<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Thomas' Developer Blog</title>
	<atom:link href="http://sanzon.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sanzon.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Thu, 05 Feb 2009 05:53:04 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='sanzon.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/a091c5655dd056e3774c63895b9b6f6a?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Thomas' Developer Blog</title>
		<link>http://sanzon.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sanzon.wordpress.com/osd.xml" title="Thomas&#8217; Developer Blog" />
		<item>
		<title>Enable/Disable .Net controls (Security Tip)</title>
		<link>http://sanzon.wordpress.com/2009/02/05/enabledisable-net-controls-security-tip/</link>
		<comments>http://sanzon.wordpress.com/2009/02/05/enabledisable-net-controls-security-tip/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 05:53:04 +0000</pubDate>
		<dc:creator>sanzon</dc:creator>
				<category><![CDATA[.Net Framework 3.5]]></category>
		<category><![CDATA[Asp.Net Framework 2.0]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://sanzon.wordpress.com/?p=103</guid>
		<description><![CDATA[I was just browing around online and found a thread on asp.net&#8217;s forum talking about disabling a textbox for security reasons.
Now, I&#8217;m always anal when it comes to security, double checking everything sever side and never assuming the page generated on the clientside will be the way I intended it on the way back.
For those [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sanzon.wordpress.com&blog=2667931&post=103&subd=sanzon&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I was just browing around online and found a thread on asp.net&#8217;s forum talking about disabling a textbox for security reasons.</p>
<p>Now, I&#8217;m always anal when it comes to security, double checking everything sever side and never assuming the page generated on the clientside will be the way I intended it on the way back.</p>
<p>For those who have ever thought of doing this as a quick solution, I&#8217;m sorry, but you&#8217;re wrong. All disabling controls do is create a friendly user interface where a user knows ahead of time they can&#8217;t edit it.</p>
<p>In any browser, such as firefox, with firebug, you can just back the code and reenable it and then alter the text and submit the form. if you failed to double check for changed and access rights, the person will have just hacked your site. Something any kid can do! So don&#8217;t do it! Use it only to make your site more friendly AND NOT for security reasons.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sanzon.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sanzon.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sanzon.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sanzon.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sanzon.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sanzon.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sanzon.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sanzon.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sanzon.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sanzon.wordpress.com/103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sanzon.wordpress.com&blog=2667931&post=103&subd=sanzon&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sanzon.wordpress.com/2009/02/05/enabledisable-net-controls-security-tip/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fa678a2f1f89798cc81e539c986c00d0?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Tom</media:title>
		</media:content>
	</item>
		<item>
		<title>Boolean to Int32 for SQL database. Yes it&#8217;s that easy!</title>
		<link>http://sanzon.wordpress.com/2009/01/29/boolean-to-int32-for-sql-database-yes-its-that-easy/</link>
		<comments>http://sanzon.wordpress.com/2009/01/29/boolean-to-int32-for-sql-database-yes-its-that-easy/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 23:11:36 +0000</pubDate>
		<dc:creator>sanzon</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sanzon.wordpress.com/?p=101</guid>
		<description><![CDATA[I came across a thread on the web browsing around for a solution to another problem when I came across a forum thread that seemed to go on forever about converting a boolean, true/false, to an int, 1/0.
I wanted to slap them after seeing how so many people couldn&#8217;t find such a simple answer! So [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sanzon.wordpress.com&blog=2667931&post=101&subd=sanzon&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I came across a thread on the web browsing around for a solution to another problem when I came across a forum thread that seemed to go on forever about converting a boolean, true/false, to an int, 1/0.</p>
<p>I wanted to slap them after seeing how so many people couldn&#8217;t find such a simple answer! So here it is incase you need to know how to do it in only 1 line of code!</p>
<p>convert.toint32(Boolean)</p>
<p>I couldn&#8217;t believe it when I saw people telling the person to use if statements and use a variable to hold the value. Granted it was a small forum, but still it shocks me how little people know about the convert method in .net.</p>
<p>If you want to see what I&#8217;m talking about look here:<br />
http://www.daniweb.com/forums/showthread.php?t=104189&amp;highlight=asp.net+convernt+boolean+to+integer</p>
<p>It makes me sort of wonder if these people do this for a living&#8230; I hope not&#8230; or else I so need a better job.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sanzon.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sanzon.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sanzon.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sanzon.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sanzon.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sanzon.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sanzon.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sanzon.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sanzon.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sanzon.wordpress.com/101/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sanzon.wordpress.com&blog=2667931&post=101&subd=sanzon&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sanzon.wordpress.com/2009/01/29/boolean-to-int32-for-sql-database-yes-its-that-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fa678a2f1f89798cc81e539c986c00d0?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Tom</media:title>
		</media:content>
	</item>
		<item>
		<title>RegisterForEventValidation and enableEventValidation</title>
		<link>http://sanzon.wordpress.com/2008/11/15/registerforeventvalidation-and-enableeventvalidation/</link>
		<comments>http://sanzon.wordpress.com/2008/11/15/registerforeventvalidation-and-enableeventvalidation/#comments</comments>
		<pubDate>Sat, 15 Nov 2008 02:22:34 +0000</pubDate>
		<dc:creator>sanzon</dc:creator>
				<category><![CDATA[.Net Framework 3.5]]></category>
		<category><![CDATA[Asp.Net Framework 2.0]]></category>
		<category><![CDATA[vb.net]]></category>
		<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[clientscript]]></category>
		<category><![CDATA[clientscriptmanager]]></category>
		<category><![CDATA[enableEventValidation]]></category>
		<category><![CDATA[RegisterForEventValidation]]></category>
		<category><![CDATA[validaterequest]]></category>

		<guid isPermaLink="false">http://sanzon.wordpress.com/?p=99</guid>
		<description><![CDATA[Ok first off&#8230; NEVER disable eventvalidation! This is for your own good. I know it&#8217;s very tempting to just type in enableeventvalidation=&#8221;false&#8221; and have the script work just fine. It&#8217;s a major security issue though and so it&#8217;s just best to learn it right the first time and fix it right!
So why does this pesky [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sanzon.wordpress.com&blog=2667931&post=99&subd=sanzon&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Ok first off&#8230; NEVER disable eventvalidation! This is for your own good. I know it&#8217;s very tempting to just type in enableeventvalidation=&#8221;false&#8221; and have the script work just fine. It&#8217;s a major security issue though and so it&#8217;s just best to learn it right the first time and fix it right!</p>
<p>So why does this pesky error appear at times? There are a few reasons in my case, because I had a clientside script being run from a server control. Which caused some messy conflicts. To sold this error it is actually really easy. Just include the following code in your script:</p>
<pre style="background-color:#ccc;">
        Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
            Page.ClientScript.RegisterForEventValidation(tbxSearch.uniqueid)
            MyBase.Render(writer)
        End Sub
</pre>
<p>And that&#8217;s it! Ok, maybe I should explain it. Generally you have to edit the script on the render phase. If you don&#8217;t know the page lifecycle&#8230;. learn it! You&#8217;ll need it! Just google it and you&#8217;ll find a great description on msdn.</p>
<p>So generally we override the render phase. Thus the keyword overrides in the code. The MyBase.Render(writer) line of code is basically&#8230;. what normally happens. In this case right before the render phase goes through we inject a line of code to say, &#8220;Hey, ignore this control! It&#8217;s safe!&#8221; and then the clientscriptmanager will process that control and let it slide pass eventvalidation. Now to do this you have to do it through page.clientscript and use the registerforeventvalidation method to find the specific control you need to allow.</p>
<p>After that test out the page and there shouldn&#8217;t be any problems! oh btw I do typically disable ValidateRequest myself. This generally prevents users from submitting information like &#8220;&lt;script&#8230;..&#8221; into forums and such. Which if you are using proper coding methods you shouldn&#8217;t need to run these training wheels. Eventvalidation is a whole other story since it&#8217;s a lot more work to enforce it strictly behind code.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sanzon.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sanzon.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sanzon.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sanzon.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sanzon.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sanzon.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sanzon.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sanzon.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sanzon.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sanzon.wordpress.com/99/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sanzon.wordpress.com&blog=2667931&post=99&subd=sanzon&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sanzon.wordpress.com/2008/11/15/registerforeventvalidation-and-enableeventvalidation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fa678a2f1f89798cc81e539c986c00d0?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Tom</media:title>
		</media:content>
	</item>
		<item>
		<title>Adding multiple AsyncPostBackTriggers dynamically</title>
		<link>http://sanzon.wordpress.com/2008/11/12/adding-multiple-asyncpostbacktriggers-dynamically/</link>
		<comments>http://sanzon.wordpress.com/2008/11/12/adding-multiple-asyncpostbacktriggers-dynamically/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 02:35:48 +0000</pubDate>
		<dc:creator>sanzon</dc:creator>
				<category><![CDATA[.Net Framework 3.5]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Asp.Net Framework 2.0]]></category>
		<category><![CDATA[Custom Controls]]></category>
		<category><![CDATA[vb.net]]></category>
		<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[AsyncPostBackTrigger]]></category>
		<category><![CDATA[triggers]]></category>
		<category><![CDATA[updatepanel]]></category>
		<category><![CDATA[updatepaneltriggercollection]]></category>

		<guid isPermaLink="false">http://sanzon.wordpress.com/?p=93</guid>
		<description><![CDATA[This one took be a bit of time to figure out, and really can be extremely useful in some cases. This is the situation, you want to set an unknown amount of controls as a triggers to your updatepanel. The problem is you typically have to do this the following way…
Dim mytrigger as new AsyncPostBackTrigger
Mytrigger.ContorlID [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sanzon.wordpress.com&blog=2667931&post=93&subd=sanzon&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This one took be a bit of time to figure out, and really can be extremely useful in some cases. This is the situation, you want to set an unknown amount of controls as a triggers to your updatepanel. The problem is you typically have to do this the following way…</p>
<pre style="background-color:#ccc;">Dim mytrigger as new AsyncPostBackTrigger
Mytrigger.ContorlID = “tab1”</pre>
<p>Well this works if you have a set amount of triggers. You just do this each time for each trigger and it works out really well. But what if you don’t know how many controls there are. An example of when? Custom server controls, which I have been learning vigorously these last few months.</p>
<p>In this case we have a property which holds several button inputs, or tabs in my case. Well the problem is the developer can add multiple instances of these tab controls, so exactly how do we link them all to the updatepanel?</p>
<p>The answer is in the UpdatePanelTriggerCollection! This wonderful class is used to hold all the triggers within the updatepanel. So to do this we first create the updatepanel followed by the updatepaneltriggercollection.</p>
<pre style="background-color:#ccc;">Dim upnlContent as new updatepanel
upnlContent.UpdateMode = UpdatePanelUpdateMode.Conditional

Dim triggerCollectionContent as new updatepaneltriggercollection(upnlContent)</pre>
<p>If you notice you must declare an owner to the triggercollection. In this case being upnlContent.</p>
<p>After you setup the triggerCollect you have to create your triggers with the following code:</p>
<pre style="background-color:#ccc;">triggerCollectionContent.Insert(0, New AsyncPostBackTrigger)
CType(triggerCollectionContent.Item(0), AsyncPostBackTrigger).ControlID = "tab1"</pre>
<p>The first line creates a new entry into the collection as a new trigger. The second line sets the controlID for the trigger. If you notice we didn’t have to assign it a variable name! Meaning it’s an array of triggers. So once you have finished inserting all of your triggers using a for loop you then go ahead and go back through that collection and add them to the updatepanel one by one as follows:</p>
<pre style="background-color:#ccc;">upnlContent.triggers.add(triggerCollectionContent.Item(0))</pre>
<p>You use the same loop to add them to the updatepanel. Hope that helps you all out!</p>
<p>NOTE: When using this method with a for loop using control.controls.item(i), make sure to use an if statement to check the control type using control.controls.item(i).gettype is gettype(controltype)!!! And make sure to use i instead of 0 if you&#8217;re looping.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sanzon.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sanzon.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sanzon.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sanzon.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sanzon.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sanzon.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sanzon.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sanzon.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sanzon.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sanzon.wordpress.com/93/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sanzon.wordpress.com&blog=2667931&post=93&subd=sanzon&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sanzon.wordpress.com/2008/11/12/adding-multiple-asyncpostbacktriggers-dynamically/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fa678a2f1f89798cc81e539c986c00d0?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Tom</media:title>
		</media:content>
	</item>
		<item>
		<title>Imposing functions onto document.body.onmousemove</title>
		<link>http://sanzon.wordpress.com/2008/10/16/imposing-functions-onto-documentbodyonmousemove/</link>
		<comments>http://sanzon.wordpress.com/2008/10/16/imposing-functions-onto-documentbodyonmousemove/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 20:53:17 +0000</pubDate>
		<dc:creator>sanzon</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[add]]></category>
		<category><![CDATA[body]]></category>
		<category><![CDATA[combine]]></category>
		<category><![CDATA[document.body]]></category>
		<category><![CDATA[document.body.onmousemove]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[impose]]></category>
		<category><![CDATA[onmousemove]]></category>

		<guid isPermaLink="false">http://sanzon.wordpress.com/?p=90</guid>
		<description><![CDATA[My last post went over how to handle onscroll with window.onscroll and adding an additional function to an existing function. Well with document.body.onmousemove there is a bit of a problem with Firefox.
In order for the script to work you need to determine if a value already exists. This is where the problem lies with FF. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sanzon.wordpress.com&blog=2667931&post=90&subd=sanzon&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>My last post went over how to handle onscroll with window.onscroll and adding an additional function to an existing function. Well with document.body.onmousemove there is a bit of a problem with Firefox.</p>
<p>In order for the script to work you need to determine if a value already exists. This is where the problem lies with FF. To get the value, the only way to do it that I know works is&#8230;</p>
<pre style="background-color:#bbb;">if (document.body.getAttribute("onmousemove")) { }</pre>
<p>Once you have that going you can simply do the same but&#8230;  but it requires a bit more work sadly.</p>
<p>As with the previous example in the last post, with onscroll, you always need to have it referenced as </p>
<pre style="background-color:#bbb;">function() { /* your code */ }</pre>
<p>In IE and most other browseres, besides FF, the returned code will always be treated as an anyomous function. Meaning when you call back document.body.onmousemove it is treated as a function which requires you to call&#8230;. document.body.onmousemove(), in FF it is returned as document.body.onmousemove without the () so the next part of this puzzle is to determine the browser type. In this case I tested for FF by using the following&#8230;</p>
<pre style="background-color:#bbb;">if (navigator.userAgent.indexOf("Firefox")!=-1) {
 //FF code
} else {
 //Non-FF code
}</pre>
<p>The final result of combing these methods is:</p>
<pre style="background-color:#bbb;">if (document.body.getAttribute("onmousemove")) {
   var MouseMoveCode = eval(document.body.onmousemove);
   if (navigator.userAgent.indexOf("Firefox")!=-1) {
      var MouseMoveEvent = function(event) {
         dragDiv(event,CustomControls.OverlayMenu.MouseMoveCode)};
         document.body.onmousemove = MouseMoveEvent;
   } else {
      MouseMoveEvent = function(event) {
      dragDiv(event,MouseMoveCode())};
      document.body.onmousemove = MouseMoveEvent;
   }
} else {
   document.body.onmousemove = function(event) { dragDiv(event) };
}</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sanzon.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sanzon.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sanzon.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sanzon.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sanzon.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sanzon.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sanzon.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sanzon.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sanzon.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sanzon.wordpress.com/90/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sanzon.wordpress.com&blog=2667931&post=90&subd=sanzon&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sanzon.wordpress.com/2008/10/16/imposing-functions-onto-documentbodyonmousemove/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fa678a2f1f89798cc81e539c986c00d0?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Tom</media:title>
		</media:content>
	</item>
		<item>
		<title>Handling form data issues with FireFox on page refresh</title>
		<link>http://sanzon.wordpress.com/2008/10/16/handling-form-data-issues-with-firefox-on-page-refresh/</link>
		<comments>http://sanzon.wordpress.com/2008/10/16/handling-form-data-issues-with-firefox-on-page-refresh/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 09:08:08 +0000</pubDate>
		<dc:creator>sanzon</dc:creator>
				<category><![CDATA[Asp.Net Framework 2.0]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[vb.net]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[refresh]]></category>

		<guid isPermaLink="false">http://sanzon.wordpress.com/?p=88</guid>
		<description><![CDATA[If you have ever noticed how FireFox maintains form data on a page refresh, it can causes some issues at times when handling .net code that uses these inputs to render javascript code after the page loads.
To get around this, you can simply use the following code with a scriptmanager control:
If Not Page.IsPostBack Then
  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sanzon.wordpress.com&blog=2667931&post=88&subd=sanzon&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you have ever noticed how FireFox maintains form data on a page refresh, it can causes some issues at times when handling .net code that uses these inputs to render javascript code after the page loads.</p>
<p>To get around this, you can simply use the following code with a scriptmanager control:</p>
<pre style="background-color:#bbb;">If Not Page.IsPostBack Then
   ScriptManager.RegisterStartupScript(Page, Page.GetType(), _
   "ScriptManager_myFunction", "document.getElementById('" &amp; _
   myControl.ClientID &amp; "').value = 'default value';", True)
End If</pre>
<p>You can also clear the form control value, but I typically do not recommend this action since it defeats the advantages associated with firefox maintaining form data on refresh.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sanzon.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sanzon.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sanzon.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sanzon.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sanzon.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sanzon.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sanzon.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sanzon.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sanzon.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sanzon.wordpress.com/88/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sanzon.wordpress.com&blog=2667931&post=88&subd=sanzon&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sanzon.wordpress.com/2008/10/16/handling-form-data-issues-with-firefox-on-page-refresh/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fa678a2f1f89798cc81e539c986c00d0?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Tom</media:title>
		</media:content>
	</item>
		<item>
		<title>Combining/Imposing Event Code in JavaScript</title>
		<link>http://sanzon.wordpress.com/2008/10/16/combiningimposing-event-code-in-javascript/</link>
		<comments>http://sanzon.wordpress.com/2008/10/16/combiningimposing-event-code-in-javascript/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 07:35:44 +0000</pubDate>
		<dc:creator>sanzon</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[combine]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[impose]]></category>
		<category><![CDATA[window]]></category>

		<guid isPermaLink="false">http://sanzon.wordpress.com/?p=81</guid>
		<description><![CDATA[In JavaScript there may be times you want to combine code onto an existing window event. In this case we will use window.onscroll.
In this example we already have assigned window.onscroll as the following:
window.onscroll = function() {
     setTimeout("document.getElementById('myDiv').style.color='red';",200);
     setTimeout("document.getElementById('myDiv').style.color='green';",400);
};
This causes the text color to blink within our div [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sanzon.wordpress.com&blog=2667931&post=81&subd=sanzon&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In JavaScript there may be times you want to combine code onto an existing window event. In this case we will use window.onscroll.</p>
<p>In this example we already have assigned window.onscroll as the following:</p>
<pre style="background-color:#bbb;">window.onscroll = function() {
     setTimeout("document.getElementById('myDiv').style.color='red';",200);
     setTimeout("document.getElementById('myDiv').style.color='green';",400);
};</pre>
<p>This causes the text color to blink within our div as we scroll. Of course this is only for example and serves no practical use&#8230; normally at least. Anyway, now we want to combine this with some other code.</p>
<p>So we now want to impose the new onscroll code:</p>
<pre style="background-color:#bbb;">function() { moveDiv() }</pre>
<p>moveDiv in this case moves the div so it is always on screen while you move. (fyi, this is how I personally get around IE5&#8217;s lack of support for position:fixed)</p>
<p>So how do we impose our old code onto the new code? Well it&#8217;s kind of strange, but we have to be a bit sneaky about it and take advantage of JavaScript&#8217;s JSON logic. To do this, we simply add the old code within the declaration of the new code, such as:</p>
<pre style="background-color:#bbb;">var ScrollCode = eval(window.onscroll);
window.onscroll = function() { moveDiv(ScrollCode()) };</pre>
<p>Yes I am using eval, and yes most people hate using eval, but if used correct it is actually very useful! So there is no harm in this case since the eval code does not involve any sort of user input.</p>
<p>So what happens in this code is simple. We call the new function moveDiv which references the variable ScrollCode which calls the function for the current onscroll code. As a result both codes are ran at the same time. This makes adding new code easy, and you can continue to add code in this same manor. It just continues to impose the code onto each other.</p>
<p>Anyway hope this helps, and please let me know if you have any issues with it. Good luck.</p>
<p>PS: Note that this method is meant to be used with window events. click events do not always require function usage. (i.e. window.onscroll = function() {};) Most window events do require this on modern browsers.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sanzon.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sanzon.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sanzon.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sanzon.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sanzon.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sanzon.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sanzon.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sanzon.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sanzon.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sanzon.wordpress.com/81/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sanzon.wordpress.com&blog=2667931&post=81&subd=sanzon&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sanzon.wordpress.com/2008/10/16/combiningimposing-event-code-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fa678a2f1f89798cc81e539c986c00d0?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Tom</media:title>
		</media:content>
	</item>
		<item>
		<title>Namespacing JavaScript with methods and properties</title>
		<link>http://sanzon.wordpress.com/2008/10/14/namespacing-javascript-with-methods-and-properties/</link>
		<comments>http://sanzon.wordpress.com/2008/10/14/namespacing-javascript-with-methods-and-properties/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 02:42:19 +0000</pubDate>
		<dc:creator>sanzon</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[method]]></category>
		<category><![CDATA[methods]]></category>
		<category><![CDATA[namespace]]></category>
		<category><![CDATA[namespacing]]></category>
		<category><![CDATA[properties]]></category>
		<category><![CDATA[property]]></category>

		<guid isPermaLink="false">http://sanzon.wordpress.com/?p=79</guid>
		<description><![CDATA[Well if you ever look into namespacing JavaScript online, I’m sure you were completely lost at first! The fact is namespacing is easy! Extremely easy! Yet people make it sound so complex it’s crazy.
Generally you must first off understand what a namespace is. It’s nothing more than a container for a group of code used [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sanzon.wordpress.com&blog=2667931&post=79&subd=sanzon&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Well if you ever look into namespacing JavaScript online, I’m sure you were completely lost at first! The fact is namespacing is easy! Extremely easy! Yet people make it sound so complex it’s crazy.</p>
<p>Generally you must first off understand what a namespace is. It’s nothing more than a container for a group of code used to organize it so you don’t have conflicts later on. Granted there is a bit more to it, but for now that’s all you really need to understand.</p>
<p>So now what is a method and what is a property? </p>
<p>In JavaScript a method is simply a function. Such as alert(), blur(), focus() you name it. The list goes on and on. So what is a property then? A property… You probably wouldn’t guess it, but it’s nothing more than a variable! Yes a property is pretty much just a variable. Nothing special about it.</p>
<p>So, we have functions and we have variables in JavaScript, so in fact we must have object oriented programming! The answer is yes! But first we need to learn to make your first namespace.</p>
<p>In JavaScript we use objects to do this. To create an object the easiest way to do it is the set a variable. Yes even your objects are variables!</p>
<p>Since my blog is .Net oriented I will use an example for a custom control namespace.</p>
<pre style="background-color:#bbb;">var CustomControls = {
	OverlayMenu : {
	    Drag : {
	        style : {}
	    },
	ContextMenu : {}
	}
};</pre>
<p>In the above code, which may look a bit complex at first, we have the namespace CustomControls.  Generally we declared CustomControls a namespace but assigning it as an object variable. To declare an object you simply use two curly brackets. “{}”</p>
<p>So in generally you can declare a very basic namespace doing this:</p>
<pre style="background-color:#bbb;">var NameSpace = {}</pre>
<p>Inside the namespace we can add different methods/properties at will by simply doing this:</p>
<pre style="background-color:#bbb;">NameSpace.Name = “HelloWorld”;</pre>
<p>Name in this example is a property, since it doesn’t do anything but hold a string value. Thus it is a variable to the namespace NameSpace. To create a method, which is generally a function, yes you wouldn’t of guess it’s:</p>
<pre style="background-color:#bbb;">NameSpace.Alert = function(message) { alert(message); };</pre>
<p>What? = function? I’m sure you’ve seen it before. You don’t have to name your functions! In fact we are assigning the variable Alert, of the namespace NameSpace, as a function variable. Yes, even functions can be variables.</p>
<p>So now with that said we need to use this new method of NameSpace:</p>
<pre style="background-color:#bbb;">NameSpace.Alert(“eureka!”);</pre>
<p> If you notice, Alert is treated like a function, even the value for message is transferred over.</p>
<p>So what next? We can add a sub-namespace or if you prefer you may call it a class. In the previous example of NameSpace, NameSpace was treated as both a namespace and a class.</p>
<p>To create a true class we’ll simply add another namespace within the namespace which is basically our… yes you wouldn’t of guess! Our class!</p>
<pre style="background-color:#bbb;">var NameSpace = {
	Class : {}
};</pre>
<p>The best way to describe the colon in this example is just to think of it as assigning it a value or a “=” sign. So now we have our class.</p>
<p>Now just as with the NameSpace we can assign some properties.</p>
<pre style="background-color:#bbb;">NameSpace.Class.Message = “Hello World”;</pre>
<p>Now our Message is stored within our class Class as a property. Let’s go ahead and create a method to call upon that message.</p>
<pre style="background-color:#bbb;">NameSpace.Clase.Alert = function(message) { alert(message); };</pre>
<p>Ah! So now what?</p>
<pre style="background-color:#bbb;">NameSpace.Class.Alert(NameSpace.Class.Message);</pre>
<p>Yep that’s right! It will alert use Hello World! In a sense the property is a global variable that is stored within the class for future reference. Pretty neat huh?</p>
<p>So, I’m noticing things are getting out of hand here… I don’t want to have to type so much! I mean it’s insane!</p>
<p>Understood! This is where object oriented programming in JavaScript because awesome!</p>
<p>So you want to get all the properties/methods of the class Class without typing NameSpace.Class.Whatever?</p>
<p>Just set a variable!</p>
<pre style="background-color:#bbb;">
var myClass = NameSpace.Class
</pre>
<p>Now myClass is connected to the Class within the namespace NameSpace.</p>
<p>So you can now use it as such:</p>
<pre style="background-color:#bbb;">
myClass.Message = “Wow it works!”;
myClass.Alert(myClass.Message);
</pre>
<p>I’ll let the result explain itself!</p>
<p>Ok yes, I’m a bit excited about this, but it’s such an amazing feature and the fact that you can use it in visual study and it’ll be treated like any other class is amazing. It’s so useful and makes JavaScript so much more organized!</p>
<p>Anyway so you can practice is here is a sample of the code:</p>
<pre style="background-color:#bbb;">
//namespace and class mapping
var NameSpace = {
	Class : {}
};

//Class method and property assignments
NameSpace.Class.Message = “Hello World”;
NameSpace.Clase.Alert = function(message) { alert(message); };

//Calling methods and properties of Class
var myClass = NameSpace.Class
myClass.Message = “Wow it works!”;
myClass.Alert(myClass.Message);
</pre>
<p>Recommended Reading:<br />
<a href="http://www.json.org/" target="_blank">http://www.json.org/</a> &#8211; If you never read JSON you NEED TO READ IT! It explains how javascript works and is probably one of the most important documents on the web relating to JS.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms533050(VS.85).aspx" target="_blank">http://msdn.microsoft.com/en-us/library/ms533050(VS.85).aspx</a> &#8211; Is actually a pretty good reference for javascript for finding methods etc.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sanzon.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sanzon.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sanzon.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sanzon.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sanzon.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sanzon.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sanzon.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sanzon.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sanzon.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sanzon.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sanzon.wordpress.com&blog=2667931&post=79&subd=sanzon&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sanzon.wordpress.com/2008/10/14/namespacing-javascript-with-methods-and-properties/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fa678a2f1f89798cc81e539c986c00d0?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Tom</media:title>
		</media:content>
	</item>
		<item>
		<title>Quick tip on client side IDs in custom controls for javascript use.</title>
		<link>http://sanzon.wordpress.com/2008/10/12/quick-tip-on-client-side-ids-in-custom-controls-for-javascript-use/</link>
		<comments>http://sanzon.wordpress.com/2008/10/12/quick-tip-on-client-side-ids-in-custom-controls-for-javascript-use/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 19:23:56 +0000</pubDate>
		<dc:creator>sanzon</dc:creator>
				<category><![CDATA[Asp.Net Framework 2.0]]></category>
		<category><![CDATA[Custom Controls]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[control]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[id]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://sanzon.wordpress.com/?p=77</guid>
		<description><![CDATA[Well one thing I found annoying when developing custom controls that use javascript is what do you do when you need to give an ID to a html dom object within a custom control in order to use it with javascript!
I thought at first, ok I could do some complex child/parent relationship coding, which I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sanzon.wordpress.com&blog=2667931&post=77&subd=sanzon&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Well one thing I found annoying when developing custom controls that use javascript is what do you do when you need to give an ID to a html dom object within a custom control in order to use it with javascript!</p>
<p>I thought at first, ok I could do some complex child/parent relationship coding, which I try not to do a ton of, but it works really well at times. In this case it would be too much of a pain. So I came up with another solution to this little problem and it&#8217;s not hard when you think about it.</p>
<p>ClientID&#8217;s often look like ct100_SomeID_SomeChildID_ETC</p>
<p>Well if you think about valid ID names, ID&#8217;s cannot start with a number! So the answer is pretty simple when you think about it.</p>
<p>Simply take the base ID of ct100_SomeID and attach a string such as, &#8220;_100jso_myID&#8221;</p>
<p>It produces something like:<br />
ct100_SomeID_100jso_ClientSideID</p>
<p>The great part about using a numeric value first is that it&#8217;s impossible to use a child control named 100jso, so it passes just fine. In case you&#8217;re wondering jso stands for javascript object in this case. I guess hdo, or html dom object may make more sense. Long as it starts with a number it&#8217;s safe!</p>
<p>So when you do work with javascript simple call:</p>
<p>document.getElementById(&#8216;&#8221; &amp; myBase.clientID &amp; &#8220;_101jso_ClientID&#8221;&#8216;)</p>
<p>Hope this helps</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sanzon.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sanzon.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sanzon.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sanzon.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sanzon.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sanzon.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sanzon.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sanzon.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sanzon.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sanzon.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sanzon.wordpress.com&blog=2667931&post=77&subd=sanzon&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sanzon.wordpress.com/2008/10/12/quick-tip-on-client-side-ids-in-custom-controls-for-javascript-use/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fa678a2f1f89798cc81e539c986c00d0?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Tom</media:title>
		</media:content>
	</item>
		<item>
		<title>Finding control on master page from content page.</title>
		<link>http://sanzon.wordpress.com/2008/10/01/finding-control-on-master-page-from-content-page/</link>
		<comments>http://sanzon.wordpress.com/2008/10/01/finding-control-on-master-page-from-content-page/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 23:16:02 +0000</pubDate>
		<dc:creator>sanzon</dc:creator>
				<category><![CDATA[Asp.Net Framework 2.0]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[vb.net]]></category>
		<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[content]]></category>
		<category><![CDATA[control]]></category>
		<category><![CDATA[findcontrol]]></category>
		<category><![CDATA[master]]></category>

		<guid isPermaLink="false">http://sanzon.wordpress.com/?p=75</guid>
		<description><![CDATA[Well this is a quicky for you. To find an element on a master page it&#8217;s really simple just use:
Dim pagebody As HtmlGenericControl = CType(Master.FindControl(&#8220;pagebody&#8221;), HtmlGenericControl)
pagebody.Attributes.Add(&#8220;style&#8221;, &#8220;background-color:black;&#8221;)
Basically the key to this is Master.FindControl(&#8220;my control ID&#8221;) and you use CType to convert it, in this case to a basic HtmlGenericControl. This example is used for adding [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sanzon.wordpress.com&blog=2667931&post=75&subd=sanzon&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Well this is a quicky for you. To find an element on a master page it&#8217;s really simple just use:</p>
<p><strong>Dim pagebody As HtmlGenericControl = CType(Master.FindControl(&#8220;pagebody&#8221;), HtmlGenericControl)<br />
pagebody.Attributes.Add(&#8220;style&#8221;, &#8220;background-color:black;&#8221;)</strong></p>
<p>Basically the key to this is Master.FindControl(&#8220;my control ID&#8221;) and you use CType to convert it, in this case to a basic HtmlGenericControl. This example is used for adding an attribute to the body tag in the master page. Great for javascript solutions like onscroll or any other mouse event.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sanzon.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sanzon.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sanzon.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sanzon.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sanzon.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sanzon.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sanzon.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sanzon.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sanzon.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sanzon.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sanzon.wordpress.com&blog=2667931&post=75&subd=sanzon&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sanzon.wordpress.com/2008/10/01/finding-control-on-master-page-from-content-page/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fa678a2f1f89798cc81e539c986c00d0?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Tom</media:title>
		</media:content>
	</item>
	</channel>
</rss>