<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8892227236862052262</id><updated>2026-10-13T00:34:58.890-07:00</updated><category term="Asp.net C#"/><category term="Sql Server"/><category term="GridView"/><category term="Jquery"/><category term="TreeView"/><category term="Asp.net"/><category term="CSS"/><category term="Chart Control"/><category term="CheckBoxList"/><category term="DataSet"/><category term="DataTable"/><category term="DetailsView"/><category term="Java Script"/><category term="Linq"/><category term="RadioButtonList"/><category term="Rdlc"/><category term="Rich-text Editors"/><category term="blog Trick"/><title type='text'>Code Snippets</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>45</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-4102679022748329518</id><published>2012-02-22T07:17:00.000-08:00</published><updated>2012-03-06T02:02:53.532-08:00</updated><title type='text'>Difference between const and readonly in c#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Difference between const and readonly in c#&lt;/b&gt;&lt;br /&gt;
Following are the &lt;b&gt;difference between  const and readonly .&lt;/b&gt;
&lt;br /&gt;
&lt;b&gt;Const:&amp;nbsp;&lt;/b&gt;
&lt;br /&gt;
&lt;pre style=&quot;text-align: left;&quot;&gt;
1.const can only be initialized at the declaration of the field.
2.const is static by default.
3.Value is evaluated at compile time.
&lt;/pre&gt;
&lt;b&gt;Readonly :&lt;/b&gt;
&lt;pre&gt;
1.Readonly can be initialized either at the declaration or in a constructor.
2.Value is evaluated at run time.
3.Readonly fields can have different values depending on the constructor used.
&lt;/pre&gt;
&lt;b&gt;Example of const and readonly keywords in c# :&lt;/b&gt;
&lt;pre&gt;
class MyClass 
{
     public readonly int y = 20; // Initialize a readonly field
     public readonly int z;

     public const int c1 = 5; // Initialize a const

