A() -> B() --> C()
OR
you want to keep data in some collection and spit it out during page rendering.
Instead of moving the data domain data from function to function, it is a good idea to put the data in the Application Context or in the StateBag.
StateBag -- This is implentation is not a session implentation but its global becuase I am making the stateBag a static variable.

PS:Click on the image to enlarge
StateBag1 implementation:
StateBag1 is a good implementation which exposes a property which will return the StateBag.. The StateBag is stored in the HttpContext. HttpContext provides a items collection where you can dump all your StateBag.This implementation will only work in web centric senario as HttpContext is not available in non web centric application.

StateBag2 implementation:
This implementation is similar to StateBag1 but can be used in non web-centric as it uses the CallContext object if HttpContext is not available.

Creating your ApplicationContext:
This is bascially a wrapper class around the HttpContext. You can store this AppContext object in the CallContext, this way only one instance is created per thread.I like this implementation a lot.

You need to searlize this StateBag before the page renders as a hidden string. When postBack happens that time you need to desearlize the StateBag to get the parameters back.
If you want to download the SourceCode ---> http://DotNetDevBlog.googlepages.com/WebApplication1.Zip
I hope you like the implentations :)
Happy Coding!!
Yash

7 comments:
一時代を築いたスタービーチは閉鎖になりましたが、もう一度楽しい思いをしたい、もう一度出会いたいと思う有志により再度復活しました。本家以上に簡単に出会えて楽しい思いを約束します
誰にも言えない秘密があります。実はとってもHなんです、せっかく女として生まれたからにはアブノーマルな世界に飛び込んでみたいです☆普段では考えられないプレイを思う存分楽しみ、経験したいんです♪快楽に溺れさせてくれませんか?一緒に感じ合いましょう!!都合はつくのですぐに時間を合わせられます。18歳よりも上の方がいいです!! quietness@docomo.ne.jp
日本最大級、だれもが知っている出会い系スタービーチがついに復活、グリーより面白い新生スタビをやってみませんか?趣味の合う理想のパートナー探し、合コンパーティーに興味がある方はぜひ無料登録してみてください。楽しかった頃のスタビで遊んでみよう
初書き込みで申し訳ないんですが、都合のいい男性探しています。不況の中でも会社が高成長してて、忙しい毎日です。お陰でプライベートが充実していなくって、溜まる一方です。財産的にも多少余裕が今のところあるのでお礼もできます。何より、この書き込みが読まれているのかちょっと怪しいですけど…。アドレス置いとくので、消されないうちにメールくれたら嬉しいです。inspiration.you@docomo.ne.jp
当サイトは、みんなが玉の輿に乗れるかどうか診断できる性格診断のサイトです。ホントのあなたをズバリ分析しちゃいます!玉の輿度チェッカーの診断結果には、期待以上の意外な結果があるかも
メル友らんどでは誰でも気軽にメル友が作れちゃう、参加無料でいつでも利用可能なコミュニティサイト♪ご近所の気の合うリア友や、真面目に彼氏彼女探しなど、楽しみ方は無限大!自分にぴったりの相手を見つけちゃおう
一人暮らし寂しいよ~(泣)誰かお家遊びにきてくれないかなぁ?休みの日とかも全然予定ありません。料理作るの得意だから来てくれたら食べてほしいな♪見た目は悪くないと思うから安心してください!(笑)細かい事は気にしないけど18歳未満の人は微妙かな、気軽に仲良くしてください milky-yukinko@docomo.ne.jp
Post a Comment