<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Dream Asp.net</title>
	<atom:link href="http://sureshsharmaaspdotnet.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sureshsharmaaspdotnet.wordpress.com</link>
	<description>Hi,I am Suresh Sharma from Gorakhpur , UP, India.I have work on .net technology from 2 years. Key skills-Asp.net 2.0,3.5, Sql 2005,2000. Ajax.net 1.1,C#.net</description>
	<lastBuildDate>Wed, 18 Jan 2012 10:34:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sureshsharmaaspdotnet.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Dream Asp.net</title>
		<link>http://sureshsharmaaspdotnet.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sureshsharmaaspdotnet.wordpress.com/osd.xml" title="Dream Asp.net" />
	<atom:link rel='hub' href='http://sureshsharmaaspdotnet.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Fading image using jquery FadeTo</title>
		<link>http://sureshsharmaaspdotnet.wordpress.com/2011/12/10/fading-image-using-jquery-fadeto/</link>
		<comments>http://sureshsharmaaspdotnet.wordpress.com/2011/12/10/fading-image-using-jquery-fadeto/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 15:22:14 +0000</pubDate>
		<dc:creator>Suresh</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://sureshsharmaaspdotnet.wordpress.com/?p=347</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sureshsharmaaspdotnet.wordpress.com&amp;blog=3415865&amp;post=347&amp;subd=sureshsharmaaspdotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: xml;">
xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
 &lt;title&gt;&lt;/title&gt;
 &lt;script src=&quot;Scripts/jquery-1.7.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
 &lt;script&gt;
 window.setInterval(&quot;Method()&quot;, 1000);
 Method = function () {
 var ff = parseFloat($(&quot;img&quot;).css(&quot;opacity&quot;)).toFixed(1);
 // alert(ff);
 if (ff == 0.6)
 $(&quot;img&quot;).fadeTo(&quot;slow&quot;, 1);
 else
 $(&quot;img&quot;).fadeTo(&quot;slow&quot;, 0.6);
 };
 &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;img src=&quot;Images/Bald.jpg&quot; width=400 border=&quot;0&quot; /&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sureshsharmaaspdotnet.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sureshsharmaaspdotnet.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sureshsharmaaspdotnet.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sureshsharmaaspdotnet.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sureshsharmaaspdotnet.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sureshsharmaaspdotnet.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sureshsharmaaspdotnet.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sureshsharmaaspdotnet.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sureshsharmaaspdotnet.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sureshsharmaaspdotnet.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sureshsharmaaspdotnet.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sureshsharmaaspdotnet.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sureshsharmaaspdotnet.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sureshsharmaaspdotnet.wordpress.com/347/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sureshsharmaaspdotnet.wordpress.com&amp;blog=3415865&amp;post=347&amp;subd=sureshsharmaaspdotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sureshsharmaaspdotnet.wordpress.com/2011/12/10/fading-image-using-jquery-fadeto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2f0dde17af6eec75e04b2c575277e124?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sureshsharmaaspdotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Populate Select from ajax with jquery</title>
		<link>http://sureshsharmaaspdotnet.wordpress.com/2011/12/06/populate-select-from-ajax-with-jquery/</link>
		<comments>http://sureshsharmaaspdotnet.wordpress.com/2011/12/06/populate-select-from-ajax-with-jquery/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 11:35:04 +0000</pubDate>
		<dc:creator>Suresh</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[DropDownList]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://sureshsharmaaspdotnet.wordpress.com/?p=344</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sureshsharmaaspdotnet.wordpress.com&amp;blog=3415865&amp;post=344&amp;subd=sureshsharmaaspdotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: xml;">
xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
 &lt;title&gt;&lt;/title&gt;
 &lt;script src=&quot;Scripts/jquery-1.7.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
 &lt;script&gt;
 $(document).ready(function () {

$.ajax({ url: &quot;Fetchdata.ashx&quot;,
 type: &quot;GET&quot;,
 dataType : 'json',
 success: function (msg) {

 $(&quot;#ddlcity&quot;).get(0).options.length = 0;
 $(&quot;#ddlcity&quot;).get(0).options[0] = new Option(&quot;Select City&quot;, &quot;-1&quot;);

$.each(msg, function (k, v) {
 //alert(v);
 $(&quot;#ddlcity&quot;).get(0).options[$(&quot;#ddlcity&quot;).get(0).options.length] = new Option(v.Name, v.ID);
 });
 },
 error: function (msg) { alert(&quot;Error !!!!&quot;); }
 });
 });
 &lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;select id=&quot;ddlcity&quot;&gt;&lt;/select&gt;
&lt;/body&gt;
&lt;/html&gt;

</pre><br />
<pre class="brush: csharp;">
&lt;%@ WebHandler Language=&quot;C#&quot; Class=&quot;Fetchdata&quot; %&gt;

using System;
using System.Web;
using System.Collections.Generic;
public class Fetchdata : IHttpHandler {

 public void ProcessRequest (HttpContext context) {
 context.Response.ContentType = &quot;text/plain&quot;;
 List Objcity = GetList();
 System.Web.Script.Serialization.JavaScriptSerializer objJs = new System.Web.Script.Serialization.JavaScriptSerializer();
 context.Response.Write( objJs.Serialize(Objcity));
 }

 public bool IsReusable {
 get {
 return false;
 }
 }
 public List GetList()
 {
 List&lt;Citydata&gt; item = new List&lt;Citydata&gt;();
 item.Add(new Citydata() { Name = &quot;Delhi&quot;, Id = &quot;1&quot; });
 item.Add(new Citydata() { Name = &quot;Mumbai&quot;, Id = &quot;2&quot; });
 item.Add(new Citydata() { Name = &quot;Kolcatta&quot;, Id = &quot;3&quot; });
 item.Add(new Citydata() { Name = &quot;Chennai&quot;, Id = &quot;4&quot; });
 item.Add(new Citydata() { Name = &quot;Banglore&quot;, Id = &quot;5&quot; });
 item.Add(new Citydata() { Name = &quot;Agra&quot;, Id = &quot;6&quot; });
 return item;
 }
}

public class Citydata
{
 string _Name = string.Empty;

public string Name
 {
 get { return _Name; }
 set { _Name = value; }
 }
 string _Id = string.Empty;

public string Id
 {
 get { return _Id; }
 set { _Id = value; }
 }

}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sureshsharmaaspdotnet.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sureshsharmaaspdotnet.wordpress.com/344/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sureshsharmaaspdotnet.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sureshsharmaaspdotnet.wordpress.com/344/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sureshsharmaaspdotnet.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sureshsharmaaspdotnet.wordpress.com/344/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sureshsharmaaspdotnet.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sureshsharmaaspdotnet.wordpress.com/344/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sureshsharmaaspdotnet.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sureshsharmaaspdotnet.wordpress.com/344/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sureshsharmaaspdotnet.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sureshsharmaaspdotnet.wordpress.com/344/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sureshsharmaaspdotnet.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sureshsharmaaspdotnet.wordpress.com/344/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sureshsharmaaspdotnet.wordpress.com&amp;blog=3415865&amp;post=344&amp;subd=sureshsharmaaspdotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sureshsharmaaspdotnet.wordpress.com/2011/12/06/populate-select-from-ajax-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2f0dde17af6eec75e04b2c575277e124?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sureshsharmaaspdotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>server side validation using regular expression and extension method</title>
		<link>http://sureshsharmaaspdotnet.wordpress.com/2011/11/07/server-side-validation-using-regular-expression-and-extension-method/</link>
		<comments>http://sureshsharmaaspdotnet.wordpress.com/2011/11/07/server-side-validation-using-regular-expression-and-extension-method/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 11:31:35 +0000</pubDate>
		<dc:creator>Suresh</dc:creator>
				<category><![CDATA[asp]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Regex]]></category>
		<category><![CDATA[RegularExpression]]></category>
		<category><![CDATA[Server side validation]]></category>
		<category><![CDATA[Validation]]></category>

		<guid isPermaLink="false">http://sureshsharmaaspdotnet.wordpress.com/?p=335</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sureshsharmaaspdotnet.wordpress.com&amp;blog=3415865&amp;post=335&amp;subd=sureshsharmaaspdotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: csharp;">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DAL
{
	public static class Extention
	{
		 const string MatchEmailPattern =
		   @&quot;^(([\w-]+\.)+[\w-]+|([a-zA-Z]{1}|[\w-]{2,}))@&quot;
	+ @&quot;((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?
				[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.&quot;
	+ @&quot;([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?
				[0-9]{1,2}|25[0-5]|2[0-4][0-9])){1}|&quot;
	+ @&quot;([a-zA-Z]+[\w-]+\.)+[a-zA-Z]{2,4})$&quot;;

		const string NumberPattern=@&quot;^\d$&quot;;
		const string AlphbetPattern = @&quot;^[a-zA-Z]*$&quot;;
		const string AlphanumricPattern = @&quot;^[a-zA-Z0-9]*$&quot;;
		const string AlphNumeric_space = @&quot;[^\w\s]&quot;;
		const string AlphaNumeric_spacial = @&quot;^((?:[A-Za-z0-9-'.,@:?!()$#/\\]+|&amp;[^#])*&amp;?)$&quot;;
		const string AlphaNumeric_Hyphen = @&quot;^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$&quot;;
		//Date Constant/////////////////
		const string Dateyyyydddmm_pattern = @&quot;^(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$&quot;;
		const string Datemmddyyyy_Pattern = @&quot;^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d$&quot;;
		const string Dateddmmyyyy_Pattern = @&quot;^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d$&quot;;
		const string DateddMMMyyyy_Pattern = @&quot;^(0[1-9]|1[012])[- /.](Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[-
/.](19|20)\d\d$&quot;;

		const string
Url_Pattern=@&quot;((www\.|(http|https|ftp|news|file)+\:\/\/)[_.a-z0-9-]+\.[a-z0-9\/_:@=.+?,##%&amp;~-]*[^.|\'|\# |!|\(|?|,|
|&gt;|&lt;|;|\)])&quot;;
		public static bool IsEmail(this string value)
		{
			if (value != null)
                return System.Text.RegularExpressions.Regex.IsMatch(value, MatchEmailPattern,
System.Text.RegularExpressions.RegexOptions.IgnoreCase);
			else
			   return false;
		}
		public static bool IsNumber(this string value)
		{
			if (value != string.Empty)
                return System.Text.RegularExpressions.Regex.IsMatch(value, NumberPattern,
System.Text.RegularExpressions.RegexOptions.IgnoreCase);
			else
				return false;

		}
		public static bool IsAlphabet(this string value)
		{
			if (!string.IsNullOrEmpty(value))
                return System.Text.RegularExpressions.Regex.IsMatch(value, AlphbetPattern,
System.Text.RegularExpressions.RegexOptions.IgnoreCase);
			else
				return false;
		}
		public static bool IsAlphaNumeric(this string value)
		{
			if (!string.IsNullOrEmpty(value))
                return System.Text.RegularExpressions.Regex.IsMatch(value, AlphanumricPattern,
System.Text.RegularExpressions.RegexOptions.IgnoreCase);
			else
				return false;
		}
		public static bool IsAlphaNumeric_Space(this string value)
		{
			if (!string.IsNullOrEmpty(value))
                return System.Text.RegularExpressions.Regex.IsMatch(value, AlphNumeric_space,
System.Text.RegularExpressions.RegexOptions.IgnoreCase);
			else
				return false;
		}
		public static bool IsAlphaNumeric_Spacial(this string value)
		{
			if (!string.IsNullOrEmpty(value))
                return System.Text.RegularExpressions.Regex.IsMatch(value, AlphaNumeric_spacial,
System.Text.RegularExpressions.RegexOptions.IgnoreCase);
			else
				return false;
		}
		public static bool IsAlphaNumeric_Hyphen(this string value)
		{
			if (!string.IsNullOrEmpty(value))
                return System.Text.RegularExpressions.Regex.IsMatch(value, AlphaNumeric_Hyphen,
System.Text.RegularExpressions.RegexOptions.IgnoreCase);
			else
				return false;
		}
		public static bool IsDateyyyydddmm(this string value)
		{
			if (!string.IsNullOrEmpty(value))
                return System.Text.RegularExpressions.Regex.IsMatch(value, Dateyyyydddmm_pattern,
System.Text.RegularExpressions.RegexOptions.IgnoreCase);
			else
				return false;
		}

		public static bool IsDatemmddyyyy(this string value)
		{
			if (!string.IsNullOrEmpty(value))
                return System.Text.RegularExpressions.Regex.IsMatch(value, Datemmddyyyy_Pattern,
System.Text.RegularExpressions.RegexOptions.IgnoreCase);
			else
				return false;
		}
		public static bool IsDateddmmyyyy(this string value)
		{
			if (!string.IsNullOrEmpty(value))
                return System.Text.RegularExpressions.Regex.IsMatch(value, Dateddmmyyyy_Pattern,
System.Text.RegularExpressions.RegexOptions.IgnoreCase);
			else
				return false;
		}
		public static bool IsDateddMMMyyyy(this string value)
		{
			if (!string.IsNullOrEmpty(value))
				return System.Text.RegularExpressions.Regex.IsMatch(value,
DateddMMMyyyy_Pattern,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
			else
				return false;
		}
		public static bool IsUrl_Valid(this string value)
		{
			if (!string.IsNullOrEmpty(value))
                return System.Text.RegularExpressions.Regex.IsMatch(value, Url_Pattern,
System.Text.RegularExpressions.RegexOptions.IgnoreCase);
			else
				return false;
		}
	}

}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sureshsharmaaspdotnet.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sureshsharmaaspdotnet.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sureshsharmaaspdotnet.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sureshsharmaaspdotnet.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sureshsharmaaspdotnet.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sureshsharmaaspdotnet.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sureshsharmaaspdotnet.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sureshsharmaaspdotnet.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sureshsharmaaspdotnet.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sureshsharmaaspdotnet.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sureshsharmaaspdotnet.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sureshsharmaaspdotnet.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sureshsharmaaspdotnet.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sureshsharmaaspdotnet.wordpress.com/335/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sureshsharmaaspdotnet.wordpress.com&amp;blog=3415865&amp;post=335&amp;subd=sureshsharmaaspdotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sureshsharmaaspdotnet.wordpress.com/2011/11/07/server-side-validation-using-regular-expression-and-extension-method/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2f0dde17af6eec75e04b2c575277e124?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sureshsharmaaspdotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>custom  paging in datagrid-repeater-gridview</title>
		<link>http://sureshsharmaaspdotnet.wordpress.com/2011/10/01/seo-custom-paging-in-datagrid-repeater-gridview/</link>
		<comments>http://sureshsharmaaspdotnet.wordpress.com/2011/10/01/seo-custom-paging-in-datagrid-repeater-gridview/#comments</comments>
		<pubDate>Sat, 01 Oct 2011 08:17:44 +0000</pubDate>
		<dc:creator>Suresh</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[Repeater]]></category>
		<category><![CDATA[Datalist]]></category>
		<category><![CDATA[gridview]]></category>
		<category><![CDATA[Paging]]></category>

		<guid isPermaLink="false">http://sureshsharmaaspdotnet.wordpress.com/?p=324</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sureshsharmaaspdotnet.wordpress.com&amp;blog=3415865&amp;post=324&amp;subd=sureshsharmaaspdotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: xml;">
&lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeFile=&quot;Default2.aspx.cs&quot; Inherits=&quot;Default2&quot; %&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head runat=&quot;server&quot;&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;style&gt;
    a{padding:5px;}
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;
    &lt;div&gt;
        &lt;asp:DataGrid ID=&quot;Dgpager&quot; runat=&quot;server&quot; BackColor=&quot;LightGoldenrodYellow&quot;
            BorderColor=&quot;Tan&quot; BorderWidth=&quot;1px&quot; CellPadding=&quot;2&quot; ForeColor=&quot;Black&quot;
            GridLines=&quot;None&quot; Width=&quot;447px&quot;&gt;
            &lt;AlternatingItemStyle BackColor=&quot;PaleGoldenrod&quot; /&gt;
            &lt;FooterStyle BackColor=&quot;Tan&quot; /&gt;
            &lt;HeaderStyle BackColor=&quot;Tan&quot; Font-Bold=&quot;True&quot; /&gt;
            &lt;PagerStyle BackColor=&quot;PaleGoldenrod&quot; ForeColor=&quot;DarkSlateBlue&quot;
                HorizontalAlign=&quot;Center&quot; /&gt;
            &lt;SelectedItemStyle BackColor=&quot;DarkSlateBlue&quot; ForeColor=&quot;GhostWhite&quot; /&gt;
        &lt;/asp:DataGrid&gt;
    &lt;div id=&quot;pagination&quot;&gt;
&lt;asp:Literal ID=&quot;litPaging&quot; runat=&quot;server&quot; EnableViewState=&quot;true&quot;&gt;&lt;/asp:Literal&gt;
&lt;/div&gt;
    &lt;/div&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre><br />
<pre class="brush: csharp;">
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        int totalRecords = 234;
        int pageSize = 10;
        int totalPages = totalRecords / pageSize + (totalRecords % pageSize &gt; 0 ? 1 : 0);
        int NoofNumaricLink = 7;
         int currentPage = 1;
          if (Request.QueryString[&quot;page&quot;] == null)
            currentPage = 1;
        if (Request.QueryString[&quot;page&quot;] != null)
        {
            if (!int.TryParse(Request.QueryString[&quot;page&quot;].ToString(), out currentPage))
                currentPage = 1;
            if (currentPage &gt; totalPages)
                currentPage = totalPages;
        }

        List&lt;Customer&gt; customers =(new Customer()).GetCustomerList();

        var ObjCustomerslist = customers.Skip((currentPage - 1)*pageSize).Take(pageSize);
        Dgpager.DataSource = ObjCustomerslist;
        Dgpager.DataBind();
        litPaging.Text = CreatePageLinks(totalRecords, pageSize, totalPages, NoofNumaricLink,currentPage);

    }

    string CreatePageLinks(int totalRecords, int pageSize, int totalPages, int TotalNoLink, int currentPage)
    {
        if (totalRecords &lt;= pageSize)
            return &quot;&quot;;
        StringBuilder strPager = new StringBuilder();

        string pageUrl = Context.Request.Url.AbsolutePath;

        if (currentPage &gt; 1)
        {
            strPager.Append(string.Format(&quot;&lt;a  href='{1}?page={0}' title='First page'&gt;Fist&lt;/a&gt;&quot;, 1, pageUrl));
            strPager.Append(string.Format(&quot;&lt;a  href='{1}?page={0}' title='Previous page'&gt;Previous&lt;/a&gt;&quot;, (currentPage - 2) + 1,
pageUrl));
        }
        if(!(currentPage &gt; 1))
        {
            strPager.Append(&quot;&lt;a herf='javascript:void(0);' title='First Page'&gt;First&lt;/a&gt;&lt;a herf='javascript:void(0);' title='Previous
page'&gt;Previous&lt;/a&gt;&quot;);
        }
        int min, max;
        if (TotalNoLink &gt;= totalPages)
        {
            min = 1;
            max = totalPages;
        }
        else
        {
            if (currentPage - TotalNoLink / 2 &gt; 0)
                max = (currentPage + TotalNoLink / 2 - (TotalNoLink - 1) % 2);
            else
                max = TotalNoLink;
            if (max &gt; totalPages) max = totalPages;
            min = max - TotalNoLink + 1 &gt; 0 ? max - TotalNoLink + 1 : 1;
        }
        for (int n = min; n &lt;= max; n++)
        {
            if (n &gt; totalPages)
                break;
            if (n == currentPage)
                strPager.Append(String.Format(&quot; {0}&quot;, n.ToString()));
            else
                strPager.Append(String.Format(&quot;&lt;a href='{2}?page={1}' title='{0}'&gt;{0}&lt;/a&gt; &quot;, n, (n - 1) + 1,pageUrl));
        }
        if (currentPage &lt; totalPages)
        {
            strPager.Append(String.Format(&quot;&lt;a href='{1}?page={0}' title='Next Page'&gt;Next&lt;/a&gt; &quot;, currentPage + 1, pageUrl));
            strPager.Append(String.Format(&quot;&lt;a href='{1}?page={0}' title='Last Page'&gt;Last&lt;/a&gt; &quot;, totalPages, pageUrl));
        }
        if (!(currentPage &lt; totalPages))
        {
            strPager.Append(&quot;&lt;a herf='javascript:void(0);' title='Next Page'&gt;Next&lt;/a&gt;&lt;a herf='javascript:void(0);' title='Last
page'&gt;Last&lt;/a&gt;&quot;);
        }

        return strPager.ToString();
    }
}

</pre><br />
<pre class="brush: csharp;">

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class Customer
{
    string uid = string.Empty;

    public string Uid
    {
        get { return uid; }
        set { uid = value; }
    }
    string name = string.Empty;

    public string Name
    {
        get { return name; }
        set { name = value; }
    }
    int age = 0;

    public int Age
    {
        get { return age; }
        set { age = value; }
    }
    public List&lt;Customer&gt; GetCustomerList()
    {
        List&lt;Customer&gt; listitem = new List&lt;Customer&gt;();
        for (int n = 1; n &lt; 245; n++)
        {
            listitem.Add(new Customer() { Uid = n.ToString(), Name = &quot;name&quot; + n.ToString(), Age = n * 10 });
        }
        return listitem;
    }
}

</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sureshsharmaaspdotnet.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sureshsharmaaspdotnet.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sureshsharmaaspdotnet.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sureshsharmaaspdotnet.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sureshsharmaaspdotnet.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sureshsharmaaspdotnet.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sureshsharmaaspdotnet.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sureshsharmaaspdotnet.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sureshsharmaaspdotnet.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sureshsharmaaspdotnet.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sureshsharmaaspdotnet.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sureshsharmaaspdotnet.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sureshsharmaaspdotnet.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sureshsharmaaspdotnet.wordpress.com/324/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sureshsharmaaspdotnet.wordpress.com&amp;blog=3415865&amp;post=324&amp;subd=sureshsharmaaspdotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sureshsharmaaspdotnet.wordpress.com/2011/10/01/seo-custom-paging-in-datagrid-repeater-gridview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2f0dde17af6eec75e04b2c575277e124?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sureshsharmaaspdotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Google like Paging in Asp.net</title>
		<link>http://sureshsharmaaspdotnet.wordpress.com/2011/09/27/google-like-paging-in-asp-net/</link>
		<comments>http://sureshsharmaaspdotnet.wordpress.com/2011/09/27/google-like-paging-in-asp-net/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 12:00:12 +0000</pubDate>
		<dc:creator>Suresh</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://sureshsharmaaspdotnet.wordpress.com/?p=321</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sureshsharmaaspdotnet.wordpress.com&amp;blog=3415865&amp;post=321&amp;subd=sureshsharmaaspdotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: xml;">

&lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeFile=&quot;Default2.aspx.cs&quot; Inherits=&quot;Default2&quot; %&gt;

&lt;!--&lt;span class=&quot;hiddenSpellError&quot; pre=&quot;&quot;--&gt;DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;

xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head runat=&quot;server&quot;&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;style&gt;
    a{padding:5px;}
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;
    &lt;div&gt;
    &lt;div id=&quot;pagination&quot;&gt;
&lt;asp:Literal ID=&quot;litPaging&quot; runat=&quot;server&quot; EnableViewState=&quot;true&quot;&gt;&lt;/asp:Literal&gt;
&lt;/div&gt;
    &lt;/div&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

</pre></p>
<p><pre class="brush: csharp;">

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Security.Cryptography;
using System.Text;

public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        int totalRecords = 234;
        int pageSize = 10;
        int totalPages = totalRecords / pageSize + (totalRecords % pageSize &gt; 0 ? 1 : 0);
        int NoofNumaricLink = 7;
        litPaging.Text = CreatePageLinks(totalRecords, pageSize, totalPages, NoofNumaricLink);

    }
    string CreatePageLinks(int totalRecords, int pageSize,int totalPages, int TotalNoLink)
    {
        if (totalRecords &lt;= pageSize)
            return &quot;&quot;;
        StringBuilder strPager = new StringBuilder();
        int currentPage = 1;
        string pageUrl = Context.Request.Url.AbsolutePath;
        if (Request.QueryString[&quot;page&quot;] == null)
            currentPage = 1;
        if (Request.QueryString[&quot;page&quot;] != null)
        {
            if (!int.TryParse(Request.QueryString[&quot;page&quot;].ToString(), out currentPage))
                currentPage = 1;
            if (currentPage &gt; totalPages)
                currentPage = totalPages;
        }

        if (currentPage &gt; 1)
            strPager.Append(string.Format(&quot;&lt;a title=&quot;Previous page&quot; href=&quot;{1}?page={0}&quot;&gt;Previous&lt;/a&gt;&quot;, (currentPage - 2) + 1, pageUrl));
        int min, max;
        if (TotalNoLink &gt;= totalPages)
        {
            min = 1;
            max = totalPages;
        }
        else
        {
            if (currentPage - TotalNoLink / 2 &gt; 0)
                max = (currentPage + TotalNoLink / 2 - (TotalNoLink - 1) % 2);
            else
                max = TotalNoLink;
            if (max &gt; totalPages) max = totalPages;
            min = max - TotalNoLink + 1 &gt; 0 ? max - TotalNoLink + 1 : 1;
        }
        for (int n = min; n &lt;= max; n++)
        {
            if (n &gt; totalPages)
                break;
            if (n == currentPage)
                strPager.Append(String.Format(&quot; {0}&quot;, n.ToString()));
            else
                strPager.Append(String.Format(&quot;&lt;a title=&quot;{0}&quot; href=&quot;{2}?page={1}&quot;&gt;{0}&lt;/a&gt; &quot;, n, (n - 1) + 1,pageUrl));
        }
        if (currentPage &lt; totalPages)
            strPager.Append(String.Format(&quot;&lt;a title=&quot;{0}&quot; href=&quot;{1}?page={0}&quot;&gt;Next&lt;/a&gt; &quot;, currentPage+1,pageUrl));
        return strPager.ToString();
    }
}

</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sureshsharmaaspdotnet.wordpress.com/321/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sureshsharmaaspdotnet.wordpress.com/321/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sureshsharmaaspdotnet.wordpress.com/321/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sureshsharmaaspdotnet.wordpress.com/321/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sureshsharmaaspdotnet.wordpress.com/321/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sureshsharmaaspdotnet.wordpress.com/321/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sureshsharmaaspdotnet.wordpress.com/321/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sureshsharmaaspdotnet.wordpress.com/321/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sureshsharmaaspdotnet.wordpress.com/321/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sureshsharmaaspdotnet.wordpress.com/321/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sureshsharmaaspdotnet.wordpress.com/321/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sureshsharmaaspdotnet.wordpress.com/321/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sureshsharmaaspdotnet.wordpress.com/321/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sureshsharmaaspdotnet.wordpress.com/321/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sureshsharmaaspdotnet.wordpress.com&amp;blog=3415865&amp;post=321&amp;subd=sureshsharmaaspdotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sureshsharmaaspdotnet.wordpress.com/2011/09/27/google-like-paging-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2f0dde17af6eec75e04b2c575277e124?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sureshsharmaaspdotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>load image or captcha image using jquery and asp.net</title>
		<link>http://sureshsharmaaspdotnet.wordpress.com/2011/08/03/load-image-or-captcha-image-using-jquery-and-asp-net/</link>
		<comments>http://sureshsharmaaspdotnet.wordpress.com/2011/08/03/load-image-or-captcha-image-using-jquery-and-asp-net/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 07:10:33 +0000</pubDate>
		<dc:creator>Suresh</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://sureshsharmaaspdotnet.wordpress.com/?p=318</guid>
		<description><![CDATA[Demo for show image or catptch image on button click using jquery&#8230;&#8230;..<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sureshsharmaaspdotnet.wordpress.com&amp;blog=3415865&amp;post=318&amp;subd=sureshsharmaaspdotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Demo for show image or catptch image on button click using jquery&#8230;&#8230;..</p>
<p><pre class="brush: xml;">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;title&gt;&lt;/title&gt;
&lt;script src=&quot;jquery-1.6.1.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script language=&quot;javascript&quot; &gt;
$(document).ready(function () {
$(&quot;#btnload&quot;).click(function () {
$.get(&quot;data.ashx&quot;, function (data) {

$(&quot;#imgload&quot;).attr(&quot;src&quot;,data);
});

});
});
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;img id=&quot;imgload&quot; border=&quot;0&quot; src=&quot;&quot; /&gt; &lt;br /&gt;
&lt;button id=&quot;btnload&quot;&gt;Load Image&lt;/button&gt;
&lt;/body&gt;
&lt;/html&gt;

</pre></p>
<p><pre class="brush: csharp;">
&lt;%@ WebHandler Language=&quot;C#&quot; %&gt;

using System;
using System.Drawing;
using System.Web;
using System.Drawing.Imaging;
using System.IO;
public class data : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = &quot;text/plain&quot;;
Bitmap bmp = new Bitmap(context.Server.MapPath(&quot;download.jpg&quot;));
using (MemoryStream ms = new MemoryStream())
{
// Convert Image to byte[]
bmp.Save(ms, ImageFormat.Jpeg);
byte[] imageBytes = ms.ToArray();

// Convert byte[] to Base64 String
string base64String = Convert.ToBase64String(imageBytes);
context.Response.Write(&quot;data:image/gif;base64,&quot; + base64String);
context.Response.End();
}
}

public bool IsReusable
{
get
{
return false;
}
}


}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sureshsharmaaspdotnet.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sureshsharmaaspdotnet.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sureshsharmaaspdotnet.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sureshsharmaaspdotnet.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sureshsharmaaspdotnet.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sureshsharmaaspdotnet.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sureshsharmaaspdotnet.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sureshsharmaaspdotnet.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sureshsharmaaspdotnet.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sureshsharmaaspdotnet.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sureshsharmaaspdotnet.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sureshsharmaaspdotnet.wordpress.com/318/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sureshsharmaaspdotnet.wordpress.com/318/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sureshsharmaaspdotnet.wordpress.com/318/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sureshsharmaaspdotnet.wordpress.com&amp;blog=3415865&amp;post=318&amp;subd=sureshsharmaaspdotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sureshsharmaaspdotnet.wordpress.com/2011/08/03/load-image-or-captcha-image-using-jquery-and-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2f0dde17af6eec75e04b2c575277e124?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sureshsharmaaspdotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Sending Mail using CDOSYS</title>
		<link>http://sureshsharmaaspdotnet.wordpress.com/2011/04/06/sending-mail-using-cdosys/</link>
		<comments>http://sureshsharmaaspdotnet.wordpress.com/2011/04/06/sending-mail-using-cdosys/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 13:17:45 +0000</pubDate>
		<dc:creator>Suresh</dc:creator>
				<category><![CDATA[asp]]></category>

		<guid isPermaLink="false">http://sureshsharmaaspdotnet.wordpress.com/?p=301</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sureshsharmaaspdotnet.wordpress.com&amp;blog=3415865&amp;post=301&amp;subd=sureshsharmaaspdotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: csharp;">
&lt;%
dim returnCode
SendMail
if returnCode = True then
 'Put your code when mail send successfull	
else	
'Put your code when mail could not send	end if


sub SendMail()
Set myMail=CreateObject(&quot;CDO.Message&quot;)
myMail.Subject=&quot;Send test Mail using CDOSYS&quot;
myMail.From=&quot;name@yourdomain.com&quot;
myMail.To=&quot;name@yourdomain.com&quot;    'You can also use comma separated Mail
myMail.HTMLBody=&quot;&lt;b&gt;Hi&lt;/b&gt;&lt;br/&gt;&lt;p&gt;How r you.&lt;/p&gt;&lt;p&gt;Test mail sending Program&lt;/p&gt;&quot;
myMail.Configuration.Fields.Item _(&quot;http://schemas.microsoft.com/cdo/configuration/sendusing&quot;)=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _(&quot;http://schemas.microsoft.com/cdo/configuration/smtpserver&quot;)=&quot;localhost&quot;
'Server port
myMail.Configuration.Fields.Item _(&quot;http://schemas.microsoft.com/cdo/configuration/smtpserverport&quot;)=25
myMail.Configuration.Fields.UpdateOn 
Error Resume Next
myMail.Send
If Err.Number = 0 then
returnCode=True
Else
returnCode=False
End If
set myMail=nothing
end sub
%&gt;

</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sureshsharmaaspdotnet.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sureshsharmaaspdotnet.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sureshsharmaaspdotnet.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sureshsharmaaspdotnet.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sureshsharmaaspdotnet.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sureshsharmaaspdotnet.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sureshsharmaaspdotnet.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sureshsharmaaspdotnet.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sureshsharmaaspdotnet.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sureshsharmaaspdotnet.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sureshsharmaaspdotnet.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sureshsharmaaspdotnet.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sureshsharmaaspdotnet.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sureshsharmaaspdotnet.wordpress.com/301/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sureshsharmaaspdotnet.wordpress.com&amp;blog=3415865&amp;post=301&amp;subd=sureshsharmaaspdotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sureshsharmaaspdotnet.wordpress.com/2011/04/06/sending-mail-using-cdosys/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2f0dde17af6eec75e04b2c575277e124?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sureshsharmaaspdotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>get items data at run time using the ItemDataBound, RowDataBound event</title>
		<link>http://sureshsharmaaspdotnet.wordpress.com/2010/11/15/get-items-data-at-run-time-using-the-itemdatabound-rowdatabound-event/</link>
		<comments>http://sureshsharmaaspdotnet.wordpress.com/2010/11/15/get-items-data-at-run-time-using-the-itemdatabound-rowdatabound-event/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 12:02:53 +0000</pubDate>
		<dc:creator>Suresh</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[DataBinder.Eval]]></category>
		<category><![CDATA[Datalist]]></category>
		<category><![CDATA[DataTable]]></category>
		<category><![CDATA[gridview]]></category>

		<guid isPermaLink="false">http://sureshsharmaaspdotnet.wordpress.com/?p=299</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sureshsharmaaspdotnet.wordpress.com&amp;blog=3415865&amp;post=299&amp;subd=sureshsharmaaspdotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: csharp;">
 protected void Page_Load(object sender, EventArgs e)
    {
        DataTable dt = new DataTable();
        //For Fill Data in DataTable 
        dt = clsemp.GetData();
       //For DataList
        DataList1.DataSource = dt;
        DataList1.DataBind();
        //for GridView
        GridView1.DataSource = dt;
        GridView1.DataBind();
        //for repeater
        Repeater1.DataSource = dt;
        Repeater1.DataBind();

    }
    protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            if (e.Item.DataItem != null)
            {
                int intEmployeeId = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, &quot;EmployeeId&quot;));
                string strFName = Convert.ToString(DataBinder.Eval(e.Item.DataItem, &quot;FirstName&quot;));
                string strLName = Convert.ToString(DataBinder.Eval(e.Item.DataItem, &quot;LastName&quot;));

                //work do as per require
            }
        }
    }
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            if (e.Row.DataItem != null)
            {
                int intEmployeeId = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, &quot;EmployeeId&quot;));
                string strFName = Convert.ToString(DataBinder.Eval(e.Row.DataItem, &quot;FirstName&quot;));
                string strLName = Convert.ToString(DataBinder.Eval(e.Row.DataItem, &quot;LastName&quot;));

                //work do as per require
            }
        }
    }
    protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            if (e.Item.DataItem != null)
            {
                int intEmployeeId = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, &quot;EmployeeId&quot;));
                string strFName = Convert.ToString(DataBinder.Eval(e.Item.DataItem, &quot;FirstName&quot;));
                string strLName = Convert.ToString(DataBinder.Eval(e.Item.DataItem, &quot;LastName&quot;));

                //work do as per require
            }
        }

    }
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sureshsharmaaspdotnet.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sureshsharmaaspdotnet.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sureshsharmaaspdotnet.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sureshsharmaaspdotnet.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sureshsharmaaspdotnet.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sureshsharmaaspdotnet.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sureshsharmaaspdotnet.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sureshsharmaaspdotnet.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sureshsharmaaspdotnet.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sureshsharmaaspdotnet.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sureshsharmaaspdotnet.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sureshsharmaaspdotnet.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sureshsharmaaspdotnet.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sureshsharmaaspdotnet.wordpress.com/299/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sureshsharmaaspdotnet.wordpress.com&amp;blog=3415865&amp;post=299&amp;subd=sureshsharmaaspdotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sureshsharmaaspdotnet.wordpress.com/2010/11/15/get-items-data-at-run-time-using-the-itemdatabound-rowdatabound-event/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2f0dde17af6eec75e04b2c575277e124?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sureshsharmaaspdotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Paging ListView With DataPager</title>
		<link>http://sureshsharmaaspdotnet.wordpress.com/2010/11/09/paging-listview-with-datapager/</link>
		<comments>http://sureshsharmaaspdotnet.wordpress.com/2010/11/09/paging-listview-with-datapager/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 12:30:20 +0000</pubDate>
		<dc:creator>Suresh</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Datapager]]></category>
		<category><![CDATA[Listview]]></category>

		<guid isPermaLink="false">http://sureshsharmaaspdotnet.wordpress.com/?p=295</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sureshsharmaaspdotnet.wordpress.com&amp;blog=3415865&amp;post=295&amp;subd=sureshsharmaaspdotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: xml;">
