Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
AoA
Dear
i am using user control in my form. when user click on search button open the usercontrol to search record, after searching load grid when grid load, on grid row click load record to dispatch form. and close the user control.
But problem is here when user open user control and they want to close user control the go to cross button and close. still window close but when page load it open again. please give me any solution.
thanks.
here i close the usercontrol. but it work when user select any record
C#
private void Search()
        {
           try
           {
               this.rwSearchDispatchForm.VisibleOnPageLoad = true;
           }
           catch (Exception ex)
           {
               this.lblMessage.Text = "<font color=red> " + ex.Message + "</font>";
           }
       }
Posted
Updated 14-Apr-15 1:07am
v2
Comments
John C Rayan 14-Apr-15 7:15am    
It works when user select any record because it fires an event to your code. But when an user close window using x button on browser window no event fires back to server. You have to think about implementing your user control in another way rather than using in browser window. Basically don't give user the x option to close.
ZurdoDev 14-Apr-15 8:53am    
It is not clear at all what you are saying, plus I don't think you are showing enough relevant code.
Sinisa Hajnal 15-Apr-15 2:17am    
You probably have a flag that says open the search on page load which doesn't get reset. Do you? Either change the flag right after opening the dialog, before you leave server code or find a way to trigger postback after dialog close.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900