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

<channel>
	<title>WebPaws.com &#187; ASP</title>
	<atom:link href="http://webpaws.com/blog/tag/asp/feed/" rel="self" type="application/rss+xml" />
	<link>http://webpaws.com/blog</link>
	<description>Internet Marketing and Design Services for Turnkey Web Solutions</description>
	<lastBuildDate>Tue, 24 Jan 2012 22:47:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Proper Date Time format for MySQL from classic ASP code</title>
		<link>http://webpaws.com/blog/163/proper-date-time-format-for-mysql-from-classic-asp-code/</link>
		<comments>http://webpaws.com/blog/163/proper-date-time-format-for-mysql-from-classic-asp-code/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 01:25:47 +0000</pubDate>
		<dc:creator>webpaws</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[Date]]></category>
		<category><![CDATA[Time]]></category>

		<guid isPermaLink="false">http://webpaws.com/blog/?p=163</guid>
		<description><![CDATA[Proper date time format (ISO) for insertion into a MySQL field from classic ASP code<br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://webpaws.com/blog/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br /><p><a href="http://webpaws.com/blog/163/proper-date-time-format-for-mysql-from-classic-asp-code/">Proper Date Time format for MySQL from classic ASP code</a> is a post from: <a href="http://webpaws.com/blog">WebPaws.com</a></p>
]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><!--S-ButtonZ 1.1.5 End--><div class="linkedin_share_container" style="float:right;margin:0px 0px 10px 10px"><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwebpaws.com%2Fblog%2F163%2Fproper-date-time-format-for-mysql-from-classic-asp-code%2F&amp;title=Proper+Date+Time+format+for+MySQL+from+classic+ASP+code&amp;summary=Proper+date+time+format+%28ISO%29+for+insertion+into+a+MySQL+field+from+classic+ASP+code&amp;source=WebPaws.com" onclick="return popupLinkedInShare(this.href,'console',400,570)" class="linkedin_share_button"><img src="http://webpaws.com/blog/wp-content/plugins/linkedin-share-button/buttons/01.png" alt="" /></a></div><p>To properly put the date and time into a MySQL date field, you need to put it into the format of:<br />
<code><br />
yyyy-mm-dd hh:mm:ss<br />
</code></p>
<p>Here is some code to do this in classic ASP for input into a MySQL table:<br />
<code><br />
Dim testdate, testmonth, testday, ISODate<br />
testdate = Request.Form("frmField5")<br />
testmonth = Right(Month(testdate),2)<br />
testday = Right(Day(testdate),2)<br />
ISODate =  Year(testdate) &#038; "-" &#038; testmonth &#038; "-" &#038; testday &#038; " " &#038; hour(testdate) &#038; ":" &#038; minute(testdate) &#038; ":" &#038; second(testdate)<br />
</code></p>
<p>The ISODate variable is in the correct format to insert in a MySQL UPDATE or INSERT SQL statement.  Below is an example SQL string to UPDATE a date field in a MySQL table:<br />
<code><br />
UPDATE myTable SET thisdate = 'ISODate' WHERE myID = 'thisID'<br />
</code></p>
<br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://webpaws.com/blog/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br /><p><a href="http://webpaws.com/blog/163/proper-date-time-format-for-mysql-from-classic-asp-code/">Proper Date Time format for MySQL from classic ASP code</a> is a post from: <a href="http://webpaws.com/blog">WebPaws.com</a></p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://webpaws.com/blog/163/proper-date-time-format-for-mysql-from-classic-asp-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Classic ASP header redirect (302 Object Moved)</title>
		<link>http://webpaws.com/blog/6/classic-asp-header-redirect-302-object-moved/</link>
		<comments>http://webpaws.com/blog/6/classic-asp-header-redirect-302-object-moved/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 21:24:27 +0000</pubDate>
		<dc:creator>webpaws</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[302]]></category>
		<category><![CDATA[303]]></category>
		<category><![CDATA[classic]]></category>
		<category><![CDATA[redirect]]></category>

		<guid isPermaLink="false">http://webpaws.com/blog/?p=6</guid>
		<description><![CDATA[ASP makes it easy to redirect a user to another page. This is a useful trick for redirecting users after form submissions, protecting content on your site by redirecting users to a login page, and pointing an old page address to a new one. Classic ASP header redirect (302 Object Moved) At the top of<a href="http://webpaws.com/blog/6/classic-asp-header-redirect-302-object-moved/"> <br /><br /> (Read More...)</a><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://webpaws.com/blog/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br /><p><a href="http://webpaws.com/blog/6/classic-asp-header-redirect-302-object-moved/">Classic ASP header redirect (302 Object Moved)</a> is a post from: <a href="http://webpaws.com/blog">WebPaws.com</a></p>
]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><!--S-ButtonZ 1.1.5 End--><div class="linkedin_share_container" style="float:right;margin:0px 0px 10px 10px"><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwebpaws.com%2Fblog%2F6%2Fclassic-asp-header-redirect-302-object-moved%2F&amp;title=Classic+ASP+header+redirect+%28302+Object+Moved%29&amp;summary=ASP+makes+it+easy+to+redirect+a+user+to+another+page.+This+is+a%0Auseful+trick+for+redirecting+users+after+form+submissions%2C+protecting%0Acontent+on+your+site+by+redirecting+users+to+a+login+page%2C+and+pointing%0Aan+old+page+address+to+a+new+one.%0AClassic+ASP+header+redirect+%28302+Object+Moved%29%0AAt+the+top+of+your+ASP+document+%28before+any%3Ca+href%3D%22http%3A%2F%2Fwebpaws.com%2Fblog%2F6%2Fclassic-asp-header-redirect-302-object-moved%2F%22%3E+%3Cbr+%2F%3E%3Cbr+%2F%3E+%28Read+More...%29%3C%2Fa%3E&amp;source=WebPaws.com" onclick="return popupLinkedInShare(this.href,'console',400,570)" class="linkedin_share_button"><img src="http://webpaws.com/blog/wp-content/plugins/linkedin-share-button/buttons/01.png" alt="" /></a></div><p>ASP makes it easy to redirect a user to another page. This is a<br />
useful trick for redirecting users after form submissions, protecting<br />
content on your site by redirecting users to a login page, and pointing<br />
an old page address to a new one.</p>
<p><strong>Classic ASP header redirect (302 Object Moved)</strong></p>
<p>At the top of your ASP document (before any HTML code), use the following code:</p>
<p><code>&lt;% Response.Redirect("default.asp") %&gt;</code></p>
<p>This example shows how to redirect a user to a page on your own<br />
site, in the same directory as your redirect page. If you wanted to<br />
redirect a user to a completely different website, simply use the full<br />
URL:</p>
<p><code>&lt;% Response.Redirect("http://www.yourdomain.com") %&gt;</code></p>
<p>The Response.Redirect declarative gives an “Object Moved,” or Status<br />
Code 302 header response. If you want to permanently point an old page<br />
address to a new one using ASP, see below.</p>
<p><strong>Serving a permanent redirect (301) header status code</strong></p>
<p>There may be an instance where you want to point an old page to a<br />
new location. This can be accomplished in ASP by including specific<br />
header information in your code snippet. The following example serves a<br />
301 Redirect (“301 Moved Permanently”) to anyone who accesses the page.</p>
<p>&lt;%<br />
Response.Status=&#8221;301 Moved Permanently&#8221;<br />
Response.AddHeader &#8220;Location&#8221;, &#8220;http://www.thenewdomain.com&#8221;<br />
%&gt;</p>
<br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://webpaws.com/blog/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br /><p><a href="http://webpaws.com/blog/6/classic-asp-header-redirect-302-object-moved/">Classic ASP header redirect (302 Object Moved)</a> is a post from: <a href="http://webpaws.com/blog">WebPaws.com</a></p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://webpaws.com/blog/6/classic-asp-header-redirect-302-object-moved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostBack in ASP.net &#8211; passing variables on postback</title>
		<link>http://webpaws.com/blog/5/postback-in-aspnet-passing-variables-on-postback/</link>
		<comments>http://webpaws.com/blog/5/postback-in-aspnet-passing-variables-on-postback/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 21:22:35 +0000</pubDate>
		<dc:creator>webpaws</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[postback]]></category>
		<category><![CDATA[variable]]></category>
		<category><![CDATA[viewstate]]></category>

		<guid isPermaLink="false">http://webpaws.com/blog/?p=5</guid>
		<description><![CDATA[Be aware that if you set a variable before postback and then check it after postback it will be reset, use Session or ViewState to keep variable values regardless of postback state. ViewState is a collection bag which holds key value pairs of changed control attributes. You can also utilize it to store your own<a href="http://webpaws.com/blog/5/postback-in-aspnet-passing-variables-on-postback/"> <br /><br /> (Read More...)</a><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://webpaws.com/blog/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br /><p><a href="http://webpaws.com/blog/5/postback-in-aspnet-passing-variables-on-postback/">PostBack in ASP.net &#8211; passing variables on postback</a> is a post from: <a href="http://webpaws.com/blog">WebPaws.com</a></p>
]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><!--S-ButtonZ 1.1.5 End--><div class="linkedin_share_container" style="float:right;margin:0px 0px 10px 10px"><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwebpaws.com%2Fblog%2F5%2Fpostback-in-aspnet-passing-variables-on-postback%2F&amp;title=PostBack+in+ASP.net+%26%238211%3B+passing+variables+on+postback&amp;summary=Be+aware+that+if+you+set+a+variable+before+postback+and+then+check+it+after+postback+it+will+be+reset%2C+use+Session+or+ViewState+to+keep+variable+values+regardless+of+postback+state.%0AViewState+is+a+collection+bag+which+holds+key+value+pairs+of+changed+control+attributes.+You+can+also+utilize+it+to+store+your+own+values%3Ca+href%3D%22http%3A%2F%2Fwebpaws.com%2Fblog%2F5%2Fpostback-in-aspnet-passing-variables-on-postback%2F%22%3E+%3Cbr+%2F%3E%3Cbr+%2F%3E+%28Read+More...%29%3C%2Fa%3E&amp;source=WebPaws.com" onclick="return popupLinkedInShare(this.href,'console',400,570)" class="linkedin_share_button"><img src="http://webpaws.com/blog/wp-content/plugins/linkedin-share-button/buttons/01.png" alt="" /></a></div><p>Be aware that if you set a <span class="highlight">variable</span> before <span class="highlight">postback</span> and then check it after <span class="highlight">postback</span> it will be reset, use Session or ViewState to keep <span class="highlight">variable</span> values regardless of <span class="highlight">postback</span> state.</p>
<p>ViewState is a collection bag which holds key value pairs of changed control attributes. You can also utilize it to store your own values which will persist though a Page&#8217;s postbacks. ViewState is a member of Page, which means it is globably accessible throughout your Page. The ViewState is loaded early on in the Page creation (life cycle), and towards the end it is encrypted and outputed into the HTML. Therefore, when you add some data to the ViewState on the first page load, that data is being stored (encrypted) in the __ViewState hidden field you&#8217;ll find in the HTML source.  When <span style="text-decoration: underline;">t</span>he page is loaded again (after you click the button), that value is decrypted and loaded into the ViewState bag, which means you&#8217;ll be able to access it.</p>
<p>Remember to always check if the value you are getting (either from ViewState or Session) is null or not. If not, you&#8217;re users will get the infamous &#8220;Object reference not sent to an instance of an object.&#8221; exception.</p>
<p>ViewState is the mechanism that allows state values to be preserved across page postbacks.</p>
<p>Because of the stateless nature of web pages, regular page member variables will not maintain their values across postbacks.  When we need a page variable to maintain its value across page post backs, we can use ViewState to store that value.  Values stored in ViewState will be serialized and sent to the client browser as the value of a hidden form input.  When you view the page source (in your browser) of a page the uses ViewState, you may see this hidden viewstate input which will look something like this:</p>
<p>&lt;input type=&#8221;hidden&#8221; name=&#8221;__VIEWSTATE&#8221; id=&#8221;__VIEWSTATE&#8221; value=&#8221;/wQPDwAKMTn1ODM5Rj&#8230;&#8230;.&#8221; /&gt;</p>
<p>This single hidden field contains all the viewstate values for all the page controls. This is an important aspect of viewstate that you need to consider.</p>
<h3>Example</h3>
<p>One simple way to store small values in viewstate is to use a property instead of a member variable.  This property can use viewstate to store its value rather than a member variable that would lose the value over a postback. For example, storing an Integer in viewstate can be accomplished like this:</p>
<p>VB</p>
<div style="padding: 5px; color: black; font-family: Courier New; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<p style="margin: 0px;"><span style="color: blue;">Public</span> <span style="color: blue;">Property</span> SomeInteger() <span style="color: blue;">As</span> <span style="color: blue;">Integer</span></p>
<p style="margin: 0px;"><span style="color: blue;">Get</span></p>
<p style="margin: 0px;"><span style="color: blue;">Dim</span> o <span style="color: blue;">As</span> <span style="color: blue;">Object</span> = ViewState(<span>&#8220;SomeInteger&#8221;</span>)</p>
<p style="margin: 0px;"><span style="color: blue;">If</span> <span style="color: blue;">Not</span> o <span style="color: blue;">Is</span> <span style="color: blue;">Nothing</span> <span style="color: blue;">Then</span> <span style="color: blue;">Return</span> <span style="color: blue;">DirectCast</span>(o, <span style="color: blue;">Integer</span>)</p>
<p style="margin: 0px;"><span style="color: blue;">Return</span> 0 <span style="color: green;">&#8216;a default</span></p>
<p style="margin: 0px;"><span style="color: blue;">End</span> <span style="color: blue;">Get</span></p>
<p style="margin: 0px;"><span style="color: blue;">Set</span>(<span style="color: blue;">ByVal</span> value <span style="color: blue;">As</span> <span style="color: blue;">Integer</span>)</p>
<p style="margin: 0px;">ViewState(<span>&#8220;SomeInteger&#8221;</span>) = value</p>
<p style="margin: 0px;"><span style="color: blue;">End</span> <span style="color: blue;">Set</span></p>
<p style="margin: 0px;"><span style="color: blue;">End</span> <span style="color: blue;">Property</span></p>
<p style="margin: 0px;">
</div>
<br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://webpaws.com/blog/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br /><p><a href="http://webpaws.com/blog/5/postback-in-aspnet-passing-variables-on-postback/">PostBack in ASP.net &#8211; passing variables on postback</a> is a post from: <a href="http://webpaws.com/blog">WebPaws.com</a></p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://webpaws.com/blog/5/postback-in-aspnet-passing-variables-on-postback/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Allow page redirect from an asp:linkbutton in an Ajax ModalPopupExtender</title>
		<link>http://webpaws.com/blog/4/allow-page-redirect-in-asplinkbutton-in-ajax-modalpopupextender/</link>
		<comments>http://webpaws.com/blog/4/allow-page-redirect-in-asplinkbutton-in-ajax-modalpopupextender/#comments</comments>
		<pubDate>Sat, 09 Aug 2008 01:11:21 +0000</pubDate>
		<dc:creator>webpaws</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[ModalPopupExtender]]></category>
		<category><![CDATA[net]]></category>
		<category><![CDATA[VB]]></category>

		<guid isPermaLink="false">http://webpaws.com/blog/?p=4</guid>
		<description><![CDATA[Inside a modalpopupextender panel, you need to add and set the UseSubmitBehavior to false for the OK/Cancel controls to be enabled with postback to behave outside of the ajax control. Example: &#60;asp:LinkButton ID="OkButton" runat="server" Text="Button Text" UseSubmitBehavior="false" PostBackUrl="product.aspx?id=3" /&#62; You can also use OnClick in the button to perform an action outside of ajax with<a href="http://webpaws.com/blog/4/allow-page-redirect-in-asplinkbutton-in-ajax-modalpopupextender/"> <br /><br /> (Read More...)</a><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://webpaws.com/blog/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br /><p><a href="http://webpaws.com/blog/4/allow-page-redirect-in-asplinkbutton-in-ajax-modalpopupextender/">Allow page redirect from an asp:linkbutton in an Ajax ModalPopupExtender</a> is a post from: <a href="http://webpaws.com/blog">WebPaws.com</a></p>
]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><!--S-ButtonZ 1.1.5 End--><div class="linkedin_share_container" style="float:right;margin:0px 0px 10px 10px"><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwebpaws.com%2Fblog%2F4%2Fallow-page-redirect-in-asplinkbutton-in-ajax-modalpopupextender%2F&amp;title=Allow+page+redirect+from+an+asp%3Alinkbutton+in+an+Ajax+ModalPopupExtender&amp;summary=Inside+a+modalpopupextender+panel%2C+you+need+to+add+and+set+the+UseSubmitBehavior+to+false+for+the+OK%2FCancel+controls+to+be+enabled+with+postback+to+behave+outside+of+the+ajax+control.%0AExample%3A%0A%0A%26lt%3Basp%3ALinkButton+ID%3D%22OkButton%22+runat%3D%22server%22+Text%3D%22Button+Text%22+UseSubmitBehavior%3D%22false%22+PostBackUrl%3D%22product.aspx%3Fid%3D3%22+%2F%26gt%3B%0A%0AYou+can+also+use+OnClick+in+the+button+to+perform+an+action+outside+of+ajax+with+UseSubmitBehavior%3D%22false%22.+&amp;source=WebPaws.com" onclick="return popupLinkedInShare(this.href,'console',400,570)" class="linkedin_share_button"><img src="http://webpaws.com/blog/wp-content/plugins/linkedin-share-button/buttons/01.png" alt="" /></a></div><p><span style="color: #000000; font-size: small;">Inside a modalpopupextender panel, you need to add and set the UseSubmitBehavior to false for the OK/Cancel controls to be enabled with postback to behave outside of the ajax control.</span></p>
<p><span style="font-size: small; text-decoration: underline;">Example:</span><br />
<code><br />
<span style="color: #000000; font-size: small;">&lt;asp:LinkButton ID="OkButton" runat="server" Text="Button Text" UseSubmitBehavior="false" PostBackUrl="product.aspx?id=3" /&gt;</span><br />
</code></p>
<p><span style="color: #000000; font-size: small;">You can also use OnClick in the button to perform an action outside of ajax with UseSubmitBehavior=&#8221;false&#8221;. </span></p>
<br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://webpaws.com/blog/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br /><p><a href="http://webpaws.com/blog/4/allow-page-redirect-in-asplinkbutton-in-ajax-modalpopupextender/">Allow page redirect from an asp:linkbutton in an Ajax ModalPopupExtender</a> is a post from: <a href="http://webpaws.com/blog">WebPaws.com</a></p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://webpaws.com/blog/4/allow-page-redirect-in-asplinkbutton-in-ajax-modalpopupextender/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