&lt;asp:ListView ID=&quot;EmpListView&quot; runat=&quot;server&quot;&gt;
            &lt;LayoutTemplate&gt;
          
                &lt;tr&gt;
                    &lt;td align=&quot;center&quot;&gt;Employee Data&lt;/td&gt;
                &lt;/tr&gt;
                       
            &lt;/LayoutTemplate&gt;
                            
            &lt;ItemTemplate&gt;
            
                &lt;tr&gt;
                    &lt;td&gt;
                    &lt;br /&gt;
                    Employee Id:&amp;nbsp;&lt;b&gt;&lt;%# Eval(&quot;employeeId&quot;) %&gt;'&gt;&lt;/b&gt;
                    &lt;br /&gt;&lt;br /&gt;
                    Employee Name::&amp;nbsp;&lt;b&gt;&lt;%# Eval(&quot;FirstName&quot;) %&gt;'&gt;&amp;nbsp;&lt;%# Eval(&quot;LastName&quot;) %&gt;'&gt;&lt;/b&gt;
                    &lt;br /&gt;
                    &lt;/td&gt;
                &lt;/tr&gt;
            
            &lt;/ItemTemplate&gt;
                    
        &lt;/asp:ListView&gt;
         &lt;/table&gt;
        &lt;br /&gt;
        &lt;asp:DataPager ID=&quot;PagerRow&quot; runat=&quot;server&quot; PagedControlID=&quot;EmpListView&quot; 
            OnPreRender=&quot;EmpList_PreRender&quot;&gt;
            &lt;Fields&gt;
                &lt;asp:TemplatePagerField&gt;
                    &lt;PagerTemplate&gt;
                        Page
                        &lt;asp:Label runat=&quot;server&quot; ID=&quot;lbCurrentPage&quot; 
                          Text=&quot;&lt;%# Container.TotalRowCount&gt;0 ? (Container.StartRowIndex / Container.PageSize) + 1 : 0 %&gt;&quot; /&gt;
                        of
                        &lt;asp:Label runat=&quot;server&quot; ID=&quot;lbTotalPages&quot; 
                          Text=&quot;&lt;%# Math.Ceiling ((double)Container.TotalRowCount / Container.PageSize) %&gt;&quot; /&gt;
                        (Total:
                        &lt;asp:Label runat=&quot;server&quot; ID=&quot;lbTotalItems&quot; 
                          Text=&quot;&lt;%# Container.TotalRowCount%&gt;&quot; /&gt;
                        records)
                    &lt;br /&gt;&lt;br /&gt;                 
                    &lt;/PagerTemplate&gt;
                &lt;/asp:TemplatePagerField&gt;
                
                
                &lt;asp:NextPreviousPagerField ButtonType =&quot;Button&quot; ShowFirstPageButton=&quot;True&quot; ShowPreviousPageButton=&quot;True&quot; ShowNextPageButton=&quot;True&quot; ShowLastPageButton=&quot;True&quot; /&gt;
               
                &lt;asp:TemplatePagerField OnPagerCommand=&quot;PagerNextPrevious_OnPagerCommand&quot;&gt;
                    &lt;PagerTemplate&gt;                                            
                        &lt;br /&gt;&lt;br /&gt;
                                                
                        &lt;asp:LinkButton ID=&quot;lbtnFirst&quot; runat=&quot;server&quot; CommandName=&quot;First&quot; 
                        Text=&quot;First&quot; Visible='&lt;%# Container.StartRowIndex &gt; 0 %&gt;' /&gt;

                        &lt;asp:LinkButton ID=&quot;lbtnPrevious&quot; runat=&quot;server&quot; CommandName=&quot;Previous&quot; 
                        Text='&lt;%# (Container.StartRowIndex - Container.PageSize + 1) + &quot; - &quot; + (Container.StartRowIndex) %&gt;'
                        Visible='&lt;%# Container.StartRowIndex &gt; 0 %&gt;' /&gt;
                        
                        &lt;asp:Label ID=&quot;lbtnCurrent&quot; runat=&quot;server&quot;
                        Text='&lt;%# (Container.StartRowIndex + 1) + &quot;-&quot; + (Container.StartRowIndex + Container.PageSize &gt; Container.TotalRowCount ? Container.TotalRowCount : Container.StartRowIndex + Container.PageSize) %&gt;' /&gt;
                       
                        &lt;asp:LinkButton ID=&quot;lbtnNext&quot; runat=&quot;server&quot; CommandName=&quot;Next&quot;
                        Text='&lt;%# (Container.StartRowIndex + Container.PageSize + 1) + &quot; - &quot; + (Container.StartRowIndex + Container.PageSize*2 &gt; Container.TotalRowCount ? Container.TotalRowCount : Container.StartRowIndex + Container.PageSize*2) %&gt;' 
                        Visible='&lt;%# (Container.StartRowIndex + Container.PageSize) &lt; Container.TotalRowCount %&gt;' /&gt;
 
                        &lt;asp:LinkButton ID=&quot;lbtnLast&quot; runat=&quot;server&quot; CommandName=&quot;Last&quot; 
                        Text=&quot;Last&quot; Visible='&lt;%# (Container.StartRowIndex + Container.PageSize) &lt; Container.TotalRowCount %&gt;' /&gt;                        
                    &lt;/PagerTemplate&gt;
                &lt;/asp:TemplatePagerField&gt;
                
                &lt;asp:TemplatePagerField OnPagerCommand = &quot;PagerNo_OnPagerCommand&quot;&gt;            
                    &lt;PagerTemplate&gt;
                        &lt;br /&gt;&lt;br /&gt;
                        &lt;asp:TextBox ID=&quot;txtPageNo&quot; runat=&quot;server&quot; Width=&quot;30px&quot; onKeyUp = &quot;value = value.replace(/[^0-9]/g,'')&quot;
                        Text=&quot;&lt;%# Container.TotalRowCount&gt;0 ? (Container.StartRowIndex / Container.PageSize) + 1 : 0 %&gt;&quot; &gt;&lt;/asp:TextBox&gt;
                        &lt;asp:Button ID=&quot;btnsubmit&quot; runat=&quot;server&quot; Text=&quot;Go&quot; /&gt;
                    &lt;/PagerTemplate&gt;            
                &lt;/asp:TemplatePagerField&gt;
            &lt;/Fields&gt;
        &lt;/asp:DataPager&gt;
