<?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>UC&#039;s Corner &#187; c#</title>
	<atom:link href="http://yussi.nl/index.php/tag/c/feed" rel="self" type="application/rss+xml" />
	<link>http://yussi.nl</link>
	<description>Yussi Ariefiyono</description>
	<lastBuildDate>Fri, 25 Jun 2010 12:57:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>modify Visible function in repeater of gridview control</title>
		<link>http://yussi.nl/index.php/modify-visible-function-in-repeater-of-gridview-control.html</link>
		<comments>http://yussi.nl/index.php/modify-visible-function-in-repeater-of-gridview-control.html#comments</comments>
		<pubDate>Thu, 31 Dec 2009 12:18:00 +0000</pubDate>
		<dc:creator>yussi ariefiyono</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[gridview]]></category>
		<category><![CDATA[repeater]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">/post/modify-Visible-function-in-repeater-of-gridview-control.aspx</guid>
		<description><![CDATA[Problem:
display label with the text full if the current field equal to zero in repeater or gridview
Solution:
&#60;asp:Label ID=&#8221;Label1&#8243; runat=&#8221;server&#8221; Text=&#8221;Full&#8221; ForeColor=&#8221;Red&#8221; Visible=&#8217;&#60;%# Convert.ToBoolean(Eval(&#8220;name of your field&#8221;).ToString().Equals(&#8220;0&#8243;)? &#8220;true&#8221;:&#8221;false&#8221;) %&#62;&#8217;&#62;
]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong><br />
display label with the text full if the current field equal to zero in repeater or gridview</p>
<p><strong>Solution:</strong><br />
&lt;asp:Label ID=&#8221;Label1&#8243; runat=&#8221;server&#8221; Text=&#8221;Full&#8221; ForeColor=&#8221;Red&#8221; Visible=&#8217;&lt;%# Convert.ToBoolean(Eval(&#8220;name of your field&#8221;).ToString().Equals(&#8220;0&#8243;)? &#8220;true&#8221;:&#8221;false&#8221;) %&gt;&#8217;&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://yussi.nl/index.php/modify-visible-function-in-repeater-of-gridview-control.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>type of requesturl aspx</title>
		<link>http://yussi.nl/index.php/type-of-requesturl-aspx.html</link>
		<comments>http://yussi.nl/index.php/type-of-requesturl-aspx.html#comments</comments>
		<pubDate>Wed, 02 Sep 2009 11:05:00 +0000</pubDate>
		<dc:creator>yussi ariefiyono</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">/post/type-of-requesturl-aspx.aspx</guid>
		<description><![CDATA[
Request.Url.Host = asp.net.do
Request.Url.ToString = http://asp.net.do/test/requesturl.aspx
Request.ApplicationPath.ToString = /test
Request.RawUrl.ToString = /test/requesturl.aspx
Page.TemplateSourceDirectory = /test
Request.Url.AbsoluteUri = http://asp.net.do/test/requesturl.aspx


Taken from : http://asp.net.do/test/requesturl.aspx
]]></description>
			<content:encoded><![CDATA[<p>
<span style="display: inline-block; height: 19px; width: 438px">Request.Url.Host = asp.net.do</span><br />
<span style="display: inline-block; height: 19px; width: 438px">Request.Url.ToString = http://asp.net.do/test/requesturl.aspx</span><br />
<span style="display: inline-block; height: 19px; width: 438px">Request.ApplicationPath.ToString = /test</span><br />
<span style="display: inline-block; height: 19px; width: 438px">Request.RawUrl.ToString = /test/requesturl.aspx</span><br />
<span style="display: inline-block; height: 19px; width: 438px">Page.TemplateSourceDirectory = /test</span><br />
<span style="display: inline-block; height: 19px; width: 438px">Request.Url.AbsoluteUri = http://asp.net.do/test/requesturl.aspx</span>
</p>
<p>
Taken from : <a href="http://asp.net.do/test/requesturl.aspx" target="_blank">http://asp.net.do/test/requesturl.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://yussi.nl/index.php/type-of-requesturl-aspx.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>embedding flash in server control</title>
		<link>http://yussi.nl/index.php/embedding-flash-in-server-control.html</link>
		<comments>http://yussi.nl/index.php/embedding-flash-in-server-control.html#comments</comments>
		<pubDate>Mon, 29 Jun 2009 14:10:00 +0000</pubDate>
		<dc:creator>yussi ariefiyono</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">/post/embedding-flash-in-server-control-aspx.aspx</guid>
		<description><![CDATA[
Problem:


When you got your website (aspx website), especially when you already put url rewriting, you want to embed flash ( doesnt matter if its swf or flv)
You need to have relative path, starting with (&#34;~/&#34; ) in the url.


Solution: 
you can put the code in your server control, so it will be easier to integrate
FlashPlayer.ascx
&#60;object&#160; <a href="http://yussi.nl/index.php/embedding-flash-in-server-control.html" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>
<strong>Problem:</strong>
</p>
<p>
When you got your website (aspx website), especially when you already put url rewriting, you want to embed flash ( doesnt matter if its swf or flv)<br />
You need to have relative path, starting with (<strong>&quot;~/&quot;</strong> ) in the url.
</p>
<p>
<strong>Solution: </strong><br />
you can put the code in your server control, so it will be easier to integrate</p>
<p><strong>FlashPlayer.ascx</strong><br />
<em>&lt;object&nbsp; classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0&quot; width=&quot;745&quot; height=&quot;181&quot; id=&quot;header&quot; align=&quot;middle&quot;&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;param name=&quot;allowScriptAccess&quot; value=&quot;sameDomain&quot; /&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;param name=&quot;allowFullScreen&quot; value=&quot;false&quot; /&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;param&nbsp; name=&quot;movie&quot; value=&#39;&lt;asp:Literal ID=&quot;Literal1&quot; runat=&quot;server&quot;&gt;&lt;/asp:Literal&gt;&#39; /&gt;&lt;param name=&quot;quality&quot; value=&quot;high&quot; /&gt;&lt;param name=&quot;bgcolor&quot; value=&quot;#ffffff&quot; /&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;embed src=&#39;&lt;asp:Literal ID=&quot;Literal2&quot; runat=&quot;server&quot;&gt;&lt;/asp:Literal&gt;&#39; quality=&quot;high&quot; bgcolor=&quot;#ffffff&quot; width=&quot;745&quot; height=&quot;181&quot; name=&quot;header&quot; align=&quot;middle&quot; allowScriptAccess=&quot;sameDomain&quot; allowFullScreen=&quot;false&quot; type=&quot;application/x-shockwave-flash&quot; pluginspage=&quot;http://www.adobe.com/go/getflashplayer_nl&quot; /&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;/object&gt;</em>
</p>
<p>
and in the <strong>FlashPlayer.ascx.cs</strong>
</p>
<p>
&nbsp; protected void Page_Load(object sender, EventArgs e)<br />
&nbsp;&nbsp;&nbsp; {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Literal1.Text = Page.ResolveUrl(&quot;<strong>~/</strong>yourpath&quot;);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Literal2.Text = Page.ResolveUrl(&quot;<strong>~/</strong>yourpath&quot;);<br />
&nbsp;&nbsp; }
</p>
<p>
and you will got flash playing! enjoy ^_^
</p>
<p>
================================
</p>
<p>
thank to <a href="http://www.linkedin.com/in/marcneeft" target="_blank">Marc Neeft</a>, hereby his input :
</p>
<p>
<span class="text">it would be even more powerful when you add the movieUrl, width and height as properties of the usercontrol:</p>
<p>private string movieUrl = String.empty;<br />
<br />
private int movieWidth = 0;<br />
<br />
private int movieHeight = 0;</p>
<p>protected void Page_Load(object sender, EventArgs e)<br />
<br />
{<br />
<br />
// todo: check if url, width and height are set, if not, throw exception</p>
<p>Literal1.Text = Page.ResolveUrl(movieUrl);<br />
<br />
Literal2.Text = Page.ResolveUrl(movieUrl);<br />
<br />
Literal3.Text = movieWidth;<br />
<br />
Literal4.Text = movieHeight;<br />
<br />
} </p>
<p>public string MovieUrl<br />
<br />
{<br />
<br />
get { return movieUrl; }<br />
<br />
set { movieUrl = value; }<br />
<br />
}</p>
<p>public string MovieWidth<br />
<br />
{<br />
<br />
get { return movieWidth; }<br />
<br />
set { movieWidth = value; }<br />
<br />
}</p>
<p>public int MovieHeight<br />
<br />
{<br />
<br />
get { return movieHeight; }<br />
<br />
set { movieHeight = value; }<br />
<br />
}</p>
<p>Of course you need to add the 2 extra literals and the errorchecking yourself but you get the general idea.</p>
<p>&lt;uc:FlashPlayer id=&quot;Flashplayer&quot; runat=&quot;server&quot; MovieUrl=&quot;~/flash</span><br />
<span class="text">/movie.flv</span><br />
<span class="text">&quot; MovieWidth=&quot;300&quot; MovieHeight=&quot;150&quot; /&gt;</span></p>
]]></content:encoded>
			<wfw:commentRss>http://yussi.nl/index.php/embedding-flash-in-server-control.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Repeater inside repeater asp net</title>
		<link>http://yussi.nl/index.php/repeater-inside-repeater-asp-net.html</link>
		<comments>http://yussi.nl/index.php/repeater-inside-repeater-asp-net.html#comments</comments>
		<pubDate>Tue, 09 Jun 2009 17:28:00 +0000</pubDate>
		<dc:creator>yussi ariefiyono</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[repeater]]></category>

		<guid isPermaLink="false">/post/Repeater-inside-repeater-asp-net.aspx</guid>
		<description><![CDATA[
Problem :


Putting repeater inside repeater and take ID of parent repeater to bind the&#160; datasourse.


Solution: 
hereby the example of code:
in .aspx
&#60;asp:Repeater ID=&#34;Repeater2&#34; runat=&#34;server&#34; 
&#160;&#160;&#160; onitemdatabound=&#34;Repeater2_ItemDataBound&#34;&#62;
&#160;&#160;&#160; &#60;ItemTemplate&#62;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;asp:Label ID=&#34;Label2&#34; runat=&#34;server&#34; Text=&#39;&#60;%# Eval(&#34;Tag&#34;) %&#62;&#39;&#62;&#60;/asp:Label&#62;&#60;/asp:HyperLink&#62;
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;asp:Repeater ID=&#34;Repeater1&#34; runat=&#34;server&#34;&#62; 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;ItemTemplate&#62;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (&#60;asp:Label ID=&#34;CountID&#34; runat=&#34;server&#34; Text=&#39;&#60;%# Eval(&#34;Expr1&#34;) %&#62;&#39;&#62;&#60;/asp:Label&#62;)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;/ItemTemplate&#62;
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;/asp:Repeater&#62;
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;br /&#62;
&#160;&#160;&#160; &#60;/ItemTemplate&#62;
&#60;/asp:Repeater&#62;


in .aspx cs 


private DataTable getDataTableforRepeater2(int TagID)
&#160;&#160;&#160; {
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <a href="http://yussi.nl/index.php/repeater-inside-repeater-asp-net.html" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>
<strong>Problem :</strong>
</p>
<p>
Putting repeater inside repeater and take ID of parent repeater to bind the&nbsp; datasourse.
</p>
<p>
<strong>Solution: </strong><br />
hereby the example of code:</p>
<p><strong>in .aspx</strong><br />
&lt;asp:Repeater ID=&quot;<strong>Repeater2</strong>&quot; runat=&quot;server&quot; <br />
&nbsp;&nbsp;&nbsp; onitemdatabound=&quot;Repeater2_ItemDataBound&quot;&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;ItemTemplate&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:Label ID=&quot;Label2&quot; runat=&quot;server&quot; Text=&#39;&lt;%# Eval(&quot;Tag&quot;) %&gt;&#39;&gt;&lt;/asp:Label&gt;&lt;/asp:HyperLink&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:Repeater ID=&quot;<strong>Repeater1</strong>&quot; runat=&quot;server&quot;&gt; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ItemTemplate&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&lt;asp:Label ID=&quot;CountID&quot; runat=&quot;server&quot; Text=&#39;&lt;%# Eval(&quot;Expr1&quot;) %&gt;&#39;&gt;&lt;/asp:Label&gt;)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/ItemTemplate&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/asp:Repeater&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;br /&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;/ItemTemplate&gt;<br />
&lt;/asp:Repeater&gt;
</p>
<p>
<strong>in .aspx cs </strong>
</p>
<p>
private DataTable getDataTableforRepeater2(int TagID)<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SqlConnection conn = new SqlConnection();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; conn.ConnectionString = ConfigurationManager.ConnectionStrings[&quot;yourconnectionName&quot;].ConnectionString;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SqlCommand command = new SqlCommand();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; command.Connection = conn;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; command.CommandText = &quot;sql command&quot;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DataTable t = new DataTable();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SqlDataAdapter adapter = new SqlDataAdapter();</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; adapter.SelectCommand = command;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; adapter.Fill(t);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return t;<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; protected void Repeater2_ItemDataBound(object sender, RepeaterItemEventArgs e)<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Repeater Repeater1 = e.Item.FindControl(&quot;Repeater1&quot;) as Repeater;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int TagID = int.Parse(DataBinder.Eval(e.Item.DataItem, &quot;TagID&quot;).ToString());</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (TagID != null)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DataTable t = getDataTableforRepeater2(TagID);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (t.Rows.Count &gt; 0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Repeater1.DataSource = t;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Repeater1.DataBind();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
]]></content:encoded>
			<wfw:commentRss>http://yussi.nl/index.php/repeater-inside-repeater-asp-net.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>disable remove viewstate aspx</title>
		<link>http://yussi.nl/index.php/disable-remove-viewstate-aspx.html</link>
		<comments>http://yussi.nl/index.php/disable-remove-viewstate-aspx.html#comments</comments>
		<pubDate>Mon, 11 May 2009 14:39:00 +0000</pubDate>
		<dc:creator>yussi ariefiyono</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[viewstate]]></category>

		<guid isPermaLink="false">/post/disable-remove-viewstate-aspx.aspx</guid>
		<description><![CDATA[
Problem:
Annoying LONG viewstate


&#60;input type=&#34;hidden&#34; name=&#34;__VIEWSTATE&#34; id=&#34;__VIEWSTATE&#34; value=&#34;/wEPDwULLTEyMjcx
NDEzNzQPZBYCZg9kFgQCAQ9kFgICAg8VAh4vV29ybGRHcmFubnkvanMvZGRhY2NvcmRpb24u
anMkL1dvcmxkR3Jhbm55L2pzL2pxdWVyeS0xLjIuMi5wYWNrLmpzZAIDD2QWBAIDDxYCHgtfIUl0
ZW1Db3VudAIKFhRmD2QWBAIBDw8WAh4LTmF2aWdhdGVVcmwFFH4vUGFnaW5hLzIvaG9tZS5h
c3B4ZBYCZg8VAQRIb21lZAIDDxYCHwACARYCAgEPZBYCAgEPDxYCHwEFFX4vUGFnaW5hLzQvc3V
iLTEuYXNweGQWAmYPFQEFc3ViIDFkAgEPZBYEAgEPDxYCHwEFG34vUGFnaW5hLzMvb3JnYW5pc2F0a
WUuYXNweGQWAmYPFQELT3JnYW5pc2F0aWVkAgMPFgIfAAICFgQCAQ9kFgICAQ8PFgIfAQUUfi9QYWdpb
mEvNS9zdWIyLmFzcHhkFgJmDxUBBHN1YjJkAgIPZBYCAgEPDxYCHwEFGH4vUGFnaW5hLzgvbmV3LXBhZ2&#34; /&#62;


LOL.. long huh 


Solution:
put this code in your .cs page



//overwrite the&#160; SavePageStateToPersistenceMedium and LoadPageStateFromPersistenceMedium
protected override void SavePageStateToPersistenceMedium(object viewState)
&#160;&#160;&#160; {
&#160;&#160;&#160; }
&#160;&#160;&#160; protected override object LoadPageStateFromPersistenceMedium()
&#160;&#160;&#160; {
&#160;&#160;&#160;&#160;&#160;&#160;&#160; return null;
&#160;&#160;&#160; }



// Remove completely after rendering html code 
&#160;protected override void Render(HtmlTextWriter output)
&#160;&#160;&#160; {
&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.IO.StringWriter stringWriter = <a href="http://yussi.nl/index.php/disable-remove-viewstate-aspx.html" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>
<strong>Problem:</strong><br />
Annoying LONG viewstate
</p>
<pre>
<em>&lt;<span class="start-tag">input</span><span class="attribute-name"> type</span>=<span class="attribute-value">&quot;hidden&quot; </span><span class="attribute-name">name</span>=<span class="attribute-value">&quot;__VIEWSTATE&quot; </span><span class="attribute-name">id</span>=<span class="attribute-value">&quot;__VIEWSTATE&quot; </span><span class="attribute-name">value</span>=<span class="attribute-value">&quot;/wEPDwULLTEyMjcx
NDEzNzQPZBYCZg9kFgQCAQ9kFgICAg8VAh4vV29ybGRHcmFubnkvanMvZGRhY2NvcmRpb24u
anMkL1dvcmxkR3Jhbm55L2pzL2pxdWVyeS0xLjIuMi5wYWNrLmpzZAIDD2QWBAIDDxYCHgtfIUl0
ZW1Db3VudAIKFhRmD2QWBAIBDw8WAh4LTmF2aWdhdGVVcmwFFH4vUGFnaW5hLzIvaG9tZS5h
c3B4ZBYCZg8VAQRIb21lZAIDDxYCHwACARYCAgEPZBYCAgEPDxYCHwEFFX4vUGFnaW5hLzQvc3V
iLTEuYXNweGQWAmYPFQEFc3ViIDFkAgEPZBYEAgEPDxYCHwEFG34vUGFnaW5hLzMvb3JnYW5pc2F0a
WUuYXNweGQWAmYPFQELT3JnYW5pc2F0aWVkAgMPFgIfAAICFgQCAQ9kFgICAQ8PFgIfAQUUfi9QYWdpb
mEvNS9zdWIyLmFzcHhkFgJmDxUBBHN1YjJkAgIPZBYCAgEPDxYCHwEFGH4vUGFnaW5hLzgvbmV3LXBhZ2&quot; </span><span class="error"><span class="attribute-name">/</span></span>&gt;</em>
</pre>
<p>
LOL.. long huh <img src='http://yussi.nl/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />
</p>
<p>
<strong>Solution:</strong><br />
put this code in your .cs page<br />

</p>
<p>
<em>//overwrite the&nbsp; </em><em>SavePageStateToPersistenceMedium</em> and <em>LoadPageStateFromPersistenceMedium</em><br />
<em>protected override void SavePageStateToPersistenceMedium(object viewState)<br />
&nbsp;&nbsp;&nbsp; {</p>
<p>&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; protected override object LoadPageStateFromPersistenceMedium()<br />
&nbsp;&nbsp;&nbsp; {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return null;</p>
<p>&nbsp;&nbsp;&nbsp; }</em>
</p>
<p>
<em><br />
// Remove completely after rendering html code <br />
&nbsp;protected override void Render(HtmlTextWriter output)<br />
&nbsp;&nbsp;&nbsp; {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.IO.StringWriter stringWriter = new System.IO.StringWriter(stringBuilder);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (Control ctrl in this.Controls)</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ctrl.RenderControl(htmlWriter);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String html = stringBuilder.Replace(&quot;/&gt;&quot;, &quot;&gt;&quot;).ToString();</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int intViewStart = html.IndexOf(&quot;&lt;input type=\&quot;hidden\&quot; name=\&quot;__VIEWSTATE\&quot;&quot;);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int intViewFinish = html.IndexOf(&quot;&gt;&quot;, intViewStart) + 1;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string strViewTag = html.Substring(intViewStart, intViewFinish &#8211; intViewStart);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Diagnostics.Debug.WriteLine(strViewTag);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; html = html.Replace(strViewTag, &quot;&quot;);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; output.Write(html);</p>
<p>&nbsp;&nbsp;&nbsp; }</em>
</p>
<p>
and WALA! its gone!!</p>
]]></content:encoded>
			<wfw:commentRss>http://yussi.nl/index.php/disable-remove-viewstate-aspx.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>find value in repeater asp net</title>
		<link>http://yussi.nl/index.php/find-value-in-repeater-asp-net.html</link>
		<comments>http://yussi.nl/index.php/find-value-in-repeater-asp-net.html#comments</comments>
		<pubDate>Mon, 04 May 2009 17:18:00 +0000</pubDate>
		<dc:creator>yussi ariefiyono</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[repeater]]></category>

		<guid isPermaLink="false">/post/Find-value-in-repeater-asp-net.aspx</guid>
		<description><![CDATA[
Problem:
find value in repeater


Solution:
write this code in itemdatabound on your repeater:


protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
&#160;&#160;&#160; {
&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (e.Item.ItemType == ListItemType.Item &#124;&#124; e.Item.ItemType == ListItemType.AlternatingItem)
&#160;&#160;&#160;&#160;&#160;&#160;&#160; {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Label title = e.Item.FindControl(&#34;Label1&#34;) as Label; // depend on what component you r searching for




&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Response.Write(title.Text);&#160;&#160; // just check&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; }
&#160;&#160;&#160; }

]]></description>
			<content:encoded><![CDATA[<p>
<strong>Problem:</strong><br />
find value in repeater
</p>
<p>
<strong>Solution:</strong><br />
write this code in itemdatabound on your repeater:
</p>
<p>
<em>protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Label title = e.Item.FindControl(&quot;Label1&quot;) as Label; // depend on what component you r searching for<br />
</em>
</p>
<p>
<em><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Response.Write(title.Text);&nbsp;&nbsp; // just check&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; }<br />
</em></p>
]]></content:encoded>
			<wfw:commentRss>http://yussi.nl/index.php/find-value-in-repeater-asp-net.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
