<?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>Mukesh Chapagain&#039;s Blog &#187; C#</title>
	<atom:link href="http://blog.chapagain.com.np/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.chapagain.com.np</link>
	<description>PHP Magento jQuery SQL Wordpress Joomla Programming &#38; Tutorial</description>
	<lastBuildDate>Tue, 07 Feb 2012 00:54:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Convert string to datetime and datetime to string in C#</title>
		<link>http://blog.chapagain.com.np/convert-string-to-datetime-and-datetime-to-string-in-c/</link>
		<comments>http://blog.chapagain.com.np/convert-string-to-datetime-and-datetime-to-string-in-c/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 17:28:19 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[.net]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=103</guid>
		<description><![CDATA[convert string to datetime string datestring = &#8220;18 March 2008&#8243;; DateTime parseddate = Convert.ToDateTime(datestring); Response.Write(parseddate); convert datetime to string DateTime dtime = DateTime.Today; string date = dtime.ToString(&#8220;yyyyMMdd&#8221;); Response.Write(date); Copyright &#169; 2011 This feed is for personal, non-commercial use only. The use of this feed on other websites breaches copyright. If this content is not in [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/magento-convert-price-from-current-currency-to-base-currency-and-vice-versa/' rel='bookmark' title='Permanent Link: Magento: Convert Price from Current Currency to Base Currency and vice-versa'>Magento: Convert Price from Current Currency to Base Currency and vice-versa</a></li>
<li><a href='http://blog.chapagain.com.np/random-number-string-generation-in-php/' rel='bookmark' title='Permanent Link: Random number, string generation in PHP'>Random number, string generation in PHP</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/php-simple-and-easy-way-to-format-url-string/' rel='bookmark' title='Permanent Link: PHP: Simple and easy way to format URL string'>PHP: Simple and easy way to format URL string</a></li>
<li><a href='http://blog.chapagain.com.np/javascript-how-to-get-current-url-without-query-string/' rel='bookmark' title='Permanent Link: Javascript: How to get current URL without Query string?'>Javascript: How to get current URL without Query string?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><strong>convert string to datetime</strong></p>
<p>string datestring = &#8220;18 March 2008&#8243;;<br />
DateTime parseddate = Convert.ToDateTime(datestring);<br />
Response.Write(parseddate);</p>
<p><strong>convert datetime to string</strong></p>
<p><span id="more-103"></span></p>
<p>DateTime dtime = DateTime.Today;<br />
string date = dtime.ToString(&#8220;yyyyMMdd&#8221;);<br />
Response.Write(date);</p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=103&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/magento-convert-price-from-current-currency-to-base-currency-and-vice-versa/' rel='bookmark' title='Permanent Link: Magento: Convert Price from Current Currency to Base Currency and vice-versa'>Magento: Convert Price from Current Currency to Base Currency and vice-versa</a></li>
<li><a href='http://blog.chapagain.com.np/random-number-string-generation-in-php/' rel='bookmark' title='Permanent Link: Random number, string generation in PHP'>Random number, string generation in PHP</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/php-simple-and-easy-way-to-format-url-string/' rel='bookmark' title='Permanent Link: PHP: Simple and easy way to format URL string'>PHP: Simple and easy way to format URL string</a></li>
<li><a href='http://blog.chapagain.com.np/javascript-how-to-get-current-url-without-query-string/' rel='bookmark' title='Permanent Link: Javascript: How to get current URL without Query string?'>Javascript: How to get current URL without Query string?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/convert-string-to-datetime-and-datetime-to-string-in-c/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dynamically change page title and meta tags in C#</title>
		<link>http://blog.chapagain.com.np/dynamically-change-page-title-and-meta-tags-in-c/</link>
		<comments>http://blog.chapagain.com.np/dynamically-change-page-title-and-meta-tags-in-c/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 17:24:22 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[.net]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=98</guid>
		<description><![CDATA[Change page title and meta tags dynamically/programmatically in C#.net to change page title Page.Title = &#8220;New Page Title&#8221;; to change meta tags // Create instances of an HtmlMeta control. HtmlMeta hm1 = new HtmlMeta(); HtmlMeta hm2 = new HtmlMeta(); // Get a reference to the page header element. HtmlHead head = (HtmlHead)Page.Header; // Define HTML [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/magento-setchange-page-layout-title-tag-meta-keywords-and-description/' rel='bookmark' title='Permanent Link: Magento: Set/Change page layout, title tag, meta keywords and description'>Magento: Set/Change page layout, title tag, meta keywords and description</a></li>
<li><a href='http://blog.chapagain.com.np/meta-tags/' rel='bookmark' title='Permanent Link: What are Meta-Tags? Full Description of Meta tags'>What are Meta-Tags? Full Description of Meta tags</a></li>
<li><a href='http://blog.chapagain.com.np/magento-show-hide-website-to-search-engines-by-adjusting-robots-meta-tag/' rel='bookmark' title='Permanent Link: Magento: Show/Hide website to search engines by adjusting robots meta tag'>Magento: Show/Hide website to search engines by adjusting robots meta tag</a></li>
<li><a href='http://blog.chapagain.com.np/magento-how-to-change-default-page-layout/' rel='bookmark' title='Permanent Link: Magento: How to change default page layout?'>Magento: How to change default page layout?</a></li>
<li><a href='http://blog.chapagain.com.np/magento-set-title-keywords-and-description-in-your-module/' rel='bookmark' title='Permanent Link: Magento: Set title, keywords and description in your module'>Magento: Set title, keywords and description in your module</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Change page title and meta tags dynamically/programmatically in C#.net</p>
<p><strong>to change page title</strong></p>
<p>Page.Title = &#8220;New Page Title&#8221;;</p>
<p><span id="more-98"></span></p>
<p><strong>to change meta tags</strong></p>
<p>// Create instances of an HtmlMeta control.<br />
HtmlMeta hm1 = new HtmlMeta();<br />
HtmlMeta hm2 = new HtmlMeta();</p>
<p>// Get a reference to the page header element.<br />
HtmlHead head = (HtmlHead)Page.Header;</p>
<p>// Define HTML <meta> elements<br />
hm1.Name = &#8220;keywords&#8221;;<br />
hm1.Content = &#8220;keywords of your web page&#8221;;<br />
head.Controls.Add(hm1);</p>
<p>hm2.Name = &#8220;description&#8221;;<br />
hm2.Content = &#8220;description of your web page&#8221;;<br />
head.Controls.Add(hm2);</p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=98&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/magento-setchange-page-layout-title-tag-meta-keywords-and-description/' rel='bookmark' title='Permanent Link: Magento: Set/Change page layout, title tag, meta keywords and description'>Magento: Set/Change page layout, title tag, meta keywords and description</a></li>
<li><a href='http://blog.chapagain.com.np/meta-tags/' rel='bookmark' title='Permanent Link: What are Meta-Tags? Full Description of Meta tags'>What are Meta-Tags? Full Description of Meta tags</a></li>
<li><a href='http://blog.chapagain.com.np/magento-show-hide-website-to-search-engines-by-adjusting-robots-meta-tag/' rel='bookmark' title='Permanent Link: Magento: Show/Hide website to search engines by adjusting robots meta tag'>Magento: Show/Hide website to search engines by adjusting robots meta tag</a></li>
<li><a href='http://blog.chapagain.com.np/magento-how-to-change-default-page-layout/' rel='bookmark' title='Permanent Link: Magento: How to change default page layout?'>Magento: How to change default page layout?</a></li>
<li><a href='http://blog.chapagain.com.np/magento-set-title-keywords-and-description-in-your-module/' rel='bookmark' title='Permanent Link: Magento: Set title, keywords and description in your module'>Magento: Set title, keywords and description in your module</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/dynamically-change-page-title-and-meta-tags-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Page.IsPostBack property: A solution to the client postback problem</title>
		<link>http://blog.chapagain.com.np/pageispostback-property-a-solution-to-the-client-postback-problem/</link>
		<comments>http://blog.chapagain.com.np/pageispostback-property-a-solution-to-the-client-postback-problem/#comments</comments>
		<pubDate>Fri, 05 Oct 2007 11:34:07 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[panel]]></category>
		<category><![CDATA[postback]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/2007/10/05/pageispostback-property-a-solution-to-the-client-postback-problem/</guid>
		<description><![CDATA[Problem There is a .aspx page with some textbox and a submit button. User enters text in the textbox and clicks the submit button. Then the system shows that the data has been successfully posted or updated. But, when we view the database, the data just posted is not entered/updated there. Solution Use Page.IsPostBack property. [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/cascading-stylesheet-css-property-value-pairs/' rel='bookmark' title='Permanent Link: Cascading StyleSheet (CSS) :: Property Value Pairs'>Cascading StyleSheet (CSS) :: Property Value Pairs</a></li>
<li><a href='http://blog.chapagain.com.np/aspnet-error-a-potentially-dangerous-requestform-value-was-detected-from-the-client/' rel='bookmark' title='Permanent Link: ASP.NET Error: A potentially dangerous Request.Form value was detected from the client'>ASP.NET Error: A potentially dangerous Request.Form value was detected from the client</a></li>
<li><a href='http://blog.chapagain.com.np/magento-solution-to-error-404-not-found-in-admin-login-page/' rel='bookmark' title='Permanent Link: Magento: Solution to &#8220;Error: 404 Not Found&#8221; in Admin Login Page'>Magento: Solution to &#8220;Error: 404 Not Found&#8221; in Admin Login Page</a></li>
<li><a href='http://blog.chapagain.com.np/how-to-show-child-page-sub-page-list-in-parent-page-in-wordpress/' rel='bookmark' title='Permanent Link: How to show child page (sub page) list in parent page in wordpress?'>How to show child page (sub page) list in parent page in wordpress?</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="text-align: justify"><strong>Problem</strong><o:p><br />
</o:p></p>
<p class="MsoNormal" style="text-align: justify">There is a .aspx page with some textbox and a submit button.<o:p></o:p></p>
<p class="MsoNormal" style="text-align: justify">User enters text in the textbox and clicks the submit button.<o:p> </o:p></p>
<p><span id="more-21"></span></p>
<p class="MsoNormal" style="text-align: justify">Then the system shows that the data has been successfully posted or updated.<o:p> </o:p></p>
<p class="MsoNormal" style="text-align: justify">But, when we view the database, the data just posted is not entered/updated there.<o:p> </o:p></p>
<p class="MsoNormal" style="text-align: justify"><strong>Solution</strong><o:p><br />
</o:p></p>
<p class="MsoNormal" style="text-align: justify">Use <em>Page.IsPostBack</em> property.<o:p> </o:p></p>
<p class="MsoNormal" style="text-align: justify">This property returns only a Boolean value: <em>true</em> if the page is being loaded in response to a client postback; otherwise, <em>false</em>. Default value is <em>false.</em></p>
<p class="MsoNormal" style="text-align: justify">More clearly:</p>
<p class="MsoNormal" style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in"><!--[if !supportLists]--><span>1)<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal">      </span></span><!--[endif]-->IsPostBack returns <em>false</em> if the page is being loaded and accessed for the first time</p>
<p class="MsoNormal" style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in"><!--[if !supportLists]--><span>2)<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal">      </span></span><!--[endif]-->IsPostBack returns <em>true</em> if the page is being loaded in response to a client postback.</p>
<p class="MsoNormal" style="text-align: justify"><o:p> </o:p><br />
<strong>Sample C# code:</strong><o:p><br />
</o:p></p>
<p class="MsoNormal" style="text-align: justify"><span style="font-size: 10pt; font-family: 'Courier New'">private void Page_Load(object sender, System.EventArgs e)<o:p></o:p><br />
<span></span>{<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align: justify"><span style="font-size: 10pt; font-family: 'Courier New'"><span>   </span>if(!Page.IsPostBack)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align: justify"><span style="font-size: 10pt; font-family: 'Courier New'"><span>   </span>{<span>                       </span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align: justify"><span style="font-size: 10pt; font-family: 'Courier New'"><span>         </span><span></span>// your code to update/insert into database<span>  </span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align: justify"><span style="font-size: 10pt; font-family: 'Courier New'"><span>   </span>} </span></p>
<p class="MsoNormal" style="text-align: justify"><span style="font-size: 10pt; font-family: 'Courier New'"><span> </span>}</span><o:p> </o:p></p>
<p class="MsoNormal" style="text-align: justify">I had this problem when I was doing my semester project on ASP.NET and C#, one year back (well, at that time I had just started learning ASP.NET and C#). Then I googled the internet and found out about panel system (asp:Panel) in ASP.NET, i.e. using different panels to display and edit record/data. This took a lot of time to code and even manage the code and design as well. I had to write the same code twice. I found it very ineffective and again searched for a proper solution. Then I got to learn about IsPostBack property and all my hurdles were gone.<o:p> </o:p></p>
<p class="MsoNormal" style="text-align: justify">Cheers,</p>
<p class="MsoNormal" style="text-align: justify">Mukesh</p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=21&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/cascading-stylesheet-css-property-value-pairs/' rel='bookmark' title='Permanent Link: Cascading StyleSheet (CSS) :: Property Value Pairs'>Cascading StyleSheet (CSS) :: Property Value Pairs</a></li>
<li><a href='http://blog.chapagain.com.np/aspnet-error-a-potentially-dangerous-requestform-value-was-detected-from-the-client/' rel='bookmark' title='Permanent Link: ASP.NET Error: A potentially dangerous Request.Form value was detected from the client'>ASP.NET Error: A potentially dangerous Request.Form value was detected from the client</a></li>
<li><a href='http://blog.chapagain.com.np/magento-solution-to-error-404-not-found-in-admin-login-page/' rel='bookmark' title='Permanent Link: Magento: Solution to &#8220;Error: 404 Not Found&#8221; in Admin Login Page'>Magento: Solution to &#8220;Error: 404 Not Found&#8221; in Admin Login Page</a></li>
<li><a href='http://blog.chapagain.com.np/how-to-show-child-page-sub-page-list-in-parent-page-in-wordpress/' rel='bookmark' title='Permanent Link: How to show child page (sub page) list in parent page in wordpress?'>How to show child page (sub page) list in parent page in wordpress?</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/pageispostback-property-a-solution-to-the-client-postback-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