</pre><br />
<pre class="brush: csharp;">
private void DataBindList()
    {
         connectionlayer dl = new connectionlayer();
         DataSet emp = new DataSet();
         dl.LoadDataSet(CommandType.Text, &quot;SELECT employeeId,LastName,FirstName FROM Employees&quot;, ref emp, &quot;emp&quot;);
         EmpListView.DataSource = emp;
         EmpListView.DataBind();
       
    }



    protected void PagerNextPrevious_OnPagerCommand(object sender, DataPagerCommandEventArgs e)
    {
        switch (e.CommandName)
        {
           
            case &quot;First&quot;:
                e.NewStartRowIndex = 0;
                e.NewMaximumRows = e.Item.Pager.MaximumRows;
                break;
            case &quot;Previous&quot;:
                e.NewStartRowIndex = e.Item.Pager.StartRowIndex - e.Item.Pager.PageSize;
                e.NewMaximumRows = e.Item.Pager.MaximumRows;
                break;
            case &quot;Next&quot;:
                int NewIndexNo = e.Item.Pager.StartRowIndex + e.Item.Pager.PageSize;
                if (NewIndexNo &lt;= e.TotalRowCount)
                {
                    e.NewStartRowIndex = NewIndexNo;
                    e.NewMaximumRows = e.Item.Pager.MaximumRows;
                }
                break;

            case &quot;Last&quot;:
                e.NewStartRowIndex = e.TotalRowCount - e.TotalRowCount % e.Item.Pager.PageSize;
                e.NewMaximumRows = e.Item.Pager.MaximumRows;
                break;
        }
    }

    protected void PagerNo_OnPagerCommand(object sender, DataPagerCommandEventArgs e)
    {
        int NewPageNo = Convert.ToInt32((e.Item.FindControl(&quot;txtPageNo&quot;) as TextBox).Text);
        int NewIndexNo = e.Item.Pager.PageSize * (NewPageNo - 1);
        if (NewIndexNo &lt;= e.TotalRowCount)
        {
            e.NewStartRowIndex = NewIndexNo;
            e.NewMaximumRows = e.Item.Pager.MaximumRows;
        }
    }
    protected void EmpList_PreRender(object sender, EventArgs e)
    {
        DataBindList();
        PagerRow.PageSize = 5;
    }
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sureshsharmaaspdotnet.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sureshsharmaaspdotnet.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sureshsharmaaspdotnet.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sureshsharmaaspdotnet.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sureshsharmaaspdotnet.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sureshsharmaaspdotnet.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sureshsharmaaspdotnet.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sureshsharmaaspdotnet.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sureshsharmaaspdotnet.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sureshsharmaaspdotnet.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sureshsharmaaspdotnet.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sureshsharmaaspdotnet.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sureshsharmaaspdotnet.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sureshsharmaaspdotnet.wordpress.com/295/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sureshsharmaaspdotnet.wordpress.com&amp;blog=3415865&amp;post=295&amp;subd=sureshsharmaaspdotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sureshsharmaaspdotnet.wordpress.com/2010/11/09/paging-listview-with-datapager/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2f0dde17af6eec75e04b2c575277e124?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sureshsharmaaspdotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>add edit and delete xml item using XPath and xmlnode</title>
		<link>http://sureshsharmaaspdotnet.wordpress.com/2010/10/28/add-edit-and-delete-xml-item-using-xpath-and-xmlnode/</link>
		<comments>http://sureshsharmaaspdotnet.wordpress.com/2010/10/28/add-edit-and-delete-xml-item-using-xpath-and-xmlnode/#comments</comments>
		<pubDate>Thu, 28 Oct 2010 19:57:11 +0000</pubDate>
		<dc:creator>Suresh</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[gridview]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[xmlnode]]></category>
		<category><![CDATA[XPath]]></category>

		<guid isPermaLink="false">http://sureshsharmaaspdotnet.wordpress.com/?p=284</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sureshsharmaaspdotnet.wordpress.com&amp;blog=3415865&amp;post=284&amp;subd=sureshsharmaaspdotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: xml;">
