开发者

Dynamically add View to ASP.Net MultiView

开发者 https://www.devze.com 2023-03-17 13:58 出处:网络
I have an ASP.Net UpdatePanel inside of which I have a MultiView, I want to dynamically add and remove Views on the refresh of the UpdatePanel.

I have an ASP.Net UpdatePanel inside of which I have a MultiView, I want to dynamically add and remove Views on the refresh of the UpdatePanel.

However when I create a new View and add it to the MultiView's Views collection it doesn't appear on the page and on subsequ开发者_开发问答ent post backs the added views is no longer part of the Views collection.

Hows should I go about dynamically adding Views to the MultiView?


That might be tricky because of the ViewState. If you add new view to the MultiView dynamically in the code behind, you have to make sure you add it on every other postback aswell, if you dont, the view you added before will dissapear and you will encounter all sort of problems because of the asp trying to load ViewState of one view of your multipage to other view etc... Read that article, it will explaint it better:

http://blog.typps.com/2008/01/failed-to-load-viewstate-typical.html

0

精彩评论

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