Refreshing a page within code.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kalyani

    Refreshing a page within code.

    Hi,
    I have a page with a DropDownList populated with some values.On a button
    click one of the value in that DropDownList DataSource is removed.But to
    update the DropDownList contents the page must be refreshed.How can I refresh
    the page so that DropDownList contents get updated?

    I am using ASP.NET with C#.Please do tell me if anyone can.

    Thanks in advance,
    Kalyani

  • Rajesh

    #2
    RE: Refreshing a page within code.

    You have to do call DataBind() for the dropdownlist again after you delete an
    item in the list.

    HTH
    Rajesh Meenrajan
    MCSD.NET


    "Kalyani" wrote:
    [color=blue]
    > Hi,
    > I have a page with a DropDownList populated with some values.On a button
    > click one of the value in that DropDownList DataSource is removed.But to
    > update the DropDownList contents the page must be refreshed.How can I refresh
    > the page so that DropDownList contents get updated?
    >
    > I am using ASP.NET with C#.Please do tell me if anyone can.
    >
    > Thanks in advance,
    > Kalyani
    >[/color]

    Comment

    • Kalyani

      #3
      RE: Refreshing a page within code.

      Actually the DropDownList I have is a Dynamic control.If I call DataBind( )
      then I get error: Unable to maintain viewstate.Items should be added in the
      same order if added dynamically.
      But I have only one dynamic control which is either this DropDownList or a
      TextBox.

      "Rajesh" wrote:
      [color=blue]
      > You have to do call DataBind() for the dropdownlist again after you delete an
      > item in the list.
      >
      > HTH
      > Rajesh Meenrajan
      > MCSD.NET
      > http://meenrajan.blogspot.com
      >
      > "Kalyani" wrote:
      >[color=green]
      > > Hi,
      > > I have a page with a DropDownList populated with some values.On a button
      > > click one of the value in that DropDownList DataSource is removed.But to
      > > update the DropDownList contents the page must be refreshed.How can I refresh
      > > the page so that DropDownList contents get updated?
      > >
      > > I am using ASP.NET with C#.Please do tell me if anyone can.
      > >
      > > Thanks in advance,
      > > Kalyani
      > >[/color][/color]

      Comment

      Working...