&lt;asp:GridView ID=&quot;GridView1&quot;  runat=&quot;server&quot; AutoGenerateColumns=false onrowcommand=&quot;GridView1_RowCommand&quot; PageSize=20 AllowPaging=true Width=&quot;80%&quot; &gt;
                &lt;Columns&gt;

                &lt;asp:TemplateField HeaderText=&quot;Sno.&quot;&gt;
                &lt;ItemTemplate&gt;
                &lt;%#Container.DataItemIndex+1 %&gt;
                &lt;/ItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
                 &lt;asp:TemplateField HeaderText=&quot;Project Name&quot;&gt;
                &lt;ItemTemplate&gt;
                &lt;%#Eval(&quot;ProjectName&quot;) %&gt;
                &lt;/ItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
                 &lt;asp:TemplateField HeaderText=&quot;Client Name&quot;&gt;
                &lt;ItemTemplate&gt;
               &lt;%#Eval(&quot;ClientName&quot;) %&gt;
                &lt;/ItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
                &lt;asp:TemplateField HeaderText=&quot;Images&quot;&gt;
                &lt;ItemTemplate&gt;
                 &lt;img src=&quot;../&lt;%#Eval(&quot;ThumbImage&quot;) %&gt;&quot; width=100 height=100 border=0 /&gt;
                &lt;/ItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
               &lt;asp:TemplateField HeaderText=&quot;Action&quot; &gt;
                &lt;ItemTemplate&gt;
                &lt;asp:LinkButton ID=&quot;lnklink&quot; Text=&quot;Edit&quot; runat=&quot;server&quot; CommandName=&quot;Edit&quot; CommandArgument='&lt;%#Eval(&quot;ProductId&quot;) %&gt;' &gt;&lt;/asp:LinkButton&gt;
                &lt;asp:Button ID=&quot;Button2&quot; runat=&quot;server&quot; Text=&quot;Delete&quot; CommandName=&quot;Del&quot; CommandArgument='&lt;%#Container.DataItemIndex%&gt;' /&gt;

                &lt;/ItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
                &lt;/Columns&gt;
                &lt;/asp:GridView&gt;

