0
votes

I have three user controls in one aspx page, where each user control is loading in each separate tabpanel. Each usercontrol has gridivew and objectdatasource(which has selectmethods). The gridview is binding data from the objectdatasource, on every postback. I have some dropdowns, the selected values are passed to the objectdatasource on submit button click, which then populates the results in the gridview. Now, if I click on any linkbutton on the gridview, the postback is happening and gridview is rebinding with null values, so no click event of linkbutton is happening. Anybody can suggest me how to stop the postbacks for gridview. I tried placing the updatepanels but didnt help

1

1 Answers

0
votes

You can control the flow of the program by checking IsPostback in Page_Load() and filling the grid only when it's supposed to be filled. You can also specify your UI elements to not postback as well, if certain ones are posting back when you don't want them to. Look into the AutoPostBack property.

If (IsPostBack == true) {
    // do something, load that
}
Else {
    // do something else, don't load that
}