     public MyClass() 
     {
        z = 24;   // Initialize a readonly instance field in constructor.
     }
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;fieldset&gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/sorting-paging-add-update-delete-in.html&quot; target=&quot;_blank&quot;&gt;Sorting, Paging, Add, Update, Delete in GridView&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/check-uncheck-all-checkbox-in-treeview.html&quot; target=&quot;_blank&quot;&gt;Check / Uncheck all checkbox in treeview using jquery&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/bind-treeview-in-apsnet-c-using-dataset.html&quot; target=&quot;_blank&quot;&gt;Bind Treeview in asp.net c# using dataset&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/4102679022748329518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2012/02/difference-between-const-and-readonly.html#comment-form' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/4102679022748329518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/4102679022748329518'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2012/02/difference-between-const-and-readonly.html' title='Difference between const and readonly in c#'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-2216619881136822651</id><published>2012-02-17T04:13:00.000-08:00</published><updated>2012-03-06T02:03:02.910-08:00</updated><title type='text'>Convert Datatable to generic list collection in c#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Convert Datatable to generic list collection in c#&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Introduction &lt;/b&gt;:In this article i will show you &lt;b&gt;how to convert Datatable to generic list collection in c#&lt;/b&gt; . It is very easy to &lt;b&gt;conversion form DataTable to  generic list collection&lt;/b&gt; .I have&amp;nbsp; showed here as step by step &lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Class Example &lt;/b&gt;
&lt;br /&gt;
&lt;pre&gt;public class City
{
 public int CityId { get; set; }
 public string Cityname { get; set; }
}
&lt;/pre&gt;
&lt;b&gt;C# Code Convert DataTable to generic list collection :&lt;/b&gt;
&lt;br /&gt;
&lt;pre&gt;List&amp;lt;City&amp;gt; CityCollection = new List&amp;lt;City&amp;gt;();

DataSet Ds = GetDataSet(&quot;Select CountryID,CountryName from Countrytable&quot;);
CityCollection = Ds.Tables[0].AsEnumerable().Select(data =&amp;gt; new City() { CityId = (int)data[&quot;CountryID&quot;], Cityname = (string)data[&quot;CountryName&quot;] }).ToList();

public static DataSet GetDataSet(string Query)
{
 DataSet Ds = new DataSet();
 try
 {
  string strCon = @&quot;Data Source=ServerName;Initial Catalog=Test;Integrated Security=True&quot;;
  SqlConnection Con = new SqlConnection(strCon);
  SqlDataAdapter Da = new SqlDataAdapter(Query, Con);
  Da.Fill(Ds);

 }
 catch (Exception) { }
 return Ds;
}

&lt;/pre&gt;

&lt;br /&gt;
&lt;fieldset&gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/sorting-paging-add-update-delete-in.html&quot; target=&quot;_blank&quot;&gt;Sorting, Paging, Add, Update, Delete in GridView&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/check-uncheck-all-checkbox-in-treeview.html&quot; target=&quot;_blank&quot;&gt;Check / Uncheck all checkbox in treeview using jquery&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/bind-treeview-in-apsnet-c-using-dataset.html&quot; target=&quot;_blank&quot;&gt;Bind Treeview in asp.net c# using dataset&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/2216619881136822651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2012/02/convert-datatable-to-generic-list.html#comment-form' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/2216619881136822651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/2216619881136822651'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2012/02/convert-datatable-to-generic-list.html' title='Convert Datatable to generic list collection in c#'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-5638323794243161921</id><published>2012-02-17T03:27:00.000-08:00</published><updated>2012-03-06T02:03:19.863-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Jquery"/><title type='text'>bind DropDownList using jquery ajax in asp.net</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Bind DropDownList using Jquery Ajax in Asp.net&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Introduction &lt;/b&gt;: In this article i will show you how to &lt;b&gt;bind a DropDownList to avoid page refresh via a webmethod&lt;/b&gt; .It is very useful  and many time we require to use Jquery ajax . I have here provided html and c# code behind code to understand Jquery Ajax in asp.net .&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Jquery Ajax Code to Bind dropdownlist in asp.net&lt;/b&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;script src=&quot;Scripts/jquery-1.4.1.min.js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src=&quot;Scripts/jquery-1.4.1.js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src=&quot;Scripts/jquery-1.4.1-vsdoc.js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
 $(document).ready(function () {
  $.ajax({
   type: &quot;POST&quot;,
   contentType: &quot;application/json; charset=utf-8&quot;,
   data: &quot;{}&quot;,
   url: &quot;AjaxInJquery.aspx/GetCityData&quot;,
   dataType: &quot;json&quot;,
   success: ajaxSucceess,
   error: ajaxError
  });
  function ajaxSucceess(response) {
   $.each(response.d, function (key, value) {
    $(&quot;#ddlCategory&quot;).append($(&quot;&amp;lt;option&amp;gt;&amp;lt;/option&amp;gt;&quot;).val(value.CityId).html(value.Cityname));
   });
  }
  function ajaxError(response) {
   alert(response.status + &#39; &#39; + response.statusText);
  }
 });
&amp;lt;/script&amp;gt;
&lt;/pre&gt;
&lt;b&gt;Html Code DropDownList&lt;/b&gt; 
&lt;br /&gt;
&lt;pre&gt;&amp;lt;asp:DropDownList ID=&quot;ddlCategory&quot; runat=&quot;server&quot;&amp;gt;
&amp;lt;/asp:DropDownList&amp;gt;
&lt;/pre&gt;
&lt;b&gt;C# Code for binding Dropdownlist using Jquery Ajax&lt;/b&gt;
&lt;br /&gt;
&lt;pre&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.Services;
using System.Data.SqlClient;

public partial class AjaxInJquery : System.Web.UI.Page
{
 protected void Page_Load(object sender, EventArgs e)
 {

 }
 [WebMethod]
 public static List&lt;city&gt; GetCityData()
 {
  List&lt;city&gt; CityCollection = new List&lt;city&gt;();
  try
  {
   DataSet Ds = GetDataSet(&quot;Select * from Countrytable&quot;);
   CityCollection = Ds.Tables[0].AsEnumerable().Select(data =&amp;gt; new City() { CityId = (int)data[&quot;CountryID&quot;], Cityname = (string)data[&quot;CountryName&quot;] }).ToList();

  }
  catch (Exception) { }
  return CityCollection;
 }
 public static DataSet GetDataSet(string Query)
 {
  DataSet Ds = new DataSet();
  try
  {
   string strCon = @&quot;Data Source=ServerName;Initial Catalog=Test;Integrated Security=True&quot;;
   SqlConnection Con = new SqlConnection(strCon);
   SqlDataAdapter Da = new SqlDataAdapter(Query, Con);
   Da.Fill(Ds);

  }
  catch (Exception) { }
  return Ds;
 }
}
public class City
{
 public int CityId { get; set; }
 public string Cityname { get; set; }
}
&lt;/city&gt;&lt;/city&gt;&lt;/city&gt;&lt;/pre&gt;


&lt;br /&gt;
&lt;fieldset&gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/sorting-paging-add-update-delete-in.html&quot; target=&quot;_blank&quot;&gt;Sorting, Paging, Add, Update, Delete in GridView&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/check-uncheck-all-checkbox-in-treeview.html&quot; target=&quot;_blank&quot;&gt;Check / Uncheck all checkbox in treeview using jquery&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/bind-treeview-in-apsnet-c-using-dataset.html&quot; target=&quot;_blank&quot;&gt;Bind Treeview in asp.net c# using dataset&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/5638323794243161921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2012/02/bind-dropdownlist-using-jquery-ajax-in.html#comment-form' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/5638323794243161921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/5638323794243161921'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2012/02/bind-dropdownlist-using-jquery-ajax-in.html' title='bind DropDownList using jquery ajax in asp.net'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-8580456266964096640</id><published>2012-02-09T08:44:00.000-08:00</published><updated>2012-03-06T02:03:51.042-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Linq"/><title type='text'>Order By Class List&lt;&gt; in C#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Order by Ascending and Descending class List&amp;lt;&amp;gt; in C# :&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Introduction :&lt;/b&gt; In this article i will explain you how to &lt;b&gt;sort class collection ( List&amp;lt;&amp;gt; of class ) in linq c#&lt;/b&gt; . I done the easy code to understand how to uses &lt;b&gt;Order by Ascending and Descending of class list in linq c#&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Class example for sorting class List&amp;lt;&amp;gt; In c#: &lt;/b&gt;Following is the user class example with  constructor in c#.
&lt;pre&gt;
public class User
{
    public int UserId { get; set; }
    public string Firstname { get; set; }
    public User(int userId, string firstname)
    {
        UserId = userId;
        Firstname = firstname;
    }
}
&lt;/pre&gt;
&lt;b&gt;Ascending and Descending Sorting class list in linq C#:&lt;/b&gt;
&lt;pre&gt;List&amp;lt;User&amp;gt; UserList = new List&amp;lt;User&amp;gt;(); 

UserList.Add(new User(1, &quot;bimal&quot;));
UserList.Add(new User(2, &quot;punit&quot;));
UserList.Add(new User(3, &quot;amit&quot;));

UserList = UserList.OrderBy(x =&amp;gt; x.Firstname).ToList();  //Ascending Sorted the class list using linq.
UserList = UserList.OrderByDescending(x =&amp;gt; x.Firstname).ToList();  // Descending Sorted the class list using linq.

&lt;/pre&gt;


&lt;br /&gt;
&lt;fieldset&gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/sorting-paging-add-update-delete-in.html&quot; target=&quot;_blank&quot;&gt;Sorting, Paging, Add, Update, Delete in GridView&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/check-uncheck-all-checkbox-in-treeview.html&quot; target=&quot;_blank&quot;&gt;Check / Uncheck all checkbox in treeview using jquery&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/bind-treeview-in-apsnet-c-using-dataset.html&quot; target=&quot;_blank&quot;&gt;Bind Treeview in asp.net c# using dataset&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/8580456266964096640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2012/02/order-by-class-list-in-c.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/8580456266964096640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/8580456266964096640'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2012/02/order-by-class-list-in-c.html' title='Order By Class List&lt;&gt; in C#'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-8469166228672145131</id><published>2012-02-09T08:14:00.000-08:00</published><updated>2012-03-06T02:04:05.191-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net C#"/><category scheme="http://www.blogger.com/atom/ns#" term="DetailsView"/><title type='text'>Add,Update,delete DetailsView in asp.net c#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Add,Update,Delete,paging with DetailsView in asp.net c#&lt;/b&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVO09f7aW4NBeCW2AGXzoH2-puaFRYtgqVWqYS01Wtn0aTM02n8d2VHFn_92fn7Or69-Q-0NbduEvd9neTp3fO2i8xRxN5KnNx3jAubdxM7bquW4cHZeH2cmlBAJ0ANaroE-QT1Hz2RG_J/s1600/DetailView.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;244&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVO09f7aW4NBeCW2AGXzoH2-puaFRYtgqVWqYS01Wtn0aTM02n8d2VHFn_92fn7Or69-Q-0NbduEvd9neTp3fO2i8xRxN5KnNx3jAubdxM7bquW4cHZeH2cmlBAJ0ANaroE-QT1Hz2RG_J/s320/DetailView.jpg&quot; width=&quot;287&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;Introduction:&lt;/b&gt; In this article i will show you how to &lt;b&gt;bind DetailsView in asp.net c#&lt;/b&gt; . I have implemented all operation like &lt;b&gt;paging ,add ,edit and delete in DetailsView in asp.net c#&lt;/b&gt; .

In following i have written the Css class to format the DetaildView.
&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Html Code for DetailsView in asp.net :&lt;/b&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;DetailView.aspx.cs&quot; Inherits=&quot;HamidSite.DetailView&quot; %&amp;gt;

&amp;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;&amp;gt;
&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&amp;gt;
&amp;lt;head id=&quot;Head1&quot; runat=&quot;server&quot;&amp;gt;
    &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
    &amp;lt;style type=&quot;text/css&quot;&amp;gt;
        .DetailsViewClass
        {
            font-family: verdana,arial,sans-serif;
            font-size: 11px;
            color: #333333;
            border-width: 1px;
            border-color: #999999;
            border-collapse: collapse;
            border-style: solid;
        }
        .Header
        {
            background: #b5cfd2;
            border-width: 1px;
            padding: 8px;
            border-style: solid;
            border-color: #999999;
        }
        .Foter
        {
            background: #dcddc0;
            border-width: 1px;
            padding: 8px;
            border-style: solid;
            border-color: #999999;
        }
        .btn
        {
            background: #ffffff;
            border-width: 1px;
            padding: 2px;
            border-style: solid;
            border-color: #999999;
            font-family: verdana,arial,sans-serif;
            font-size: 11px;
        }
        .textbox
        {
            border-width: 1px;
            padding: 1px;
            border-style: solid;
            border-color: #999999;
            font-family: verdana,arial,sans-serif;
            font-size: 11px;
            width: 100px;
        }
    &amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;form id=&quot;form1&quot; runat=&quot;server&quot;&amp;gt;
    &amp;lt;div&amp;gt;
        &amp;lt;asp:DetailsView ID=&quot;DetailsViewExample&quot; AllowPaging=&quot;true&quot; AutoGenerateRows=&quot;false&quot;
            runat=&quot;server&quot; Height=&quot;50px&quot; CssClass=&quot;DetailsViewClass&quot; CellPadding=&quot;4&quot; OnPageIndexChanging=&quot;DetailsViewExample_PageIndexChanging&quot;
            OnItemCommand=&quot;DetailsViewExample_ItemCommand1&quot; OnItemUpdating=&quot;DetailsViewExample_ItemUpdating&quot;
            OnModeChanging=&quot;DetailsViewExample_ModeChanging&quot; OnItemInserting=&quot;DetailsViewExample_ItemInserting&quot;
            Width=&quot;270px&quot; OnItemDeleting=&quot;DetailsViewExample_ItemDeleting&quot;&amp;gt;
            &amp;lt;Fields&amp;gt;
                &amp;lt;asp:TemplateField HeaderText=&quot;First Name&quot;&amp;gt;
                    &amp;lt;ItemTemplate&amp;gt;
                        &amp;lt;asp:Label ID=&quot;lblID&quot; Text=&#39;&amp;lt;%# Eval(&quot;ID&quot;) %&amp;gt;&#39; Visible=&quot;false&quot; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;
                        &amp;lt;asp:Label ID=&quot;lblFirstName&quot; Text=&#39;&amp;lt;%# Eval(&quot;FirstName&quot;) %&amp;gt;&#39; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;
                    &amp;lt;/ItemTemplate&amp;gt;
                    &amp;lt;EditItemTemplate&amp;gt;
                        &amp;lt;asp:Label ID=&quot;lblIDEdit&quot; Text=&#39;&amp;lt;%# Eval(&quot;ID&quot;) %&amp;gt;&#39; Visible=&quot;false&quot; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;
                        &amp;lt;asp:TextBox ID=&quot;txtFirstname&quot; Text=&#39;&amp;lt;%# Eval(&quot;FirstName&quot;) %&amp;gt;&#39; runat=&quot;server&quot; CssClass=&quot;textbox&quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                    &amp;lt;/EditItemTemplate&amp;gt;
                &amp;lt;/asp:TemplateField&amp;gt;
                &amp;lt;asp:TemplateField HeaderText=&quot;Last Name&quot;&amp;gt;
                    &amp;lt;ItemTemplate&amp;gt;
                        &amp;lt;asp:Label ID=&quot;lblLastName&quot; Text=&#39;&amp;lt;%# Eval(&quot;LastName&quot;) %&amp;gt;&#39; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;
                    &amp;lt;/ItemTemplate&amp;gt;
                    &amp;lt;EditItemTemplate&amp;gt;
                        &amp;lt;asp:TextBox ID=&quot;txtLastName&quot; Text=&#39;&amp;lt;%# Eval(&quot;LastName&quot;) %&amp;gt;&#39; runat=&quot;server&quot; CssClass=&quot;textbox&quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                    &amp;lt;/EditItemTemplate&amp;gt;
                &amp;lt;/asp:TemplateField&amp;gt;
                &amp;lt;asp:TemplateField HeaderText=&quot;City&quot;&amp;gt;
                    &amp;lt;ItemTemplate&amp;gt;
                        &amp;lt;asp:Label ID=&quot;lbldob&quot; Text=&#39;&amp;lt;%# Eval(&quot;City&quot;) %&amp;gt;&#39; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;
                    &amp;lt;/ItemTemplate&amp;gt;
                    &amp;lt;EditItemTemplate&amp;gt;
                        &amp;lt;asp:TextBox ID=&quot;txtCity&quot; Text=&#39;&amp;lt;%# Eval(&quot;City&quot;) %&amp;gt;&#39; runat=&quot;server&quot; CssClass=&quot;textbox&quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                    &amp;lt;/EditItemTemplate&amp;gt;
                &amp;lt;/asp:TemplateField&amp;gt;
                &amp;lt;asp:TemplateField HeaderText=&quot;Address&quot;&amp;gt;
                    &amp;lt;ItemTemplate&amp;gt;
                        &amp;lt;asp:Label ID=&quot;lblAddress&quot; Text=&#39;&amp;lt;%# Eval(&quot;Address&quot;) %&amp;gt;&#39; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;
                    &amp;lt;/ItemTemplate&amp;gt;
                    &amp;lt;EditItemTemplate&amp;gt;
                        &amp;lt;asp:TextBox ID=&quot;txtAddress&quot; Text=&#39;&amp;lt;%# Eval(&quot;Address&quot;) %&amp;gt;&#39; runat=&quot;server&quot; CssClass=&quot;textbox&quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                    &amp;lt;/EditItemTemplate&amp;gt;
                &amp;lt;/asp:TemplateField&amp;gt;
                &amp;lt;asp:TemplateField HeaderText=&quot;Pin No&quot;&amp;gt;
                    &amp;lt;ItemTemplate&amp;gt;
                        &amp;lt;asp:Label ID=&quot;lblPinNo&quot; Text=&#39;&amp;lt;%# Eval(&quot;PinNo&quot;) %&amp;gt;&#39; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;
                    &amp;lt;/ItemTemplate&amp;gt;
                    &amp;lt;EditItemTemplate&amp;gt;
                        &amp;lt;asp:TextBox ID=&quot;txtPinNo&quot; Text=&#39;&amp;lt;%# Eval(&quot;PinNo&quot;) %&amp;gt;&#39; runat=&quot;server&quot; CssClass=&quot;textbox&quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                    &amp;lt;/EditItemTemplate&amp;gt;
                &amp;lt;/asp:TemplateField&amp;gt;
                &amp;lt;asp:TemplateField HeaderText=&quot;Mobile No&quot;&amp;gt;
                    &amp;lt;ItemTemplate&amp;gt;
                        &amp;lt;asp:Label ID=&quot;lblMobileNo&quot; Text=&#39;&amp;lt;%# Eval(&quot;MobileNo&quot;) %&amp;gt;&#39; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;
                    &amp;lt;/ItemTemplate&amp;gt;
                    &amp;lt;EditItemTemplate&amp;gt;
                        &amp;lt;asp:TextBox ID=&quot;txtMobileNo&quot; Text=&#39;&amp;lt;%# Eval(&quot;MobileNo&quot;) %&amp;gt;&#39; runat=&quot;server&quot; CssClass=&quot;textbox&quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                    &amp;lt;/EditItemTemplate&amp;gt;
                &amp;lt;/asp:TemplateField&amp;gt;
                &amp;lt;asp:CommandField Visible=&quot;true&quot; ShowInsertButton=&quot;true&quot; ShowCancelButton=&quot;true&quot;
                    ShowDeleteButton=&quot;true&quot; ShowEditButton=&quot;true&quot; /&amp;gt;
            &amp;lt;/Fields&amp;gt;
            &amp;lt;PagerStyle CssClass=&quot;Foter&quot; /&amp;gt;
            &amp;lt;FieldHeaderStyle Width=&quot;80px&quot; CssClass=&quot;Header&quot; /&amp;gt;
        &amp;lt;/asp:DetailsView&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

&lt;/pre&gt;
&lt;b&gt;C# Code for DetailsView in asp.net c# :&lt;/b&gt;
&lt;br /&gt;
&lt;pre&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

namespace HamidSite
{
    public partial class DetailView : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                bindDetailtView();
            }
        }
        private void bindDetailtView()
        {
            try
            {
                DataSet Ds = GetDataSet(&quot;Select * from Employee&quot;);
                DetailsViewExample.DataSource = Ds;
                DetailsViewExample.DataBind();
            }
            catch (Exception ex) { throw ex; }
        }
        private DataSet GetDataSet(string Query)
        {
            DataSet Ds = new DataSet();
            try
            {
                string strCon = @&quot;Data Source=ServerName;Initial Catalog=Test;Integrated Security=True&quot;;
                SqlConnection Con = new SqlConnection(strCon);
                SqlDataAdapter Da = new SqlDataAdapter(Query, Con);
                Da.Fill(Ds);

            }
            catch (Exception) { }
            return Ds;
        }
        private void ExecuteQuery(string Query)
        {
            try
            {
                string strCon = @&quot;Data Source=ServerName;Initial Catalog=Test;Integrated Security=True&quot;;
                SqlConnection Con = new SqlConnection(strCon);
                Con.Open();
                SqlCommand cmd = new SqlCommand(Query, Con);
                cmd.ExecuteNonQuery();
                Con.Close();
            }
            catch (Exception) { }
        }
        protected void DetailsViewExample_PageIndexChanging(object sender, DetailsViewPageEventArgs e)
        {
            DetailsViewExample.PageIndex = e.NewPageIndex;
            bindDetailtView();
        }
        protected void DetailsViewExample_ItemCommand1(object sender, DetailsViewCommandEventArgs e)
        {
            switch (e.CommandName.ToString())
            {
                case &quot;Edit&quot;:
                    DetailsViewExample.ChangeMode(DetailsViewMode.Edit);
                    bindDetailtView();
                    break;
                case &quot;Cancel&quot;:
                    DetailsViewExample.ChangeMode(DetailsViewMode.ReadOnly);
                    bindDetailtView();
                    break;
                case &quot;New&quot;:
                    DetailsViewExample.ChangeMode(DetailsViewMode.Insert);
                    bindDetailtView();
                    break;
            }
        }
        protected void DetailsViewExample_ModeChanging(object sender, DetailsViewModeEventArgs e)
        {
        }
        protected void DetailsViewExample_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
        {
            TextBox txtFirstname = (TextBox)DetailsViewExample.FindControl(&quot;txtFirstname&quot;);
            TextBox txtLastName = (TextBox)DetailsViewExample.FindControl(&quot;txtLastName&quot;);
            TextBox txtCity = (TextBox)DetailsViewExample.FindControl(&quot;txtCity&quot;);
            TextBox txtAddress = (TextBox)DetailsViewExample.FindControl(&quot;txtAddress&quot;);
            TextBox txtPinNo = (TextBox)DetailsViewExample.FindControl(&quot;txtPinNo&quot;);
            TextBox txtMobileNo = (TextBox)DetailsViewExample.FindControl(&quot;txtMobileNo&quot;);
            Label lblIDEdit = (Label)DetailsViewExample.FindControl(&quot;lblIDEdit&quot;);

            string Query = &quot;Update Employee Set FirstName=&#39;&quot; + txtFirstname.Text + &quot;&#39; ,LastName =&#39;&quot; + txtLastName.Text + &quot;&#39; ,City =&#39;&quot; + txtCity.Text + &quot;&#39;,Address=&#39;&quot; + txtAddress.Text + &quot;&#39;,PinNo=&#39;&quot; + txtPinNo.Text + &quot;&#39;,MobileNo=&#39;&quot; + txtMobileNo.Text + &quot;&#39; where ID =&quot; + lblIDEdit.Text;
            ExecuteQuery(Query);
            DetailsViewExample.ChangeMode(DetailsViewMode.ReadOnly);
            bindDetailtView();
        }
        protected void DetailsViewExample_ItemInserting(object sender, DetailsViewInsertEventArgs e)
        {
            TextBox txtFirstname = (TextBox)DetailsViewExample.FindControl(&quot;txtFirstname&quot;);
            TextBox txtLastName = (TextBox)DetailsViewExample.FindControl(&quot;txtLastName&quot;);
            TextBox txtCity = (TextBox)DetailsViewExample.FindControl(&quot;txtCity&quot;);
            TextBox txtAddress = (TextBox)DetailsViewExample.FindControl(&quot;txtAddress&quot;);
            TextBox txtPinNo = (TextBox)DetailsViewExample.FindControl(&quot;txtPinNo&quot;);
            TextBox txtMobileNo = (TextBox)DetailsViewExample.FindControl(&quot;txtMobileNo&quot;);
            string Query = &quot;Insert into Employee ([FirstName] ,[LastName] ,[City] ,[Address] ,[PinNo] ,[MobileNo]) values (&#39;&quot; + txtFirstname.Text + &quot;&#39; ,&#39;&quot; + txtLastName.Text + &quot;&#39; ,&#39;&quot; + txtCity.Text + &quot;&#39;,&#39;&quot; + txtAddress.Text + &quot;&#39;,&#39;&quot; + txtPinNo.Text + &quot;&#39;,&#39;&quot; + txtMobileNo.Text + &quot;&#39;)&quot;;
            ExecuteQuery(Query);
            DetailsViewExample.ChangeMode(DetailsViewMode.ReadOnly);
            bindDetailtView();
        }
        protected void DetailsViewExample_ItemDeleting(object sender, DetailsViewDeleteEventArgs e)
        {
            Label lblID = (Label)DetailsViewExample.FindControl(&quot;lblID&quot;);
            string Query = &quot;Delete from Employee where ID =&quot; + lblID.Text;
            ExecuteQuery(Query);
            bindDetailtView();
        }
    }
}&lt;/pre&gt;

&lt;br /&gt;
&lt;fieldset&gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/sorting-paging-add-update-delete-in.html&quot; target=&quot;_blank&quot;&gt;Sorting, Paging, Add, Update, Delete in GridView&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/check-uncheck-all-checkbox-in-treeview.html&quot; target=&quot;_blank&quot;&gt;Check / Uncheck all checkbox in treeview using jquery&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/bind-treeview-in-apsnet-c-using-dataset.html&quot; target=&quot;_blank&quot;&gt;Bind Treeview in asp.net c# using dataset&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/8469166228672145131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2012/02/addupdatedelete-detailsview-in-aspnet-c.html#comment-form' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/8469166228672145131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/8469166228672145131'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2012/02/addupdatedelete-detailsview-in-aspnet-c.html' title='Add,Update,delete DetailsView in asp.net c#'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVO09f7aW4NBeCW2AGXzoH2-puaFRYtgqVWqYS01Wtn0aTM02n8d2VHFn_92fn7Or69-Q-0NbduEvd9neTp3fO2i8xRxN5KnNx3jAubdxM7bquW4cHZeH2cmlBAJ0ANaroE-QT1Hz2RG_J/s72-c/DetailView.jpg" height="72" width="72"/><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-5035500283626716928</id><published>2012-01-29T08:47:00.000-08:00</published><updated>2012-03-06T02:08:58.671-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net C#"/><category scheme="http://www.blogger.com/atom/ns#" term="GridView"/><title type='text'>Export gridview to excel in Asp.net</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Export gridview to excel in Asp.net :
&lt;/b&gt;&lt;br /&gt;
&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnLnQ8bI0cIsVm5ERrmpvDYUMAsZIEo8kRVlRGRGbPqekOkVcMfVp9MzQDDgaHGfW1v_RyfD3ltXj01INRzgV26DiCBuugE2Lv9lwqL_bm6Y2dsx76ClkHlZeQIqRSHKaS1SQ4AKPH34L-/s1600/GridView.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;216&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnLnQ8bI0cIsVm5ERrmpvDYUMAsZIEo8kRVlRGRGbPqekOkVcMfVp9MzQDDgaHGfW1v_RyfD3ltXj01INRzgV26DiCBuugE2Lv9lwqL_bm6Y2dsx76ClkHlZeQIqRSHKaS1SQ4AKPH34L-/s320/GridView.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYRT66Hvu1sOwbQluiqtJebYZ5R0i-74c7Gh3LaD5A_hGMf5XDebnhHyQ7SKw3pEP-blAuyHU4DOi0_iS1wUtSw_uCCV3ObJdMjFfGpjFLmfTogqdHabZ9OJ7V1di5prxcRHsdaQtSXb2F/s1600/GridViewExported.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYRT66Hvu1sOwbQluiqtJebYZ5R0i-74c7Gh3LaD5A_hGMf5XDebnhHyQ7SKw3pEP-blAuyHU4DOi0_iS1wUtSw_uCCV3ObJdMjFfGpjFLmfTogqdHabZ9OJ7V1di5prxcRHsdaQtSXb2F/s320/GridViewExported.jpg&quot; width=&quot;293&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/br&gt;
&lt;b&gt;Introduction :&lt;/b&gt; In this article i will show you how to &lt;b&gt;export GridView to excel file&lt;/b&gt;. Many times we require to &lt;b&gt;export the GridView to excel shee&lt;/b&gt;t file.I have here written following &lt;b&gt;code in asp.net c# to export the gridview control to excel sheet&lt;/b&gt; file.&lt;br /&gt;
&lt;/br&gt;
&lt;b&gt;Html code for gridview export to excel sheet :&lt;/b&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;asp:GridView ID=&quot;GridViewExample&quot; runat=&quot;server&quot; AutoGenerateColumns=&quot;False&quot; BackColor=&quot;White&quot;
    BorderColor=&quot;#3366CC&quot; BorderStyle=&quot;None&quot; BorderWidth=&quot;1px&quot; CellPadding=&quot;4&quot;&amp;gt;
    &amp;lt;Columns&amp;gt;
        &amp;lt;asp:TemplateField HeaderText=&quot;City Name&quot; SortExpression=&quot;Name&quot; FooterStyle-Width=&quot;200px&quot;
            ItemStyle-Width=&quot;200px&quot;&amp;gt;
            &amp;lt;ItemTemplate&amp;gt;
                &amp;lt;asp:Label ID=&quot;lblCityName&quot; Text=&#39;&amp;lt;%#Bind(&quot;Name&quot;)%&amp;gt;&#39; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;
            &amp;lt;/ItemTemplate&amp;gt;
            &amp;lt;FooterStyle Width=&quot;200px&quot;&amp;gt;&amp;lt;/FooterStyle&amp;gt;
            &amp;lt;ItemStyle Width=&quot;200px&quot;&amp;gt;&amp;lt;/ItemStyle&amp;gt;
        &amp;lt;/asp:TemplateField&amp;gt;
        &amp;lt;asp:TemplateField HeaderText=&quot;STD Code&quot; SortExpression=&quot;STDCode&quot; FooterStyle-Width=&quot;100px&quot;
            ItemStyle-Width=&quot;100px&quot;&amp;gt;
            &amp;lt;ItemTemplate&amp;gt;
                &amp;lt;asp:Label ID=&quot;lblSTDCOde&quot; Text=&#39;&amp;lt;%#Bind(&quot;STDCode&quot;)%&amp;gt;&#39; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;
            &amp;lt;/ItemTemplate&amp;gt;
            &amp;lt;FooterStyle Width=&quot;100px&quot;&amp;gt;&amp;lt;/FooterStyle&amp;gt;
            &amp;lt;ItemStyle Width=&quot;100px&quot;&amp;gt;&amp;lt;/ItemStyle&amp;gt;
        &amp;lt;/asp:TemplateField&amp;gt;
    &amp;lt;/Columns&amp;gt;
    &amp;lt;FooterStyle BackColor=&quot;#99CCCC&quot; ForeColor=&quot;#003399&quot; /&amp;gt;
    &amp;lt;HeaderStyle BackColor=&quot;#003399&quot; Font-Bold=&quot;True&quot; ForeColor=&quot;#CCCCFF&quot; /&amp;gt;
    &amp;lt;PagerStyle BackColor=&quot;#99CCCC&quot; ForeColor=&quot;#003399&quot; HorizontalAlign=&quot;Left&quot; /&amp;gt;
    &amp;lt;RowStyle BackColor=&quot;White&quot; ForeColor=&quot;#003399&quot; /&amp;gt;
    &amp;lt;SelectedRowStyle BackColor=&quot;#009999&quot; Font-Bold=&quot;True&quot; ForeColor=&quot;#CCFF99&quot; /&amp;gt;
    &amp;lt;SortedAscendingCellStyle BackColor=&quot;#EDF6F6&quot; /&amp;gt;
    &amp;lt;SortedAscendingHeaderStyle BackColor=&quot;#0D4AC4&quot; /&amp;gt;
    &amp;lt;SortedDescendingCellStyle BackColor=&quot;#D6DFDF&quot; /&amp;gt;
    &amp;lt;SortedDescendingHeaderStyle BackColor=&quot;#002876&quot; /&amp;gt;
&amp;lt;/asp:GridView&amp;gt;
&amp;lt;asp:Button ID=&quot;btnExport&quot; BackColor=&quot;#003399&quot; Text=&quot;Export To Excel&quot; runat=&quot;server&quot;
    OnClick=&quot;btnExport_Click&quot; /&amp;gt;
&lt;/pre&gt;
&lt;b&gt;C# Code to export the gridview to excel sheet :
&lt;/b&gt;&lt;br /&gt;
&lt;pre&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.IO;

namespace HamidSite
{
    public partial class GridviewExportToExcel : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindGridView();
            }
        }

        private void BindGridView()
        {
            try
            {
                DataTable Dt = GetDataTable(&quot;Select Name ,stdcode from citytable&quot;);
                GridViewExample.DataSource = Dt;
                GridViewExample.DataBind();

            }
            catch (Exception)
            {
                throw;
            }
        }
        private DataTable GetDataTable(string Query)
        {
            DataSet Ds = new DataSet();
            try
            {
                string strCon = @&quot;Data Source=ServerName;Initial Catalog=Test;Integrated Security=True;&quot;;  //Conntection String
                SqlConnection Con = new SqlConnection(strCon);
                SqlDataAdapter Da = new SqlDataAdapter(Query, Con);
                Da.Fill(Ds);
            }
            catch (Exception) { }
            return Ds.Tables[0];
        }

        protected void btnExport_Click(object sender, EventArgs e)
        {
            Response.Clear();
            Response.AddHeader(&quot;content-disposition&quot;, &quot;attachment;filename=GridViewExample.xls&quot;);
            Response.Charset = &quot;&quot;;
            Response.ContentType = &quot;application/vnd.xls&quot;;

            StringWriter StringWriter = new System.IO.StringWriter();
            HtmlTextWriter HtmlTextWriter = new HtmlTextWriter(StringWriter);

            GridViewExample.RenderControl(HtmlTextWriter);
            Response.Write(StringWriter.ToString());
            Response.End();
        }
        public override void VerifyRenderingInServerForm(Control control)
        {
        }
    }
}
&lt;/pre&gt;