</pre></p>
<p><pre class="brush: csharp;">
using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Xml;
using System.Web.UI.WebControls;

public partial class cpanel_Add_Project : System.Web.UI.Page
{
    string  Id
    {
        get
        {
            if (ViewState[&quot;Id&quot;] == null)
                return &quot;&quot;;
            else
                return (string)ViewState[&quot;Id&quot;];
        }
        set
        {
            ViewState[&quot;Id&quot;] = value;
        }
    }
    DataSet Table
    {
        get
        {
            if (ViewState[&quot;Table&quot;] == null)
                return new DataSet();
            else
                return (DataSet)ViewState[&quot;Table&quot;];
        }
        set
        {
            ViewState[&quot;Table&quot;] = value;
        }
    }
    string ThumbImage
    {
        get
        {
            if (ViewState[&quot;ThumbImage&quot;] == null)
                return &quot;&quot;;
            else
                return (string)ViewState[&quot;ThumbImage&quot;];
        }
        set
        {
            ViewState[&quot;ThumbImage&quot;] = value;
        }
    }
   
    protected void Page_Load(object sender, EventArgs e)
    {
        
     
        if (!string.IsNullOrEmpty(Request.QueryString[&quot;id&quot;]))
        {
            Id = Convert.ToString(Request.QueryString[&quot;id&quot;]);
        }
        if (!IsPostBack)
        {
           
                BindData();
            
        }

    }
    class ClsProducts
    {
        string _ProductId = string.Empty;

