Refresh Controls in my web page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I want to develop a web page with ASP.NET using C#. is there any Command in
C# like UpdateData in VC.

Because, when I change my Combo Box or Edit Box, they don't give new
information.

I want to use a command that when I press a button, my Data became refresh.

in protected void Page_Load(object sender, EventArgs e), I have a function
Getdata() that get data from database. if I disable this command every thing
is fine but I need this command.

what should I do?

Thank you.
Monica
 
Hi,

I want to develop a web page with ASP.NET using C#. is there any Command
in
C# like UpdateData in VC.

Because, when I change my Combo Box or Edit Box, they don't give new
information.

I want to use a command that when I press a button, my Data became
refresh.

in protected void Page_Load(object sender, EventArgs e), I have a function
Getdata() that get data from database. if I disable this command every
thing
is fine but I need this command.

what should I do?

1) Surround your call to GetData() in Page_Load with an IsPostBack check...

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetData();
}
}

2) Wire up an OnSelectedIndexChanged event for your DropDownList which also
calls GetData();
 
Back
Top