&lt;br /&gt;
&lt;fieldset&gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/sorting-paging-add-update-delete-in.html&quot; target=&quot;_blank&quot;&gt;Sorting, Paging, Add, Update, Delete in GridView&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/check-uncheck-all-checkbox-in-treeview.html&quot; target=&quot;_blank&quot;&gt;Check / Uncheck all checkbox in treeview using jquery&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/bind-treeview-in-apsnet-c-using-dataset.html&quot; target=&quot;_blank&quot;&gt;Bind Treeview in asp.net c# using dataset&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/5035500283626716928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2012/01/export-gridview-to-excel-in-aspnet.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/5035500283626716928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/5035500283626716928'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2012/01/export-gridview-to-excel-in-aspnet.html' title='Export gridview to excel in Asp.net'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnLnQ8bI0cIsVm5ERrmpvDYUMAsZIEo8kRVlRGRGbPqekOkVcMfVp9MzQDDgaHGfW1v_RyfD3ltXj01INRzgV26DiCBuugE2Lv9lwqL_bm6Y2dsx76ClkHlZeQIqRSHKaS1SQ4AKPH34L-/s72-c/GridView.jpg" height="72" width="72"/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-1173280372354690169</id><published>2012-01-28T23:58:00.000-08:00</published><updated>2012-03-06T02:08:26.590-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><title type='text'>Css Class for textbox in asp.net</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Css Class for textbox in asp.net&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Introduction &lt;/b&gt;: In this i will show you &lt;b&gt;Css Class for textbox in asp.net&lt;/b&gt; . You just need &lt;b&gt;apply cssClass  that on textbox&lt;/b&gt; .&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;
Css Class for TextBox :&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;style type=&quot;text/css&quot;&amp;gt;
    .txtclass
    {
        font-family: Tahoma,Arial, Helvetica, sans-serif;
        font-size: 11px;
        color: #000000;
        font-weight: normal;
        text-decoration: none;
        border: 1px solid #888888;
    }
&amp;lt;/style&amp;gt;&lt;/pre&gt;
&lt;/br&gt;
&lt;b&gt;Apply Css Class to textbox as follow :&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;asp:TextBox ID=&quot;txtname&quot; CssClass=&quot;txtclass&quot; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
&lt;/pre&gt;

