How do i correctly implement !isPostback?
Posted on 2007-08-08
I have a huge application and I notice that when the user makes a selection from a drop-down or clicks a button, the data is not reloaded. The only time the page is reloaded is when I click the actual navigation button for the page. I also have a label that displays record count or error messages which does not clear unless I select a navigation button. I know that there has to be a better way. How do i know when to include !isPostback?
for example, below is an event for a button click. errorlabel displays error data as well as recordcount. how would I make sure that if the user reselected the initial drop-down and then re-selected the button, that other data was cleared?
protected void initSearchbtn_Click(object sender, EventArgs e)
int topSearch = Convert.ToInt32(searchFunc.SelectedIndex);
if (topSearch == 0) //tapes
tapeGrid.Visible = true;
bindOpenTapeReqs(); //contains errorLbl.Text
mainGrid.Visible = false;
dubdetailsgrid.Visible = false;
if (topSearch == 1) //dubs, includes dubs awaiting completion