views:

23

answers:

1

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.

+1  A: 

heh.. love the "retain" tag..

so it sounds like something about this link of yours is not standard. how is the link generated? sounds to me like it is not causing a POST, but a GET.

use a LinkButton instead that will ensure a real postback, and it won't go through your check.

if this is not it, post the code that generates the link in question

Sonic Soul