<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.1" -->
<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/"
	>

<channel>
	<title>TechToolBlog &#187; asp.net</title>
	<link>http://www.techtoolblog.com</link>
	<description></description>
	<pubDate>Wed, 22 Feb 2012 13:46:39 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<item>
		<title>Add Web References to Visual Studio 2008</title>
		<link>http://www.techtoolblog.com/archives/add-web-references-to-visual-studio-2008</link>
		<comments>http://www.techtoolblog.com/archives/add-web-references-to-visual-studio-2008#comments</comments>
		<pubDate>Wed, 27 Feb 2008 20:46:59 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[asp.net]]></category>

		<guid isPermaLink="false">http://www.techtoolblog.com/archives/add-web-references-to-visual-studio-2008</guid>
		<description><![CDATA[So I&#8217;m doing a little work connecting to a Currency Exchange rate web service, simple enough.&#160; Normal steps are to right click your solution-&#62;Add Web Reference, punch in the WSDL location and bang, web service goodness is at hand. 
But with VS 2008 the option I have is &#34;Add Service Reference&#34;.&#160; So I run thru [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "Add Web References to Visual Studio 2008", url: "http://www.techtoolblog.com/archives/add-web-references-to-visual-studio-2008" });</script>]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;m doing a little work connecting to a Currency Exchange rate web service, simple enough.&#160; Normal steps are to right click your solution-&gt;Add Web Reference, punch in the WSDL location and bang, web service goodness is at hand. </p>
<p>But with VS 2008 the option I have is &quot;Add Service Reference&quot;.&#160; So I run thru these steps and things are smooth again.&#160; But now all the documentation the vendor provided seems way off in terms of naming and such.&#160; Long story short is you need to click the advanced tab</p>
<p><a href="http://www.techtoolblog.com//wp-content/uploads/2008/02/image1.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="441" alt="image" src="http://www.techtoolblog.com//wp-content/uploads/2008/02/image-thumb1.png" width="472" border="0" /></a> </p>
<p>And then go the compatibility section to add it the .NET 2.0 way.</p>
<p><a href="http://www.techtoolblog.com//wp-content/uploads/2008/02/image2.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="500" alt="image" src="http://www.techtoolblog.com//wp-content/uploads/2008/02/image-thumb2.png" width="466" border="0" /></a></p>
<p><a href="http://sharethis.com/item?&wp=2.3.1&amp;publisher=24accfc2-4cf2-46ea-abf6-c137f8fa267d&amp;title=Add+Web+References+to+Visual+Studio+2008&amp;url=http%3A%2F%2Fwww.techtoolblog.com%2Farchives%2Fadd-web-references-to-visual-studio-2008">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.techtoolblog.com/archives/add-web-references-to-visual-studio-2008/feed</wfw:commentRss>
		</item>
		<item>
		<title>ASP:HyperLink &#38; Mailto</title>
		<link>http://www.techtoolblog.com/archives/asphyperlink-mailto</link>
		<comments>http://www.techtoolblog.com/archives/asphyperlink-mailto#comments</comments>
		<pubDate>Wed, 15 Aug 2007 20:19:04 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[asp.net]]></category>

		<guid isPermaLink="false">http://www.techtoolblog.com/archives/asphyperlink-mailto</guid>
		<description><![CDATA[Recently I had a bit of trouble getting the HyperLink control to push out a&#160;mailto link in a Details View.


&#60;asp:HyperLink NavigateUrl=&#8217;mailto:&#8217; Text=&#8217;&#60;%# Bind(&#8221;Email&#8221;) %&#62;&#8216; runat=&#8221;server&#8221; ID=&#8221;hlEmail&#8221;&#62;&#60;/asp:HyperLink&#62;

&#160;
This leaves a hyperlink but with a blank mailto&#160;- i.e. test@techtoolblog.com 
So I assume if I stick in the bind (or eval)&#160;text to the Navigate URL we should be good [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "ASP:HyperLink &#38; Mailto", url: "http://www.techtoolblog.com/archives/asphyperlink-mailto" });</script>]]></description>
			<content:encoded><![CDATA[<p>Recently I had a bit of trouble getting the HyperLink control to push out a&nbsp;mailto link in a Details View.</p>
<p><!--<br />
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red163\green21\blue21;\red0\green0\blue0;\red255\green0\blue0;\red255\green238\blue98;}??\fs20 \cf1 &lt;\cf3 asp\cf1 :\cf3 HyperLink\cf0  \cf5 NavigateUrl\cf1 ='mailto:'\cf0   \cf5 Text\cf1 ='\cf0\cb6\highlight6 &lt;%\cb0\highlight0 # Bind("ClassAdminEmail") \cb6\highlight6 %&gt;\cf1\cb0\highlight0 '\cf0  \cf5 runat\cf1 ="server"\cf0  \cf5 ID\cf1 ="hlClassAdminEmail"&gt;&lt;/\cf3 asp\cf1 :\cf3 HyperLink\cf1 &gt;}<br />
-->
<div style="font-size: 10pt; background: white; color: black; font-family: consolas">
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">HyperLink</span> <span style="color: red">NavigateUrl</span><span style="color: blue">=&#8217;mailto:&#8217;</span> <span style="color: red">Text</span><span style="color: blue">=&#8217;</span><span style="background: #ffee62">&lt;%</span># Bind(&#8221;Email&#8221;) <span style="background: #ffee62">%&gt;</span><span style="color: blue">&#8216;</span> <span style="color: red">runat</span><span style="color: blue">=&#8221;server&#8221;</span> <span style="color: red">ID</span><span style="color: blue">=&#8221;hlEmail&#8221;&gt;&lt;/</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">HyperLink</span><span style="color: blue">&gt;</span></p>
</div>
<p>&nbsp;</p>
<p>This leaves a hyperlink but with a blank mailto&nbsp;- i.e. <a href="mailto:test@techtoolblog.com">test@techtoolblog.com</a> </p>
<p>So I assume if I stick in the bind (or eval)&nbsp;text to the Navigate URL we should be good to go: <!--<br />
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red163\green21\blue21;\red0\green0\blue0;\red255\green0\blue0;\red255\green238\blue98;}??\fs20 \cf1 &lt;\cf3 asp\cf1 :\cf3 HyperLink\cf0  \cf5 NavigateUrl\cf1 ='mailto:\cf0\cb6\highlight6 &lt;%\cb0\highlight0 # Bind("ClassAdminEmail") \cb6\highlight6 %&gt;\cf1\cb0\highlight0 '\cf0   \cf5 Text\cf1 ='\cf0\cb6\highlight6 &lt;%\cb0\highlight0 # Bind("ClassAdminEmail") \cb6\highlight6 %&gt;\cf1\cb0\highlight0 '\cf0  \cf5 runat\cf1 ="server"\cf0  \cf5 ID\cf1 ="hlClassAdminEmail"&gt;&lt;/\cf3 asp\cf1 :\cf3 HyperLink\cf1 &gt;}<br />
--></p>
<div style="font-size: 10pt; background: white; color: black; font-family: consolas">
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">HyperLink</span> <span style="color: red">NavigateUrl</span><span style="color: blue">=&#8217;mailto:</span><span style="background: #ffee62">&lt;%</span># Bind(&#8221;Email&#8221;) <span style="background: #ffee62">%&gt;</span><span style="color: blue">&#8216;</span> <span style="color: red">Text</span><span style="color: blue">=&#8217;</span><span style="background: #ffee62">&lt;%</span># Bind(&#8221;Email&#8221;) <span style="background: #ffee62">%&gt;</span><span style="color: blue">&#8216;</span> <span style="color: red">runat</span><span style="color: blue">=&#8221;server&#8221;</span> <span style="color: red">ID</span><span style="color: blue">=&#8221;hlEmail&#8221;&gt;&lt;/</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">HyperLink</span><span style="color: blue">&gt;</span></p>
</div>
<p>&nbsp;</p>
<p>This gives me a link that is&nbsp;<strong>NOT</strong> clickable - If I view the source I see </p>
<p><!--<br />
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red163\green21\blue21;\red0\green0\blue0;\red255\green0\blue0;}??\fs20 \cf1 &lt;\cf3 a\cf0  \cf5 id\cf1 ="dvClassDetails_hlClassAdminEmail"\cf0  \cf5 href\cf1 ="mailto:&amp;lt;%#%20Bind(&amp;quot;ClassAdminEmail&amp;quot;)%20%&gt;"&gt;\cf0 test@test.com\cf1 &lt;/\cf3 a\cf1 &gt;}<br />
-->
<div style="font-size: 10pt; background: white; color: black; font-family: consolas">
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">a</span> <span style="color: red">id</span><span style="color: blue">=&#8221;Details_hlEmail&#8221;</span> <span style="color: red">href</span><span style="color: blue">=&#8221;mailto:&amp;lt;%#%20Bind(&amp;quot;Email&amp;quot;)%20%&gt;&#8221;&gt;</span><a href="mailto:test@techtoolblog.com">test@techtoolblog.com</a> <span style="color: blue">&lt;/</span><span style="color: #a31515">a</span><span style="color: blue">&gt;</span></p>
</div>
<p>&nbsp;</p>
<p>My next guess is that this has something to do with formatting string, sure enough it is: This is the solution that ended up working for me:</p>
<p><!--<br />
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red163\green21\blue21;\red0\green0\blue0;\red255\green0\blue0;\red255\green238\blue98;}??\fs20 \cf1 &lt;\cf3 asp\cf1 :\cf3 HyperLink\cf0   \cf5 NavigateUrl\cf1 ='\cf0\cb6\highlight6 &lt;%\cb0\highlight0 # Bind("ClassAdminEmail", "mailto:\{0\}") \cb6\highlight6 %&gt;\cf1\cb0\highlight0 '\cf0   \cf5 Text\cf1 ='\cf0\cb6\highlight6 &lt;%\cb0\highlight0 # Bind("ClassAdminEmail") \cb6\highlight6 %&gt;\cf1\cb0\highlight0 '\cf0  \cf5 runat\cf1 ="server"\cf0  \cf5 ID\cf1 ="hlClassAdminEmail"&gt;&lt;/\cf3 asp\cf1 :\cf3 HyperLink\cf1 &gt;}<br />
-->
<div style="font-size: 10pt; background: white; color: black; font-family: consolas">
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">HyperLink</span> <span style="color: red">NavigateUrl</span><span style="color: blue">=&#8217;</span><span style="background: #ffee62">&lt;%</span># Bind(&#8221;Email&#8221;, &#8220;mailto:{0}&#8221;) <span style="background: #ffee62">%&gt;</span><span style="color: blue">&#8216;</span> <span style="color: red">Text</span><span style="color: blue">=&#8217;</span><span style="background: #ffee62">&lt;%</span># Bind(&#8221;Email&#8221;) <span style="background: #ffee62">%&gt;</span><span style="color: blue">&#8216;</span> <span style="color: red">runat</span><span style="color: blue">=&#8221;server&#8221;</span> <span style="color: red">ID</span><span style="color: blue">=&#8221;hlEmail&#8221;&gt;&lt;/</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">HyperLink</span><span style="color: blue">&gt;</span></p>
</div>
<p><a href="http://sharethis.com/item?&wp=2.3.1&amp;publisher=24accfc2-4cf2-46ea-abf6-c137f8fa267d&amp;title=ASP%3AHyperLink+%26amp%3B+Mailto&amp;url=http%3A%2F%2Fwww.techtoolblog.com%2Farchives%2Fasphyperlink-mailto">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.techtoolblog.com/archives/asphyperlink-mailto/feed</wfw:commentRss>
		</item>
		<item>
		<title>e.Row.RowState</title>
		<link>http://www.techtoolblog.com/archives/erowrowstate</link>
		<comments>http://www.techtoolblog.com/archives/erowrowstate#comments</comments>
		<pubDate>Tue, 17 Jul 2007 00:26:36 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[asp.net]]></category>

		<guid isPermaLink="false">http://www.techtoolblog.com/archives/erowrowstate</guid>
		<description><![CDATA[I&#8217;m building a GridView that contains edit/update capabilities.&#160; In edit mode for certain rows I need to turn on a drop down list, and based on that row add/remove Items from the list, other rows I want to show a text input to edit, all based on Foreign Key for that row in the database [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "e.Row.RowState", url: "http://www.techtoolblog.com/archives/erowrowstate" });</script>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m building a GridView that contains edit/update capabilities.&nbsp; In edit mode for certain rows I need to turn on a drop down list, and based on that row add/remove Items from the list, other rows I want to show a text input to edit, all based on Foreign Key for that row in the database (which I store in a DataKey to access).&nbsp; I handle the OnRowDataBound with a custom subroutine.&nbsp; This hasn?t been an issue in the past but this time I have multiple controls in the ItemTemplate and need to manipulate at databound time, which is a first.&nbsp;</p>
<div style="font-size: 10pt; background: white; color: black; font-family: consolas">
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">EditItemTemplate</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">DropDownList</span> <span style="color: red">ID</span><span style="color: blue">=?ddlAnswer?</span> <span style="color: red">runat</span><span style="color: blue">=?server?</span> <span style="color: red">Visible</span><span style="color: blue">=?False?&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">ListItem</span> <span style="color: red">Value</span><span style="color: blue">=?Yes?</span> <span style="color: red">Text</span><span style="color: blue">=?Yes?</span> <span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">ListItem</span> <span style="color: red">Value</span><span style="color: blue">=?No?</span> <span style="color: red">Text</span><span style="color: blue">=?No?</span> <span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">ListItem</span> <span style="color: red">Value</span><span style="color: blue">=?Neutral?</span> <span style="color: red">Text</span><span style="color: blue">=?Neutral?</span> <span style="color: blue">/&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">DropDownList</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">TextBox</span> <span style="color: red">ID</span><span style="color: blue">=?txtAnswer?</span> <span style="color: red">runat</span><span style="color: blue">=?server?</span> <span style="color: red">Text</span><span style="color: blue">=?</span><span style="background: #ffee62">&lt;%</span># Bind(?Answer?) <span style="background: #ffee62">%&gt;</span><span style="color: blue">?</span> <span style="color: red">Visible</span><span style="color: blue">=?False?&gt;&lt;/</span><span style="color: #a31515">asp</span><span style="color: blue">:</span><span style="color: #a31515">TextBox</span><span style="color: blue">&gt;</span></p>
<p style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">EditItemTemplate</span><span style="color: blue">&gt;</span></p>
</div>
<p>&nbsp;</p>
<p>Both have visible=false so I need to get at the bound event and flip one on and change the item list if it?s the DropDownList.</p>
<h2><strong>RowState</strong></h2>
<p>I find the e.Row.RowState property and assign an if conditional to DataControlRowState.Edit.&nbsp;</p>
<p>&nbsp;</p>
<div style="font-size: 10pt; background: white; color: black; font-family: consolas">
<p style="margin: 0px"><span style="color: blue">If</span> e.Row.RowState = DataControlRowState.Edit <span style="color: blue">Then</span></p>
<p style="margin: 0px">&nbsp;</p>
<p style="margin: 0px"><span style="color: green">?CHANGE UPDATE COMMAND ARGUMENT</span></p>
<p style="margin: 0px"><span style="color: blue">CType</span>(e.Row.FindControl(<span style="color: #a31515">?lbUpdate?</span>), LinkButton).CommandArgument = _</p>
<p style="margin: 0px">e.Row.RowIndex.ToString()</p>
<p style="margin: 0px">&nbsp;</p>
<p style="margin: 0px"><span style="color: blue">Dim</span> iAnswerTypeID = <span style="color: blue">CInt</span>(gvEditSurveyResults.DataKeys(e.Row.RowIndex).Item(0))</p>
<p style="margin: 0px"><span style="color: green">?TURN ON CORRECT TYPE OF INPUT</span></p>
<p style="margin: 0px"><span style="color: blue">Select</span> <span style="color: blue">Case</span> <span style="color: blue">CInt</span>(gvEditSurveyResults.DataKeys(e.Row.RowIndex).Item(0))</p>
<p style="margin: 0px"><span style="color: blue">Case</span> 1</p>
<p style="margin: 0px"><span style="color: blue">CType</span>(e.Row.FindControl(<span style="color: #a31515">?ddlAnswer?</span>), DropDownList).Visible = <span style="color: blue">True</span></p>
<p style="margin: 0px"><span style="color: blue">CType</span>(e.Row.FindControl(<span style="color: #a31515">?ddlAnswer?</span>), DropDownList).SelectedValue = _</p>
<p style="margin: 0px"><span style="color: blue">CStr</span>(gvEditSurveyResults.DataKeys(e.Row.RowIndex).Item(2))</p>
<p style="margin: 0px">&nbsp;</p>
<p style="margin: 0px"><span style="color: blue">Case</span> 2</p>
<p style="margin: 0px"><span style="color: blue">CType</span>(e.Row.FindControl(<span style="color: #a31515">?txtAnswer?</span>), TextBox).Visible = <span style="color: blue">True</span></p>
<p style="margin: 0px">&nbsp;</p>
<p style="margin: 0px"><span style="color: blue">Case</span> 3</p>
<p style="margin: 0px">&nbsp;</p>
<p style="margin: 0px"><span style="color: blue">Case</span> 4</p>
<p style="margin: 0px"><span style="color: blue">CType</span>(e.Row.FindControl(<span style="color: #a31515">?txtAnswer?</span>), TextBox).Visible = <span style="color: blue">True</span></p>
<p style="margin: 0px"><span style="color: blue">CType</span>(e.Row.FindControl(<span style="color: #a31515">?txtAnswer?</span>), TextBox).TextMode = TextBoxMode.MultiLine</p>
<p style="margin: 0px">&nbsp;</p>
<p style="margin: 0px"><span style="color: blue">Case</span> 5</p>
<p style="margin: 0px"><span style="color: blue">CType</span>(e.Row.FindControl(<span style="color: #a31515">?ddlAnswer?</span>), DropDownList).Visible = <span style="color: blue">True</span></p>
<p style="margin: 0px"><span style="color: blue">Dim</span> oldListItem <span style="color: blue">As</span> ListItem = <span style="color: blue">CType</span>(e.Row.FindControl(<span style="color: #a31515">?ddlAnswer?</span>), DropDownList).Items.FindByValue(<span style="color: #a31515">?Neutral?</span>)</p>
<p style="margin: 0px"><span style="color: green">?REMOVE NEUTRAL</span></p>
<p style="margin: 0px"><span style="color: blue">CType</span>(e.Row.FindControl(<span style="color: #a31515">?ddlAnswer?</span>), DropDownList).Items.Remove(oldListItem)</p>
<p style="margin: 0px"><span style="color: green">?ADD NA</span></p>
<p style="margin: 0px"><span style="color: blue">CType</span>(e.Row.FindControl(<span style="color: #a31515">?ddlAnswer?</span>), DropDownList).Items.Add _</p>
<p style="margin: 0px">(<span style="color: blue">New</span> ListItem(<span style="color: blue">CStr</span>(gvEditSurveyResults.DataKeys(e.Row.RowIndex).Item(1)), <span style="color: blue">CStr</span>(gvEditSurveyResults.DataKeys(e.Row.RowIndex).Item(1))))</p>
<p style="margin: 0px"><span style="color: blue">CType</span>(e.Row.FindControl(<span style="color: #a31515">?ddlAnswer?</span>), DropDownList).SelectedValue = _</p>
<p style="margin: 0px"><span style="color: blue">CStr</span>(gvEditSurveyResults.DataKeys(e.Row.RowIndex).Item(2))</p>
<p style="margin: 0px"><span style="color: blue">End</span> <span style="color: blue">Select</span></p>
<p style="margin: 0px">&nbsp;</p>
<p style="margin: 0px"><span style="color: blue">End</span> <span style="color: blue">If</span></p>
</div>
<p>&nbsp;</p>
<p>This doesn?t work, I never get into the if block for all rows. Setting a debug point I find the state of the row is not always DataControlRowState.Edit, but sometimes Alternate with an enumeration of 5.&nbsp; Looking thru Microsoft documentation I don?t see any 5 reference.&nbsp;</p>
<p><strong>My Assumption</strong></p>
<p>I am assuming that every property of the DataControlRowState handler has an Alternate row of that plus 1.&nbsp; So edit&nbsp; = 4 and edit on an alternative row is 5.<!--</p>
<div style="font-size: 10pt; background: white; color: black; font-family: consolas">
<p style="margin: 0px"><span style="color: blue">If</span> e.Row.RowState = 4 <span style="color: blue">Or</span> e.Row.RowState = 5 <span style="color: blue">Then</span></p>
</div>
<p>&nbsp;</p>
<p>This does look to be the case but I can?t find anything concrete that confirms it, but it does work.</p>
<p><a href="http://sharethis.com/item?&wp=2.3.1&amp;publisher=24accfc2-4cf2-46ea-abf6-c137f8fa267d&amp;title=e.Row.RowState&amp;url=http%3A%2F%2Fwww.techtoolblog.com%2Farchives%2Ferowrowstate">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.techtoolblog.com/archives/erowrowstate/feed</wfw:commentRss>
		</item>
		<item>
		<title>Stored Procedures vs Ad Hoc SQL</title>
		<link>http://www.techtoolblog.com/archives/stored-procedures-vs-ad-hoc-sql</link>
		<comments>http://www.techtoolblog.com/archives/stored-procedures-vs-ad-hoc-sql#comments</comments>
		<pubDate>Fri, 01 Jun 2007 19:49:05 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[asp.net]]></category>

		<category><![CDATA[database]]></category>

		<guid isPermaLink="false">http://www.techtoolblog.com/archives/stored-procedures-vs-ad-hoc-sql</guid>
		<description><![CDATA[Stored procedures debate from my point of view:
Pros of using Stored Procedures

Cleaner code.&#160; Thousand lines of logic and sql statements can be traded in for hundreds.
Push more work to someone else besides developer.&#160; If you have a dedicated DB guy, this can really help&#160;in your timing.&#160;
Put much more logic into Stored Procedure then Ad Hoc [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "Stored Procedures vs Ad Hoc SQL", url: "http://www.techtoolblog.com/archives/stored-procedures-vs-ad-hoc-sql" });</script>]]></description>
			<content:encoded><![CDATA[<p>Stored procedures debate from my point of view:</p>
<p><strong>Pros of using Stored Procedures</strong></p>
<ul>
<li>Cleaner code.&nbsp; Thousand lines of logic and sql statements can be traded in for hundreds.
<li>Push more work to someone else besides developer.&nbsp; If you have a dedicated DB guy, this can really help&nbsp;in your timing.&nbsp;
<li>Put much more logic into Stored Procedure then Ad Hoc SQL
<li><strike>Faster.</strike> Ok, maybe a little bit, but with processing power and RAM does this really matter anymore?
<li>Permissions are centralized and encompassed.
<li>Trips to the database server can be reduced.</li>
</ul>
<p><strong>Cons of using Stored Procedures</strong></p>
<ul>
<li>Much harder to debug.&nbsp; No UI debugger, stepping thru the code.&nbsp;
<li>Harder to tell were errors lie. Does this lie at the stored procedure or my code calling it?&nbsp; Plus the error codes returned by SQL are cryptic - &#8220;Error 512 was called&#8221; - Oh yeah, good old error 512.
<li>Parameter list can be really long, which takes away from the cleaner code.
<li>&#8220;<a href="http://weblogs.asp.net/fbouma/archive/2003/11/18/38178.aspx">Stored procedures also will open up a maintenance problem. The reason for this is that they form an API by themselves.&#8221;</a>&nbsp;This is the main point that causes me to stay away from Stored Procedures.</li>
</ul>
<p>I&#8217;m not entirely sure which side of the fence I lie.&nbsp; Right now I&#8217;m more comfortable with <strong>not</strong> using stored procedures because of the maintenance factor.&nbsp; I really think <a href="http://msdn2.microsoft.com/en-us/netframework/aa904594.aspx">LINQ</a> is going to make stored procedures deprecated.</p>
<p>.NET specific - Here is a nice line of code to keep around when working with stored procedures that I end up using when getting the the dreaded &#8220;Parameters do not match&#8221; error.&nbsp; You can put this on your datasource Inserting Event.</p>
<p><!--<br />
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;}??\fs20 \cf1 For\cf0  x \cf1 As\cf0  \cf1 Integer\cf0  = 0 \cf1 To\cf0  e.Command.Parameters.Count - 1\par ??            Trace.Write(e.Command.Parameters(x).ParameterName)\par ??            Trace.Write(e.Command.Parameters(x).Value)\par ??        \cf1 Next}<br />
-->
<div style="font-size: 10pt; background: white; color: black; font-family: consolas">
<p style="margin: 0px"><span style="color: blue">For</span> x <span style="color: blue">As</span> <span style="color: blue">Integer</span> = 0 <span style="color: blue">To</span> e.Command.Parameters.Count - 1</p>
<p style="margin: 0px">Trace.Write(e.Command.Parameters(x).ParameterName)</p>
<p style="margin: 0px">Trace.Write(e.Command.Parameters(x).Value)</p>
<p style="margin: 0px"><span style="color: blue">Next</span></p>
</div>
<p><a href="http://sharethis.com/item?&wp=2.3.1&amp;publisher=24accfc2-4cf2-46ea-abf6-c137f8fa267d&amp;title=Stored+Procedures+vs+Ad+Hoc+SQL&amp;url=http%3A%2F%2Fwww.techtoolblog.com%2Farchives%2Fstored-procedures-vs-ad-hoc-sql">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.techtoolblog.com/archives/stored-procedures-vs-ad-hoc-sql/feed</wfw:commentRss>
		</item>
		<item>
		<title>Subdomain Cookies and Localhost</title>
		<link>http://www.techtoolblog.com/archives/subdomain-cookies-and-localhost</link>
		<comments>http://www.techtoolblog.com/archives/subdomain-cookies-and-localhost#comments</comments>
		<pubDate>Tue, 22 May 2007 18:50:24 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[asp.net]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[web 2.0 ish]]></category>

		<guid isPermaLink="false">http://www.techtoolblog.com/archives/subdomain-cookies-and-localhost</guid>
		<description><![CDATA[So I have a site - we&#8217;ll call www.site1.com that sets a client side cookie named CookieName1 and I need a subdomain test.site1.com to be able to read that value. Using php&#8217;s standard setcookie() method I set the cookie on www by using:
setcookie( &#8220;CookieName1&#8243;, $CookieName1Value, $CookieExpDate, &#8220;/&#8221;, &#8220;.site1.com&#8221; );
This works, no problem.&#160; Now test.site1.com uses [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "Subdomain Cookies and Localhost", url: "http://www.techtoolblog.com/archives/subdomain-cookies-and-localhost" });</script>]]></description>
			<content:encoded><![CDATA[<p>So I have a site - we&#8217;ll call <a href="http://www.site1.com">www.site1.com</a> that sets a client side cookie named CookieName1 and I need a subdomain test.site1.com to be able to read that value. Using php&#8217;s standard setcookie() method I set the cookie on www by using:</p>
<p><font face="Courier New" size="1">setcookie( &#8220;CookieName1&#8243;, $CookieName1Value, $CookieExpDate, &#8220;/&#8221;, &#8220;.site1.com&#8221; );</font></p>
<p><font face="v" size="2">This works, no problem.&nbsp; Now test.site1.com uses .NET to read in the value and do something.&nbsp; Pretty standard stuff here:</font></p>
<p><!--<br />
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red163\green21\blue21;\red0\green128\blue0;}??\fs20  \cf3 If\cf0  Request.Cookies(\cf4 "SourceKey"\cf0 ) \cf3 IsNot\cf0  \cf3 Nothing\cf0  \cf3 Then\par ??\cf0             \cf5 ''DO SOMETHING\par ??\cf0         \cf3 End\cf0  \cf3 If}<br />
-->
<div style="font-size: 10pt; background: white; color: black; font-family: consolas">
<p style="margin: 0px">&nbsp;&nbsp;<span style="color: blue">If</span> Request.Cookies(<span style="color: #a31515">&#8220;CookieName1&#8243;</span>) <span style="color: blue">IsNot</span> <span style="color: blue">Nothing</span> <span style="color: blue">Then</span></p>
<p style="margin: 0px">&nbsp;&nbsp; <span style="color: green">&#8221;DO SOMETHING</span></p>
<p style="margin: 0px">&nbsp;&nbsp;<span style="color: blue">End</span> <span style="color: blue">If</span></p>
</div>
<p><font size="2"></font>&nbsp;</p>
<p>Build &gt; Debug, set a breakpoint on the if block, skips right over it.&nbsp; Huh?&nbsp; I make sure IE has the cookie, try again.&nbsp; Nope, Request.Cookies(&#8221;CookieName1&#8243;) is Nothing.&nbsp;&nbsp;Can&#8217;t be an IE thing can it?&nbsp; Run same scenerio in FireFox - same result.&nbsp; Then it dawns on me, I&#8217;m not running this under test.site1.com, I&#8217;m running this under localhost.&nbsp; Everything was working as expected, cookies can only be read by *.site1.com.&nbsp; So how am I going to test this thing on my local machine? I do have a sandbox, test1sandbox.site1.com, but what if I didn&#8217;t?&nbsp; A simple solution is to change the host file found at <tt>%SystemRoot%\system32\drivers\etc\</tt> with:</p>
<p>127.0.0.1 localhost<br />127.0.0.1 test1.site1.com</p>
<p>Run another Debug, change the <a href="http://localhost">http://localhost</a> to <a href="http://test1.site1.com">http://test1.site1.com</a> and now I&#8217;m able to read cookies from *.site1.com. Nifty.</p>
<p><a href="http://sharethis.com/item?&wp=2.3.1&amp;publisher=24accfc2-4cf2-46ea-abf6-c137f8fa267d&amp;title=Subdomain+Cookies+and+Localhost&amp;url=http%3A%2F%2Fwww.techtoolblog.com%2Farchives%2Fsubdomain-cookies-and-localhost">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.techtoolblog.com/archives/subdomain-cookies-and-localhost/feed</wfw:commentRss>
		</item>
		<item>
		<title>Ajax.Net Pro and Atlas Together</title>
		<link>http://www.techtoolblog.com/archives/ajaxnet-pro-and-atlas-together</link>
		<comments>http://www.techtoolblog.com/archives/ajaxnet-pro-and-atlas-together#comments</comments>
		<pubDate>Tue, 27 Feb 2007 17:28:26 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[asp.net]]></category>

		<guid isPermaLink="false">http://www.techtoolblog.com/archives/ajaxnet-pro-and-atlas-together</guid>
		<description><![CDATA[I&#8217;ve been using AJAX with ASP.NET 2.0 for over a year now, mostly using Ajax.Net Professional.  Now that Atlas is version 1.0 I&#8217;ve been playing around with it a bit.  I ran into an issue having Ajax.Net Pro &#038; Atlas running in the same web.config.  I had a generic httpHandlers set for [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "Ajax.Net Pro and Atlas Together", url: "http://www.techtoolblog.com/archives/ajaxnet-pro-and-atlas-together" });</script>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using AJAX with ASP.NET 2.0 for over a year now, mostly using <a href="http://www.ajaxpro.info/">Ajax.Net Professional</a>.  Now that <a href="http://ajax.asp.net/">Atlas</a> is version 1.0 I&#8217;ve been playing around with it a bit.  I ran into an issue having Ajax.Net Pro &#038; Atlas running in the same web.config.  I had a generic httpHandlers set for Ajax.Net Pro that was interfering with the Atlas setting.  The fix was adding more meta data to the Ajax.Net Pro httpHandler.</p>
<div style="font-family: Arial; font-size: 10pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">httpHandlers</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: blue;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;</span><span style="color: #a31515;">add</span><span style="color: blue;"> </span><span style="color: red;">verb</span><span style="color: blue;">=</span>&#8220;<span style="color: blue;">*</span>&#8220;<span style="color: blue;"> </span><span style="color: red;">path</span><span style="color: blue;">=</span>&#8220;<span style="color: blue;">*.ashx</span>&#8220;<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>&#8220;<span style="color: blue;">AjaxPro.AjaxHandlerFactory,AjaxPro.2, Version=6.10.6.2, Culture=neutral,</span><span style="color: blue;">PublicKeyToken=4735ae9824c7d3ec</span>&#8220;<span style="color: blue;">/&gt;</span></p>
<p style="margin: 0px;"><span style="color: blue;">&nbsp; &nbsp; &nbsp; &lt;/</span><span style="color: #a31515;">httpHandlers</span><span style="color: blue;">&gt;</span></p>
</div>
<p><a href="http://sharethis.com/item?&wp=2.3.1&amp;publisher=24accfc2-4cf2-46ea-abf6-c137f8fa267d&amp;title=Ajax.Net+Pro+and+Atlas+Together&amp;url=http%3A%2F%2Fwww.techtoolblog.com%2Farchives%2Fajaxnet-pro-and-atlas-together">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.techtoolblog.com/archives/ajaxnet-pro-and-atlas-together/feed</wfw:commentRss>
		</item>
		<item>
		<title>Adding a Javascript Confirm Alert to a .NET Checkbox control in a GridView</title>
		<link>http://www.techtoolblog.com/archives/adding-a-javascript-confirm-alert-to-a-net-checkbox-control-in-a-gridview</link>
		<comments>http://www.techtoolblog.com/archives/adding-a-javascript-confirm-alert-to-a-net-checkbox-control-in-a-gridview#comments</comments>
		<pubDate>Tue, 28 Nov 2006 20:19:51 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[asp.net]]></category>

		<guid isPermaLink="false">http://www.techtoolblog.com/archives/adding-a-javascript-confirm-alert-to-a-net-checkbox-control-in-a-gridview</guid>
		<description><![CDATA[One issue I recently ran into dealing with the gridview control in .NET is adding a javascript confirm box when a user selects a checkbox control and have a postback event fired.  The dopostback event is tied to the onclick event, so I was unable to add it to the template item itself.  [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "Adding a Javascript Confirm Alert to a .NET Checkbox control in a GridView", url: "http://www.techtoolblog.com/archives/adding-a-javascript-confirm-alert-to-a-net-checkbox-control-in-a-gridview" });</script>]]></description>
			<content:encoded><![CDATA[<p>One issue I recently ran into dealing with the gridview control in .NET is adding a javascript confirm box when a user selects a checkbox control and have a postback event fired.  The dopostback event is tied to the onclick event, so I was unable to add it to the template item itself.  I ended up having to manually call the dopostback myself with the javascript below.</p>
<div style="font-family: Consolas; font-size: 8pt; color: black; background: white;">
<pre style="margin: 0px;"><span style="color: blue;">function</span> confirmSubmit(mycheckbox) {</pre>
<pre style="margin: 0px;">&nbsp;<span style="color: blue;">var</span> agree=confirm(<span style="color: maroon;">&#8220;Are you sure you want to delete this quote?&#8221;</span>);</pre>
<pre style="margin: 0px;">&nbsp;<span style="color: blue;">if</span> (agree) {</pre>
<pre style="margin: 0px;">&nbsp;setTimeout(<span style="color: maroon;">&#8216;__doPostBack(\&#8217;gvQuotes$ctl07$btnDelete\&#8217;,\&#8217;\')&#8217;</span>, 0)</pre>
<pre style="margin: 0px;">&nbsp;<span style="color: blue;">return</span> <span style="color: blue;">true</span> ;</pre>
<pre style="margin: 0px;">&nbsp;}</pre>
<pre style="margin: 0px;">&nbsp;<span style="color: blue;">else</span> {</pre>
<pre style="margin: 0px;">&nbsp; mycheckbox.checked = <span style="color: blue;">false</span>;</pre>
<pre style="margin: 0px;">&nbsp; <span style="color: blue;">return</span> <span style="color: blue;">false</span> ;</pre>
<pre style="margin: 0px;">&nbsp; }</pre>
<pre style="margin: 0px;">}</pre>
</div>
<p>Here is the itemtemplate code that fires the javascript code:</p>
<div style="font-family: Consolas; font-size: 8pt; color: black; background: white;">
<pre style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: maroon;">asp</span><span style="color: blue;">:</span><span style="color: maroon;">TemplateField</span> <span style="color: red;">HeaderText</span><span style="color: blue;">=&#8221;delete&#8221;&gt;</span></pre>
<pre style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: maroon;">ItemTemplate</span><span style="color: blue;">&gt;</span></pre>
<pre style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: maroon;">asp</span><span style="color: blue;">:</span><span style="color: maroon;">CheckBox</span> <span style="color: red;">ID</span><span style="color: blue;">=&#8221;btnDelete&#8221;</span> <span style="color: red;">runat</span><span style="color: blue;">=&#8221;server&#8221;</span> <span style="color: red;">Text</span><span style="color: blue;">=&#8221;"</span> </pre>
<pre style="margin: 0px;"><span style="color: red;">onclick</span><span style="color: blue;">=&#8221;confirmSubmit(this)&#8221;</span>&nbsp; </pre>
<pre style="margin: 0px;"><span style="color: red;">OnCheckedChanged</span><span style="color: blue;">=&#8221;FireDeleteQuote&#8221;</span>&nbsp; <span style="color: blue;">/&gt;</span></pre>
<pre style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: maroon;">ItemStyle</span> <span style="color: red;">HorizontalAlign</span><span style="color: blue;">=&#8221;Center&#8221;</span> <span style="color: red;">Width</span><span style="color: blue;">=&#8221;0px&#8221;</span> <span style="color: blue;">/&gt;</span></pre>
<pre style="margin: 0px;"><span style="color: blue;">&lt;/</span><span style="color: maroon;">ItemTemplate</span><span style="color: blue;">&gt;</span></pre>
<pre style="margin: 0px;"><span style="color: blue;">&lt;/</span><span style="color: maroon;">asp</span><span style="color: blue;">:</span><span style="color: maroon;">TemplateField</span><span style="color: blue;">&gt;</span></pre>
</div>
<p>If anyone has found an easier way to accomplish this let me know.</p>
<p><Hr><br />
Adding <a href="http://mailservices.berkeley.edu/bc2/bclabelinfo.htm">code</a> for checkbox control is a good idea.  Coding makes everything so much more convenient, from <a href="http://www.barcodediscount.com/">bar code scanners</a> to helpful web code.  A <a href="http://www.barcodediscount.com/catalog/symbol/">symbol scanner</a> can also simplify business processes by <a href="http://www.ejm.lsc.gov/EJMIssue1/Technology/touchscreenjustice.htm">reading</a> code.  Partnered with a <a href="http://www.barcodediscount.com/products/touchscreen_monitors/">touch screen monitor</a> these barcode readers and scanners become the ultimate in convenience.</p>
<p><a href="http://sharethis.com/item?&wp=2.3.1&amp;publisher=24accfc2-4cf2-46ea-abf6-c137f8fa267d&amp;title=Adding+a+Javascript+Confirm+Alert+to+a+.NET+Checkbox+control+in+a+GridView&amp;url=http%3A%2F%2Fwww.techtoolblog.com%2Farchives%2Fadding-a-javascript-confirm-alert-to-a-net-checkbox-control-in-a-gridview">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.techtoolblog.com/archives/adding-a-javascript-confirm-alert-to-a-net-checkbox-control-in-a-gridview/feed</wfw:commentRss>
		</item>
		<item>
		<title>IE 7 - Native xmlHttpRequest Not So Good</title>
		<link>http://www.techtoolblog.com/archives/ie-7-native-xmlhttprequest-not-so-good</link>
		<comments>http://www.techtoolblog.com/archives/ie-7-native-xmlhttprequest-not-so-good#comments</comments>
		<pubDate>Wed, 25 Oct 2006 20:05:37 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[asp.net]]></category>

		<category><![CDATA[web 2.0 ish]]></category>

		<guid isPermaLink="false">http://www.techtoolblog.com/archives/ie-7-native-xmlhttprequest-not-so-good</guid>
		<description><![CDATA[When I found out IE7 was going to implement a native javascript object, xmlHttpRequest, in addition to their own Microsoft.XMLHTTP object, I was thrilled.  This meant once IE 6 was phased out of the world, all my ajax stuff wouldn&#8217;t need to check browser before proceeding.  For the most I use ajax frameworks [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "IE 7 - Native xmlHttpRequest Not So Good", url: "http://www.techtoolblog.com/archives/ie-7-native-xmlhttprequest-not-so-good" });</script>]]></description>
			<content:encoded><![CDATA[<p>When I found out IE7 was going to implement a native javascript object, xmlHttpRequest, in addition to their own Microsoft.XMLHTTP object, I was thrilled.  This meant once IE 6 was phased out of the world, all my ajax stuff wouldn&#8217;t need to check browser before proceeding.  For the most I use ajax frameworks (<a href="http://www.ajaxpro.info/">http://www.ajaxpro.info/</a>) that already have this built in but I do write my own xmlhttp request on occasion.</p>
<p>For an internal application I have an ajax search functionality built that queries a database and returns customers names on key entry.  So I type in &#8220;Acm&#8221; I get a listing of:</p>
<p>Acmanda<br />
Acmat<br />
Acme</p>
<p>This is very similar to Google suggest, but I display the results in a fixed height div tag with auto scroll enabled.  The ajax returns li tags with href tags around the company names.  This works on IE 6, FF, and Safari.  However in IE7, there is some real slowness to this.  When I use <a href="http://www.fiddlertool.com/fiddler/">Fiddler</a> I see the Request returning from the AJAX calls but the results do not show up.  I tried setting the page cache to nothing, but still no luck.  I then ran into several articles questioning the XmlHttpRequest javascript object.</p>
<ul>
<li><a href="http://ajaxian.com/archives/ie7-xmlhttprequest-native-or-not">http://ajaxian.com/archives/ie7-xmlhttprequest-native-or-not</a></li>
<li><a href="http://blogs.msdn.com/ie/archive/2006/01/23/516393.aspx#518174">http://blogs.msdn.com/ie/archive/2006/01/23/516393.aspx#518174</a></li>
</ul>
<p>I also found out IE 7 is slow on some Google sites where a ton of XML traffic is being returned, like their Google Maps.</p>
<ul>
<li><a href="http://scobleizer.wordpress.com/2006/10/19/firefox-vs-ie-7-ie7-having-trouble-with-google-sites">http://scobleizer.wordpress.com/2006/10/19/firefox-vs-ie-7-ie7-having-trouble-with-google-sites</a></li>
</ul>
<p>I started playing around with IE 7&#8217;s options, turning off Phishing filter, testing, no luck and so on.  When I turned off the native XMLHttp support as seen below, my application ran perfectly fast on IE7.  IE 7 is set up to fall back to the Microsoft.XMLHTTP Active X object if this gets turned off.</p>
<p><!--adsense--></p>
<p><a href="http://www.techtoolblog.com/wp-content/CropperCapture%5B5%5D.Jpg"><img src="http://www.techtoolblog.com/wp-content/_CropperCapture%5B5%5D.Jpg" width="199" height="250" alt="" title=""  /></a></p>
<p>So this makes me wonder.  </p>
<ul>
<li>Did the IE 7 team really implement a native javascript XmlHttpRequest object?</li>
<li>If so, did they follow the spec?</li>
<li>If so, is their object code buggy or just plain slow</li>
</ul>
<p>OR</p>
<ul>
<li>Is their native XmlHttpRequest object really a javascript object or did they cut corners and implement an object that acts native but in all reality is a deformed active x object?</li>
<li>If so, why would you ship with this option turned on by default?</li>
</ul>
<p>This has egg on the face written all over it.</p>
<hr />
Did you know you could browse IE with <a href="http://www.barcodediscount.com/catalog/psc/falcon-4420.htm">handheld computers</a>?  Modern technology makes <a href="http://www.nsf.gov/discoveries/disc_summ.jsp?cntn_id=100278">everything</a> more portable, like <a href="http://www.barcodediscount.com/">barcode readers</a> and mobile computers.  <a href="http://www.barcodediscount.com/catalog/zebra/card-printer-supplies.htm">Zebra card printers</a> are now portable, too, so you can <a href="http://systemsupport.und.edu/index.php?action=kb&amp;article=80">print</a> on the go!</p>
<p><a href="http://sharethis.com/item?&wp=2.3.1&amp;publisher=24accfc2-4cf2-46ea-abf6-c137f8fa267d&amp;title=IE+7+-+Native+xmlHttpRequest+Not+So+Good&amp;url=http%3A%2F%2Fwww.techtoolblog.com%2Farchives%2Fie-7-native-xmlhttprequest-not-so-good">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.techtoolblog.com/archives/ie-7-native-xmlhttprequest-not-so-good/feed</wfw:commentRss>
		</item>
		<item>
		<title>Free Programming Video Tutorials</title>
		<link>http://www.techtoolblog.com/archives/free-programming-video-tutorials</link>
		<comments>http://www.techtoolblog.com/archives/free-programming-video-tutorials#comments</comments>
		<pubDate>Thu, 27 Jul 2006 11:59:28 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[asp.net]]></category>

		<guid isPermaLink="false">http://www.techtoolblog.com/archives/free-programming-video-tutorials</guid>
		<description><![CDATA[Microsoft just released a series of free c# video tutorials .  It starts at a beginners level but moves to more advanced stuff like creating a RSS reader.  They also have the same videos in VB in case that peaks your interest.

Some of the more interesting lessons that I&#8217;ve watched are:

Lesson 10:  [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "Free Programming Video Tutorials", url: "http://www.techtoolblog.com/archives/free-programming-video-tutorials" });</script>]]></description>
			<content:encoded><![CDATA[<p>Microsoft just released a series of free <a href="http://msdn.microsoft.com/vstudio/express/visualCSharp/learning/">c# video tutorials </a>.  It starts at a beginners level but moves to more advanced stuff like creating a RSS reader.  They also have the <a href="http://msdn.microsoft.com/vstudio/express/vb/learning/">same videos in VB </a>in case that peaks your interest.</p>
<p><!--adsense--></p>
<p>Some of the more interesting lessons that I&#8217;ve watched are:</p>
<ul>
<li>Lesson 10:  Working with XML</li>
<li>Lesson 12:  The RSS Reader Project - Designing and Planning</li>
<li>Lesson 16:  The RSS Reader Project - Fortifying, Testing and Deploying the Application</li>
<li>Lesson 6:  How to create a System Tray application using the NotifyIcon control</li>
</ul>
<p>The tutorials were made by <a href="http://www.learnvisualstudio.net/default.aspx">http://www.learnvisualstudio.net/default.aspx</a>, they too have more free tutorials on their site. - Enjoy!</p>
<p><!--adsense--></p>
<p><a href="http://sharethis.com/item?&wp=2.3.1&amp;publisher=24accfc2-4cf2-46ea-abf6-c137f8fa267d&amp;title=Free+Programming+Video+Tutorials&amp;url=http%3A%2F%2Fwww.techtoolblog.com%2Farchives%2Ffree-programming-video-tutorials">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.techtoolblog.com/archives/free-programming-video-tutorials/feed</wfw:commentRss>
		</item>
		<item>
		<title>Adding a Confirm Javascript PopUp to a ASP.NET GridView</title>
		<link>http://www.techtoolblog.com/archives/adding-a-confirm-javascript-popup-to-net-gridview</link>
		<comments>http://www.techtoolblog.com/archives/adding-a-confirm-javascript-popup-to-net-gridview#comments</comments>
		<pubDate>Fri, 02 Jun 2006 22:11:10 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[asp.net]]></category>

		<guid isPermaLink="false">http://www.techtoolblog.com/archives/adding-a-confirm-javascript-popup-to-net-gridview</guid>
		<description><![CDATA[The more and more I use the GridView control, the more I end up writing my own  rather then using the DataBound columns because of the additional flexiblity you get when writing your own templates.   
This time I ended up writing my own TemplateField because I need to add a confirm pop [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "Adding a Confirm Javascript PopUp to a ASP.NET GridView", url: "http://www.techtoolblog.com/archives/adding-a-confirm-javascript-popup-to-net-gridview" });</script>]]></description>
			<content:encoded><![CDATA[<p>The more and more I use the GridView control, the more I end up writing my own <code><asp:TemplateField></code> rather then using the DataBound columns because of the additional flexiblity you get when writing your own templates.   </p>
<p>This time I ended up writing my own TemplateField because I need to add a confirm pop up to basically a &#8220;delete&#8221; command (it didn&#8217;t really delete the database record but in fact flagged it as a different type)&#8230; but you get the idea where this might come in handy.  After all you don&#8217;t want users calling saying &#8220;Yeah, I just deleted something I didn&#8217;t mean to&#8221;.  Instead you want to pop up a javascript box with a &#8220;Do you really want to do this&#8230;because I am not fixing it again!&#8221;</p>
<p>Unfortunetly the <code><asp:BoundField></code> doesn&#8217;t offer you an <code>onClientClick</code> event, so this is my work around.</p>
<p>Here is the basic Javascript code to pop up a <a href="http://developer.mozilla.org/en/docs/DOM:window.defaultStatus">confirm button</a>. </p>
<div style="font-family: Courier New; font-size: 8pt; color: black; background: white; border-top: windowtext 1pt solid; padding-top: 0pt; border-left: windowtext 1pt solid; padding-left: 0pt; border-right: windowtext 1pt solid; padding-right: 0pt; border-bottom: windowtext 1pt solid; padding-bottom: 0pt;">
<p style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: maroon;">SCRIPT</span> <span style="color: red;">LANGUAGE</span><span style="color: blue;">=&#8221;JavaScript&#8221;&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp; <span style="color: blue;">function</span> confirmSubmit() {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp; <span style="color: blue;">var</span> agree=confirm(<span style="color: maroon;">&#8220;Do you really want to mark this prospect as in the database?&#8221;</span>);</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp; <span style="color: blue;">if</span> (agree)</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <span style="color: blue;">return</span> <span style="color: blue;">true</span> ;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp; <span style="color: blue;">else</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <span style="color: blue;">return</span> <span style="color: blue;">false</span> ;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp;  }</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp;  <span style="color: blue;">&lt;/</span><span style="color: maroon;">SCRIPT</span><span style="color: blue;">&gt;</span></p>
</div>
<p></p>
<p>Now in your GridView->Column Tag add a <code><asp:TemplateField/></code> and your onClientClick attribute.  This will call your Javascript function above and display a confirm popup to your users.  You also must define a onClick event that points to a function that you will need to create for the server side processing of this request.</p>
<div style="font-family: Courier New; font-size: 8pt; color: black; background: white; border-top: windowtext 1pt solid; padding-top: 0pt; border-left: windowtext 1pt solid; padding-left: 0pt; border-right: windowtext 1pt solid; padding-right: 0pt; border-bottom: windowtext 1pt solid; padding-bottom: 0pt;">
<p style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: maroon;">asp</span><span style="color: blue;">:</span><span style="color: maroon;">TemplateField</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">&lt;</span><span style="color: maroon;">ItemTemplate</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">&lt;</span><span style="color: maroon;">asp</span><span style="color: blue;">:</span><span style="color: maroon;">Button</span> <span style="color: red;">ID</span><span style="color: blue;">=&#8221;btnCustomerExist&#8221;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: red;">text</span><span style="color: blue;">=&#8221;customer exist&#8221;</span> </p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: red;">Runat</span><span style="color: blue;">=Server</span> </p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: red;">OnClick</span><span style="color: blue;">=&#8221;CustomerAlreadyExist&#8221;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: red;">OnClientClick</span><span style="color: blue;">=&#8221;return confirmSubmit()&#8221;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: red;">Width</span><span style="color: blue;">=&#8221;100&#8243;</span> <span style="color: blue;">/&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: blue;">&lt;/</span><span style="color: maroon;">ItemTemplate</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;">&nbsp; <span style="color: blue;">&lt;/</span><span style="color: maroon;">asp</span><span style="color: blue;">:</span><span style="color: maroon;">TemplateField</span><span style="color: blue;">&gt;</span></p>
</div>
<p>If the user clicks &#8220;OK&#8221; on the popup, you will need to handle the server side processing.  I tend to write my own Data Access layer to handle Selects and Deletes so for me it is pretty straight forward from here, I call a function and pass in the unique id from the database.</p>
<div style="font-family: Courier New; font-size: 8pt; color: black; background: white; border-top: windowtext 1pt solid; padding-top: 0pt; border-left: windowtext 1pt solid; padding-left: 0pt; border-right: windowtext 1pt solid; padding-right: 0pt; border-bottom: windowtext 1pt solid; padding-bottom: 0pt;">
<p style="margin: 0px;"><span style="color: blue;">Public</span> <span style="color: blue;">Sub</span> CustomerAlreadyExist(<span style="color: blue;">ByVal</span> sender <span style="color: blue;">As</span> <span style="color: blue;">Object</span>, <span style="color: blue;">ByVal</span> e <span style="color: blue;">As</span> EventArgs)</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">Dim</span> ProspectID <span style="color: blue;">As</span> Int32</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">Dim</span> btnRemoveProspect <span style="color: blue;">As</span> Button = <span style="color: blue;">CType</span>(sender, Button)</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">Dim</span> grdRow <span style="color: blue;">As</span> GridViewRow = <span style="color: blue;">CType</span>(btnRemoveProspect.Parent.Parent, GridViewRow)</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">&#8216;Get ID</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ProspectID = grdRow.Cells(0).Text</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">&#8216;Instant Class</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; myAddProspect = <span style="color: blue;">New</span> AddProspect()</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">&#8216;Removes from Prospect Table</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; myAddProspect.RemoveFromDatabase(ProspectID)</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">&#8216;Refresh Gridview</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Page_Load(sender, e)</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">End</span> <span style="color: blue;">Sub</span></p>
</div>
<p>The End Result</p>
<p><a href="http://www.techtoolblog.com/wp-content/uploads/microsoft/gridviewshot.gif"><img src="http://www.techtoolblog.com/wp-content/uploads/microsoft/_gridviewshot.gif" width="250" height="65" alt="" title=""  /></a></p>
<p>Of course this won&#8217;t stop everyone from accidentally deleting users but it will stop 9/10.</p>
<p><a href="http://sharethis.com/item?&wp=2.3.1&amp;publisher=24accfc2-4cf2-46ea-abf6-c137f8fa267d&amp;title=Adding+a+Confirm+Javascript+PopUp+to+a+ASP.NET+GridView&amp;url=http%3A%2F%2Fwww.techtoolblog.com%2Farchives%2Fadding-a-confirm-javascript-popup-to-net-gridview">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.techtoolblog.com/archives/adding-a-confirm-javascript-popup-to-net-gridview/feed</wfw:commentRss>
		</item>
	</channel>
</rss>

