开发者

Can I Access The Objects Of The Previous Page

I've used PreviousPage Property to access the controls of the previous page but how can I access objects and instances of classes I initiated in t开发者_高级运维he previous page!

Thanks For Your Time =)!


You can cast the PreviousPage object to the type of the previous page if it exposes public properties and methods that are going to be of use to you. However this isn't the same instance of the page that you created during the previous request. Any properties of then page that you set during the previous request will no longer be set.

One of the downsides to the webforms model is it encourages you to think that web programming preserves state from one request to the next, when in fact it doesn't.


Unless you persisted the state of the objects, etc. from the previous page then they are gone.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