Home > DeveloperSection > Forums > DropDownList not working after using .SelectedValue
Ashish Pandey

Total Post:128

Points:898
Posted on    November-17-2014 11:29 PM

 ASP.Net ASP.Net 
Ratings:


 1 Reply(s)
 497  View(s)
Rate this:
I'm new with asp.net and i think this is really easy question, but i can't find the answer
I have a DropDownList on my page, one of the ways to go to that page is follow the link on the other page (page B). By this link i deliver some parameters, so i use them in the Page_load of page A:

    protected void Page_Load(object sender, EventArgs e)

    {

        string strStatus = Request.QueryString["status"];

        DListStatus.SelectedValue = strStatus;

    }

I thought that .ClearSelection() will help

i really wonder what to do and will really appreciate your help



Sumit Kesarwani

Total Post:378

Points:2694
Posted on    November-17-2014 11:43 PM

Hi Ashish, 

Check if is it is a post back

if (!Page.IsPostBack)

{

    string strStatus = Request.QueryString["status"];

    DListStatus.SelectedValue = strStatus;

}


Don't want to miss updates? Please click the below button!

Follow MindStick