&lt;br /&gt;
&lt;fieldset&gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/sorting-paging-add-update-delete-in.html&quot; target=&quot;_blank&quot;&gt;Sorting, Paging, Add, Update, Delete in GridView&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/check-uncheck-all-checkbox-in-treeview.html&quot; target=&quot;_blank&quot;&gt;Check / Uncheck all checkbox in treeview using jquery&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/bind-treeview-in-apsnet-c-using-dataset.html&quot; target=&quot;_blank&quot;&gt;Bind Treeview in asp.net c# using dataset&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/1173280372354690169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2012/01/css-class-for-textbox-in-aspnet.html#comment-form' title='16 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/1173280372354690169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/1173280372354690169'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2012/01/css-class-for-textbox-in-aspnet.html' title='Css Class for textbox in asp.net'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>16</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-4516878712949105070</id><published>2012-01-28T03:37:00.000-08:00</published><updated>2012-03-06T02:08:34.721-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Jquery"/><title type='text'>Detect Browser in Jquery</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Detect Browser in Jquery&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Introduction :&lt;/b&gt; In this article i will show &lt;b&gt;how to detect browser in Jquery&lt;/b&gt; . Many times we require &lt;b&gt;to detect browser&lt;/b&gt; and need to do code accordingly as per browser. By using following code &lt;b&gt;you can detect Internet Explorer Browser ,Mozila Browser ,Safari Browser  In Jquery&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Jquery Code to Detect Browser :
&lt;/b&gt;&lt;br /&gt;
&lt;pre&gt;   
&amp;lt;script src=&quot;Scripts/jquery-1.4.1-vsdoc.js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src=&quot;Scripts/jquery-1.4.1.js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src=&quot;Scripts/jquery-1.4.1.min.js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
    $(document).ready(function () {
        if ($.browser.msie) { alert(&#39;Internet Explorer and Version is &#39; + $.browser.version) }
        if ($.browser.safari) { alert(&#39;Safari Browser .&#39;) }
        if ($.browser.mozilla) { alert(&#39;Mozila Browser and Version is &#39; +  $.browser.version) }
    });    
&amp;lt;/script&amp;gt;
&lt;/pre&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;fieldset&gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;br /&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/sorting-paging-add-update-delete-in.html&quot; target=&quot;_blank&quot;&gt;Sorting, Paging, Add, Update, Delete in GridView&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/check-uncheck-all-checkbox-in-treeview.html&quot; target=&quot;_blank&quot;&gt;Check / Uncheck all checkbox in treeview using jquery&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/bind-treeview-in-apsnet-c-using-dataset.html&quot; target=&quot;_blank&quot;&gt;Bind Treeview in asp.net c# using dataset&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/4516878712949105070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2012/01/detect-browser-in-jquery.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/4516878712949105070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/4516878712949105070'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2012/01/detect-browser-in-jquery.html' title='Detect Browser in Jquery'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-4330277548114787063</id><published>2012-01-28T00:34:00.001-08:00</published><updated>2012-01-28T01:08:53.460-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net C#"/><category scheme="http://www.blogger.com/atom/ns#" term="GridView"/><title type='text'>Sorting, Paging, Add, Update, Delete in GridView asp.net c#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Sorting, Paging, Add, Update, Delete in GridView asp.net c#&lt;/b&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIgVA0HTDeSP3eKUiUasvkfjkSFw8WLTOCRyNfrwiLB44Uu_Y9KoalDelyFUrbVlfgik7sWIqju89z9FbtZiwcWgzPEJVzgUEm-zyB4f8cr7Ocd6UorzHhsMUNGoOx5VSs7wZH-hhPwKn9/s1600/GridView_Example.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;183&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIgVA0HTDeSP3eKUiUasvkfjkSFw8WLTOCRyNfrwiLB44Uu_Y9KoalDelyFUrbVlfgik7sWIqju89z9FbtZiwcWgzPEJVzgUEm-zyB4f8cr7Ocd6UorzHhsMUNGoOx5VSs7wZH-hhPwKn9/s320/GridView_Example.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Introduction &lt;/b&gt;: In this article i will show &lt;b&gt;full functional Gridview with Sorting, Paging , Add ,Update ,delete operation&lt;/b&gt; .The &lt;b&gt;GridView control&lt;/b&gt; is used to display the values of a data source in a table. It is very useful asp.net control .Here I have written the code for Sorting , Paging , Update , Delete , Add with footer row .&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
The Code for &lt;b&gt;All operations in GridVeiw&lt;/b&gt; that i have written is very easy understand and easy to implement in you application .&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;
Html Code For Gridview with Sorting, Paging , Add ,Update ,delete operation In Asp.net:&amp;nbsp;&lt;/b&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;table&amp;gt;
    &amp;lt;tr&amp;gt;
        &amp;lt;td&amp;gt;
            &amp;lt;asp:Label ID=&quot;lblmsg&quot; runat=&quot;server&quot; ForeColor=&quot;Red&quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;
        &amp;lt;/td&amp;gt;
    &amp;lt;/tr&amp;gt;
    &amp;lt;tr&amp;gt;
        &amp;lt;td&amp;gt;
            &amp;lt;asp:GridView AllowSorting=&quot;True&quot; AllowPaging=&quot;True&quot; PageSize=&quot;3&quot; ID=&quot;GVCity&quot; runat=&quot;server&quot;
                AutoGenerateColumns=&quot;False&quot; OnRowCommand=&quot;GVCity_RowCommand&quot; OnPageIndexChanging=&quot;GVCity_PageIndexChanging&quot;
                OnSorting=&quot;GVCity_Sorting&quot; BackColor=&quot;White&quot; BorderColor=&quot;#CC9966&quot; BorderStyle=&quot;None&quot;
                BorderWidth=&quot;1px&quot; CellPadding=&quot;4&quot;&amp;gt;
                &amp;lt;Columns&amp;gt;
                    &amp;lt;asp:TemplateField HeaderText=&quot;City Name&quot; SortExpression=&quot;Name&quot; FooterStyle-Width=&quot;200px&quot;
                        ItemStyle-Width=&quot;200px&quot;&amp;gt;
                        &amp;lt;ItemTemplate&amp;gt;
                            &amp;lt;asp:Label ID=&quot;lblCityName&quot; Text=&#39;&amp;lt;%#Bind(&quot;Name&quot;)%&amp;gt;&#39; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;
                            &amp;lt;asp:Label ID=&quot;lblCityId&quot; Visible=&quot;false&quot; Text=&#39;&amp;lt;%#Bind(&quot;CityId&quot;)%&amp;gt;&#39; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;
                        &amp;lt;/ItemTemplate&amp;gt;
                        &amp;lt;EditItemTemplate&amp;gt;
                            &amp;lt;asp:TextBox ID=&quot;txtEditCityName&quot; Text=&#39;&amp;lt;%#Bind(&quot;Name&quot;)%&amp;gt;&#39; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                            &amp;lt;asp:Label ID=&quot;lblCityIdEdit&quot; Visible=&quot;false&quot; Text=&#39;&amp;lt;%#Bind(&quot;CityId&quot;)%&amp;gt;&#39; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;
                            &amp;lt;asp:RequiredFieldValidator ID=&quot;rfvEditCityname&quot; ValidationGroup=&quot;Edit&quot; runat=&quot;server&quot;
                                SetFocusOnError=&quot;true&quot; Display=&quot;Dynamic&quot; ControlToValidate=&quot;txtEditCityName&quot;
                                ErrorMessage=&quot;Please , Enter City Name.&quot;&amp;gt;&amp;lt;/asp:RequiredFieldValidator&amp;gt;
                        &amp;lt;/EditItemTemplate&amp;gt;
                        &amp;lt;FooterTemplate&amp;gt;
                            &amp;lt;asp:TextBox ID=&quot;txtFooterCityName&quot; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                            &amp;lt;asp:RequiredFieldValidator ID=&quot;rfvFooterCityname&quot; ValidationGroup=&quot;Footer&quot; runat=&quot;server&quot;
                                SetFocusOnError=&quot;true&quot; Display=&quot;Dynamic&quot; ControlToValidate=&quot;txtFooterCityName&quot;
                                ErrorMessage=&quot;Please , Enter City Name.&quot;&amp;gt;&amp;lt;/asp:RequiredFieldValidator&amp;gt;
                        &amp;lt;/FooterTemplate&amp;gt;
                        &amp;lt;FooterStyle Width=&quot;200px&quot;&amp;gt;&amp;lt;/FooterStyle&amp;gt;
                        &amp;lt;ItemStyle Width=&quot;200px&quot;&amp;gt;&amp;lt;/ItemStyle&amp;gt;
                    &amp;lt;/asp:TemplateField&amp;gt;
                    &amp;lt;asp:TemplateField HeaderText=&quot;STD Code&quot; SortExpression=&quot;STDCode&quot; FooterStyle-Width=&quot;100px&quot;
                        ItemStyle-Width=&quot;100px&quot;&amp;gt;
                        &amp;lt;ItemTemplate&amp;gt;
                            &amp;lt;asp:Label ID=&quot;lblSTDCOde&quot; Text=&#39;&amp;lt;%#Bind(&quot;STDCode&quot;)%&amp;gt;&#39; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;
                        &amp;lt;/ItemTemplate&amp;gt;
                        &amp;lt;EditItemTemplate&amp;gt;
                            &amp;lt;asp:TextBox ID=&quot;txtEditSTDCOde&quot; Text=&#39;&amp;lt;%#Bind(&quot;STDCode&quot;)%&amp;gt;&#39; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                        &amp;lt;/EditItemTemplate&amp;gt;
                        &amp;lt;FooterTemplate&amp;gt;
                            &amp;lt;asp:TextBox ID=&quot;txtFooterSTDCOde&quot; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                        &amp;lt;/FooterTemplate&amp;gt;
                        &amp;lt;FooterStyle Width=&quot;100px&quot;&amp;gt;&amp;lt;/FooterStyle&amp;gt;
                        &amp;lt;ItemStyle Width=&quot;100px&quot;&amp;gt;&amp;lt;/ItemStyle&amp;gt;
                    &amp;lt;/asp:TemplateField&amp;gt;
                    &amp;lt;asp:TemplateField&amp;gt;
                        &amp;lt;HeaderTemplate&amp;gt;
                            Actions
                        &amp;lt;/HeaderTemplate&amp;gt;
                        &amp;lt;FooterTemplate&amp;gt;
                            &amp;lt;table cellpadding=&quot;2&quot;&amp;gt;
                                &amp;lt;tr&amp;gt;
                                    &amp;lt;td&amp;gt;
                                        &amp;lt;asp:ImageButton ID=&quot;imgBtnAdd&quot; CssClass=&quot;imgButton&quot; ImageUrl=&quot;~/Images/save.png&quot;
                                            runat=&quot;server&quot; CommandName=&quot;AddSave&quot; ValidationGroup=&quot;Footer&quot; ToolTip=&quot;Save&quot;
                                            CausesValidation=&quot;true&quot; /&amp;gt;
                                        &amp;lt;asp:ImageButton ID=&quot;ImageBtnCancel&quot; CssClass=&quot;imgButton&quot; runat=&quot;server&quot; ImageUrl=&quot;~/Images/cancel.gif&quot;
                                            CommandName=&quot;AddCancel&quot; ToolTip=&quot;Cancel&quot; CausesValidation=&quot;false&quot; /&amp;gt;
                                    &amp;lt;/td&amp;gt;
                                &amp;lt;/tr&amp;gt;
                            &amp;lt;/table&amp;gt;
                        &amp;lt;/FooterTemplate&amp;gt;
                        &amp;lt;EditItemTemplate&amp;gt;
                            &amp;lt;table cellpadding=&quot;2&quot;&amp;gt;
                                &amp;lt;tr&amp;gt;
                                    &amp;lt;td&amp;gt;
                                        &amp;lt;asp:ImageButton ID=&quot;imgBtnEditSave&quot; AlternateText=&quot;Save&quot; CssClass=&quot;imgButton&quot; runat=&quot;server&quot;
                                            CommandName=&quot;EditSave&quot; ToolTip=&quot;Save&quot; ValidationGroup=&quot;Edit&quot; CausesValidation=&quot;true&quot;
                                            ImageUrl=&quot;~/Images/save.png&quot; /&amp;gt;
                                        &amp;lt;asp:ImageButton ID=&quot;ImageEditCancel&quot; AlternateText=&quot;Cancel&quot; CssClass=&quot;imgButton&quot;
                                            runat=&quot;server&quot; CommandName=&quot;EditCancel&quot; CausesValidation=&quot;false&quot; ImageUrl=&quot;~/Images/cancel.gif&quot;
                                            ToolTip=&quot;Cancel&quot; /&amp;gt;
                                    &amp;lt;/td&amp;gt;
                                &amp;lt;/tr&amp;gt;
                            &amp;lt;/table&amp;gt;
                        &amp;lt;/EditItemTemplate&amp;gt;
                        &amp;lt;ItemTemplate&amp;gt;
                            &amp;lt;table cellpadding=&quot;2&quot;&amp;gt;
                                &amp;lt;tr&amp;gt;
                                    &amp;lt;td&amp;gt;
                                        &amp;lt;asp:ImageButton ID=&quot;imgLanEdit&quot; ImageUrl=&quot;~/Images/edit.gif&quot; CssClass=&quot;imgButton&quot;
                                            runat=&quot;server&quot; CommandName=&quot;CityEdit&quot; ToolTip=&quot;Edit&quot; /&amp;gt;
                                        &amp;lt;asp:ImageButton ID=&quot;ImgBtnDelete&quot; ImageUrl=&quot;~/Images/delete.gif&quot; CssClass=&quot;imgButton&quot;
                                            runat=&quot;server&quot; CommandName=&quot;CityDelete&quot; ToolTip=&quot;Delete&quot; /&amp;gt;
                                    &amp;lt;/td&amp;gt;
                                &amp;lt;/tr&amp;gt;
                            &amp;lt;/table&amp;gt;
                        &amp;lt;/ItemTemplate&amp;gt;
                    &amp;lt;/asp:TemplateField&amp;gt;
                &amp;lt;/Columns&amp;gt;
                &amp;lt;FooterStyle BackColor=&quot;#FFFFCC&quot; ForeColor=&quot;#330099&quot; /&amp;gt;
                &amp;lt;HeaderStyle BackColor=&quot;#990000&quot; Font-Bold=&quot;True&quot; ForeColor=&quot;#FFFFCC&quot; /&amp;gt;
                &amp;lt;PagerStyle BackColor=&quot;#FFFFCC&quot; ForeColor=&quot;#330099&quot; HorizontalAlign=&quot;Center&quot; /&amp;gt;
                &amp;lt;RowStyle BackColor=&quot;White&quot; ForeColor=&quot;#330099&quot; /&amp;gt;
                &amp;lt;SelectedRowStyle BackColor=&quot;#FFCC66&quot; Font-Bold=&quot;True&quot; ForeColor=&quot;#663399&quot; /&amp;gt;
                &amp;lt;SortedAscendingCellStyle BackColor=&quot;#FEFCEB&quot; /&amp;gt;
                &amp;lt;SortedAscendingHeaderStyle BackColor=&quot;#AF0101&quot; /&amp;gt;
                &amp;lt;SortedDescendingCellStyle BackColor=&quot;#F6F0C0&quot; /&amp;gt;
                &amp;lt;SortedDescendingHeaderStyle BackColor=&quot;#7E0000&quot; /&amp;gt;
            &amp;lt;/asp:GridView&amp;gt;
        &amp;lt;/td&amp;gt;
    &amp;lt;/tr&amp;gt;
    &amp;lt;tr&amp;gt;
        &amp;lt;td&amp;gt;
            &amp;lt;asp:Button ID=&quot;imgExperiencetInsert&quot; runat=&quot;server&quot; Text=&quot;Insert Record&quot; OnClick=&quot;imgExperiencetInsert_Click&quot; /&amp;gt;
        &amp;lt;/td&amp;gt;
    &amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;&lt;/pre&gt;

&lt;b&gt;C# Code For Gridview with Sorting, Paging , Add ,Update ,delete operation In Asp.net:&amp;nbsp;&lt;/b&gt;
&lt;br /&gt;
&lt;pre&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

namespace HamidSite
{
    public partial class GridviewExample : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            lblmsg.Text = &quot;&quot;;
            if (!IsPostBack)
            {
                BindGridView();
            }
        }
        private string SortDirection
        {
            get
            {
                if (ViewState[&quot;SortDirection&quot;] != null)
                    return (String)ViewState[&quot;SortDirection&quot;];
                else return &quot;ASC&quot;;
            }
            set
            {
                ViewState[&quot;SortDirection&quot;] = value;
            }
        }
        private string SortExpression
        {
            get
            {
                if (ViewState[&quot;SortExpression&quot;] != null)
                    return ViewState[&quot;SortExpression&quot;].ToString();
                else return null;
            }
            set
            {
                ViewState[&quot;SortExpression&quot;] = value;
            }
        }
        private void BindGridView()
        {
            try
            {
                DataTable Dt = GetDataTable(&quot;Select Name ,stdcode ,Cityid from citytable&quot;);
                DataView DV = Dt.DefaultView;

                if (SortExpression != null)
                {
                    DV.Sort = SortExpression + &quot; &quot; + SortDirection;
                }

                GVCity.DataSource = DV;
                GVCity.DataBind();
                if (DV.Count == 0)
                {
                    imgExperiencetInsert.Visible = false;
                }
                else
                {
                    imgExperiencetInsert.Visible = true;
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
        private DataTable GetDataTable(string Query)
        {
            DataSet Ds = new DataSet();
            try
            {
                string strCon = @&quot;Data Source=Servername;Initial Catalog=Test;Integrated Security=True;&quot;;  //Conntection String
                SqlConnection Con = new SqlConnection(strCon);
                SqlDataAdapter Da = new SqlDataAdapter(Query, Con);
                Da.Fill(Ds);
            }
            catch (Exception) { }
            return Ds.Tables[0];
        }
        private int ExecuteQuery(string Query)
        {
            int RowAffected = 0;
            try
            {
                string strCon = @&quot;Data Source=Servername;Initial Catalog=Test;Integrated Security=True;&quot;;  //Conntection String
                SqlConnection Con = new SqlConnection(strCon);
                Con.Open();
                SqlCommand cmd = new SqlCommand(Query, Con);
                RowAffected = (int)cmd.ExecuteNonQuery();
                Con.Close();
            }
            catch (Exception) { }
            return RowAffected;
        }
        /// &lt;summary&gt;
        /// Edit , Update , Delete , Cancel in Gridview using RowCommand in c# Code.
        /// &lt;/summary&gt;        
        protected void GVCity_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            switch (e.CommandName)
            {
                case &quot;AddCancel&quot;:
                    GVCity.EditIndex = -1;
                    imgExperiencetInsert.Enabled = true;
                    GVCity.ShowFooter = false;
                    BindGridView();
                    break;
                case &quot;AddSave&quot;:

                    GridViewRow grvAdd = ((GridViewRow)((DataControlFieldCell)((ImageButton)e.CommandSource).Parent).Parent);
                    TextBox txtFooterCityName = (TextBox)grvAdd.FindControl(&quot;txtFooterCityName&quot;);
                    TextBox txtFooterSTDCOde = (TextBox)grvAdd.FindControl(&quot;txtFooterSTDCOde&quot;);

                    string InsertQuery = &quot;Insert into cityTable(Name,STDCode) Values(&#39;&quot; + txtFooterCityName.Text.Trim() + &quot;&#39;,&#39;&quot; + txtFooterSTDCOde.Text.Trim() + &quot;&#39;)&quot;;
                    if (ExecuteQuery(InsertQuery) &amp;gt; 0)
                    {
                        lblmsg.Text = &quot;City Inserted Successfully&quot;;
                        imgExperiencetInsert.Enabled = true;
                    }

                    GVCity.ShowFooter = false;
                    BindGridView();

                    break;
                case &quot;CityDelete&quot;:
                    GridViewRow grv = ((GridViewRow)((DataControlFieldCell)((ImageButton)e.CommandSource).Parent).Parent);

                    if (grv != null)
                    {
                        Label lblCityId = (Label)grv.FindControl(&quot;lblCityId&quot;);
                        String DeleteQuery = &quot;Delete from cityTable where cityid =&quot; + lblCityId.Text;
                        
                        if (ExecuteQuery(DeleteQuery) &amp;gt; 0)
                        {
                            lblmsg.Text = &quot;City Deleted Successfully&quot;;

                        }
                        BindGridView();
                        break;
                    }

                    break;
                case &quot;CityEdit&quot;:
                    GridViewRow grvEdit = ((GridViewRow)((DataControlFieldCell)((ImageButton)e.CommandSource).Parent).Parent);
                    GVCity.EditIndex = grvEdit.RowIndex;
                    BindGridView();
                    break;

                case &quot;EditSave&quot;:
                    GridViewRow grvSaveEdit = ((GridViewRow)((DataControlFieldCell)((ImageButton)e.CommandSource).Parent).Parent);

                    TextBox txtEditCityName = (TextBox)grvSaveEdit.FindControl(&quot;txtEditCityName&quot;);
                    TextBox txtEditSTDCOde = (TextBox)grvSaveEdit.FindControl(&quot;txtEditSTDCOde&quot;);
                    Label lblCityIdEdit = (Label)grvSaveEdit.FindControl(&quot;lblCityIdEdit&quot;);

                    string queryUpdate = &quot;update cityTable set Name = &#39;&quot; + txtEditCityName.Text.Trim() + &quot;&#39;, STDCode =&#39;&quot; + txtEditSTDCOde.Text.Trim() + &quot;&#39; where cityid=&quot; + lblCityIdEdit.Text;
                    if (ExecuteQuery(queryUpdate) &amp;gt; 0)
                    {
                        lblmsg.Text = &quot;City Updated Successfully&quot;;
                        imgExperiencetInsert.Enabled = true;
                    }
                    
                    GVCity.EditIndex = -1;
                    BindGridView();

                    break;
                case &quot;EditCancel&quot;:
                    GVCity.EditIndex = -1;
                    BindGridView();
                    break;
            }
        }
        protected void imgExperiencetInsert_Click(object sender, EventArgs e)
        {
            imgExperiencetInsert.Enabled = false;
            GVCity.ShowFooter = true;
            GVCity.EditIndex = -1;
            BindGridView();
        }
        protected void GVCity_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            GVCity.PageIndex = e.NewPageIndex;
            BindGridView();
        }
        /// &lt;summary&gt;
        /// Gridview Sorting Code in c#
        /// &lt;/summary&gt;       
        protected void GVCity_Sorting(object sender, GridViewSortEventArgs e)
        {
            if (SortExpression != null)
            {
                if (SortExpression == e.SortExpression &amp;amp;&amp;amp; SortDirection == &quot;ASC&quot;)
                    SortDirection = &quot;DESC&quot;;
                else
                    SortDirection = &quot;ASC&quot;;
            }
            SortExpression = e.SortExpression;
            BindGridView();
        }
    }
}
&lt;/pre&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;fieldset&gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;br /&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/sorting-paging-add-update-delete-in.html&quot; target=&quot;_blank&quot;&gt;Sorting, Paging, Add, Update, Delete in GridView&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/check-uncheck-all-checkbox-in-treeview.html&quot; target=&quot;_blank&quot;&gt;Check / Uncheck all checkbox in treeview using jquery&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/bind-treeview-in-apsnet-c-using-dataset.html&quot; target=&quot;_blank&quot;&gt;Bind Treeview in asp.net c# using dataset&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/4330277548114787063/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2012/01/sorting-paging-add-update-delete-in.html#comment-form' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/4330277548114787063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/4330277548114787063'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2012/01/sorting-paging-add-update-delete-in.html' title='Sorting, Paging, Add, Update, Delete in GridView asp.net c#'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIgVA0HTDeSP3eKUiUasvkfjkSFw8WLTOCRyNfrwiLB44Uu_Y9KoalDelyFUrbVlfgik7sWIqju89z9FbtZiwcWgzPEJVzgUEm-zyB4f8cr7Ocd6UorzHhsMUNGoOx5VSs7wZH-hhPwKn9/s72-c/GridView_Example.jpg" height="72" width="72"/><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-930883339289681927</id><published>2012-01-25T22:48:00.000-08:00</published><updated>2012-01-28T01:09:19.199-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net C#"/><title type='text'>Pass arguments to String.Format method in c#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Pass arguments to String.Format method in c#&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Introduction :&lt;/b&gt; In this article i will show you how &lt;b&gt;to pass the arguments to String.Format method in c#&lt;/b&gt; .
You need to &lt;b&gt;pass comma separated list of arguments to the string.Format method&lt;/b&gt; .There must be argument for each of the place holders .&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Following is the example of String.Format in c# :&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&lt;/b&gt;

&lt;br /&gt;
&lt;pre&gt; string Name =&quot;Seta Hamid &quot;;
 string Country =&quot;India&quot;;          
 Response.Write( String.Format(&quot;My Name is {0}. I am from {1}.&quot;, Name, Country));
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Output of the string.Format C#.&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&lt;/b&gt;
&lt;br /&gt;
&lt;pre&gt;My Name is Seta Hamid . I am from India. 
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;fieldset&gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/pass-arguments-to-stringformat-method.html&quot; target=&quot;_blank&quot;&gt;Pass arguments to String.Format method in c#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/get-recursive-all-childs-by-parentid-in.html&quot; target=&quot;_blank&quot;&gt;Get Recursive all childs by parentid in sql server &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge word document files in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation Using Jquery in Asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/doc-file-to-rtf-format-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;DOC file to RTF format in asp.net C#.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/930883339289681927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2012/01/pass-arguments-to-stringformat-method.html#comment-form' title='35 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/930883339289681927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/930883339289681927'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2012/01/pass-arguments-to-stringformat-method.html' title='Pass arguments to String.Format method in c#'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>35</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-8555316064741514553</id><published>2012-01-12T06:54:00.000-08:00</published><updated>2012-01-26T06:58:56.391-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Sql Server"/><title type='text'>Get Recursive all childs by parentid in sql server</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;

Get Recursive all childs by parentid in sql server&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Introduction &lt;/b&gt;: In this article i will show you&lt;b&gt; how to get all recursive childs by parentid in sql server&lt;/b&gt; .To get all childs i have used &lt;b&gt;recursive query using with CTE&lt;/b&gt; ( Common Table Expressions ) . It is very simple to with parentid and childId relationship table.I have written query for &lt;b&gt;getting recursive child records in sql server&lt;/b&gt; is as follow .&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Table design for Relationship :&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEic8Cd7n2MeI9DkZP7Vx7enU1q4tb9RN9jhkTAiPBdgOwh_kWLNWbHsAxzywUq1VsUUn9VBf_3lEUusDUnUBGcBUGBd0NVur-F7qu38IjHoMQGs19AvWp7deQ5iuoLlWF1kEkM8pw4xcy1A/s1600/Tabledesign_ParentChild.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEic8Cd7n2MeI9DkZP7Vx7enU1q4tb9RN9jhkTAiPBdgOwh_kWLNWbHsAxzywUq1VsUUn9VBf_3lEUusDUnUBGcBUGBd0NVur-F7qu38IjHoMQGs19AvWp7deQ5iuoLlWF1kEkM8pw4xcy1A/s1600/Tabledesign_ParentChild.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Query for get all childs by parentid in sql server :&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &lt;/b&gt;&lt;br /&gt;
&lt;pre&gt;declare @ParentId as int;
set @ParentId =  1;

WITH RecursiveTable (ProductId, ParentId,ProductName, Level)
AS
(    
    SELECT      MaintTab.ProductId, 
                MaintTab.ParentId, 
                MaintTab.ProductName ,
                0 AS Level
    FROM ProductTable AS MaintTab
    WHERE ParentId = @ParentId
    
    UNION ALL
    
    SELECT  MaintTab.ProductId, 
                MaintTab.ParentId, 
                MaintTab.ProductName ,
                LEVEL + 1
    FROM ProductTable AS MaintTab
        INNER JOIN RecursiveTable Rtab ON
        MaintTab.ParentId = Rtab.ProductId
)
SELECT * FROM RecursiveTable
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Output of query :&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjruzTxEmBj-qEMmSgj-nfMVGmgThXkeU3fckf6rr5YBlz4WDFgRIUZpS55Pa48ba08px0h0-PqXA6aU_7BT43f8pcndYC5RaoT22BFcJfJOO-P9lwZKuqVmW2pCuqvV5FMzksEQ3Gtakkl/s1600/QueryResult.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjruzTxEmBj-qEMmSgj-nfMVGmgThXkeU3fckf6rr5YBlz4WDFgRIUZpS55Pa48ba08px0h0-PqXA6aU_7BT43f8pcndYC5RaoT22BFcJfJOO-P9lwZKuqVmW2pCuqvV5FMzksEQ3Gtakkl/s1600/QueryResult.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;

&lt;fieldset&gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/pass-arguments-to-stringformat-method.html&quot; target=&quot;_blank&quot;&gt;Pass arguments to String.Format method in c#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/get-recursive-all-childs-by-parentid-in.html&quot; target=&quot;_blank&quot;&gt;Get Recursive all childs by parentid in sql server &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge word document files in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation Using Jquery in Asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/doc-file-to-rtf-format-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;DOC file to RTF format in asp.net C#.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/8555316064741514553/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2012/01/get-recursive-all-childs-by-parentid-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/8555316064741514553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/8555316064741514553'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2012/01/get-recursive-all-childs-by-parentid-in.html' title='Get Recursive all childs by parentid in sql server'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEic8Cd7n2MeI9DkZP7Vx7enU1q4tb9RN9jhkTAiPBdgOwh_kWLNWbHsAxzywUq1VsUUn9VBf_3lEUusDUnUBGcBUGBd0NVur-F7qu38IjHoMQGs19AvWp7deQ5iuoLlWF1kEkM8pw4xcy1A/s72-c/Tabledesign_ParentChild.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-9101661056576628697</id><published>2012-01-11T10:28:00.000-08:00</published><updated>2012-01-28T01:09:52.620-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Chart Control"/><title type='text'>Chart Control in asp.net 4.0</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Chart Control in asp.net 4.0&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Introduction &lt;/b&gt;: In this article i will show you&lt;b&gt; how to add Chart control in asp.net 4.0&lt;/b&gt; and &lt;b&gt;how to bind chart control in asp.net with Datase&lt;/b&gt;t .You just need to drag the chart control in aspx page so following assembly will be register in your web page and corresponding httpHandlers will be added in web config too .&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC42gezgG3KeUMkBxW7QYl4UlZPvDwtWGS_lqwdcV-6qBSH4zSgMb9MGCvXDLFqElB4mTxMnrOvTOZh3fBSWegbetCvSilsTEVLc0JdZ6Ddg7i3PYyyOtijJEfAapN6IAahxcwZcb5lydy/s1600/ChartControl.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;186&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC42gezgG3KeUMkBxW7QYl4UlZPvDwtWGS_lqwdcV-6qBSH4zSgMb9MGCvXDLFqElB4mTxMnrOvTOZh3fBSWegbetCvSilsTEVLc0JdZ6Ddg7i3PYyyOtijJEfAapN6IAahxcwZcb5lydy/s320/ChartControl.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;%@ Register Assembly=&quot;System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot;
    Namespace=&quot;System.Web.UI.DataVisualization.Charting&quot; TagPrefix=&quot;asp&quot; %&amp;gt;&lt;/pre&gt;
&lt;b&gt;Code For Bind Chart Control In asp.net  :
&lt;/b&gt;I have following complete html and code behind code for binding &lt;b&gt;Chart control in c# asp.net&lt;/b&gt;. I have here created &lt;b&gt;Bar chart control in asp.net&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;HTML Code For Chart Control In asp.net :&lt;/b&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;ChartControl.aspx.cs&quot; Inherits=&quot;HamidSite.ChartControl&quot; %&amp;gt;

&amp;lt;%@ Register Assembly=&quot;System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot;
    Namespace=&quot;System.Web.UI.DataVisualization.Charting&quot; TagPrefix=&quot;asp&quot; %&amp;gt;
&amp;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;&amp;gt;
&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&amp;gt;
&amp;lt;head runat=&quot;server&quot;&amp;gt;
    &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;form id=&quot;form1&quot; runat=&quot;server&quot;&amp;gt;
    &amp;lt;div&amp;gt;
        &amp;lt;asp:Chart ID=&quot;ChartControlTest&quot; runat=&quot;server&quot; Width=&quot;706px&quot; Height=&quot;367px&quot;&amp;gt;
            &amp;lt;Series&amp;gt;
                &amp;lt;asp:Series Name=&quot;SeriesTest&quot; IsValueShownAsLabel=&quot;true&quot; Legend=&quot;LegendTest&quot; ChartArea=&quot;ChartAreaTest&quot;
                    XValueMember=&quot;MonthName&quot; YValueMembers=&quot;Amount&quot;&amp;gt;
                &amp;lt;/asp:Series&amp;gt;
            &amp;lt;/Series&amp;gt;
            &amp;lt;ChartAreas&amp;gt;
                &amp;lt;asp:ChartArea Name=&quot;ChartAreaTest&quot; Area3DStyle-LightStyle=&quot;Simplistic&quot; AlignmentStyle=&quot;AxesView&quot;
                    BorderDashStyle=&quot;Solid&quot; Area3DStyle-Enable3D=&quot;true&quot;&amp;gt;
                &amp;lt;/asp:ChartArea&amp;gt;
            &amp;lt;/ChartAreas&amp;gt;            
        &amp;lt;/asp:Chart&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;
C# Code For Chart Control in asp.net :&lt;/b&gt;
&lt;br /&gt;
&lt;pre&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

namespace HamidSite
{
    public partial class ChartControl : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindChartControl();
            }
        }
        private void BindChartControl()
        {
            DataSet Ds = GetDataSet(&quot;Select MonthName , Amount from OrderTable&quot;);
            ChartControlTest.DataSource = Ds; 
            ChartControlTest.DataBind(); 
        }
        private DataSet GetDataSet(string Query)
        {
            DataSet Ds = new DataSet();
            try
            {
                string strCon = @&quot;Data Source=ServerName;Initial Catalog=Test;Integrated Security=True;&quot;;  //Conntection String
                SqlConnection Con = new SqlConnection(strCon);
                SqlDataAdapter Da = new SqlDataAdapter(Query, Con);
                Da.Fill(Ds);
            }
            catch (Exception) { }
            return Ds;
        }
    }
}
&lt;/pre&gt;

&lt;fieldset&gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/pass-arguments-to-stringformat-method.html&quot; target=&quot;_blank&quot;&gt;Pass arguments to String.Format method in c#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/get-recursive-all-childs-by-parentid-in.html&quot; target=&quot;_blank&quot;&gt;Get Recursive all childs by parentid in sql server &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge word document files in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation Using Jquery in Asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/doc-file-to-rtf-format-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;DOC file to RTF format in asp.net C#.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/9101661056576628697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2012/01/chart-control-in-aspnet-40.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/9101661056576628697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/9101661056576628697'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2012/01/chart-control-in-aspnet-40.html' title='Chart Control in asp.net 4.0'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC42gezgG3KeUMkBxW7QYl4UlZPvDwtWGS_lqwdcV-6qBSH4zSgMb9MGCvXDLFqElB4mTxMnrOvTOZh3fBSWegbetCvSilsTEVLc0JdZ6Ddg7i3PYyyOtijJEfAapN6IAahxcwZcb5lydy/s72-c/ChartControl.jpg" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-4940203261653964659</id><published>2012-01-11T07:03:00.000-08:00</published><updated>2012-01-26T06:59:46.230-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Jquery"/><title type='text'>Set hidden field&#39;s value on button&#39;s click in Jquery</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Set hidden field&#39;s value on button&#39;s click in Jquery &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Introduction &lt;/b&gt;: In this i will show you how to &lt;b&gt;set value of hidden field&#39;s value on button click usinng Jquery&lt;/b&gt; . It is very easy to &lt;b&gt;set value of hidden field&#39;s value using Jquery&lt;/b&gt; .I have written two way to &lt;b&gt;set value of hidden field using Jquer&lt;/b&gt;y . In first way you can write code in $(document).ready() function and second you can directly assign to on click of button .&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;HTML Code for Set hidden field&#39;s value on button&#39;s click in Jquery :&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot; CodeBehind=&amp;quot;JqueryValidation.aspx.cs&amp;quot; Inherits=&amp;quot;HamidSite.JqueryValidation&amp;quot; %&amp;gt;

&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;
&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;gt;
&amp;lt;head runat=&amp;quot;server&amp;quot;&amp;gt;
    &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
    &amp;lt;script src=&amp;quot;Scripts/jquery-1.4.1-vsdoc.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src=&amp;quot;Scripts/jquery-1.4.1.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src=&amp;quot;Scripts/jquery-1.4.1.min.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src=&amp;quot;Scripts/jquery.validate.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;  &amp;gt;
        $(document).ready(function () {
            $(&amp;quot;#submit1&amp;quot;).click(function () {
                $(&#39;#hiddenTest&#39;).val(&#39;Test-2&#39;);
                alert($(&#39;#hiddenTest&#39;).val());
            });
        });
  &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;
    &amp;lt;div&amp;gt;
            &amp;lt;input type=&amp;quot;hidden&amp;quot; id=&amp;quot;hiddenTest&amp;quot; value=&amp;quot;&amp;quot; /&amp;gt;
            &amp;lt;input id=&amp;quot;submit&amp;quot; type=&amp;quot;submit&amp;quot; value=&amp;quot;test-1&amp;quot; onclick=&amp;quot;$(&#39;#hiddenTest&#39;).val(&#39;Test-1&#39;);alert($(&#39;#hiddenTest&#39;).val());&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt;            
            &amp;lt;input id=&amp;quot;submit1&amp;quot; type=&amp;quot;submit&amp;quot; value=&amp;quot;test-2&amp;quot;  runat=&amp;quot;server&amp;quot; /&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;/br&gt;

&lt;fieldset&gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/pass-arguments-to-stringformat-method.html&quot; target=&quot;_blank&quot;&gt;Pass arguments to String.Format method in c#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/get-recursive-all-childs-by-parentid-in.html&quot; target=&quot;_blank&quot;&gt;Get Recursive all childs by parentid in sql server &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge word document files in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation Using Jquery in Asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/doc-file-to-rtf-format-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;DOC file to RTF format in asp.net C#.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/4940203261653964659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2012/01/set-hidden-fields-value-on-buttons.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/4940203261653964659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/4940203261653964659'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2012/01/set-hidden-fields-value-on-buttons.html' title='Set hidden field&#39;s value on button&#39;s click in Jquery'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-1264785194693773437</id><published>2012-01-10T07:55:00.000-08:00</published><updated>2012-03-06T02:02:27.450-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net C#"/><category scheme="http://www.blogger.com/atom/ns#" term="TreeView"/><title type='text'>Check / Uncheck all checkbox in treeview using jquery in asp.net</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Check / Uncheck all checkbox in treeview using jquery in asp.net&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Introduction &lt;/b&gt;: In this article i will show you how &lt;b&gt;check all checkboxes in treeview using Jquery in asp.net&lt;/b&gt; .It is very easy just you need add code and replace id as per treeview control .

For the binding the Treeview control in asp.net you can visits my previous post &lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/bind-treeview-in-apsnet-c-using-dataset.html&quot;&gt;bind treeview in-asp.net&lt;/a&gt; .
&lt;br /&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZAFl1tXmes1aTVYo4FKhuKGmEQTY2ldYdLdm0OGm3zQprzm0lN4SDhSaMn4fhyphenhyphenYGGSzuz3P5KouNCJD-TjfXjmRhmBHCDaMKGOf-VuI-uW21ZempDpNNq9-4yPN4ocT1J387UrnrzHGcX/s1600/TreeViewControl.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZAFl1tXmes1aTVYo4FKhuKGmEQTY2ldYdLdm0OGm3zQprzm0lN4SDhSaMn4fhyphenhyphenYGGSzuz3P5KouNCJD-TjfXjmRhmBHCDaMKGOf-VuI-uW21ZempDpNNq9-4yPN4ocT1J387UrnrzHGcX/s1600/TreeViewControl.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNE2sXiiTn7oyJ07PP-Dj221Z4P2bZwZsFckBTGcHAd8JtY8Ora5kLgcaFoUbIxqwfpM26onHIxwgv8vCZtj-seUumrCdd0-gPKiQIIpzmyBgbGL6vUXvmS8nG37cyEUXXhVFxnIHW045t/s1600/TreeViewControl_1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNE2sXiiTn7oyJ07PP-Dj221Z4P2bZwZsFckBTGcHAd8JtY8Ora5kLgcaFoUbIxqwfpM26onHIxwgv8vCZtj-seUumrCdd0-gPKiQIIpzmyBgbGL6vUXvmS8nG37cyEUXXhVFxnIHW045t/s1600/TreeViewControl_1.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;b&gt;Jquery for check / uncheck all checkboxes in treeview in c# :&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
Following is&lt;b&gt; jquery code for check or uncheck all checkboxes in treeview control&lt;/b&gt; and HTML code in asp.net .&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;TreeViewControl.aspx.cs&quot;
    Inherits=&quot;HamidSite.TreeViewControl&quot; %&amp;gt;

&amp;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;&amp;gt;
&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&amp;gt;
&amp;lt;head runat=&quot;server&quot;&amp;gt;
    &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
    &amp;lt;script src=&quot;Scripts/jquery-1.4.1-vsdoc.js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src=&quot;Scripts/jquery-1.4.1.js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src=&quot;Scripts/jquery-1.4.1.min.js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script type=&quot;text/javascript&quot; &amp;gt;

        $(document).ready(function () {

            $(&quot;div[id $= treeviwExample] input[type=checkbox]&quot;).click(function () {
                $(this).closest(&quot;table&quot;).next(&quot;div&quot;).find(&quot;input[type=checkbox]&quot;).attr(&quot;checked&quot;, this.checked);
            });

        });    
        
    &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;form id=&quot;form1&quot; runat=&quot;server&quot;&amp;gt;
    &amp;lt;div&amp;gt;
        &amp;lt;asp:TreeView ID=&quot;treeviwExample&quot; ShowCheckBoxes=&quot;All&quot;  runat=&quot;server&quot; ImageSet=&quot;Arrows&quot;&amp;gt;
            &amp;lt;HoverNodeStyle Font-Underline=&quot;True&quot; ForeColor=&quot;#5555DD&quot; /&amp;gt;
            &amp;lt;NodeStyle Font-Names=&quot;Verdana&quot; Font-Size=&quot;8pt&quot; ForeColor=&quot;Black&quot; HorizontalPadding=&quot;5px&quot; NodeSpacing=&quot;0px&quot; VerticalPadding=&quot;0px&quot; /&amp;gt;
            &amp;lt;ParentNodeStyle Font-Bold=&quot;False&quot; /&amp;gt;
            &amp;lt;SelectedNodeStyle Font-Underline=&quot;True&quot; ForeColor=&quot;#5555DD&quot; HorizontalPadding=&quot;0px&quot; VerticalPadding=&quot;0px&quot; /&amp;gt;            
        &amp;lt;/asp:TreeView&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;fieldset&gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/sorting-paging-add-update-delete-in.html&quot; target=&quot;_blank&quot;&gt;Sorting, Paging, Add, Update, Delete in GridView&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/check-uncheck-all-checkbox-in-treeview.html&quot; target=&quot;_blank&quot;&gt;Check / Uncheck all checkbox in treeview using jquery&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/bind-treeview-in-apsnet-c-using-dataset.html&quot; target=&quot;_blank&quot;&gt;Bind Treeview in asp.net c# using dataset&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/1264785194693773437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2012/01/check-uncheck-all-checkbox-in-treeview.html#comment-form' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/1264785194693773437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/1264785194693773437'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2012/01/check-uncheck-all-checkbox-in-treeview.html' title='Check / Uncheck all checkbox in treeview using jquery in asp.net'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZAFl1tXmes1aTVYo4FKhuKGmEQTY2ldYdLdm0OGm3zQprzm0lN4SDhSaMn4fhyphenhyphenYGGSzuz3P5KouNCJD-TjfXjmRhmBHCDaMKGOf-VuI-uW21ZempDpNNq9-4yPN4ocT1J387UrnrzHGcX/s72-c/TreeViewControl.jpg" height="72" width="72"/><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-5471219856517852288</id><published>2012-01-09T04:57:00.001-08:00</published><updated>2012-01-28T01:10:54.327-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net C#"/><category scheme="http://www.blogger.com/atom/ns#" term="TreeView"/><title type='text'>Bind Treeview in asp.net c# using dataset</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Bind Treeview in asp.net c# using dataset &lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPKX6mbHdOTXuKIOExId_vs1gG2amVlBa7SVw7qAK7crVIVNXZFP4qOpyS4j7fW2K51XL_Dmx6M7aQsN-Gxj939k9SBCv-Qyu7Wa7mDJHyJRquKE7-ydIqWjFA3DFbmQs4Yx3mg2XKKcwP/s1600/TreeViewControlExample.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPKX6mbHdOTXuKIOExId_vs1gG2amVlBa7SVw7qAK7crVIVNXZFP4qOpyS4j7fW2K51XL_Dmx6M7aQsN-Gxj939k9SBCv-Qyu7Wa7mDJHyJRquKE7-ydIqWjFA3DFbmQs4Yx3mg2XKKcwP/s320/TreeViewControlExample.bmp&quot; width=&quot;224&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Introduction &lt;/b&gt;: In this article i will show you how to&lt;b&gt; bind treeview in c# using dataset&lt;/b&gt; . I have created complete &lt;b&gt;code to bind the treeview&lt;/b&gt; and also table structure in image which require for the &lt;b&gt;treeview control to bind in asp.net c# using dataset&lt;/b&gt; .&lt;/div&gt;
&lt;b&gt;Table structure :&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRzNS50ggUTyRz8piKI5uQaWiMsysMPuvL4Mqv8n21n-uELiDOdN6NmL1vnuHt1-uJ0ZXZ1O4gqfDCmtjLSaJcIkW3VeH0Nr7wDgLQax9UtRz_iecG8v2qbWxrsqqBJoQqFv6vdMYbbUbb/s1600/TreeViewControl.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;296&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRzNS50ggUTyRz8piKI5uQaWiMsysMPuvL4Mqv8n21n-uELiDOdN6NmL1vnuHt1-uJ0ZXZ1O4gqfDCmtjLSaJcIkW3VeH0Nr7wDgLQax9UtRz_iecG8v2qbWxrsqqBJoQqFv6vdMYbbUbb/s320/TreeViewControl.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;HTML code treeview in asp.net : &lt;/b&gt;&lt;br /&gt;
&lt;pre&gt;&amp;lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;TreeViewControl.aspx.cs&quot;
    Inherits=&quot;HamidSite.TreeViewControl&quot; %&amp;gt;

&amp;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;&amp;gt;
&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&amp;gt;
&amp;lt;head runat=&quot;server&quot;&amp;gt;
    &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;form id=&quot;form1&quot; runat=&quot;server&quot;&amp;gt;
    &amp;lt;div&amp;gt;
        &amp;lt;asp:TreeView ID=&quot;treeviwExample&quot;  runat=&quot;server&quot; ImageSet=&quot;Arrows&quot;&amp;gt;
            &amp;lt;HoverNodeStyle Font-Underline=&quot;True&quot; ForeColor=&quot;#5555DD&quot; /&amp;gt;
            &amp;lt;NodeStyle Font-Names=&quot;Verdana&quot; Font-Size=&quot;8pt&quot; ForeColor=&quot;Black&quot; HorizontalPadding=&quot;5px&quot; NodeSpacing=&quot;0px&quot; VerticalPadding=&quot;0px&quot; /&amp;gt;
            &amp;lt;ParentNodeStyle Font-Bold=&quot;False&quot; /&amp;gt;
            &amp;lt;SelectedNodeStyle Font-Underline=&quot;True&quot; ForeColor=&quot;#5555DD&quot; HorizontalPadding=&quot;0px&quot; VerticalPadding=&quot;0px&quot; /&amp;gt;            
        &amp;lt;/asp:TreeView&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;C# Code treeview control in asp.net :&lt;/b&gt; &lt;br /&gt;
&lt;pre&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

namespace HamidSite
{
    public partial class TreeViewControl : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack) {
                BindTreeViewControl();
            }
        }
        private void BindTreeViewControl()
        {
            try
            {
                DataSet ds = GetDataSet(&quot;Select ProductId,ProductName,ParentId from ProductTable&quot;);
                DataRow[] Rows = ds.Tables[0].Select(&quot;ParentId IS NULL&quot;); // Get all parents nodes
                for (int i = 0; i &amp;lt; Rows.Length; i++)
                {
                    TreeNode root = new TreeNode(Rows[i][&quot;ProductName&quot;].ToString(), Rows[i][&quot;ProductId&quot;].ToString());
                    root.SelectAction = TreeNodeSelectAction.Expand;
                    CreateNode(root, ds.Tables[0]);
                    treeviwExample.Nodes.Add(root);
                }
            } catch (Exception Ex) { throw Ex; }
        }

        public void CreateNode(TreeNode node , DataTable Dt)
        {
            DataRow[] Rows = Dt.Select(&quot;ParentId =&quot; + node.Value);            
            if (Rows.Length == 0) { return; }
            for (int i = 0; i &amp;lt; Rows.Length; i++)
            {
                TreeNode Childnode = new TreeNode(Rows[i][&quot;ProductName&quot;].ToString(), Rows[i][&quot;ProductId&quot;].ToString());
                Childnode.SelectAction = TreeNodeSelectAction.Expand;
                node.ChildNodes.Add(Childnode);
                CreateNode(Childnode, Dt);
            }
        }
        private DataSet GetDataSet(string Query)
        {           
            DataSet Ds = new DataSet();
            try {
                string strCon = @&quot;Data Source=Servername;Initial Catalog=Test;Integrated Security=True&quot;; 
                SqlConnection Con = new SqlConnection(strCon);
                SqlDataAdapter Da = new SqlDataAdapter(Query, Con);
                Da.Fill(Ds);
            } catch (Exception) { }
            return Ds; 
        }
    }
}&lt;/pre&gt;
&lt;br /&gt;
For &lt;b&gt;Check / Uncheck Checkboxes in treeview control using jquery&lt;/b&gt; you can visit following post :-

&lt;b&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/check-uncheck-all-checkbox-in-treeview.html&quot;&gt;Check / Uncheck Checkboxes in treeview control using jquery&lt;/a&gt;&lt;/b&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;fieldset&gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;br /&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/sorting-paging-add-update-delete-in.html&quot; target=&quot;_blank&quot;&gt;Sorting, Paging, Add, Update, Delete in GridView&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2012/01/check-uncheck-all-checkbox-in-treeview.html&quot; target=&quot;_blank&quot;&gt;Check / Uncheck all checkbox in treeview using jquery&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/bind-treeview-in-apsnet-c-using-dataset.html&quot; target=&quot;_blank&quot;&gt;Bind Treeview in asp.net c# using dataset&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/5471219856517852288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2012/01/bind-treeview-in-apsnet-c-using-dataset.html#comment-form' title='35 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/5471219856517852288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/5471219856517852288'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2012/01/bind-treeview-in-apsnet-c-using-dataset.html' title='Bind Treeview in asp.net c# using dataset'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPKX6mbHdOTXuKIOExId_vs1gG2amVlBa7SVw7qAK7crVIVNXZFP4qOpyS4j7fW2K51XL_Dmx6M7aQsN-Gxj939k9SBCv-Qyu7Wa7mDJHyJRquKE7-ydIqWjFA3DFbmQs4Yx3mg2XKKcwP/s72-c/TreeViewControlExample.bmp" height="72" width="72"/><thr:total>35</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-4239475980562327921</id><published>2012-01-07T02:49:00.000-08:00</published><updated>2012-01-28T01:11:22.305-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net C#"/><title type='text'>Merge word document files in asp.net c#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Merge word document files in asp.net c#&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKqVK8OiwYa0LljogpAiAEpNKQp_F5itQbt56QPJcTFfsGSwx1idWqLqLe7lcU0Od1Zdix5cLjRx_xoqg8LB6Zf0R4MVQ6ZkGwNcuG5eX061isPUH_oWPkOofEaowKxRTgoPm-2QSiLbsN/s1600/Merge_WordDoc.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;62&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKqVK8OiwYa0LljogpAiAEpNKQp_F5itQbt56QPJcTFfsGSwx1idWqLqLe7lcU0Od1Zdix5cLjRx_xoqg8LB6Zf0R4MVQ6ZkGwNcuG5eX061isPUH_oWPkOofEaowKxRTgoPm-2QSiLbsN/s320/Merge_WordDoc.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Introduction &lt;/b&gt;: This article show you how to &lt;b&gt;merge or combine two more doc files in Asp.net using C#&lt;/b&gt; .&lt;br /&gt;
I have created one function to &lt;b&gt;merge &lt;/b&gt;multiple word file in c# .it is very easy to use .You just need to pass &lt;b&gt;word&lt;/b&gt; file path arrays and save file path . Then i will save&amp;nbsp; &lt;b&gt;merged word document file&lt;/b&gt; .&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Add following dll reference to your application :&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;Microsoft.Office.Interop.Word&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Code for merge word doc files :&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Office.Interop.Word;

namespace HamidSite
{
    public partial class MergerWorddocs : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string[] DocsFiles = new string[] { @&quot;C:\Merfiles\Doc1.docx&quot;, @&quot;C:\Merfiles\Doc2.docx&quot; };
            string PathToSave =Server.MapPath(&quot;MergesDocs/MergeDoc.docx&quot;);
            Merge(DocsFiles,PathToSave,true);
            
        }
        public void Merge(string[] filesToMerge, string fileSavePath, bool insertPageBreaks)
        {  
            object missing = System.Type.Missing;
            object pageBreak = WdBreakType.wdPageBreak;
            object outputFile = fileSavePath;
           
            Application wordApplication = new Application();
            try
            {                
                Document wordDocument = wordApplication.Documents.Add(ref missing, ref missing , ref missing , ref missing);                           
                Selection selection = wordApplication.Selection;
               
                foreach (string docFile in filesToMerge)
                {
                    selection.InsertFile(docFile , ref missing , ref missing , ref missing , ref missing);
                    if (insertPageBreaks)
                    {
                        selection.InsertBreak(ref pageBreak);
                    }
                }               
                wordDocument.SaveAs(ref outputFile, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
                wordDocument = null;
                wordApplication.Quit(ref missing, ref missing, ref missing);
            }
            catch (Exception ex) { throw ex; }           
        }
    }
} 

&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;fieldset &gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;br /&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/how-to-add-html-code-in-blogspot.html&quot; target=&quot;_blank&quot;&gt;Html Code in blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/radiobuttonlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Radiobuttonlist Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/to-take-back-up-of-database-in-sql.html&quot; target=&quot;_blank&quot;&gt;Database backup in sql Server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;

&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/4239475980562327921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/4239475980562327921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/4239475980562327921'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html' title='Merge word document files in asp.net c#'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKqVK8OiwYa0LljogpAiAEpNKQp_F5itQbt56QPJcTFfsGSwx1idWqLqLe7lcU0Od1Zdix5cLjRx_xoqg8LB6Zf0R4MVQ6ZkGwNcuG5eX061isPUH_oWPkOofEaowKxRTgoPm-2QSiLbsN/s72-c/Merge_WordDoc.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-1717452623021606860</id><published>2012-01-06T22:50:00.000-08:00</published><updated>2012-01-07T04:33:41.314-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Jquery"/><title type='text'>Validation Using Jquery in Asp.net page</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Validation Using Jquery in Asp.net page&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Introduction :&lt;/b&gt; This article show you how to add &lt;b&gt;validation using Jquery in Asp.net &lt;/b&gt;. &lt;b&gt;Validation &lt;/b&gt;is easy in &lt;b&gt;jquery &lt;/b&gt;just need add my following complete html code for&lt;b&gt; Jquery validation in asp.net&lt;/b&gt; .&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVe9o2mEa0FAVy7dM_4sigQJ1RBkhNawCkUor06ZV9ESoBr94izU5X_HDOIsa9exLmLPcoQA0hyuTzbHS2yWJHYZjq1O545mHUPJqB5kNa4caNKcuA4x8XavM8SRhyphenhyphenkypfWSQjRRzraeWu/s1600/JqueryValidation.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;284&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVe9o2mEa0FAVy7dM_4sigQJ1RBkhNawCkUor06ZV9ESoBr94izU5X_HDOIsa9exLmLPcoQA0hyuTzbHS2yWJHYZjq1O545mHUPJqB5kNa4caNKcuA4x8XavM8SRhyphenhyphenkypfWSQjRRzraeWu/s640/JqueryValidation.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Hows&amp;nbsp; Jquery validation works in Asp.net :&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&lt;/b&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
you can download&amp;nbsp; Jquery.validate.js from &lt;a href=&quot;http://jzaefferer.github.com/jquery-validation/jquery.validate.js&quot; target=&quot;_blank&quot;&gt;http://jzaefferer.github.com/jquery-validation/jquery.validate.js&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
you can apply required validation by adding class to textbox like : CssClass=&quot;required&quot;. ..etc .so on you can Url validation ,date validation , digits validation ..etc using jquery .&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Complete Html Code for Jquery validation in asp.net page :&lt;/b&gt;&lt;br /&gt;
&lt;pre&gt;&amp;lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;JqueryValidation.aspx.cs&quot; Inherits=&quot;HamidSite.JqueryValidation&quot; %&amp;gt;

&amp;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;&amp;gt;
&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&amp;gt;
&amp;lt;head runat=&quot;server&quot;&amp;gt;
    &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
    &amp;lt;script src=&quot;Scripts/jquery-1.4.1-vsdoc.js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src=&quot;Scripts/jquery-1.4.1.js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src=&quot;Scripts/jquery-1.4.1.min.js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src=&quot;Scripts/jquery.validate.js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script type=&quot;text/javascript&quot;  &amp;gt;
         $(document).ready(function () {
             $(&quot;#form1&quot;).validate();
         });
  &amp;lt;/script&amp;gt;
 &amp;lt;style type=&quot;text/css&quot;&amp;gt;
    label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
&amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;form id=&quot;form1&quot; runat=&quot;server&quot;&amp;gt;
    &amp;lt;div&amp;gt;
            &amp;lt;fieldset style=&quot;width:500px;vertical-align:middle;font-family:Verdana;font-size:12px;border-bottom-width:medium;&quot; &amp;gt;
                &amp;lt;legend&amp;gt;Validation Using Jquery in Asp.net page &amp;lt;/legend&amp;gt;
                &amp;lt;table align=&quot;center&quot; cellpadding=&quot;5px&quot; &amp;gt;
                    &amp;lt;tr&amp;gt;
                        &amp;lt;td&amp;gt;
                            Name :
                        &amp;lt;/td&amp;gt;
                        &amp;lt;td&amp;gt;
                            &amp;lt;asp:TextBox ID=&quot;txtname&quot; CssClass=&quot;required&quot; runat=&quot;server&quot; &amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                        &amp;lt;/td&amp;gt;
                    &amp;lt;/tr&amp;gt;
                    &amp;lt;tr&amp;gt;
                        &amp;lt;td&amp;gt;
                            Amount :
                        &amp;lt;/td&amp;gt;
                        &amp;lt;td&amp;gt;
                            &amp;lt;asp:TextBox ID=&quot;TextBox1&quot; CssClass=&quot;digits&quot; runat=&quot;server&quot; &amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                        &amp;lt;/td&amp;gt;
                    &amp;lt;/tr&amp;gt;
                    &amp;lt;tr&amp;gt;
                        &amp;lt;td&amp;gt;
                            Website url :
                        &amp;lt;/td&amp;gt;
                        &amp;lt;td&amp;gt;
                            &amp;lt;asp:TextBox ID=&quot;TextBox2&quot; CssClass=&quot;url&quot; runat=&quot;server&quot; &amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                        &amp;lt;/td&amp;gt;
                    &amp;lt;/tr&amp;gt;
                    &amp;lt;tr&amp;gt;
                        &amp;lt;td&amp;gt;
                            Email :
                        &amp;lt;/td&amp;gt;
                        &amp;lt;td&amp;gt;
                            &amp;lt;asp:TextBox ID=&quot;TextBox3&quot; CssClass=&quot;email&quot; runat=&quot;server&quot; &amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                        &amp;lt;/td&amp;gt;
                    &amp;lt;/tr&amp;gt;
                    &amp;lt;tr&amp;gt;
                        &amp;lt;td&amp;gt;
                            Date :
                        &amp;lt;/td&amp;gt;
                        &amp;lt;td&amp;gt;
                            &amp;lt;asp:TextBox ID=&quot;TextBox4&quot; CssClass=&quot;date&quot; runat=&quot;server&quot; &amp;gt;&amp;lt;/asp:TextBox&amp;gt;
                        &amp;lt;/td&amp;gt;
                    &amp;lt;/tr&amp;gt;
                     &amp;lt;tr&amp;gt;
                        &amp;lt;td&amp;gt;
                            
                        &amp;lt;/td&amp;gt;
                        &amp;lt;td&amp;gt;
                            &amp;lt;asp:Button ID=&quot;btnSave&quot;  runat=&quot;server&quot; Text=&quot;Submit&quot; /&amp;gt;
                        &amp;lt;/td&amp;gt;
                    &amp;lt;/tr&amp;gt;
                &amp;lt;/table&amp;gt;
            &amp;lt;/fieldset&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;fieldset &gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;br /&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/how-to-add-html-code-in-blogspot.html&quot; target=&quot;_blank&quot;&gt;Html Code in blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/radiobuttonlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Radiobuttonlist Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/to-take-back-up-of-database-in-sql.html&quot; target=&quot;_blank&quot;&gt;Database backup in sql Server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/1717452623021606860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/1717452623021606860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/1717452623021606860'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html' title='Validation Using Jquery in Asp.net page'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVe9o2mEa0FAVy7dM_4sigQJ1RBkhNawCkUor06ZV9ESoBr94izU5X_HDOIsa9exLmLPcoQA0hyuTzbHS2yWJHYZjq1O545mHUPJqB5kNa4caNKcuA4x8XavM8SRhyphenhyphenkypfWSQjRRzraeWu/s72-c/JqueryValidation.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-1089895150809244301</id><published>2012-01-06T02:58:00.000-08:00</published><updated>2012-01-28T01:12:00.878-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net C#"/><title type='text'>DOC file to RTF format in asp.net C#.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;DOC file to RTF format in asp.net C#.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Introduction &lt;/b&gt;: This article describe how you can convert the DOC file to RTF format in asp.net using c# language .&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Code For Doc to RTF:&lt;/b&gt; I have created one function to &lt;b&gt;convert DOC file to RTF format in c#&lt;/b&gt; . You need to pass just doc file path to it and it save the .RTF format file .&lt;br /&gt;
First you need to add reference of  Microsoft.Office.Interop.Word.dll dll in project .&lt;br /&gt;
&lt;pre&gt;Microsoft.Office.Interop.Word.dll
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Function For Conversion Doc To RTF&lt;/b&gt; :&lt;br /&gt;
&lt;pre&gt;public void ConvertDocToRTF(string DocPath)
{        
        //Creare object of documnet .
        Document document = new Document();
        try
        {
          //Load doc file from given path
          document.LoadFromFile(DocPath);
         //Save doc file. It will convert to .Rtf format .
          document.SaveToFile(&quot;Tesfile.rtf&quot;, FileFormat.Rtf);
        }
        catch (Exception) { throw; }
}
&lt;/pre&gt;
&lt;br /&gt;
Call Function :&lt;br /&gt;
&lt;pre&gt;ConvertDocToRTF(&quot;MyDocFilePath&quot;);
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;fieldset &gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;br /&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/how-to-add-html-code-in-blogspot.html&quot; target=&quot;_blank&quot;&gt;Html Code in blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/radiobuttonlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Radiobuttonlist Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/to-take-back-up-of-database-in-sql.html&quot; target=&quot;_blank&quot;&gt;Database backup in sql Server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/1089895150809244301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2012/01/doc-file-to-rtf-format-in-aspnet-c.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/1089895150809244301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/1089895150809244301'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2012/01/doc-file-to-rtf-format-in-aspnet-c.html' title='DOC file to RTF format in asp.net C#.'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-2721609680109933447</id><published>2012-01-05T03:24:00.001-08:00</published><updated>2012-01-28T01:11:45.472-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net C#"/><title type='text'>Send Mail Using gmail In asp.net c#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Send Mail Using gmail In asp.net c#&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Introduction &lt;/b&gt;: In this article i will show you how to send mail 
in asp.net using gmail account.It is very simple just you need to pass 
your gmail account email address and password in 
System.Net.NetworkCredential() . And also you need to set host= smtp.gmail.com ,port =587 .I 
have following code to send mail using gmail account in asp.net c# . &lt;/div&gt;
&lt;br /&gt;
&lt;pre&gt;protected void btnSendMail_Click1(object sender, EventArgs e)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string myEmailAddress = &quot;your gmail account&quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string mypwd = &quot;your gmail account password&quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string toEmailAddress = &quot;to email address&quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string subject = &quot;Test Subject&quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string mailbody = &quot;Test body&quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var client = new System.Net.Mail.SmtpClient(&quot;smtp.gmail.com&quot;, 587)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Credentials = new System.Net.NetworkCredential(myEmailAddress, mypwd),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EnableSsl = true
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; client.Send(myEmailAddress, toEmailAddress, subject, mailbody);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;fieldset &gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;br /&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/how-to-add-html-code-in-blogspot.html&quot; target=&quot;_blank&quot;&gt;Html Code in blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/radiobuttonlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Radiobuttonlist Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/to-take-back-up-of-database-in-sql.html&quot; target=&quot;_blank&quot;&gt;Database backup in sql Server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/2721609680109933447/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/2721609680109933447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/2721609680109933447'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html' title='Send Mail Using gmail In asp.net c#'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-1608797388966142987</id><published>2012-01-04T23:01:00.000-08:00</published><updated>2012-01-28T01:12:36.191-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net C#"/><title type='text'>Redirect One website to another website automatically</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Redirect One website to another website &lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Introduction &lt;/b&gt;: In this article i will show &lt;b&gt;how to redirect one website to another website&lt;/b&gt; . Many times we require that some one visit&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;www.xyz.com&lt;/span&gt;&amp;nbsp; then he should be redirect to another site for that you need add peace of java-script code and it &lt;b&gt;automatically redirect to another site &lt;/b&gt;.&lt;/div&gt;
&lt;br /&gt;
&lt;pre&gt;
&amp;lt;head runat=&quot;server&quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; location.replace(&quot;http://www.google.com&quot;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;fieldset &gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;br /&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/how-to-add-html-code-in-blogspot.html&quot; target=&quot;_blank&quot;&gt;Html Code in blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/radiobuttonlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Radiobuttonlist Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/to-take-back-up-of-database-in-sql.html&quot; target=&quot;_blank&quot;&gt;Database backup in sql Server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/1608797388966142987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2012/01/redirect-one-website-to-another-website.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/1608797388966142987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/1608797388966142987'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2012/01/redirect-one-website-to-another-website.html' title='Redirect One website to another website automatically'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-9113603058612435984</id><published>2011-12-27T02:41:00.000-08:00</published><updated>2012-01-28T01:13:09.633-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net C#"/><category scheme="http://www.blogger.com/atom/ns#" term="RadioButtonList"/><title type='text'>RadioButtonList Control In Asp.net c#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;RadioButtonList Control In Asp.net c#&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzYDxgMidB8Cxngo3quy9WEun_ClKW9MlJ8DU9wgc2PU1Wx4KVDe4vxdBpouioxmRtHA2Zu0qnGFknDs_dEVGpIKml1O8cPiY7JYslQZGgH3Cr49hAaIMQeD33iTVLU90rj-DC3IkaOjxw/s1600/RadioButtonList_Example.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;177&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzYDxgMidB8Cxngo3quy9WEun_ClKW9MlJ8DU9wgc2PU1Wx4KVDe4vxdBpouioxmRtHA2Zu0qnGFknDs_dEVGpIKml1O8cPiY7JYslQZGgH3Cr49hAaIMQeD33iTVLU90rj-DC3IkaOjxw/s200/RadioButtonList_Example.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Introduction &lt;/b&gt;:&amp;nbsp; In this article i will show you how to bind &lt;b&gt;Radiobuttonlist &lt;/b&gt;in asp.net c# .&lt;b&gt;Radiobuttonlist&lt;/b&gt; control is group of Radiobutton.Many time we require to bind the data in RadioButtonList using database sql server in asp.net . I have here provided complete Html code and Code behind code for binding RadioButtonList In Asp.net c# .Following are my simple code .&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Html Code :-&lt;/b&gt;&lt;br /&gt;
&lt;pre&gt;&amp;lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeFile=&quot;RadioButtonList.aspx.cs&quot; Inherits=&quot;RadioButtonList&quot; %&amp;gt;
&amp;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;&amp;gt;
&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&amp;gt;
&amp;lt;head runat=&quot;server&quot;&amp;gt; &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt; &amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;form id=&quot;form1&quot; runat=&quot;server&quot;&amp;gt;
        &amp;lt;div&amp;gt;
            &amp;lt;table&amp;gt;
                &amp;lt;tr&amp;gt; &amp;lt;td&amp;gt; &amp;lt;h2&amp;gt; RadioButtonList example&amp;lt;/h2&amp;gt;&amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;
                &amp;lt;tr&amp;gt;
                       &amp;lt;td&amp;gt; &amp;lt;asp:RadioButtonList ID=&quot;rblRadiobuttonlistTest&quot; CellPadding=&quot;1&quot; CellSpacing=&quot;1&quot; RepeatDirection=&quot;Vertical&quot; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:RadioButtonList&amp;gt;  &amp;lt;/td&amp;gt;
                &amp;lt;/tr&amp;gt;
            &amp;lt;/table&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

&lt;/pre&gt;
&lt;b&gt;Server Side Code :-&lt;/b&gt;&lt;br /&gt;
&lt;pre&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

public partial class RadioButtonList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            bindRadioButtonList();
        }
    }
    private void bindRadioButtonList()
    {   try{
            DataSet Ds = GetDataSet(&quot;Select * from Countrytable&quot;);
            rblRadiobuttonlistTest.DataSource = Ds;                 // Set DataSource Here
            rblRadiobuttonlistTest.DataTextField = &quot;CountryName&quot;;   // Assign DataText Field
            rblRadiobuttonlistTest.DataValueField = &quot;CountryID&quot;;    // Assign Value Field
            rblRadiobuttonlistTest.DataBind();
            }  catch (Exception) { }
    }
    private DataSet GetDataSet(string Query)
    {   DataSet Ds = new DataSet();
        try{
            string strCon = @&quot;Data Source=ServerName\SQLEXPRESS;Initial Catalog=Test;Integrated Security=True&quot;;  //Conntection String
            SqlConnection Con = new SqlConnection(strCon);
            SqlDataAdapter Da = new SqlDataAdapter(Query, Con);
            Da.Fill(Ds);
           } catch (Exception) { }
        return Ds; 
    }
}&lt;/pre&gt;

&lt;b&gt;Conclusion &lt;/b&gt;: It is very easy to bind the &lt;b&gt;radiobuttonlist &lt;/b&gt;control in asp.net .
&lt;br /&gt;
&lt;br /&gt;
&lt;fieldset &gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/how-to-add-html-code-in-blogspot.html&quot; target=&quot;_blank&quot;&gt;Html Code in blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/radiobuttonlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Radiobuttonlist Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/to-take-back-up-of-database-in-sql.html&quot; target=&quot;_blank&quot;&gt;Database backup in sql Server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/9113603058612435984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2011/12/radiobuttonlist-example-in-aspnet-c.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/9113603058612435984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/9113603058612435984'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2011/12/radiobuttonlist-example-in-aspnet-c.html' title='RadioButtonList Control In Asp.net c#'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzYDxgMidB8Cxngo3quy9WEun_ClKW9MlJ8DU9wgc2PU1Wx4KVDe4vxdBpouioxmRtHA2Zu0qnGFknDs_dEVGpIKml1O8cPiY7JYslQZGgH3Cr49hAaIMQeD33iTVLU90rj-DC3IkaOjxw/s72-c/RadioButtonList_Example.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-983270578380908891</id><published>2011-12-27T01:47:00.001-08:00</published><updated>2012-01-07T04:37:12.325-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="blog Trick"/><title type='text'>How to add Html Code in Blogspot</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Html Code In&lt;i&gt; Blogspot&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Introduction &lt;/b&gt;: In this article i will show you how you can add &lt;b&gt;html code in Blogger&lt;/b&gt; .sometimes we require to display&lt;i&gt; html code in blog&lt;/i&gt; too. To add &lt;b&gt;Html code&lt;/b&gt; you need to follow just some steps then html code will be able to display in blog .&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;Open &lt;a href=&quot;http://centricle.com/tools/html-entities/&quot;&gt;http://centricle.com/tools/html-entities/&lt;/a&gt; Site&amp;nbsp;&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Paste Html Code in box&lt;/li&gt;
&lt;li&gt;Then Click on Encode&lt;/li&gt;
&lt;li&gt;Copy Encode Code and paste in your blog&lt;/li&gt;
&lt;/ol&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;fieldset &gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/how-to-add-html-code-in-blogspot.html&quot; target=&quot;_blank&quot;&gt;Html Code in blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/radiobuttonlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Radiobuttonlist Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/to-take-back-up-of-database-in-sql.html&quot; target=&quot;_blank&quot;&gt;Database backup in sql Server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/983270578380908891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2011/12/how-to-add-html-code-in-blogspot.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/983270578380908891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/983270578380908891'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2011/12/how-to-add-html-code-in-blogspot.html' title='How to add Html Code in Blogspot'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-7245350569312126629</id><published>2011-12-27T01:32:00.000-08:00</published><updated>2012-01-28T01:14:09.888-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net C#"/><category scheme="http://www.blogger.com/atom/ns#" term="CheckBoxList"/><title type='text'>CheckBoxList example In Asp.net c#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;b&gt;CheckBoxList example In Asp.net c#&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Many time we require to bind the data in &lt;b&gt;checkboxlist &lt;/b&gt;using database sql server in asp.net . I have here provided complete Html code and Code behind code for &lt;b&gt;binding CheckBoxList&lt;/b&gt; In&lt;b&gt; Asp.net c#&lt;/b&gt; .Following are my simple code .&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Screen Shots :-&lt;/b&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJV21pkyHG65xpDJn7fz13d6GWyj8MKhgGOk3ogdkmBsMSItIOfMAZIcpEkKH5brc3c-GJFsyHtBQm5nFtbHiQcnmga1gLo7D6VPb6jCwU2GAGXwrwhtf3inqFMwts6X_YwYHQAgNVZzEY/s1600/Checkboxlist_Example.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJV21pkyHG65xpDJn7fz13d6GWyj8MKhgGOk3ogdkmBsMSItIOfMAZIcpEkKH5brc3c-GJFsyHtBQm5nFtbHiQcnmga1gLo7D6VPb6jCwU2GAGXwrwhtf3inqFMwts6X_YwYHQAgNVZzEY/s200/Checkboxlist_Example.png&quot; width=&quot;198&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4MKeFkzHSU8jZsJO8B2gQ6CzGnyLlTjG4DbnvjHWRApxJsK_1tEDGo-_z7CFnraYkxF3ZCXu-UDWdJdjTTOHRmoZvBFmnP0OKzxksN492buR4zto4zvDUjrBYrDfMWjnVK_t9n1E7R7n6/s1600/Table_CheckboxList.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;162&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4MKeFkzHSU8jZsJO8B2gQ6CzGnyLlTjG4DbnvjHWRApxJsK_1tEDGo-_z7CFnraYkxF3ZCXu-UDWdJdjTTOHRmoZvBFmnP0OKzxksN492buR4zto4zvDUjrBYrDfMWjnVK_t9n1E7R7n6/s200/Table_CheckboxList.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;b&gt;Html Code :-&lt;/b&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
&amp;lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeFile=&quot;Checkboxlist.aspx.cs&quot; Inherits=&quot;Checkboxlist&quot; %&amp;gt;
&amp;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;&amp;gt;
&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&amp;gt;
&amp;lt;head runat=&quot;server&quot;&amp;gt;
    &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;form id=&quot;form1&quot; runat=&quot;server&quot;&amp;gt;
    &amp;lt;table&amp;gt;
        &amp;lt;tr&amp;gt; &amp;lt;td&amp;gt; &amp;lt;h2&amp;gt;  CheckBoxList example&amp;lt;/h2&amp;gt; &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;
        &amp;lt;tr&amp;gt;
            &amp;lt;td&amp;gt; &amp;lt;asp:CheckBoxList ID=&quot;chklisttest&quot; runat=&quot;server&quot;&amp;gt; &amp;lt;/asp:CheckBoxList&amp;gt;  &amp;lt;/td&amp;gt;
        &amp;lt;/tr&amp;gt;
    &amp;lt;/table&amp;gt;
    &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/code&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Code Behind :-&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

public partial class Checkboxlist : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            bindCheckBoxList();
        }
    }
    private void bindCheckBoxList()
    {   try
        {
            DataSet Ds = GetDataSet(&quot;Select * from Countrytable&quot;);
            chklisttest.DataSource = Ds;
            chklisttest.DataTextField = &quot;CountryName&quot;;
            chklisttest.DataValueField = &quot;CountryID&quot;;
            chklisttest.DataBind();
        }
        catch (Exception){}
    }
    private DataSet GetDataSet(string Query)
    {   DataSet Ds = new DataSet();
        try
        {   string strCon = @&quot;Data Source=Servername;Initial Catalog=Test;Integrated Security=True&quot;;
            SqlConnection Con = new SqlConnection(strCon);
            SqlDataAdapter Da = new SqlDataAdapter(Query, Con);
            Da.Fill(Ds);           
        }
        catch (Exception){}
        return Ds;
    }
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;fieldset &gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/how-to-add-html-code-in-blogspot.html&quot; target=&quot;_blank&quot;&gt;Html Code in blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/radiobuttonlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Radiobuttonlist Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/to-take-back-up-of-database-in-sql.html&quot; target=&quot;_blank&quot;&gt;Database backup in sql Server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/7245350569312126629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/7245350569312126629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/7245350569312126629'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html' title='CheckBoxList example In Asp.net c#'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJV21pkyHG65xpDJn7fz13d6GWyj8MKhgGOk3ogdkmBsMSItIOfMAZIcpEkKH5brc3c-GJFsyHtBQm5nFtbHiQcnmga1gLo7D6VPb6jCwU2GAGXwrwhtf3inqFMwts6X_YwYHQAgNVZzEY/s72-c/Checkboxlist_Example.png" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-1381410143797452543</id><published>2011-12-26T22:21:00.001-08:00</published><updated>2012-01-07T04:38:05.516-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net C#"/><category scheme="http://www.blogger.com/atom/ns#" term="DataSet"/><title type='text'>Fill Dataset In  Asp.net C#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Fill DataSet In Asp.net C#&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Introduction :&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
In this article i will show how to fill &lt;b&gt;dataset from database sql server&lt;/b&gt; using c# language .For this i have created common methodh in which you have just pass the query and it automatically return the filled &lt;b&gt;dataset &lt;/b&gt;.GetDataSet function contains the easy code to &lt;b&gt;fill the dataset&lt;/b&gt; .&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Calling the method :&lt;/b&gt;
&lt;br /&gt;
&lt;pre&gt;DataSet Ds = GetDataSet(&quot;Select * from Tablename&quot;);&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Method to bind dataset :&lt;/b&gt;
&lt;br /&gt;
&lt;pre&gt;private DataSet GetDataSet(string Query)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataSet Ds = new DataSet();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string strCon =&quot;&quot;; // set connetion string here ..
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SqlConnection Con = new SqlConnection(strCon);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SqlDataAdapter Da = new SqlDataAdapter(Query, Con);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Da.Fill(Ds);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch (Exception)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Ds;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } 
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;fieldset &gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/how-to-add-html-code-in-blogspot.html&quot; target=&quot;_blank&quot;&gt;Html Code in blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/radiobuttonlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Radiobuttonlist Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/to-take-back-up-of-database-in-sql.html&quot; target=&quot;_blank&quot;&gt;Database backup in sql Server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/1381410143797452543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2011/12/fill-dataset-in-aspnet-c.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/1381410143797452543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/1381410143797452543'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2011/12/fill-dataset-in-aspnet-c.html' title='Fill Dataset In  Asp.net C#'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8892227236862052262.post-6077950709894436341</id><published>2011-06-03T02:28:00.000-07:00</published><updated>2012-03-06T02:07:45.740-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net C#"/><category scheme="http://www.blogger.com/atom/ns#" term="GridView"/><title type='text'>DateTime Format in GridView ItemTemplate In Asp.net C#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;DateTime Format in GridView ItemTemplate In Asp.net C#&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
To format DateTime in GridView In ItemTemplate we have to pass format in eval or bind . There are many format available for the &lt;br /&gt;
DateTime .In this article i have given some example that how to format datetime and at end i have listed the datetime format&lt;br /&gt;
used in gridview .&lt;br /&gt;
&lt;br /&gt;
Following are&amp;nbsp; the examples of ItemTemplate where format used for datetime .&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;asp:TemplateField&amp;gt;
    &amp;lt;ItemTemplate&amp;gt;
        &amp;lt;asp:Label ID=&quot;lblDate&quot; runat=&quot;server&quot; Text=&#39;&amp;lt;%# Eval(&quot;Date&quot;, &quot;{0:dd/MM/yyyy}&quot;)%&amp;gt;&#39; &amp;gt;&amp;lt;/asp:Label&amp;gt;
    &amp;lt;/ItemTemplate&amp;gt;
