开发者

asp.net viewstate of different usercontrol

I have two user controls on a page - UC1,UC2. Each usercontrol have a asp:button. Now if I click the any of the buttons the page post back. Now if I click the button of UC1 then the following happen.

  1. Viewstate load for two user controls.
  2. Page load called for two user controls.
  3. The event handler of UC1 button is fired.

Now if user click on the UC1 button, I do not want to load the view state of UC2 user controls at server because the viewstate of U开发者_如何学编程C2 is large. The execution of UC1 is not dependent of UC2.

Please suggest how can I achive this.

Thanks!


What it sounds like your asking for is the ability to do partial postbacks. That is postbacks that only affect a portion of the page. There are a number of ways to accomplish this such as using the Microsoft provided AJAX controls (http://www.asp.net/ajax) or rolling your own with JQuery and web methods (this method however is stateless and should be expected as such). Specifically you will want to look at UpdatePanels and PostBack Triggers.

Hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