I've a SQL DataSource and a Data Grid in a Web Page. The data grid gets binded automatically when the page is loaded. How do I delay that until click event of a Button.
1 Answer
In ButtonToBindclickevent
- System.Web.HttpContext.Current.Session("BindUnbind")="b"
- response.redirect("Mypage.aspx")
In ButtonToUnBindclickevent
- System.Web.HttpContext.Current.Session("BindUnbind")="u"
- response.redirect("Mypage.aspx")
*in page_load*
if System.Web.HttpContext.Current.Session("BindUnbind")="b" then
- bind the grid
elseif System.Web.HttpContext.Current.Session("BindUnbind")="u" then
- UNbind the grid
endif
System.Web.HttpContext.Current.Session("BindUnbind")=""