retain drop down value page posting back to itself asp.net

Posted by d3020 on Stack Overflow See other posts from Stack Overflow or by d3020
Published on 2010-06-15T04:26:51Z Indexed on 2010/06/15 4:32 UTC
Read the original article Hit count: 373

Filed under:
|
|
|
|

I have an aspx page that has...

    if (!IsPostBack)
    {
        PopulateBrand();

in the Page_Load. This PopulateBrand() simply populates my drop down. That works great and on post back it retains the value.

The problem I'm having is that there is also a link on the page that is posting back some parameters to this page. What is happening is that when this is clicked it's falling through this !IsPostBack section and wiping out my drop down values that I had selected and repopulating it.

How can I prevent this and just retain what I selected when this page is posting back to itself when the link is clicked?

Thanks.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about option