&amp;lt;/asp:TemplateField&amp;gt;
&amp;lt;asp:TemplateField&amp;gt;
    &amp;lt;ItemTemplate&amp;gt;
        &amp;lt;asp:Label ID=&quot;lblDat1&quot; runat=&quot;server&quot; Text=&#39;&amp;lt;%# Eval(&quot;Date&quot;, &quot;{0:D}&quot;)%&amp;gt;&#39; &amp;gt;&amp;lt;/asp:Label&amp;gt;
    &amp;lt;/ItemTemplate&amp;gt;
&amp;lt;/asp:TemplateField&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
Following are&amp;nbsp; the examples of BoundFieldwhere format used for datetime .&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;asp:boundfield datafield=&quot;DOB&quot; dataformatstring=&quot;{0:d}&quot; headertext=&quot;Date Of Birth&quot; readonly=&quot;True&quot;&amp;gt; &amp;lt;/asp:boundfield&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
The following table shows some date format strings that can be used to format date in GridView columns,&lt;br /&gt;
&lt;br /&gt;
 &lt;table class=&quot;gridtable&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;&lt;b&gt;Format Pattern&lt;/b&gt;&lt;/th&gt;
&lt;th&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/th&gt;
&lt;th&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;d&lt;/td&gt;
&lt;td&gt;Short date&lt;/td&gt;
&lt;td&gt;11/8/2008&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D&lt;/td&gt;
&lt;td&gt;Long date&lt;/td&gt;
&lt;td&gt;Sunday, August 11, 2008&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;t&lt;/td&gt;
&lt;td&gt;Short time&lt;/td&gt;
&lt;td&gt;3:32 PM
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;T
&lt;/td&gt;
&lt;td&gt;Long time
&lt;/td&gt;
&lt;td&gt;3:32:00 PM
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;f
&lt;/td&gt;
&lt;td&gt;Full date/time (short time)
&lt;/td&gt;
&lt;td&gt;Sunday, August 11, 2008 3:32 PM
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;F
&lt;/td&gt;
&lt;td&gt;Full date/time (long time)
&lt;/td&gt;
&lt;td&gt;Sunday, August 11, 2008 3:32:00 PM
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;g
&lt;/td&gt;
&lt;td&gt;General date/time (short time)
&lt;/td&gt;
&lt;td&gt;8/11/2008 3:32 PM
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;G
&lt;/td&gt;
&lt;td&gt;General date/time (long time)
&lt;/td&gt;
&lt;td&gt;8/11/2008 3:32:00 PM
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;m or M
&lt;/td&gt;
&lt;td&gt;Month day
&lt;/td&gt;
&lt;td&gt;August 11
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;r or R
&lt;/td&gt;
&lt;td&gt;RFC 1123
&lt;/td&gt;
&lt;td&gt;Sun, 11 Aug 2008 8:32:00 GMT
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;s
&lt;/td&gt;
&lt;td&gt;Sortable date/time
&lt;/td&gt;
&lt;td&gt;2008-08-11T15:32:00
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;u
&lt;/td&gt;
&lt;td&gt;Universable sortable date/time
&lt;/td&gt;
&lt;td&gt;2008-08-11 15:32:00z
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;U
&lt;/td&gt;
&lt;td&gt;Universable sortable date/time
&lt;/td&gt;
&lt;td&gt;Sunday, August 11, 2008 11:32:00 PM
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;y or Y&lt;/td&gt;
&lt;td&gt;Year month&lt;/td&gt;
&lt;td&gt;August, 2008&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;fieldset &gt;
&lt;legend&gt;Related Other posts&lt;/legend&gt;
&lt;table&gt;
    &lt;tbody&gt;
