Skip to content Skip to sidebar Skip to footer

ASP.Net My Updated Value From Drop Down List Doesn't Update/Display

I have a 4 page ASP.NET form which is storing data in the session. A button on my 3rd page clears the session. All this is working fine but I'm having a problem updating a value on

Solution 1:

You are setting it back to the value in your session on postback.

Add this to your Page_Load.

if (!IsPostBack)
{
    //set values from session
}

Solution 2:

Fix is

if (!IsPostBack)
{
     if (ddlInnoc.SelectedValue != "0" && Session["pg1dd"] != null)
     {
          ddlInnoc.SelectedValue = Session["pg1dd"].ToString();
     }
}

Post a Comment for "ASP.Net My Updated Value From Drop Down List Doesn't Update/Display"