<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>johnjcamilleri.com &#187; viewstate</title>
	<atom:link href="http://johnjcamilleri.com/tag/viewstate/feed/" rel="self" type="application/rss+xml" />
	<link>http://johnjcamilleri.com</link>
	<description></description>
	<lastBuildDate>Fri, 03 Sep 2010 13:00:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>ASP.NET Postback Class Members</title>
		<link>http://johnjcamilleri.com/2009/04/aspnet-postback-class-members/</link>
		<comments>http://johnjcamilleri.com/2009/04/aspnet-postback-class-members/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 18:03:11 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[postback]]></category>
		<category><![CDATA[viewstate]]></category>

		<guid isPermaLink="false">http://www.johnjcamilleri.com/blog/?p=27</guid>
		<description><![CDATA[Found this helpful article I thought I&#8217;d post.. http://webpaws.com/blog/2008/08/19/postback-in-aspnet-passing-variables-on-postback/ Basically I had a class variable in an ASP.NET and found it was getting lost on page post-back.. well all you have to do is put that object in the Viewstate object already created for you. eg: public partial class MyPage : System.Web.UI.Page { protected int [...]]]></description>
			<content:encoded><![CDATA[<p>Found this helpful article I thought I&#8217;d post..<br />
<a href="http://webpaws.com/blog/2008/08/19/postback-in-aspnet-passing-variables-on-postback/">http://webpaws.com/blog/2008/08/19/postback-in-aspnet-passing-variables-on-postback/</a><br />
Basically I had a class variable in an ASP.NET and found it was getting lost on page post-back.. well all you have to do is put that object in the Viewstate object already created for you.</p>
<p>eg:</p>
<pre>public partial class MyPage : System.Web.UI.Page
{
        protected int MyInt;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
		MyInt = 12345;
                ViewState["MyKey"] = MyInt;
            }
        }

        /*
	 This is called on a page post-back...
	*/
	protected void Event(object sender, EventArgs e)
        {
			//Get factor list from viewstate
			MyInt = (int)ViewState["MyKey"];

			//Go nuts
	}
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://johnjcamilleri.com/2009/04/aspnet-postback-class-members/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