        public string ProductId
        {
            get { return _ProductId; }
            set { _ProductId = value; }
        }
        string _projectName = string.Empty;

        public string ProjectName
        {
            get { return _projectName; }
            set { _projectName = value; }
        }
        string _clientName = string.Empty;

        public string ClientName
        {
            get { return _clientName; }
            set { _clientName = value; }
        }
        string _thumbImage = string.Empty;

        public string ThumbImage
        {
            get { return _thumbImage; }
            set { _thumbImage = value; }
        }
    }
    private void BindData()
    {
        XmlDocument item = new XmlDocument();

        item.Load(Server.MapPath(&quot;~/&quot;) + &quot;projects.xml&quot;);

        XmlNodeList itemdata = item.SelectNodes(&quot;//projects/project&quot;);
        if (itemdata != null)
        {
            List&lt;ClsProducts&gt; itemProduct = new List&lt;ClsProducts&gt;();
            for (int n = 0; n &lt; itemdata.Count; n++)
            {
                ClsProducts obj = new ClsProducts();
                obj.ProductId = itemdata.Item(n).ChildNodes.Item(0).InnerText;
                obj.ProjectName = itemdata.Item(n).ChildNodes.Item(1).InnerText;
                obj.ClientName = itemdata.Item(n).ChildNodes.Item(2).InnerText;
                obj.ThumbImage = itemdata.Item(n).ChildNodes.Item(3).InnerText;
                itemProduct.Add(obj);

            }
            GridView1.DataSource = itemProduct;
            GridView1.DataBind();
        }
        if (Id != &quot;&quot;)
        {
            XmlNode xlist = item.SelectSingleNode(&quot;//projects/project[projectID=&quot; + Id + &quot;]&quot;);
            if (xlist != null)
            {
                txtProjectName.Value = xlist.ChildNodes.Item(1).InnerText;
                txtprojectClient.Value = xlist.ChildNodes.Item(2).InnerText;
                ThumbImage = xlist.ChildNodes.Item(3).InnerText;
                Image1.ImageUrl = &quot;../&quot; + ThumbImage;
            }
            else
            {
                Image1.Visible = false;
            }
        }
        else
        {
            Image1.Visible = false;
        }
    }
    protected void btnImage_Click(object sender, ImageClickEventArgs e)
    {
        if (UpThumbImage.HasFile)
        {
            string filename = DateTime.Now.ToString(&quot;MMddyyyyHHmmss&quot;) + UpThumbImage.FileName;
            string location = Server.MapPath(&quot;~/images/thumbnails/&quot;) + filename;
            UpThumbImage.PostedFile.SaveAs(location);
            ThumbImage = &quot;images/thumbnails/&quot; + filename;
        }
        else
        {
            if (ThumbImage.Length == 0)
            {
                WebUtility.PageAlert(Page, &quot;Please Upload Images!&quot;);
                return;
            }
        }
        XmlDocument item = new XmlDocument();

        item.Load(Server.MapPath(&quot;~/&quot;) + &quot;projects.xml&quot;);
        if (Id!=&quot;&quot;)
        {
           
            XmlNode xlist = item.SelectSingleNode(&quot;//projects/project[projectID=&quot; + Id + &quot;]&quot;);
            if (xlist != null)
            {
                xlist.ChildNodes.Item(1).InnerText = txtProjectName.Value;
                xlist.ChildNodes.Item(2).InnerText = txtprojectClient.Value;
                xlist.ChildNodes.Item(3).InnerText = ThumbImage;
                item.Save(Server.MapPath(&quot;~/&quot;) + &quot;projects.xml&quot;);


            }

        }
        else
        {
            XmlNodeList xlist1 = item.SelectNodes(&quot;//projects/project&quot;);
            string xmlvalue=&quot;&quot;
    + &quot;&lt;projectID&gt;&quot; + DateTime.Now.ToString(&quot;MMddyyHHmmss&quot;)+ &quot;&lt;/projectID&gt;&quot; +
    &quot;&lt;projectName&gt;&quot;+txtProjectName.Value+&quot;&lt;/projectName&gt;&quot;+
    &quot;&lt;projectClient&gt;&quot;+txtprojectClient.Value+&quot;&lt;/projectClient&gt;&quot;+
    &quot;&lt;imagethumb&gt;&quot;+ThumbImage+&quot;&lt;/imagethumb&gt;&quot;+
    &quot;&quot;;
            XmlNode newnode = item.LastChild.FirstChild.Clone();
             
            newnode.InnerXml = xmlvalue;
            item.LastChild.AppendChild(newnode);
            item.Save(Server.MapPath(&quot;~/&quot;) + &quot;projects.xml&quot;);
        }
        BindData();
    }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == &quot;Edit&quot;)
        {
            Response.Redirect(&quot;Add-Project.aspx?id=&quot; + e.CommandArgument.ToString());
        }
        else if (e.CommandName == &quot;Del&quot;)
        {
            XmlDocument item = new XmlDocument();
           int n = Convert.ToInt32(e.CommandArgument.ToString());
            item.Load(Server.MapPath(&quot;~/&quot;) + &quot;projects.xml&quot;);
            XmlNodeList xlist = item.SelectNodes(&quot;//projects/project&quot;);
            xlist.Item(n).ParentNode.RemoveChild(xlist.Item(n));
            item.Save(Server.MapPath(&quot;~/&quot;) + &quot;projects.xml&quot;);

            WebUtility.PageAlert(Page, &quot;Delete Product successfully&quot;, &quot;Add-Project.aspx&quot;);
        }
    }
}

</pre><br />
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;projects&gt;
  &lt;project&gt;
    &lt;projectID&gt;4&lt;/projectID&gt;
    &lt;projectName&gt;project 4&lt;/projectName&gt;
    &lt;projectClient&gt;client 4&lt;/projectClient&gt;
    &lt;imagethumb&gt;images/thumbnails/4.jpg&lt;/imagethumb&gt;
   &lt;/project&gt;
  &lt;project&gt;
    &lt;projectID&gt;5&lt;/projectID&gt;
    &lt;projectName&gt;project 5&lt;/projectName&gt;
    &lt;projectClient&gt;client 5&lt;/projectClient&gt;
    &lt;imagethumb&gt;images/thumbnails/5.jpg&lt;/imagethumb&gt;
 &lt;/project&gt;
  &lt;project&gt;
    &lt;projectID&gt;6&lt;/projectID&gt;
    &lt;projectName&gt;project 6&lt;/projectName&gt;
    &lt;projectClient&gt;client 6&lt;/projectClient&gt;
    &lt;imagethumb&gt;images/thumbnails/6.jpg&lt;/imagethumb&gt;
&lt;/project&gt;
  &lt;project&gt;
    &lt;projectID&gt;7&lt;/projectID&gt;
    &lt;projectName&gt;project 7&lt;/projectName&gt;
    &lt;projectClient&gt;client 7&lt;/projectClient&gt;
    &lt;imagethumb&gt;images/thumbnails/7.jpg&lt;/imagethumb&gt;
 &lt;/project&gt;
  &lt;project&gt;
    &lt;projectID&gt;102310214626&lt;/projectID&gt;
    &lt;projectName&gt;Rishabh Sharma&lt;/projectName&gt;
    &lt;projectClient&gt;Rishabh client&lt;/projectClient&gt;
    &lt;imagethumb&gt;images/thumbnails/10232010214626client5.png&lt;/imagethumb&gt;
   &lt;/project&gt;
&lt;/projects&gt;
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sureshsharmaaspdotnet.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sureshsharmaaspdotnet.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sureshsharmaaspdotnet.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sureshsharmaaspdotnet.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sureshsharmaaspdotnet.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sureshsharmaaspdotnet.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sureshsharmaaspdotnet.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sureshsharmaaspdotnet.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sureshsharmaaspdotnet.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sureshsharmaaspdotnet.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sureshsharmaaspdotnet.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sureshsharmaaspdotnet.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sureshsharmaaspdotnet.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sureshsharmaaspdotnet.wordpress.com/284/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sureshsharmaaspdotnet.wordpress.com&amp;blog=3415865&amp;post=284&amp;subd=sureshsharmaaspdotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sureshsharmaaspdotnet.wordpress.com/2010/10/28/add-edit-and-delete-xml-item-using-xpath-and-xmlnode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2f0dde17af6eec75e04b2c575277e124?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sureshsharmaaspdotnet</media:title>
		</media:content>
	</item>
	</channel>
</rss>