&lt;tr&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/how-to-add-html-code-in-blogspot.html&quot; target=&quot;_blank&quot;&gt;Html Code in blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/radiobuttonlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Radiobuttonlist Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/bind-image-in-datalist-control-in.html&quot; target=&quot;_blank&quot;&gt;Image In Datalist&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/merge-word-document-files-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Merge docs files in c#&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/to-take-back-up-of-database-in-sql.html&quot; target=&quot;_blank&quot;&gt;Database backup in sql Server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/12/checkboxlist-example-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;CheckboxList example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html&quot; target=&quot;_blank&quot;&gt;Datetime format in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/send-mail-using-gmail-in-aspnet-c.html&quot; target=&quot;_blank&quot;&gt;Send mail in asp.net c#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;ul style=&quot;list-style-type: circle;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/fetch-highest-second-record-in-sql.html&quot; target=&quot;_blank&quot;&gt;Highest second record in sql &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/nested-gridview-in-aspnet.html&quot; target=&quot;_blank&quot;&gt;Nested gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://hamidseta.blogspot.com/2011/05/checking-all-checkboxes-in-gridview-by.html&quot; target=&quot;_blank&quot;&gt;Checkboxs in gridview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hamidseta.blogspot.com/2012/01/validation-using-jquery-in-aspnet-page.html&quot; target=&quot;_blank&quot;&gt;Validation using jquery in asp.net page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/fieldset&gt;

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidseta.blogspot.com/feeds/6077950709894436341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html#comment-form' title='15 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/6077950709894436341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8892227236862052262/posts/default/6077950709894436341'/><link rel='alternate' type='text/html' href='http://hamidseta.blogspot.com/2011/06/datetime-format-in-gridview.html' title='DateTime Format in GridView ItemTemplate In Asp.net C#'/><author><name>seta hamid</name><uri>http://www.blogger.com/profile/08452079705876987424</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>15</thr:total></entry></feed>