<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosuresfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-6236973097452836208</atom:id><lastBuildDate>Sun, 22 Jan 2012 18:47:55 +0000</lastBuildDate><category>IRequiresSessionState</category><category>Code Snippets</category><category>POP Access From ASP.Net</category><category>UpdateProgress</category><category>State Management</category><category>Javascript</category><category>GridView ASP.NET</category><category>Encrypt and Decript String</category><category>AJAX</category><category>Session</category><category>API Integration</category><category>Tracing</category><category>Payment Module</category><category>ASP.NET</category><category>ValidatorCallout</category><category>Trojan Programming</category><category>SQL SERVER 2005</category><category>IP Address</category><category>Multiple File Upload</category><category>MS-SQL</category><category>C#.Net</category><category>Read Email From ASP.NET</category><category>DirectX</category><category>Silverlight</category><category>AJAX Control Toolkit</category><title>Open Source .Net</title><description /><link>http://makhaai.blogspot.com/</link><managingEditor>noreply@blogger.com (Raju.M)</managingEditor><generator>Blogger</generator><openSearch:totalResults>89</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/OpenSourcenet" /><feedburner:info uri="opensourcenet" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><itunes:owner><itunes:email>noreply@blogger.com</itunes:email></itunes:owner><itunes:explicit>no</itunes:explicit><itunes:subtitle></itunes:subtitle><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-4604820979744936328</guid><pubDate>Tue, 29 Nov 2011 02:46:00 +0000</pubDate><atom:updated>2011-11-28T19:38:23.116-08:00</atom:updated><title>Unlimited Scroll in ASP.Net DataList Control</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Unlimited scroll is not a big deal, for example facebook news feed its scroll when user reach bottom of the page.
Actually client side script check the scroll position  the container, if the position is in bottom, the scripts request content form server and update the container. In here the container is a DIV tag, named holder, and put some style tag height, width and overflow.holder is hold the DataList&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;CSS for the holder.
&lt;/b&gt;&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&lt;style type="text/css"&gt;
    #holder {width: 1900px; height:200px;overflow:auto;  }
&lt;/style&gt;
&lt;/pre&gt;
Here I used Northwind database Products Table to demonstrate the unlimited scroll in this&amp;nbsp; article and used a Handler page, First time page loads with 10 records in DataList, take a look below.
&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;        if (!IsPostBack)
        {
            DataClass data = new DataClass();
            DataList1.DataSource = data.FirstTenRecords();
            DataList1.DataBind();
        }
&lt;/pre&gt;
And in client side I set current item count to 10 and next item count to 0. 
&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;var current=10;
var next=0;
&lt;/pre&gt;
and call function for load next form javascript, it’s nothing but calling server via AJAX, ie requesting Handler page with a query string of start and next. below&amp;nbsp; image shows how the request url form client, I used firebug to show requests &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-Ma1zUhWZBGU/TtRHr2LIHZI/AAAAAAAABZ8/e2ghTbdeagY/s1600/unlimitedscroll.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-Ma1zUhWZBGU/TtRHr2LIHZI/AAAAAAAABZ8/e2ghTbdeagY/s1600/unlimitedscroll.PNG" /&gt;&lt;/a&gt;&lt;/div&gt;
lets look on &lt;b&gt;loadNext&lt;/b&gt;
&lt;br /&gt;
&lt;pre class="xml" name="code"&gt; var loadNext = function () {
            next = current + 10;
            $.ajax({
                url: "Handler.ashx?start=" + current + "&amp;amp;next=" + next,
                success: function (data) {
                    $("#DataList1").append(data);
                }
            });
            current = current + 10;
        };
&lt;/pre&gt;
Before calling the Handler page set next, after set current to current+10
&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;  next = current + 10;
  current = current + 10;
&lt;/pre&gt;
To get the data from a specific row number I used a stored procedure, it will return my data, I want to send number of position, if I send start=10&amp;amp;next=20, It will return 10th to 20th row form the database.

&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;USE [Northwind]
GO
/****** Object:  StoredProcedure [dbo].[ProductPages]    Script Date: 11/28/2011 12:03:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[ProductPages]
(
 @start int,
 @next int
) 
AS
BEGIN
SELECT ProductID,ProductName,UnitPrice FROM
(
   SELECT ROW_NUMBER() OVER(ORDER BY ProductID,ProductName,UnitPrice) NUM,
   * FROM Products
) A 
WHERE NUM &amp;gt;@start AND NUM &amp;lt;=@next
END
&lt;/pre&gt;
Now let take a look on how its work. everything works depends on holders scroll function. script check the scroll position of the container is bottom or not, if it on bottom, function call loadNext().

&lt;br /&gt;
&lt;pre class="xml" name="code"&gt; $(document).ready(function () {
            $("#holder").scroll(function () {
                if ($(this)[0].scrollHeight - $(this).scrollTop() == $(this).outerHeight()) {
                    loadNext();
                }
            });
        });
&lt;/pre&gt;
Handler page is nothing, like a aspx page.Its call a class file DataClass, DataClass is simple class file to reduce bulky code in Handler page. It call the DataLayer and return the data from database, after do some format to fill on the DataList and write it on response.
&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;public void ProcessRequest(HttpContext context)
    {
        string startQstring = context.Request.QueryString["start"];
        string nextQstring = context.Request.QueryString["next"];
        //null check
        if ((!string.IsNullOrWhiteSpace(startQstring)) &amp;amp;&amp;amp; (!string.IsNullOrWhiteSpace(nextQstring)))
        {
            //convert string to int
            int start = Convert.ToInt32(startQstring);
            int next = Convert.ToInt32(nextQstring);
            
            //setting content type
            context.Response.ContentType = "text/plain";
            DataClass data = new DataClass();
            //writing response
            context.Response.Write(data.GetAjaxContent(start, next));
        }
    }
&lt;/pre&gt;
There is only one class file. But I put there class on that file.&lt;br /&gt;
1:&lt;b&gt;DataClass 
 &lt;/b&gt;:&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;Contain two function On handler page we are calling first function GetAjaxContent(start,end) it retrun the records from database.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;2nd function loaad data on Page_Load even
 &lt;/li&gt;
&lt;/ul&gt;
2: &lt;b&gt;Provide :
 &lt;/b&gt;Provide SqlConnection from web.config&lt;br /&gt;
3:&lt;b&gt;DBHelper &lt;/b&gt;: Data layer

Take a look &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

/// &lt;summary&gt;
/// Summary description for DataClass
/// &lt;/summary&gt;
/// 


public class DataClass
{
    public DataClass()
    {
    }
    /// &lt;summary&gt;
    ///  return rows depend on position
    ///  if you need 10th to 20th you need to pass start=10 and end=20
    /// &lt;/summary&gt;
    /// &lt;param name="start" /&gt;
database start position of one row
    /// &lt;param name="next" /&gt;
database end position of one row
    /// &lt;returns&gt;&lt;/returns&gt;
    public string GetAjaxContent(int start, int end)
    {
        string result = string.Empty;
        //adding sp params with values in Dictionary entry.
        Dictionary&lt;string, object=""&gt; keyValPair = new Dictionary&lt;string, object=""&gt;();
        keyValPair.Add("@start", start);
        keyValPair.Add("@next", end);

        DBHelper DBHelper = new DBHelper();
        //passing the Stored Procedure name and keyvalue pair
        DataTable dataTable = DBHelper.GetTable("ProductPages", keyValPair);
        if (dataTable.Rows.Count &amp;gt; 0)
        {
            for (int i = 0; i &amp;lt; dataTable.Rows.Count; i++)
            {
                result += string.Format(@"
                                                        
                                                            &lt;table&gt;
                                                                &lt;tbody&gt;
&lt;tr&gt;
                                                                    &lt;td style="width: 50px;"&gt;{0}&lt;/td&gt;&lt;td style="width: 400px;"&gt;{1}&lt;/td&gt;&lt;td style="width: 150px;"&gt;{2}&lt;/td&gt;
                                                                &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
", dataTable.Rows[i][0].ToString(), dataTable.Rows[i][1].ToString(), dataTable.Rows[i][2].ToString());
            }

        }
        //this string is going to append on Datalist on client.
        return result;
    }
    /// &lt;summary&gt;
    /// function to bind data on page load
    /// &lt;/summary&gt;
    /// &lt;returns&gt;&lt;/returns&gt;
    public DataTable FirstTenRecords()
    {
        Dictionary&lt;string, object=""&gt; keyValPair = new Dictionary&lt;string, object=""&gt;();
        keyValPair.Add("@start", 0);
        keyValPair.Add("@next", 10);

        DBHelper DBHelper = new DBHelper();
        DataTable dataTable = DBHelper.GetTable("ProductPages", keyValPair);
        return dataTable;
    }
}

/// &lt;summary&gt;
/// return sqlconnection string formweb.config file
/// &lt;/summary&gt;
public class Provider
{
    public static SqlConnection GetConnection()
    {
        return new SqlConnection(ConfigurationManager.AppSettings["SqlConnectionString"]);
    }
}
/// &lt;summary&gt;
/// Data layer
/// &lt;/summary&gt;
public class DBHelper
{
    public DBHelper()
    { }

    SqlConnection con;
    SqlCommand cmd;
    SqlDataAdapter adapter;
    public DataTable GetTable(string SPName, Dictionary&lt;string, object=""&gt; SPParamWithValues)
    {
        DataTable dataTable = new DataTable();
        try
        {
            con = Provider.GetConnection();
            //open DB connection
            con.Open();
            cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Connection = con;
            cmd.CommandText = SPName;
            foreach (KeyValuePair&lt;string, object=""&gt; paramValue in SPParamWithValues)
            {
                cmd.Parameters.AddWithValue(paramValue.Key, paramValue.Value);
            }
            adapter = new SqlDataAdapter(cmd);
            adapter.Fill(dataTable);
        }
        finally
        {
            //close connection string
            con.Close();
        }
        return dataTable;
    }
}
&lt;/string,&gt;&lt;/string,&gt;&lt;/string,&gt;&lt;/string,&gt;&lt;/string,&gt;&lt;/string,&gt;&lt;/pre&gt;
If it not display properly please use the images
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-O_9sJNjZzaU/TtRPN28hNgI/AAAAAAAABaI/vSSs5t0k30M/s1600/dataclass.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-O_9sJNjZzaU/TtRPN28hNgI/AAAAAAAABaI/vSSs5t0k30M/s1600/dataclass.PNG" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-qUe21XpiybU/TtRPYVNKGgI/AAAAAAAABag/VNqOfEiQm_Q/s1600/DBlayer.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-qUe21XpiybU/TtRPYVNKGgI/AAAAAAAABag/VNqOfEiQm_Q/s1600/DBlayer.PNG" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-qFgIwoopevU/TtRPYNJmm-I/AAAAAAAABaU/7EWzCf7brbw/s1600/provide.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-qFgIwoopevU/TtRPYNJmm-I/AAAAAAAABaU/7EWzCf7brbw/s1600/provide.PNG" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;a href="http://www.mediafire.com/download.php?foylq96zbahn5zd" target="_blank"&gt;Download Source&lt;/a&gt;&lt;/div&gt;
&lt;a href="http://www.codeproject.com/script/Articles/ViewDownloads.aspx?aid=126421"&gt;Download full source code&lt;/a&gt; 
&lt;a href="http://www.codeproject.com/script/Articles/BlogFeedList.aspx?amid=3497545" rel="tag" style="display: none;"&gt;CodeProject&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-4604820979744936328?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=mdSsj7ldJHc:uJQMtFhav7Y:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=mdSsj7ldJHc:uJQMtFhav7Y:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=mdSsj7ldJHc:uJQMtFhav7Y:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=mdSsj7ldJHc:uJQMtFhav7Y:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=mdSsj7ldJHc:uJQMtFhav7Y:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=mdSsj7ldJHc:uJQMtFhav7Y:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=mdSsj7ldJHc:uJQMtFhav7Y:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=mdSsj7ldJHc:uJQMtFhav7Y:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=mdSsj7ldJHc:uJQMtFhav7Y:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=mdSsj7ldJHc:uJQMtFhav7Y:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=mdSsj7ldJHc:uJQMtFhav7Y:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=mdSsj7ldJHc:uJQMtFhav7Y:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=mdSsj7ldJHc:uJQMtFhav7Y:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=mdSsj7ldJHc:uJQMtFhav7Y:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=mdSsj7ldJHc:uJQMtFhav7Y:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=mdSsj7ldJHc:uJQMtFhav7Y:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=mdSsj7ldJHc:uJQMtFhav7Y:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/mdSsj7ldJHc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/mdSsj7ldJHc/unlimited-scroll-in-aspnet-datalist.html</link><author>noreply@blogger.com (Raju.M)</author><media:thumbnail url="http://2.bp.blogspot.com/-Ma1zUhWZBGU/TtRHr2LIHZI/AAAAAAAABZ8/e2ghTbdeagY/s72-c/unlimitedscroll.PNG" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://makhaai.blogspot.com/2011/11/unlimited-scroll-in-aspnet-datalist.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-4044872168529707124</guid><pubDate>Fri, 30 Sep 2011 11:16:00 +0000</pubDate><atom:updated>2011-09-30T07:23:48.485-07:00</atom:updated><title>Download  Microsoft® Visual Studio® 11 Developer Preview</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;b&gt;Overview
&lt;/b&gt;&lt;br /&gt;
Visual Studio 11 Developer Preview is an integrated development environment that seamlessly spans the entire life cycle of software creation, including architecture, user interface design, code creation, code insight and analysis, code deployment, testing, and validation. This release adds support for the most advanced Microsoft platforms, including the next version of Windows (code-named "Windows 8") and Windows Azure, and enables you to target platforms across devices, services, and the cloud. Integration with Team Foundation Server allows the entire team, from the customer to the developer, to build scalable and high-quality applications to exacting standards and requirements.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Visual Studio 11 Developer Preview is prerelease software and should not be used in production scenarios.&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
This preview enables you to test updates and improvements made since Visual Studio 2010, including the following:&lt;br /&gt;
&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;

    Support for the most advanced platforms from Microsoft, including Windows 8 and Windows Azure, as well as a host of language enhancements.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;    New features such as code clone detection, code review workflow, enhanced unit testing, lightweight requirements, production intelliTrace™, exploratory testing, and fast context switching.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-Lc60sOi3aGM/ToXQxpFx7sI/AAAAAAAABXY/FB89CjO1em4/s1600/framework+support.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="223" src="http://1.bp.blogspot.com/-Lc60sOi3aGM/ToXQxpFx7sI/AAAAAAAABXY/FB89CjO1em4/s320/framework+support.PNG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;/ul&gt;
&lt;br /&gt;
This preview can be installed to run side by side with an existing Visual Studio 2010 installation. The preview provides an opportunity for developers to use the software and provide feedback before the final release. To provide feedback, please visit the Microsoft Connect website.&lt;br /&gt;
&lt;br /&gt;
The .NET Framework 4.5 Developer Preview is also installed as part of Visual Studio 11 Developer Preview.&lt;br /&gt;
&lt;br /&gt;
Note: This prerelease software will expire on June 30, 2012. To continue using Visual Studio 11 after that date, you will have to install a later version of the software.&lt;br /&gt;
&lt;br /&gt;
In order to develop Metro style applications, the Visual Studio 11 Developer Preview must be installed on the &lt;a href="http://msdn.microsoft.com/en-us/windows/apps/br229516"&gt;Windows Developer Preview with developer tools English, 64-bit&lt;/a&gt;. Developing Metro style applications on other Preview versions of Windows 8 is not supported.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-3YnTZksekck/ToXQ5fTreQI/AAAAAAAABXc/Y3L0OPjRBKg/s1600/startupscreen.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="180" src="http://1.bp.blogspot.com/-3YnTZksekck/ToXQ5fTreQI/AAAAAAAABXc/Y3L0OPjRBKg/s320/startupscreen.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h2 id="system-requirements"&gt;

System requirements&lt;/h2&gt;
&lt;b&gt;Supported Operating Systems:&lt;/b&gt; Windows 7, Windows Server 2008 R2&lt;br /&gt;
&lt;ul&gt;&lt;ul&gt;
&lt;li&gt;Windows 7 (x86 and x64)&lt;/li&gt;
&lt;li&gt;Windows 8 (x86 and x64)&lt;/li&gt;
&lt;li&gt;Windows Server 2008 R2 (x64) &lt;/li&gt;
&lt;li&gt;Windows Server Developer Preview (x64)&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&lt;b&gt;Supported Architectures:&lt;/b&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;32-bit (x86)&lt;/li&gt;
&lt;li&gt;64-bit (x64) &lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&lt;b&gt;Hardware Requirements:&lt;/b&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;1.6 GHz or faster processor&lt;/li&gt;
&lt;li&gt;1 GB of RAM (1.5 GB if running on a virtual machine)&lt;/li&gt;
&lt;li&gt;5.5 GB of available hard disk space&lt;/li&gt;
&lt;li&gt;5400 RPM hard drive&lt;/li&gt;
&lt;li&gt;DirectX 9-capable video card running at 1024 x 768 or higher display resolution&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;a href="http://www.asp.net/vnext/whats-new"&gt;What is new in VS2011&lt;/a&gt; &lt;br /&gt;
&lt;ul&gt;&lt;ul&gt;
&lt;/ul&gt;
&lt;/ul&gt;
Source &lt;a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=27543"&gt;Download&amp;nbsp; Microsoft® Visual Studio® 11 Developer Preview &lt;/a&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-4044872168529707124?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=0aSIFb8URaA:-j8JVf5LSjo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=0aSIFb8URaA:-j8JVf5LSjo:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=0aSIFb8URaA:-j8JVf5LSjo:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=0aSIFb8URaA:-j8JVf5LSjo:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=0aSIFb8URaA:-j8JVf5LSjo:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/0aSIFb8URaA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/0aSIFb8URaA/microsoft-visual-studio-11-developer.html</link><author>noreply@blogger.com (Raju.M)</author><media:thumbnail url="http://1.bp.blogspot.com/-Lc60sOi3aGM/ToXQxpFx7sI/AAAAAAAABXY/FB89CjO1em4/s72-c/framework+support.PNG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://makhaai.blogspot.com/2011/09/microsoft-visual-studio-11-developer.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-2601033414346022064</guid><pubDate>Tue, 30 Aug 2011 09:45:00 +0000</pubDate><atom:updated>2011-08-30T02:46:21.210-07:00</atom:updated><title>Download Microsoft Visual Studio 2010 SP1</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;b&gt;MIcrosoft Visual Studio 2010 SP1 RTM&lt;/b&gt;&lt;br /&gt;
Microsoft released Microsoft Visual Studio 2010 SP1 RTM for all vs2010 products to developers.&lt;br /&gt;
&lt;a href="http://go.microsoft.com/fwlink/?LinkId=209902"&gt;Online Installer&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://go.microsoft.com/fwlink/?LinkId=210710"&gt;Offline Installer&lt;/a&gt; &lt;br /&gt;
Offline Installer is an .ISO file. You can use daemon tools [download from &lt;a href="http://www.daemon-tools.cc/eng/downloads/"&gt;here&lt;/a&gt;] to create virtual IDE devices.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-2601033414346022064?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=yvWXVy5BSpM:9b6ILyaUchg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=yvWXVy5BSpM:9b6ILyaUchg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=yvWXVy5BSpM:9b6ILyaUchg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=yvWXVy5BSpM:9b6ILyaUchg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=yvWXVy5BSpM:9b6ILyaUchg:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=yvWXVy5BSpM:9b6ILyaUchg:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=yvWXVy5BSpM:9b6ILyaUchg:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=yvWXVy5BSpM:9b6ILyaUchg:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=yvWXVy5BSpM:9b6ILyaUchg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=yvWXVy5BSpM:9b6ILyaUchg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=yvWXVy5BSpM:9b6ILyaUchg:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=yvWXVy5BSpM:9b6ILyaUchg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=yvWXVy5BSpM:9b6ILyaUchg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=yvWXVy5BSpM:9b6ILyaUchg:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=yvWXVy5BSpM:9b6ILyaUchg:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=yvWXVy5BSpM:9b6ILyaUchg:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=yvWXVy5BSpM:9b6ILyaUchg:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/yvWXVy5BSpM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/yvWXVy5BSpM/download-microsoft-visual-studio-2010.html</link><author>noreply@blogger.com (Raju.M)</author><thr:total>0</thr:total><enclosure url="http://go.microsoft.com/fwlink/?LinkId=210710" length="1592336384" type="application/octet-stream" /><media:content url="http://go.microsoft.com/fwlink/?LinkId=210710" fileSize="1592336384" type="application/octet-stream" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>MIcrosoft Visual Studio 2010 SP1 RTM Microsoft released Microsoft Visual Studio 2010 SP1 RTM for all vs2010 products to developers. Online Installer Offline Installer Offline Installer is an .ISO file. You can use daemon tools [download from here] to crea</itunes:subtitle><itunes:author>noreply@blogger.com (Raju.M)</itunes:author><itunes:summary>MIcrosoft Visual Studio 2010 SP1 RTM Microsoft released Microsoft Visual Studio 2010 SP1 RTM for all vs2010 products to developers. Online Installer Offline Installer Offline Installer is an .ISO file. You can use daemon tools [download from here] to create virtual IDE devices.OpenSource.Net</itunes:summary><feedburner:origLink>http://makhaai.blogspot.com/2011/08/download-microsoft-visual-studio-2010.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-5173199636992377956</guid><pubDate>Wed, 02 Feb 2011 01:04:00 +0000</pubDate><atom:updated>2011-02-01T17:14:01.682-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">AJAX</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><title>Checking Username Availability using ASP.net AJAX</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Checking username in user registration page is common thing in these days. Now we can check how to this using AJAX., ie Check username availability without postback. To achieve this you need to know about Ajax. Ajax is Asynchronous JavaScript and XML.  AJAX is the art of exchanging data with a server, and update parts of a web page - without reloading the whole page &lt;a href="http://www.w3schools.com/ajax/default.asp"&gt;[more]&lt;/a&gt;.&lt;/div&gt;&lt;br /&gt;
Here I use two Class files and one Generic handler page to simplify code.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1: AjaxHelper&lt;br /&gt;
2: DataBaseHelper&lt;br /&gt;
3: Handler.ashx&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Do not get confused, Client side javascript communicating sever with the help of Handler file, ie we send request to handler file, In the Handler file we create one instance of  &lt;b&gt;AjaxHelper Class &lt;/b&gt; and communicate with database with the help of &lt;b&gt;DataBaseHelper Class &lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
First we can check the sample images&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_atbH0-cQOmg/TUiipuBiPHI/AAAAAAAAA84/BlrQp6G-WFs/s1600/availlllllllllllll.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_atbH0-cQOmg/TUiipuBiPHI/AAAAAAAAA84/BlrQp6G-WFs/s1600/availlllllllllllll.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_atbH0-cQOmg/TUii_bTwDxI/AAAAAAAAA9A/-dwiu0azAF0/s1600/notav.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_atbH0-cQOmg/TUii_bTwDxI/AAAAAAAAA9A/-dwiu0azAF0/s1600/notav.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
User in Database&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_atbH0-cQOmg/TUitH4K8OAI/AAAAAAAAA9I/uSGwsB9ELMY/s1600/table.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_atbH0-cQOmg/TUitH4K8OAI/AAAAAAAAA9I/uSGwsB9ELMY/s1600/table.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can check how to send request to Handler Page, ie we do ajax calls to server, see the script below&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&lt;script language="javascript" type="text/javascript"&gt;
    function btnDoAjaxCall_onclick() {
        var xmlhttp;
            if (window.XMLHttpRequest)
              {
              xmlhttp=new XMLHttpRequest();
              }
            else
              {
              xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            xmlhttp.onreadystatechange=function()
              {
              if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200)
                {
              // showAvailability is a div used to display response form server
document.getElementById("showAvailability").innerHTML=xmlhttp.responseText;
                }
              }
        var str=document.getElementById("TextBox1").value;
        //sending request to handler page
        xmlhttp.open("GET","Handler.ashx?uname="+str,true);
        xmlhttp.send();
    }
    
&lt;/script&gt;
&lt;/pre&gt;&lt;br /&gt;
Above we  requested the handler file, Now we are going to check what handler file do when a request come from the client side.&lt;br /&gt;
first handler file check the query string. after create an instance of AjaxHelper class, it contain one boolean function called &lt;b&gt;CheckUserNameAvailable(stirng username)&lt;/b&gt;. if the value of &lt;b&gt;CheckUserNameAvailable &lt;/b&gt; is true, it send response as "Available" else it send "Not Available".&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;public void ProcessRequest(HttpContext context)
    {
        HttpRequest request = context.Request;
        HttpResponse response = context.Response;
        if (!string.IsNullOrEmpty(request.QueryString["uname"]))
        {
            AjaxHelper ajaxHelper = new AjaxHelper();
            bool available = ajaxHelper.CheckUserNameAvailable(request.QueryString["uname"]);
            if (available)
            {
                response.Write("&lt;div style="color: green; width: 200px;"&gt;Username Available&lt;/div&gt;");
            }
            else
            { response.Write("&lt;div style="color: red; width: 200px;"&gt;Username Not Available&lt;/div&gt;"); }
        }

    }&lt;/pre&gt;&lt;br /&gt;
Next is what is happening AjaxHelper Class, here is do not use any store procedure, if you need you can use SP. I already mentioned that this class contain only one method,  &lt;b&gt;public bool CheckUserNameAvailable(string username)&lt;/b&gt;&lt;br /&gt;
in this class I select the users in usertable which username is equal to requested username.&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;public class AjaxHelper
{
    public AjaxHelper()
    {
    }
    public bool CheckUserNameAvailable(string username)
    {
        DataBaseHelper DBHelper = new DataBaseHelper();
        string cmdString = string.Format("SELECT username FROM usertable  WHERE username ='{0}'", username);
        string user = Convert.ToString(DBHelper.ExecuteScalar(cmdString));
        if (string.IsNullOrEmpty(user))
            return true;
        else
            return false;
    }
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Check the &lt;b&gt;DataBaseHelper &lt;/b&gt;Class, in DataBaseHelper class we read connection string form web.config file. then create sql connection, set sql command object, open sql connection, execute sql command, close sql connection, dispose command and connection.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;public class DataBaseHelper
{
    SqlConnection con;
    SqlCommand cmd;

    public DataBaseHelper()
    {
    }
    public object ExecuteScalar(string commandText)
    {
        con = Provider.GetConnection();
        cmd = new SqlCommand(commandText, con);
        con.Open();
        try
        {
            return cmd.ExecuteScalar();
        }
        catch
        { throw; }
        finally
        {
            cmd.Dispose();
            con.Close();
            con.Dispose();
        }
    }
}




public class Provider
{
    public static SqlConnection GetConnection()
    {
        return new SqlConnection(ConfigurationManager.AppSettings["sqlConn"]);
    }
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Connection string in Web.Config &lt;/b&gt;&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&lt;appsettings&gt;
    &lt;add key="sqlConn" value="Data Source=MAKHAAI\SQLEXPRESS;Initial Catalog=test;Integrated Security=True"&gt;
  &lt;/add&gt;
&lt;/appsettings&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
Download source &lt;a href="http://www.cafekerala.com/makhaaiblogspot/username_availability.rar"&gt;username availability in asp.net Ajax&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-5173199636992377956?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=XULKme2R_e4:kGt8lELhQ4I:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=XULKme2R_e4:kGt8lELhQ4I:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=XULKme2R_e4:kGt8lELhQ4I:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=XULKme2R_e4:kGt8lELhQ4I:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=XULKme2R_e4:kGt8lELhQ4I:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=XULKme2R_e4:kGt8lELhQ4I:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=XULKme2R_e4:kGt8lELhQ4I:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=XULKme2R_e4:kGt8lELhQ4I:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=XULKme2R_e4:kGt8lELhQ4I:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=XULKme2R_e4:kGt8lELhQ4I:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=XULKme2R_e4:kGt8lELhQ4I:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=XULKme2R_e4:kGt8lELhQ4I:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=XULKme2R_e4:kGt8lELhQ4I:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=XULKme2R_e4:kGt8lELhQ4I:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=XULKme2R_e4:kGt8lELhQ4I:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=XULKme2R_e4:kGt8lELhQ4I:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=XULKme2R_e4:kGt8lELhQ4I:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/XULKme2R_e4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/XULKme2R_e4/checking-username-availability-using.html</link><author>noreply@blogger.com (Raju.M)</author><media:thumbnail url="http://3.bp.blogspot.com/_atbH0-cQOmg/TUiipuBiPHI/AAAAAAAAA84/BlrQp6G-WFs/s72-c/availlllllllllllll.png" height="72" width="72" /><thr:total>6</thr:total><enclosure url="http://www.cafekerala.com/makhaaiblogspot/username_availability.rar" length="3379" type="application/octet-stream" /><media:content url="http://www.cafekerala.com/makhaaiblogspot/username_availability.rar" fileSize="3379" type="application/octet-stream" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>Checking username in user registration page is common thing in these days. Now we can check how to this using AJAX., ie Check username availability without postback. To achieve this you need to know about Ajax. Ajax is Asynchronous JavaScript and XML. AJA</itunes:subtitle><itunes:author>noreply@blogger.com (Raju.M)</itunes:author><itunes:summary>Checking username in user registration page is common thing in these days. Now we can check how to this using AJAX., ie Check username availability without postback. To achieve this you need to know about Ajax. Ajax is Asynchronous JavaScript and XML. AJAX is the art of exchanging data with a server, and update parts of a web page - without reloading the whole page [more]. Here I use two Class files and one Generic handler page to simplify code. 1: AjaxHelper 2: DataBaseHelper 3: Handler.ashx Do not get confused, Client side javascript communicating sever with the help of Handler file, ie we send request to handler file, In the Handler file we create one instance of AjaxHelper Class and communicate with database with the help of DataBaseHelper Class First we can check the sample images User in Database Now we can check how to send request to Handler Page, ie we do ajax calls to server, see the script below function btnDoAjaxCall_onclick() { var xmlhttp; if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { // showAvailability is a div used to display response form server document.getElementById("showAvailability").innerHTML=xmlhttp.responseText; } } var str=document.getElementById("TextBox1").value; //sending request to handler page xmlhttp.open("GET","Handler.ashx?uname="+str,true); xmlhttp.send(); } Above we requested the handler file, Now we are going to check what handler file do when a request come from the client side. first handler file check the query string. after create an instance of AjaxHelper class, it contain one boolean function called CheckUserNameAvailable(stirng username). if the value of CheckUserNameAvailable is true, it send response as "Available" else it send "Not Available". public void ProcessRequest(HttpContext context) { HttpRequest request = context.Request; HttpResponse response = context.Response; if (!string.IsNullOrEmpty(request.QueryString["uname"])) { AjaxHelper ajaxHelper = new AjaxHelper(); bool available = ajaxHelper.CheckUserNameAvailable(request.QueryString["uname"]); if (available) { response.Write("Username Available"); } else { response.Write("Username Not Available"); } } } Next is what is happening AjaxHelper Class, here is do not use any store procedure, if you need you can use SP. I already mentioned that this class contain only one method, public bool CheckUserNameAvailable(string username) in this class I select the users in usertable which username is equal to requested username. public class AjaxHelper { public AjaxHelper() { } public bool CheckUserNameAvailable(string username) { DataBaseHelper DBHelper = new DataBaseHelper(); string cmdString = string.Format("SELECT username FROM usertable WHERE username ='{0}'", username); string user = Convert.ToString(DBHelper.ExecuteScalar(cmdString)); if (string.IsNullOrEmpty(user)) return true; else return false; } } Check the DataBaseHelper Class, in DataBaseHelper class we read connection string form web.config file. then create sql connection, set sql command object, open sql connection, execute sql command, close sql connection, dispose command and connection. public class DataBaseHelper { SqlConnection con; SqlCommand cmd; public DataBaseHelper() { } public object ExecuteScalar(string commandText) { con = Provider.GetConnection(); cmd = new SqlCommand(commandText, con); con.Open(); try { return cmd.ExecuteScalar(); } catch { throw; } finally { cmd.Dispose(); con.Close(); con.Dispose(); } } } public class Provider { public static SqlConnection GetConnection() { return new SqlConnection(ConfigurationManager.AppSettings["sqlConn"]); } } Connection string in Web.Config Download source username availability in asp.net AjaxOpenSource.Net</itunes:summary><itunes:keywords>AJAX, ASP.NET</itunes:keywords><feedburner:origLink>http://makhaai.blogspot.com/2011/02/checking-username-availability-using.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-5182526443497891687</guid><pubDate>Tue, 25 Jan 2011 23:33:00 +0000</pubDate><atom:updated>2011-01-30T15:50:23.049-08:00</atom:updated><title>Javascript Countdown timer</title><description>This post is mainly to understand, how to program a countdown timer using javascript. if you need to study more about javascript and javascript timer function go to &lt;a href="http://www.w3schools.com"&gt;w3schools.com&lt;/a&gt; and select Learn JavaScript.&lt;br /&gt;
&lt;br /&gt;
Here I use two funtion to ActivateTimer() and Timer()&lt;br /&gt;
&lt;br /&gt;
check the script&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;&lt;script language="javascript" type="text/javascript"&gt;
            var min = 1;
            var sec = 59;
            var timer;
            var timeon = 0;
            function ActivateTimer() {
                if (!timeon) {
                    timeon = 1;
                    Timer();
                }
            }
            function Timer() {

                var _time = min + ":" + sec;
                document.getElementById("Label1").innerHTML =_time;
                if (_time != "0:0") {

                    if (sec == 0) {
                        min = min - 1;
                        sec = 59;
                    } else {
                        sec = sec - 1;
                    }
                    timer = setTimeout("Timer()", 1000);
                }
                else {
                    alert("Time is Over");
                }
            }
           
        &lt;/script&gt;&lt;/pre&gt;&lt;b&gt; Check the Output&lt;/b&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_atbH0-cQOmg/TT9cpcZh1II/AAAAAAAAA8w/W68j5CqAbNo/s1600/image.axd.png" imageanchor="1" style=""&gt;&lt;img border="0" height="168" width="327" src="http://4.bp.blogspot.com/_atbH0-cQOmg/TT9cpcZh1II/AAAAAAAAA8w/W68j5CqAbNo/s400/image.axd.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://makhaai.dotnetobject.com/timer.html"&gt;Example URL&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Full code file&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="html" name="code"&gt;&amp;lt;HTML&amp;gt;
  &amp;lt;BODY&amp;gt;
  &amp;lt;div&amp;gt;
        &amp;lt;div ID=&amp;quot;Label1&amp;quot; style=&amp;quot;font-size:24pt;font-weight:bold;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
        &amp;lt;input type=&amp;quot;button&amp;quot; onclick=&amp;quot;ActivateTimer();&amp;quot; value=&amp;quot;Activate&amp;quot; /&amp;gt;
        &amp;lt;script language=&amp;quot;javascript&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;
            var min = 1;
            var sec = 59;
            var timer;
            var timeon = 0;
            function ActivateTimer() {
                if (!timeon) {
                    timeon = 1;
                    Timer();
                }
            }
            function Timer() {
                var _time = min + &amp;quot;:&amp;quot; + sec;
                document.getElementById(&amp;quot;Label1&amp;quot;).innerHTML =_time;
                if (_time != &amp;quot;0:0&amp;quot;) {
                    if (sec == 0) {
                        min = min - 1;
                        sec = 59;
                    } else {
                        sec = sec - 1;
                    }
                    timer = setTimeout(&amp;quot;Timer()&amp;quot;, 1000);
                }
                else {
                    alert(&amp;quot;Time is Over&amp;quot;);
                }
            }
        &amp;lt;/script&amp;gt;

    &amp;lt;/div&amp;gt;
 &amp;lt;/BODY&amp;gt;
&amp;lt;/HTML&amp;gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-5182526443497891687?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=T-AVgakebBc:Bs4IBHDc4Tk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=T-AVgakebBc:Bs4IBHDc4Tk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=T-AVgakebBc:Bs4IBHDc4Tk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=T-AVgakebBc:Bs4IBHDc4Tk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=T-AVgakebBc:Bs4IBHDc4Tk:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=T-AVgakebBc:Bs4IBHDc4Tk:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=T-AVgakebBc:Bs4IBHDc4Tk:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=T-AVgakebBc:Bs4IBHDc4Tk:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=T-AVgakebBc:Bs4IBHDc4Tk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=T-AVgakebBc:Bs4IBHDc4Tk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=T-AVgakebBc:Bs4IBHDc4Tk:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=T-AVgakebBc:Bs4IBHDc4Tk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=T-AVgakebBc:Bs4IBHDc4Tk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=T-AVgakebBc:Bs4IBHDc4Tk:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=T-AVgakebBc:Bs4IBHDc4Tk:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=T-AVgakebBc:Bs4IBHDc4Tk:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=T-AVgakebBc:Bs4IBHDc4Tk:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/T-AVgakebBc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/T-AVgakebBc/javascript-countdown-timer.html</link><author>noreply@blogger.com (Raju.M)</author><media:thumbnail url="http://4.bp.blogspot.com/_atbH0-cQOmg/TT9cpcZh1II/AAAAAAAAA8w/W68j5CqAbNo/s72-c/image.axd.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://makhaai.blogspot.com/2011/01/javascript-countdown-timer.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-757330426643125683</guid><pubDate>Tue, 25 Jan 2011 23:22:00 +0000</pubDate><atom:updated>2011-04-25T14:56:40.242-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Code Snippets</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><title>Limiting file size or getting file size of Upload file in ASP.Net</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;this is a small code snippet to limit file size on file upload&lt;br /&gt;
&lt;br /&gt;
Asp.Net FileUpload control's FileBytes.Length returns file size in Bytes. &lt;br /&gt;
Here we want file size in MB. so we want to divide size by 1024*1024.&lt;br /&gt;
&lt;br /&gt;
ie &lt;br /&gt;
1024 kilobytes = 1 megabyte (MB)&lt;br /&gt;
1 Kilobyte = 1024 bytes &lt;br /&gt;
&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;protected void Button1_Click(object sender, EventArgs e)
    {
        //checking size&amp;nbsp;
        double fileSize =(double) FileUpload1.FileBytes.Length;
        double fileinMB = fileSize / (1024 * 1024);
        if (fileinMB &amp;gt; limit)
        {
            Response.Write("Size is limited to 2MB");
        }
        else
        {
        //upload file
            Response.Write("Uploaded");
        }
       
    }

&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-757330426643125683?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=8ymdot5KrVo:X8S_IoeBD7E:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=8ymdot5KrVo:X8S_IoeBD7E:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=8ymdot5KrVo:X8S_IoeBD7E:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=8ymdot5KrVo:X8S_IoeBD7E:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=8ymdot5KrVo:X8S_IoeBD7E:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=8ymdot5KrVo:X8S_IoeBD7E:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=8ymdot5KrVo:X8S_IoeBD7E:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=8ymdot5KrVo:X8S_IoeBD7E:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=8ymdot5KrVo:X8S_IoeBD7E:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=8ymdot5KrVo:X8S_IoeBD7E:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=8ymdot5KrVo:X8S_IoeBD7E:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=8ymdot5KrVo:X8S_IoeBD7E:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=8ymdot5KrVo:X8S_IoeBD7E:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=8ymdot5KrVo:X8S_IoeBD7E:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=8ymdot5KrVo:X8S_IoeBD7E:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=8ymdot5KrVo:X8S_IoeBD7E:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=8ymdot5KrVo:X8S_IoeBD7E:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/8ymdot5KrVo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/8ymdot5KrVo/limiting-file-size-or-getting-file-size.html</link><author>noreply@blogger.com (Raju.M)</author><thr:total>0</thr:total><feedburner:origLink>http://makhaai.blogspot.com/2011/01/limiting-file-size-or-getting-file-size.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-8359164460648505421</guid><pubDate>Sat, 06 Nov 2010 23:47:00 +0000</pubDate><atom:updated>2011-10-21T04:51:46.343-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C#.Net</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><title>Image Handling In ASP.Net</title><description>&lt;b&gt;&lt;span style="font-size: large;"&gt;Contents&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Store Image&lt;/b&gt;&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;&lt;b&gt;In Database&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;In Folder &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Display Image in Image Control, GridView and DataList&amp;nbsp;&lt;/b&gt;&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;&lt;b&gt;From Database&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;From Folder&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;&lt;b&gt;Creating Thumbnails&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Adding Watermark Text on Image&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Adding Image as Watermark&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;Introduction&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In this Article&amp;nbsp; I am going to explain how to handle image in ASP.Net. I seen lot of question regarding &lt;b&gt;"How to save and display image from database in ASP.Net"&amp;nbsp;&lt;/b&gt; in different .net discussing forums. I think it must be helpful for beginners to solve their problems regarding images in ASP.Net. &amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;Store Images &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
We can store images in Database and project folders. If it is in Database the datatype of image data is "image" , now we can check the Database design&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;In Database&lt;/b&gt;&lt;/span&gt; &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_atbH0-cQOmg/TNWop7lcPVI/AAAAAAAAA7Q/0cPv_3lnZDA/s1600/database.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_atbH0-cQOmg/TNWop7lcPVI/AAAAAAAAA7Q/0cPv_3lnZDA/s1600/database.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
here I used create a store procedure to save image in database.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;CREATE PROCEDURE [dbo].[sp_UploadImage]
@imageData as image
AS
BEGIN
INSERT INTO Images (imageData) VALUES(@imageData)
END
&lt;/pre&gt;&lt;br /&gt;
Now we can look how to save image in Database. we need one FileUpload Control to select file. and need to check file extension to verify uploading file is image or not. below script function "valiadate();"&amp;nbsp; check the file is image or not, ie we check the file extensions with javascript. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Javascript to check Upload file extension&lt;/b&gt; &lt;br /&gt;
&lt;pre class="javascript" name="code"&gt;&lt;script language="javascript" type="text/javascript"&gt;
            function validate() {
                var result = false;
                var upfile = document.getElementById("FileUpload1").value;
                if (upfile != "") {
                    var accept = "png,gif,jpg,jpeg".split(',');
                    var getExtention = upfile.split('.');
                    var extention = getExtention[getExtention.length - 1];
                    for (i = 0; i &lt; accept.length; i++) {
                        if (accept[i] == extention) {
                            result = true;
                            break;
                        }
                    }
                    if (!result) {
                        alert("allowed file extetions are png,gif,jpg,jpeg");
                    }
                }
                else {
                    alert("select image to Upload");
                }
                return result;
            }
        
&lt;/script&gt;
&lt;/pre&gt;&lt;b&gt;Now check the .aspx page&lt;/b&gt; 










&lt;pre class="html" name="code"&gt; &lt;asp:fileupload id="FileUpload1" runat="server"&gt;
    &lt;asp:button id="btnUploadImage" onclick="btnUploadImage_Click" onclientclick="return validate();" runat="server" text="Upload to DataBase"&gt;
&lt;/asp:button&gt;&lt;/asp:fileupload&gt;&lt;/pre&gt;Now server side code. Reading bytes value from FileUpload Control and pass that value with store procedure name in to a HashTable. that hashtable send to DataBaseHelper Class file to save image in Database.










&lt;pre class="csharp" name="code"&gt; protected void btnUploadImage_Click(object sender, EventArgs e)
    {
        //server side checking
        if (FileUpload1.PostedFile.ContentType.ToLower().StartsWith("image") &amp;amp;&amp;amp; FileUpload1.HasFile)
        {
            Hashtable imageHash = new Hashtable();
            imageHash.Add("@imageData", FileUpload1.FileBytes);
            DataBaseHelper DBHelper = new DataBaseHelper();
            //storing image in to DataBase
            DBHelper.ExecuteNonQuery("sp_UploadImage", imageHash);
        }
    }&amp;nbsp;&lt;/pre&gt;&lt;b&gt; Database with image data&lt;/b&gt;










&lt;div class="separator" style="clear: both; text-align: center;"&gt;

&lt;a href="http://2.bp.blogspot.com/_atbH0-cQOmg/TNWxEVS99PI/AAAAAAAAA7U/Fqpn78543ws/s1600/databasewithimage.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_atbH0-cQOmg/TNWxEVS99PI/AAAAAAAAA7U/Fqpn78543ws/s1600/databasewithimage.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;
In Folder&lt;/span&gt;&lt;/b&gt;
Saving folder is simple to compare saving in Database. FileUpload control have SaveAs() method to save file. here I save images in "savedImages" folder. We are not keeping any values in database. At the time of display image we pick images from folder using DirectoryInfo and FileInfo Class or Directory.GetFiles Methord











&lt;pre class="csharp" name="code"&gt;protected void btnUploadToFolder_Click(object sender, EventArgs e)
    {
        //save file in folder
        if (FileUpload1.PostedFile.ContentType.ToLower().StartsWith("image") &amp;amp;&amp;amp; FileUpload1.HasFile)
        {
            string savelocation = Server.MapPath("savedImages/");
            string fileExtention = System.IO.Path.GetExtension(FileUpload1.FileName);
            //creating filename to avoid file name conflicts.
            string fileName = Guid.NewGuid().ToString();
            //saving file in savedImage folder.
            string savePath = savelocation + fileName + fileExtention;
            FileUpload1.SaveAs(savePath);
        }
    }&lt;/pre&gt;&lt;b&gt;Preview of saved images in folder&lt;/b&gt;











&lt;div class="separator" style="clear: both; text-align: center;"&gt;

&lt;a href="http://2.bp.blogspot.com/_atbH0-cQOmg/TNWzRRBi6kI/AAAAAAAAA7Y/ghNxO_E_CeE/s1600/savedImages.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_atbH0-cQOmg/TNWzRRBi6kI/AAAAAAAAA7Y/ghNxO_E_CeE/s1600/savedImages.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Display Images in Image Control, GridView and DataList&lt;/span&gt;&lt;/b&gt;
To display image from Database is not simple as displaying from folders. because we previously saved image as byte in Database.

&lt;b&gt;&lt;span style="font-size: large;"&gt;
From Database
&lt;/span&gt;&lt;/b&gt;
To display image, we need to change&amp;nbsp; byte data to Image, to convert byte data to image we need to use a separate page, here I am using a Generic Handler page to show image from Database.&amp;nbsp; 
In that Generic Handler page we take image byte from Database and render in that Handler page and set image controls src or ImageUrl to that Generic Handler page for example it work like this











&lt;pre class="csharp" name="code"&gt;//from database
Image1.ImageUrl="Handler.aspx?id=1";
//from folder
Image1.ImageUrl="savedImages/ca34fa6c-8321-492c-938b-5413781bdcde.png";
&lt;/pre&gt;&lt;b&gt;Display image in Generic Handler page&lt;/b&gt;

&lt;b&gt;
Method 1&lt;/b&gt;











&lt;pre class="csharp" name="code"&gt;  
   public void ProcessRequest (HttpContext context) {
        HttpRequest request = context.Request;
        if (!string.IsNullOrEmpty(request.QueryString["id"]))
        {
            //this hash table contain the SP parameter
            Hashtable hash = new Hashtable();
            hash.Add("@imageID", request.QueryString["id"]);
            DataBaseHelper DBHelper = new DataBaseHelper();

            //DBHelper.SQLExecuteNonQuery(procedure_name,command_parameters) return the object data.
            // casting return value to byte[]
            byte[] imageByte = (byte[])DBHelper.SQLExecuteNonQuery("sp_getImage", hash);
            //creating object of image
            System.Drawing.Image b;
            //creating object of bitmap
            Bitmap bitMap = null;
            //checking byte[] 
            if (imageByte != null &amp;amp;&amp;amp; imageByte.Length &amp;gt; 0)
            {
                //creating memoryStream object
                using (MemoryStream mm = new MemoryStream())
                {
                    //wrting to memoryStream
                    mm.Write(imageByte, 0, imageByte.Length);
                    b = System.Drawing.Image.FromStream(mm);
                    bitMap = new System.Drawing.Bitmap(b, b.Width, b.Height);
                    //creating graphic object, to produce High Quality images.
                    using (Graphics g = Graphics.FromImage(bitMap))
                    {
                        g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
                        g.SmoothingMode = SmoothingMode.HighQuality;
                        g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
                        g.DrawImage(bitMap, 0, 0, b.Width, b.Height);
                        g.Dispose(); b.Dispose(); mm.Dispose();
                        //changing content type of handler page
                        context.Response.ContentType = "image/jpeg";
                        //saving bitmap image
                        bitMap.Save(context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
                        bitMap.Dispose();
                    }
                }
            }
        }
    }
  &lt;/pre&gt;&lt;b&gt;Method 2&lt;/b&gt;
You can also use this code to render image in Handler page











&lt;pre class="csharp" name="code"&gt;public void ProcessRequest (HttpContext context) {
        HttpRequest request = context.Request;
        if (!string.IsNullOrEmpty(request.QueryString["id"]))
        {
            //this hash table contain the SP parameter
            Hashtable hash = new Hashtable();
            hash.Add("@imageID", request.QueryString["id"]);
            DataBaseHelper DBHelper = new DataBaseHelper();

            //DBHelper.SQLExecuteNonQuery(procedure_name,command_parameters) return the object data.
            // casting return value to byte[]
            byte[] imageByte = (byte[])DBHelper.SQLExecuteNonQuery("sp_getImage", hash);
            //checking byte[] 
            if (imageByte != null &amp;amp;&amp;amp; imageByte.Length &amp;gt; 0)
            {
                context.Response.ContentType = "image/jpeg";
                context.Response.BinaryWrite(imageByte);
            }
        }
    }&amp;nbsp;&lt;/pre&gt;Example of Handler page displaying image, and check the URL, it display 3rd&amp;nbsp; image from the Database.











&lt;div class="separator" style="clear: both; text-align: center;"&gt;

&lt;a href="http://2.bp.blogspot.com/_atbH0-cQOmg/TNXH74oQ99I/AAAAAAAAA7c/Qs8nmMG7TMo/s1600/sampleimagefromhandler.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="303" src="http://2.bp.blogspot.com/_atbH0-cQOmg/TNXH74oQ99I/AAAAAAAAA7c/Qs8nmMG7TMo/s640/sampleimagefromhandler.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;Store procedure used to get Image












&lt;pre class="csharp" name="code"&gt;CREATE PROCEDURE sp_getImage
@imageID as numeric
AS
BEGIN
SELECT imageData FROM Images WHERE imageId=@imageID
END&amp;nbsp;&lt;/pre&gt;I already said how to display image in Image Conrtol. now we can check how to display in  &lt;b&gt;GridView Control&lt;/b&gt; form folders and Database.


&lt;b&gt;
From Database&lt;/b&gt;
In the aspx page I put a GridView and , then set SqlDataSource, after that I&amp;nbsp; add a Template column, then drag and drop a Image control in Template column&amp;nbsp; and set ImageUrl of the image control using Image DataBinding


&lt;b&gt;Setting image url&amp;nbsp;&lt;/b&gt;












&lt;div class="separator" style="clear: both; text-align: center;"&gt;

&lt;a href="http://3.bp.blogspot.com/_atbH0-cQOmg/TNXh45mDTjI/AAAAAAAAA7g/3JudfloYZ0c/s1600/gridview.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="402" src="http://3.bp.blogspot.com/_atbH0-cQOmg/TNXh45mDTjI/AAAAAAAAA7g/3JudfloYZ0c/s640/gridview.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;


&lt;b&gt;Source of GridView&lt;/b&gt;
Passing &lt;b&gt;imageId&lt;/b&gt; to Handler.ashx page. It will display image as I said above.












&lt;div class="separator" style="clear: both; text-align: center;"&gt;

&lt;a href="http://2.bp.blogspot.com/_atbH0-cQOmg/TNXjMzKMlzI/AAAAAAAAA7k/mrOByS1CU64/s1600/gridviews.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_atbH0-cQOmg/TNXjMzKMlzI/AAAAAAAAA7k/mrOByS1CU64/s1600/gridviews.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;
Preview with HTML Source.&lt;/b&gt;












&lt;div class="separator" style="clear: both; text-align: center;"&gt;

&lt;a href="http://4.bp.blogspot.com/_atbH0-cQOmg/TNXjh-HZbTI/AAAAAAAAA7o/0QXI4J8FpRo/s1600/gridviewSample.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="448" src="http://4.bp.blogspot.com/_atbH0-cQOmg/TNXjh-HZbTI/AAAAAAAAA7o/0QXI4J8FpRo/s640/gridviewSample.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt; Displaying Image From Folder&lt;/b&gt;
you need to add a template column in GridView after that put one image control on template column, then set image controls DataImageUrlField from DataTable.










&lt;pre class="xml" name="code"&gt;&amp;lt;asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="false"&amp;gt;
     &amp;lt;Columns&amp;gt;
         &amp;lt;asp:ImageField  DataImageUrlField="Image"&amp;gt;
         &amp;lt;/asp:ImageField&amp;gt;
     &amp;lt;/Columns&amp;gt;
 &amp;lt;/asp:GridView&amp;gt;&lt;/pre&gt;&lt;b&gt; Server side code&lt;/b&gt;










&lt;pre class="csharp" name="code"&gt; private void BindImage()
    {
     
        DataTable dt = new DataTable();
        dt.Columns.Add(new DataColumn("Image", typeof(string)));
        DataRow dr;
        int i = 0;
  //fetching files from savedImages folder
        foreach (string file in Directory.GetFiles(Server.MapPath(@"savedImages\")))
        {
            dr = dt.NewRow();
            dt.Rows.Add(dr);
            dr["Image"] = "savedImages/" + System.IO.Path.GetFileName(file);
            i += 1;
        }
        GridView2.DataSource = dt;
        GridView2.DataBind();
    }
&lt;/pre&gt;Now we can check how DataList works. Datalist is more simple control than GridView. Here aslo we call Database image with Generic Handler file Handler.ashx and pass "id" as QueryString. handler file display image, and we point that image in to our DataList Control.











&lt;pre class="xml" name="code"&gt;&amp;lt;asp:DataList ID="DataList1" runat="server"
            RepeatColumns="3" RepeatDirection="Horizontal"&amp;gt;
            &amp;lt;ItemTemplate&amp;gt;
                &amp;lt;table&amp;gt;
                    &amp;lt;tr&amp;gt;
                        &amp;lt;td valign="middle" align="center" style="background-color:#cccccc;border:1px solid gray;width:150px;height:150px;"&amp;gt;&amp;lt;%#DataBinder.Eval(Container.DataItem, "images") %&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:DataList&amp;gt;&lt;/pre&gt;&lt;pre class="csharp" name="code"&gt;protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            BindDataList();
    }
    private void BindDataList()
    {
        string sqlCmd = "SELECT imageid FROM Images";
        DataBaseHelper DBHelper = new DataBaseHelper();
        DataTable dt = DBHelper.GetTable(sqlCmd);
        //adding new column to disply image
        DataColumn imageCol = new DataColumn("images", typeof(string));
        dt.Columns.Add(imageCol);
        
        if (dt.Rows.Count &amp;gt; 0)
        {
            for (int i = 0; i &amp;lt; dt.Rows.Count; i++)
            {
                dt.Rows[i][imageCol] = string.Format("&amp;lt;img src='Handler.ashx?id={0}' alt='' style='width:100px' /&amp;gt;", dt.Rows[i][0].ToString());
            }
        }
        DataList1.DataSource = dt;
        DataList1.DataBind();
    }&lt;/pre&gt;&lt;b&gt; Preview of Images in DataList Control&lt;/b&gt;










&lt;div class="separator" style="clear: both; text-align: center;"&gt;

&lt;a href="http://4.bp.blogspot.com/_atbH0-cQOmg/TNYGaJ5FMzI/AAAAAAAAA7s/BSOT8LDKECA/s1600/datalist.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_atbH0-cQOmg/TNYGaJ5FMzI/AAAAAAAAA7s/BSOT8LDKECA/s1600/datalist.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Creating Thumbnails image&lt;/span&gt;&lt;/b&gt;
To create a thumbnail we need a image. we can pick image from FileUpload Control, then we need to know dimension of image ie [ Width x Height ]. Here I create a UI to handle this. check the UI









&lt;div class="separator" style="clear: both; text-align: center;"&gt;

&lt;a href="http://2.bp.blogspot.com/_atbH0-cQOmg/TNsN_M7hDEI/AAAAAAAAA7w/4vf50M-d5eM/s1600/thumbs.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_atbH0-cQOmg/TNsN_M7hDEI/AAAAAAAAA7w/4vf50M-d5eM/s1600/thumbs.png" /&gt;&lt;/a&gt;&lt;/div&gt;To maintain aspect ratio of image with height and width I use a class AspectRatio.cs
you can get the source code "Browse Code" or "Download Source" Section. Now we can look the code of thumbnail creating section. As I said above here I call a function to create thumbs. let look at this. Below method returns Bitmap image, I am saving that image in root folder.









&lt;pre class="csharp" name="code"&gt; public Bitmap CreateThumbnail(byte[] imageByte, bool maintainAspectRatio, int desiredWidth, int desiredHeight)
    {
        Bitmap bmp = null;
        try
        {
            MemoryStream memStream = new MemoryStream(imageByte);
            System.Drawing.Image img = System.Drawing.Image.FromStream(memStream);

            if (maintainAspectRatio)
            {
                AspectRatio aspectRatio = new AspectRatio();
                aspectRatio.WidthAndHeight(img.Width, img.Height, desiredWidth, desiredHeight);
                bmp = new Bitmap(img, aspectRatio.Width, aspectRatio.Height);
            }
            else
            {
                bmp = new Bitmap(img, desiredWidth, desiredHeight);
            }
            memStream.Dispose();
        }
        catch(Exception ex)
        {
            havException = true;
            ExceptionMessage = ex.Message;
        }
        return bmp;
    }

&lt;/pre&gt;Server side code of "Create Thumbnail" Button. You can see this button in above image. here I pass image byte[] to CreateThumbnail Method. it return Bitmap Image. and save that file in root folder.









&lt;pre class="csharp" name="code"&gt; protected void btnCreateThumb_Click(object sender, EventArgs e)
    {
        int width = 0;
        int height = 0;
        byte[] image = FileUpload1.FileBytes;
        Int32.TryParse(txtDWidth.Text, out width);
        Int32.TryParse(txtDHeight.Text, out height);
        ImageHandler imageHandler = new ImageHandler();
        bool maintainAR = cbxAspectRation.Checked;
        //calling CreateThumbnail Method to create thumb images
        //it returns Bitmap Image. 
        Bitmap bmp = imageHandler.CreateThumbnail(image, maintainAR, width, height);
        if (bmp != null)
        {
            //creating a file name with guid.
            string fileName = Guid.NewGuid().ToString() + ".jpg";
            //saving in current root folder.
            bmp.Save(Server.MapPath(fileName));
            //set image controls ImageUrl to saved Image, this is to view the thumbnail image
            Image1.ImageUrl = fileName;
        }
        else
        {
            //exception part
            if (imageHandler.havException)
            {
                Response.Write(imageHandler.ExceptionMessage);
            }
        }
    }
&lt;/pre&gt;You can check preview of Thumbnail ,Height and Width of image with the help of Firebug&amp;nbsp; console.








&lt;div class="separator" style="clear: both; text-align: center;"&gt;

&lt;a href="http://2.bp.blogspot.com/_atbH0-cQOmg/TNsWTvAt5SI/AAAAAAAAA70/ZmaqXlt_GuM/s1600/thumbspreview.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="478" src="http://2.bp.blogspot.com/_atbH0-cQOmg/TNsWTvAt5SI/AAAAAAAAA70/ZmaqXlt_GuM/s640/thumbspreview.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Creating Watermark Text on Image&lt;/span&gt;&lt;/b&gt;
Now we can discuss how to add Watermark on image. I think you know about &lt;a href="http://en.wikipedia.org/wiki/Watermark"&gt;Watermark&lt;/a&gt;. 
here I call a method &lt;b&gt;AddWatermarkText&lt;/b&gt; to add watermark on image. I pass image byte and watermark text to this method. method create on System.Drawing.Image object from MemoryStream. MemoryStream Hold the  image Byte. using System.Drawing.SolidBrush and System.Drawing.Font we create Text after that 





&lt;pre class="csharp" name="code"&gt; 
Graphics.DrawString(string s, Font font, Brush brush, PointF point);
&lt;/pre&gt;we write text on Image. below method is AddWatermarkText(byte[] imageByte,string textOnImage); you can check that. 







&lt;pre class="csharp" name="code"&gt; 

public Image AddWatermarkText(byte[] imageByte,string textOnImage)
    {
        System.Drawing.Image img = null;
        try
        {
            MemoryStream memStream = new MemoryStream(imageByte);
            img = System.Drawing.Image.FromStream(memStream);
            Graphics g = System.Drawing.Graphics.FromImage(img);
            Font font = new Font("Aril", 30, FontStyle.Bold);

            SolidBrush solidBrush = new SolidBrush(Color.Red);
            Point point = new Point(img.Width / 3, img.Height / 2);
            g.DrawString(textOnImage, font, solidBrush, point);
            g.Save();

            memStream.Dispose();
            g.Dispose();
            solidBrush.Dispose();
            font.Dispose();
        }
        catch(Exception ex)
        {
            havException = true;
            ExceptionMessage = ex.Message;
        }
        return img;
    }
&lt;/pre&gt;above method return Image. I am saving this image in root folder and display it using a Image control. you can check the UI of add Watermark Page and watermark on resultant Image.





&lt;div class="separator" style="clear: both; text-align: center;"&gt;

&lt;a href="http://4.bp.blogspot.com/_atbH0-cQOmg/TNsoYxEjvmI/AAAAAAAAA74/nYR8F_1wffE/s1600/watermark.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_atbH0-cQOmg/TNsoYxEjvmI/AAAAAAAAA74/nYR8F_1wffE/s1600/watermark.png" /&gt;&lt;/a&gt;&lt;/div&gt;Now we can check the code of Add Watermark button





&lt;pre class="csharp" name="code"&gt; protected void btnAddWaterMark_Click(object sender, EventArgs e)
    {
        if (FileUpload1.HasFile)
        {
            byte[] imgbyte = FileUpload1.FileBytes;
            //creating object of ImageHandler Class
            ImageHandler imageHandler = new ImageHandler();
            System.Drawing.Image imageWithWatermark = imageHandler.AddWatermarkText(imgbyte, txtWaterMarkText.Text);
            if (imageWithWatermark != null)
            {
                //file name to save
                string saveFileName = Guid.NewGuid().ToString() + ".jpg";
                //saving image in current root location
                imageWithWatermark.Save(Server.MapPath(saveFileName));
                //displaying image file in a Image Control
                Image1.ImageUrl = saveFileName;
                imageWithWatermark.Dispose();
            }
            else
            {
                if (imageHandler.havException)
                {
                    Response.Write(imageHandler.ExceptionMessage);
                }
            }
        }
    }
&lt;/pre&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Image as Watermark&lt;/span&gt;&lt;/b&gt;

In this section I am explaining how to add Image as watermark. I think you seen same website with images. they have their log on image. we can check how to do something link that

first we need a logo image here I take codeproject's logo image to explain this example. I save CP logo image in  watermarklogo folder.




&lt;div class="separator" style="clear: both; text-align: center;"&gt;

&lt;a href="http://3.bp.blogspot.com/_atbH0-cQOmg/TNsrKmxid9I/AAAAAAAAA78/mQ0000FBkKg/s1600/imageaswatermark.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_atbH0-cQOmg/TNsrKmxid9I/AAAAAAAAA78/mQ0000FBkKg/s1600/imageaswatermark.png" /&gt;&lt;/a&gt;&lt;/div&gt;I am embedding CP logo image in to an upload image, using Graphics.DrawImage(Image image, Point point); Method. here I add  add fading to logo image  using TextureBrush




&lt;pre class="csharp" name="code"&gt; //add fading to logo image  using TextureBrush
        System.Drawing.Image waterMarkimage = System.Drawing.Image.FromFile(Server.MapPath("watermarklogo/CodeprojectLogo.jpg"));
        Graphics opacity = System.Drawing.Graphics.FromImage(waterMarkimage);
        Rectangle imageRect = new Rectangle(0, 0, waterMarkimage.Width, waterMarkimage.Height);
        Brush brush = new TextureBrush(waterMarkimage, imageRect);
        opacity.FillRectangle(brush, imageRect);
        opacity.Save();
&lt;/pre&gt;check the sample image




&lt;div class="separator" style="clear: both; text-align: center;"&gt;

&lt;a href="http://2.bp.blogspot.com/_atbH0-cQOmg/TNstODGZp1I/AAAAAAAAA8A/2_phxSEK5jE/s1600/imageOOOO.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_atbH0-cQOmg/TNstODGZp1I/AAAAAAAAA8A/2_phxSEK5jE/s1600/imageOOOO.png" /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;

&lt;/div&gt;Check the source code



&lt;pre class="csharp" name="code"&gt;protected void btnAddImageAsWaterMark_Click(object sender, EventArgs e)
    {
        byte[] imageByte = FileUpload1.FileBytes;
        MemoryStream memStream = new MemoryStream(imageByte);
        System.Drawing.Image img = System.Drawing.Image.FromStream(memStream);

        //add fading to logo image  using TextureBrush
        System.Drawing.Image waterMarkimage = System.Drawing.Image.FromFile(Server.MapPath("watermarklogo/CodeprojectLogo.jpg"));
        Graphics opacity = System.Drawing.Graphics.FromImage(waterMarkimage);
        Rectangle imageRect = new Rectangle(0, 0, waterMarkimage.Width, waterMarkimage.Height);
        Brush brush = new TextureBrush(waterMarkimage, imageRect);
        opacity.FillRectangle(brush, imageRect);
        opacity.Save();
       
        Graphics g = System.Drawing.Graphics.FromImage(img);
        Point point = new Point(img.Width / 3, img.Height / 2);
        g.DrawImage(waterMarkimage, point);
        string filename = Guid.NewGuid().ToString() + ".jpg";
        img.Save(Server.MapPath(filename));
        
        opacity.Dispose();
        memStream.Dispose();
        g.Dispose();
        waterMarkimage.Dispose();
        img.Dispose();

        Image1.ImageUrl = filename;
    }&amp;nbsp;&lt;/pre&gt;
&lt;a href="http://www.codeproject.com/script/Articles/ViewDownloads.aspx?aid=126421"&gt;Download full source code&lt;/a&gt; 
&lt;a href="http://www.codeproject.com/script/Articles/BlogFeedList.aspx?amid=3497545" rel="tag" style="display: none;"&gt;CodeProject&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-8359164460648505421?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=ghyI_ccdzIY:dcE8dVMjeZ0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=ghyI_ccdzIY:dcE8dVMjeZ0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=ghyI_ccdzIY:dcE8dVMjeZ0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=ghyI_ccdzIY:dcE8dVMjeZ0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=ghyI_ccdzIY:dcE8dVMjeZ0:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=ghyI_ccdzIY:dcE8dVMjeZ0:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=ghyI_ccdzIY:dcE8dVMjeZ0:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=ghyI_ccdzIY:dcE8dVMjeZ0:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=ghyI_ccdzIY:dcE8dVMjeZ0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=ghyI_ccdzIY:dcE8dVMjeZ0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=ghyI_ccdzIY:dcE8dVMjeZ0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=ghyI_ccdzIY:dcE8dVMjeZ0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=ghyI_ccdzIY:dcE8dVMjeZ0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=ghyI_ccdzIY:dcE8dVMjeZ0:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=ghyI_ccdzIY:dcE8dVMjeZ0:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=ghyI_ccdzIY:dcE8dVMjeZ0:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=ghyI_ccdzIY:dcE8dVMjeZ0:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/ghyI_ccdzIY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/ghyI_ccdzIY/image-handling-in-aspnet-part-1.html</link><author>noreply@blogger.com (Raju.M)</author><media:thumbnail url="http://3.bp.blogspot.com/_atbH0-cQOmg/TNWop7lcPVI/AAAAAAAAA7Q/0cPv_3lnZDA/s72-c/database.png" height="72" width="72" /><thr:total>9</thr:total><feedburner:origLink>http://makhaai.blogspot.com/2010/11/image-handling-in-aspnet-part-1.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-7272361388139202323</guid><pubDate>Mon, 20 Sep 2010 01:30:00 +0000</pubDate><atom:updated>2010-10-05T15:46:00.186-07:00</atom:updated><title>Delete Data in GridView Using Template Button</title><description>This article  explain how to delete data from &lt;b&gt;GridView &lt;/b&gt;using &lt;b&gt;Template Buttons&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Now we look how to add template button in &lt;b&gt;GridView&lt;/b&gt;.&lt;br /&gt;
first select &lt;b&gt;Edit Columns &lt;/b&gt; in GridView. &lt;br /&gt;
&lt;br /&gt;
&lt;img height="262" src="http://img831.imageshack.us/img831/2640/img1ml.jpg" width="640" /&gt;&lt;br /&gt;
&lt;br /&gt;
2nd add template column in GridView. &lt;br /&gt;
&lt;br /&gt;
&lt;img height="465" src="http://img827.imageshack.us/img827/8820/img2r.jpg" width="640" /&gt;&lt;br /&gt;
&lt;br /&gt;
Now configuring template column, Click &lt;b&gt;Edit Template&lt;/b&gt;. Place a &lt;b&gt;LinkButton&lt;/b&gt; on Template field. Click &lt;b&gt;Edit Databindings&lt;/b&gt; , then select &lt;b&gt;CommandArgument &lt;/b&gt; , after that set  field binding, bound to "ID" field, this ID field is used to delete data in server side code. Then press ok button.&lt;br /&gt;
&lt;br /&gt;
&lt;img height="281" src="http://img835.imageshack.us/img835/6821/img3b.jpg" width="640" /&gt;&lt;br /&gt;
&lt;img height="379" src="http://img214.imageshack.us/img214/448/img4f.jpg" width="640" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we can configure &lt;b&gt;LinkButton&lt;/b&gt; [ Delete button ].&lt;br /&gt;
Select &lt;b&gt;Property &lt;/b&gt;of Link button. set &lt;b&gt;CommandName&lt;/b&gt; and Text as Delete.&lt;br /&gt;
We can  access this  &lt;b&gt;CommandName &lt;/b&gt; in &lt;b&gt;GridView1_RowCommand&lt;/b&gt; event.  After this add GridView events &lt;b&gt;GridView1_RowCommand&lt;/b&gt; and  &lt;b&gt;GridView1_RowDeleted&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;img height="472" src="http://img265.imageshack.us/img265/6695/img5bm.jpg" width="640" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &lt;b&gt;RowDeleted &lt;/b&gt;event is raised whenever a Delete button associated with an item in the GridView control is clicked, but after the GridView control deletes the record.&lt;br /&gt;
&lt;br /&gt;
This allows you to provide an event-handling method that performs a custom routine, such as checking the results of a delete operation, whenever this event occurs. To avoid errors  we add one custom code in &lt;b&gt;GridView1_RowDeleted&lt;/b&gt; event&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;//handling gridview delete excetion
        e.ExceptionHandled = true;

&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Now the server side part.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="c-sharp" name="code"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Default3 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void GridView1_RowDeleted(object sender, GridViewDeletedEventArgs e)
    {
        //handling gridview delete excetion
        e.ExceptionHandled = true;
    }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "dele")
        {
            //database Helper
            DBHelper objDBHelper = new DBHelper();
            //sql command to delete data from database
            string sqlCmdText = string.Format("DELETE FROM Table WHERE ID='{0}'", e.CommandArgument.ToString());
            //Executeing sql command
            objDBHelper.ExecuteScalar(sqlCmdText);
            //refresh gridview
            GridView1.DataBind();

        }
    }
}

&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
ASPX Page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="html" name="code"&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %&amp;gt;
&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;
&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;
&amp;lt;head runat="server"&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="form1" runat="server"&amp;gt;
    &amp;lt;div&amp;gt;
        &amp;lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
            DataSourceID="SqlDataSource1" onrowcommand="GridView1_RowCommand"
            onrowdeleted="GridView1_RowDeleted"&amp;gt;
            &amp;lt;Columns&amp;gt;
                &amp;lt;asp:BoundField DataField="biInvitationId" HeaderText="biInvitationId"
                    InsertVisible="False" ReadOnly="True" SortExpression="biInvitationId" /&amp;gt;
                &amp;lt;asp:BoundField DataField="biEventName" HeaderText="biEventName"
                    SortExpression="biEventName" /&amp;gt;
                &amp;lt;asp:BoundField DataField="biHostName" HeaderText="biHostName"
                    SortExpression="biHostName" /&amp;gt;
                &amp;lt;asp:BoundField DataField="biTelephone" HeaderText="biTelephone"
                    SortExpression="biTelephone" /&amp;gt;
                &amp;lt;asp:TemplateField&amp;gt;
                    &amp;lt;ItemTemplate&amp;gt;
                        &amp;lt;asp:LinkButton ID="LinkButton1" runat="server"
                            CommandArgument='&amp;lt;%# Eval("biInvitationId") %&amp;gt;' CommandName="dele"&amp;gt;Delete&amp;lt;/asp:LinkButton&amp;gt;
                    &amp;lt;/ItemTemplate&amp;gt;
                &amp;lt;/asp:TemplateField&amp;gt;
            &amp;lt;/Columns&amp;gt;
        &amp;lt;/asp:GridView&amp;gt;
        &amp;lt;asp:SqlDataSource ID="SqlDataSource1" runat="server"&amp;gt;
        &amp;lt;/asp:SqlDataSource&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;
Thank you,&lt;br /&gt;
&lt;br /&gt;
Feel free to comment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
&lt;a href="http://www.codeproject.com/script/Articles/BlogFeedList.aspx?amid=3497545" rel="tag" style="display: none;"&gt;CodeProject&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-7272361388139202323?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=lUopOC4fCKw:i2221BDFNWU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=lUopOC4fCKw:i2221BDFNWU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=lUopOC4fCKw:i2221BDFNWU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=lUopOC4fCKw:i2221BDFNWU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=lUopOC4fCKw:i2221BDFNWU:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=lUopOC4fCKw:i2221BDFNWU:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=lUopOC4fCKw:i2221BDFNWU:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=lUopOC4fCKw:i2221BDFNWU:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=lUopOC4fCKw:i2221BDFNWU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=lUopOC4fCKw:i2221BDFNWU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=lUopOC4fCKw:i2221BDFNWU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=lUopOC4fCKw:i2221BDFNWU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=lUopOC4fCKw:i2221BDFNWU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=lUopOC4fCKw:i2221BDFNWU:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=lUopOC4fCKw:i2221BDFNWU:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=lUopOC4fCKw:i2221BDFNWU:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=lUopOC4fCKw:i2221BDFNWU:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/lUopOC4fCKw" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/lUopOC4fCKw/delete-data-in-gridview-using-template.html</link><author>noreply@blogger.com (Raju.M)</author><thr:total>0</thr:total><feedburner:origLink>http://makhaai.blogspot.com/2010/09/delete-data-in-gridview-using-template.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-2192429863892620315</guid><pubDate>Sat, 04 Sep 2010 16:24:00 +0000</pubDate><atom:updated>2010-09-04T09:31:11.626-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C#.Net</category><category domain="http://www.blogger.com/atom/ns#">GridView ASP.NET</category><title>Select GridView Row without using Select button</title><description>This code snippet Illustrate How to Select GridView Row without using Select Command button. &lt;br /&gt;
I think code can do better idea than description. check the snippet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="c-sharp" name="code"&gt;protected void Button1_Click(object sender, EventArgs e)
    {
        //identifying button
        Button gridBtn = (Button)sender;
       //selecting grid row
        GridViewRow gridRow = (GridViewRow)gridBtn.NamingContainer;
       //setting Index
        int selectedIndex = gridRow.DataItemIndex;
       // Setting Selected Index of GridView1
         GridView1.SelectedIndex = selectedIndex;
        //firing selected Index changed if you need
        //here I used to change color of selected rows
         GridView1_SelectedIndexChanged(GridView1, EventArgs.Empty);
        if (gridBtn != null)
        {
           //changing button text[/color]
            if (gridBtn.Text == "DeSelect")
            { gridBtn.Text = "Select"; }
            else
            { gridBtn.Text = "DeSelect"; }
        }

    }
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        int sIndex = GridView1.SelectedIndex;
        if (GridView1.Rows[sIndex].BackColor == System.Drawing.Color.Red)
        {
            GridView1.Rows[sIndex].BackColor = System.Drawing.Color.White;
        }
        else
        {
            GridView1.Rows[sIndex].BackColor = System.Drawing.Color.Red;
        }

    }
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
ASPX section&lt;br /&gt;
&lt;br /&gt;
I add One Button field as Template field. and add Button text as "Select". when you click on select button in GridView, the selected Row become Red color.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="html" name="code"&gt;&amp;lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
            DataSourceID="SqlDataSource1"&amp;gt;
            &amp;lt;columns&amp;gt;
                &amp;lt;asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" /&amp;gt;
                &amp;lt;asp:BoundField DataField="Category" HeaderText="Category"
                    SortExpression="Category" /&amp;gt;
                &amp;lt;asp:BoundField DataField="Tags" HeaderText="Tags" SortExpression="Tags" /&amp;gt;
                &amp;lt;asp:TemplateField&amp;gt;
                    &amp;lt;itemtemplate&amp;gt;
                        &amp;lt;asp:Button ID="Button1" runat="server" Text="Select" onclick="Button1_Click" /&amp;gt;
                    &amp;lt;/ItemTemplate&amp;gt;
                &amp;lt;/asp:TemplateField&amp;gt;
            &amp;lt;/Columns&amp;gt;
        &amp;lt;/asp:GridView&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Preview of Output&lt;/b&gt;&lt;br /&gt;
You can Select or Deselect GridView Rows.&lt;br /&gt;
&lt;img src="http://img72.imageshack.us/img72/9930/selectb.jpg" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br/&gt;&lt;br/&gt;&lt;br /&gt;
Thank you for Reading this code snippet.&lt;br /&gt;
Feel Free to comment. if you have any doubts let me know.&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-2192429863892620315?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=wPy-jdZ56GE:lwXfr4Q8o5w:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=wPy-jdZ56GE:lwXfr4Q8o5w:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=wPy-jdZ56GE:lwXfr4Q8o5w:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=wPy-jdZ56GE:lwXfr4Q8o5w:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=wPy-jdZ56GE:lwXfr4Q8o5w:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/wPy-jdZ56GE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/wPy-jdZ56GE/this-code-snippet-illustrate-how-to.html</link><author>noreply@blogger.com (Raju.M)</author><thr:total>0</thr:total><feedburner:origLink>http://makhaai.blogspot.com/2010/09/this-code-snippet-illustrate-how-to.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-8563144810889541159</guid><pubDate>Thu, 02 Sep 2010 20:52:00 +0000</pubDate><atom:updated>2010-09-02T13:55:17.536-07:00</atom:updated><title>Ajax AutoComplete in ASP.Net</title><description>Without using AjaxControlToolKit we can implement AutoComplete Extender using pure Ajax Call. This article is explaining how to do make AutoComplete Extender. &lt;br /&gt;
OnKeyUp event help you to fetch data from Database with Ajax call. Here one Handler.ashx handles the AJAX request form Client. I add a Class file to handle database operations to better coding practice. Below I am explaining  the database helper Class. Class have one method  &lt;b&gt;GetTable(string  sqlQuery)&lt;/b&gt; this return DataTable after fetching data from database. And also include Provide Class, this Class help to get SqlConnection string.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="html" name="code"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
/// &lt;summary&gt;
/// Summary description for DBHelper
/// &lt;/summary&gt;
public class DBHelper
{
    SqlConnection connection;
    SqlDataAdapter adapter;
    SqlCommand command;
    DataTable dataTable;
    public DBHelper()
    {
    }
    /// &lt;summary&gt;
    /// 
    /// &lt;/summary&gt;
    /// &lt;param name="sqlQuery"&gt;passing SQL Query here&lt;/param&gt;/// &lt;returns&gt;DataTable object is returned&lt;/returns&gt;
    public DataTable GetTable(string sqlQuery)
    {
        //creating new instance of Datatable
        dataTable = new DataTable();
        connection = Provider.GetConnection();
        command = new SqlCommand(sqlQuery, connection);
        //Open SQL Connection
        connection.Open();
            try
            {
                adapter = new SqlDataAdapter(command);
                adapter.Fill(dataTable);
            }
            catch
            { }
            finally
            {
                //Closing Sql Connection 
                connection.Close();
            }
        return dataTable;
    }
}
public class Provider
{
    public static SqlConnection GetConnection()
    {
        //creating SqlConnection
        return new SqlConnection(ConfigurationManager.AppSettings["sqlConn"]);
    }
} 

&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Now we can look into Handler file. When request come from Ajax Call from Client it passes the data into our Database helper Class, handler file hold the data in DataTable. Result data are formatted in a table and write in the context.  We can add  JavaScript function for select the data, here &lt;b&gt;api_helper.AddtoTaxtBox(selectedItem)&lt;/b&gt;is managing client section of data. Check Handler file &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="html" name="code"&gt;&lt;%@ WebHandler Language="C#" Class="Handler" %&gt;
using System;
using System.Web;
using System.Data;
public class Handler : IHttpHandler {
    public void ProcessRequest (HttpContext context) {

        HttpRequest request = HttpContext.Current.Request;
        //checking string null or empty
        if (!string.IsNullOrEmpty(request.QueryString["name"]))
        {
            string name=request.QueryString["name"];
            //creating instance of new database helper
            DBHelper objDBHelper = new DBHelper();
            //creating Sql Query
            string sqlQuery = string.Format("SELECT Name FROM User WHERE Name LIKE '{0}%'", name);
            //filling data from database
            DataTable dataTable = objDBHelper.GetTable(sqlQuery);

            string table = string.Empty;
            //table for hold data
            table = "&lt;table width='100%'&gt;";             string td = string.Empty;             //checking datatable                 if (dataTable.Rows.Count &gt; 0)                 {                     for (int i = 0; i &lt; dataTable.Rows.Count; i++)
                    {
                        //adding table rows
                        td += string.Format("&lt;tr&gt;&lt;td class='select' onclick='api_helper.AddtoTaxtBox(this.innerHTML)'&gt;{0}&lt;/td&gt;&lt;/tr&gt;
", dataTable.Rows[i][0].ToString());                     }                 }                 table += td + "&lt;/table&gt;";
                context.Response.Write(table);
        }
    }
    public bool IsReusable {
        get {
            return false;
        }
    }

}
&lt;/pre&gt;&lt;br /&gt;
Now we can check how Ajax works. On Textbox onKeyUp event call the ajax code. It send the entered value into server using ajax and result displayed in div control under the search textbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="html" name="code"&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot;  CodeFile=&amp;quot;Default.aspx.cs&amp;quot; Inherits=&amp;quot;_Default&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;style type=&amp;quot;text/css&amp;quot;&amp;gt;
      .select{cursor:pointer;height:20px;color:red;}
      .select:hover{cursor:pointer;height:20px;color:black;background-color:#cccccc;}
      #myDiv{position:relative;top: -1px; left: 0px;width:150px; overflow:hidden;}
      #txtName{width:150px}
&amp;lt;/style&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;asp:TextBox ID=&amp;quot;txtName&amp;quot; runat=&amp;quot;server&amp;quot; onkeyup=&amp;quot;api_helper.callAjax();&amp;quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
&amp;lt;div id=&amp;quot;myDiv&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;


&amp;lt;script language=&amp;quot;javascript&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;

            if (typeof (api_helper) == 'undefined') { api_helper = {} }


            api_helper.doAjax = function(HandlerUrl, displayDiv) {
                var Req; try { Req = new XMLHttpRequest(); } catch (e) { try { Req = new ActiveXObject(&amp;quot;Msxml2.XMLHTTP&amp;quot;); } catch (e) { try { xmlHttp = new ActiveXObject(&amp;quot;Microsoft.XMLHTTP&amp;quot;); } catch (e) { return false; } } } Req.onreadystatechange = function() { if (Req.readyState == 4) { var d = document.getElementById(displayDiv); d.innerHTML = Req.responseText; } }
                Req.open(&amp;quot;GET&amp;quot;, HandlerUrl, true); Req.send(null);
            }


            api_helper.callAjax = function() {
                var text = document.getElementById(&amp;quot;txtName&amp;quot;).value;
                if (text != &amp;quot;&amp;quot;) {
                    var requestUrl = &amp;quot;Handler.ashx?name=&amp;quot; + text;
                    var displayDiv=&amp;quot;myDiv&amp;quot;;
                    api_helper.doAjax(requestUrl, displayDiv);
                }
            }


            api_helper.AddtoTaxtBox = function(txt) {
                document.getElementById(&amp;quot;txtName&amp;quot;).value = txt;
                document.getElementById(&amp;quot;myDiv&amp;quot;).innerHTML = &amp;quot;&amp;quot;;
            }
&amp;lt;/script&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;
Thanks for reading this article and feel free to comment.&lt;br /&gt;
Tags Ajax AutoComplete, Ajax Example.&lt;br /&gt;
&lt;a href="http://www.codeproject.com/script/Articles/BlogFeedList.aspx?amid=3497545" style="display:none" rel="tag"&gt;CodeProject&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-8563144810889541159?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=uRwdW-20-Sw:m0EuRBS9Gz8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=uRwdW-20-Sw:m0EuRBS9Gz8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=uRwdW-20-Sw:m0EuRBS9Gz8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=uRwdW-20-Sw:m0EuRBS9Gz8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=uRwdW-20-Sw:m0EuRBS9Gz8:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=uRwdW-20-Sw:m0EuRBS9Gz8:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=uRwdW-20-Sw:m0EuRBS9Gz8:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=uRwdW-20-Sw:m0EuRBS9Gz8:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=uRwdW-20-Sw:m0EuRBS9Gz8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=uRwdW-20-Sw:m0EuRBS9Gz8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=uRwdW-20-Sw:m0EuRBS9Gz8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=uRwdW-20-Sw:m0EuRBS9Gz8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=uRwdW-20-Sw:m0EuRBS9Gz8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=uRwdW-20-Sw:m0EuRBS9Gz8:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=uRwdW-20-Sw:m0EuRBS9Gz8:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=uRwdW-20-Sw:m0EuRBS9Gz8:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=uRwdW-20-Sw:m0EuRBS9Gz8:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/uRwdW-20-Sw" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/uRwdW-20-Sw/ajax-autocomplete-in-aspnet.html</link><author>noreply@blogger.com (Raju.M)</author><thr:total>1</thr:total><feedburner:origLink>http://makhaai.blogspot.com/2010/09/ajax-autocomplete-in-aspnet.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-5604785139723386013</guid><pubDate>Thu, 08 Jul 2010 15:23:00 +0000</pubDate><atom:updated>2010-07-23T23:40:45.562-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">AJAX Control Toolkit</category><category domain="http://www.blogger.com/atom/ns#">UpdateProgress</category><title>UpdateProgress Control</title><description>&lt;b&gt;This sample illustrate how to implement UpdateProgress Control in ASP.Net&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
UpdatePanel control enable partial page rendering in ASP.Net. using UpdateProgress control enable&amp;nbsp; status&amp;nbsp; when Updating UpdatePanel. UpdateProgress have ProgressTemplate, When updates is happen&amp;nbsp; UpdateProgress show the content in ProgressTemplate.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="html" name="code"&gt;&amp;nbsp; &amp;lt;asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="UpdatePanel1" runat="server"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ProgressTemplate&amp;gt;
&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;lt;div style="color:Red;font-size:xx-large;"&amp;gt;Please wait ......&amp;lt;/div&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ProgressTemplate&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/asp:UpdateProgress&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;AssociatedUpdatePanelID &lt;/b&gt;is enable which update is shown update process. Here i am displaying time in label control. When user click update button&amp;nbsp; status is shown in UpdateProgress control&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;protected void UpdateTime_Click(object sender, EventArgs e)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; //sleeps for 2 seconds 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Threading.Thread.Sleep(2000);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lblDate.Text = DateTime.Now.ToString();
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;Full Source Code&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="html" name="code"&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %&amp;gt;
&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;
&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;
&amp;lt;head runat="server"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;form id="form1" runat="server"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt;
&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;lt;asp:ScriptManager ID="ScriptManager1" runat="server"&amp;gt;
&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;lt;/asp:ScriptManager&amp;gt;
&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;lt;asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="UpdatePanel1" runat="server"&amp;gt;
&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;lt;ProgressTemplate&amp;gt;
&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;lt;div style="color:Red;font-size:xx-large;"&amp;gt;Please wait ......&amp;lt;/div&amp;gt;
&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;lt;/ProgressTemplate&amp;gt;
&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;lt;/asp:UpdateProgress&amp;gt;
&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;&amp;nbsp; &amp;lt;asp:UpdatePanel runat="Server" ID="UpdatePanel1" UpdateMode="Conditional"&amp;gt;
&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;lt;ContentTemplate&amp;gt;
&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;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Label ID="lblDate" runat="server"&amp;gt;&amp;lt;/asp:Label&amp;gt;
&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;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Button ID="UpdateTime" runat="server" onclick="UpdateTime_Click" Text="Update" /&amp;gt;
&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;lt;/ContentTemplate&amp;gt;
&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;lt;/asp:UpdatePanel&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;br /&gt;
&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Reflection;
public partial class Default2 : System.Web.UI.Page
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void Page_Load(object sender, EventArgs e)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!IsPostBack)
&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; lblDate.Text = DateTime.Now.ToString();
&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; protected void UpdateTime_Click(object sender, EventArgs e)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //sleeps for 2 seconds 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Threading.Thread.Sleep(2000);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lblDate.Text = DateTime.Now.ToString();
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;Output &lt;/b&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_atbH0-cQOmg/TDXtImb09fI/AAAAAAAAA6A/2NNsoYD447c/s1600/UpdateProgress.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_atbH0-cQOmg/TDXtImb09fI/AAAAAAAAA6A/2NNsoYD447c/s320/UpdateProgress.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;a href="http://cafekerala.com/makhaaiblogspot/UpdateProgress_Sample.rar"&gt;Download Source&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a href="http://www.codeproject.com/script/Articles/BlogFeedList.aspx?amid=3497545" style="display:none" rel="tag"&gt;CodeProject&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-5604785139723386013?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=RtLZs16QWdE:lAoFfVntR64:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=RtLZs16QWdE:lAoFfVntR64:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=RtLZs16QWdE:lAoFfVntR64:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=RtLZs16QWdE:lAoFfVntR64:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=RtLZs16QWdE:lAoFfVntR64:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=RtLZs16QWdE:lAoFfVntR64:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=RtLZs16QWdE:lAoFfVntR64:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=RtLZs16QWdE:lAoFfVntR64:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=RtLZs16QWdE:lAoFfVntR64:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=RtLZs16QWdE:lAoFfVntR64:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=RtLZs16QWdE:lAoFfVntR64:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=RtLZs16QWdE:lAoFfVntR64:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=RtLZs16QWdE:lAoFfVntR64:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=RtLZs16QWdE:lAoFfVntR64:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=RtLZs16QWdE:lAoFfVntR64:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=RtLZs16QWdE:lAoFfVntR64:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=RtLZs16QWdE:lAoFfVntR64:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/RtLZs16QWdE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/RtLZs16QWdE/updateprogress-control.html</link><author>noreply@blogger.com (Raju.M)</author><media:thumbnail url="http://2.bp.blogspot.com/_atbH0-cQOmg/TDXtImb09fI/AAAAAAAAA6A/2NNsoYD447c/s72-c/UpdateProgress.jpg" height="72" width="72" /><thr:total>0</thr:total><enclosure url="http://cafekerala.com/makhaaiblogspot/UpdateProgress_Sample.rar" length="971" type="application/octet-stream" /><media:content url="http://cafekerala.com/makhaaiblogspot/UpdateProgress_Sample.rar" fileSize="971" type="application/octet-stream" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>This sample illustrate how to implement UpdateProgress Control in ASP.Net UpdatePanel control enable partial page rendering in ASP.Net. using UpdateProgress control enable&amp;nbsp; status&amp;nbsp; when Updating UpdatePanel. UpdateProgress have ProgressTemplate,</itunes:subtitle><itunes:author>noreply@blogger.com (Raju.M)</itunes:author><itunes:summary>This sample illustrate how to implement UpdateProgress Control in ASP.Net UpdatePanel control enable partial page rendering in ASP.Net. using UpdateProgress control enable&amp;nbsp; status&amp;nbsp; when Updating UpdatePanel. UpdateProgress have ProgressTemplate, When updates is happen&amp;nbsp; UpdateProgress show the content in ProgressTemplate. &amp;nbsp; &amp;lt;asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="UpdatePanel1" runat="server"&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ProgressTemplate&amp;gt; &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;lt;div style="color:Red;font-size:xx-large;"&amp;gt;Please wait ......&amp;lt;/div&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ProgressTemplate&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/asp:UpdateProgress&amp;gt; AssociatedUpdatePanelID is enable which update is shown update process. Here i am displaying time in label control. When user click update button&amp;nbsp; status is shown in UpdateProgress control protected void UpdateTime_Click(object sender, EventArgs e) &amp;nbsp;&amp;nbsp;&amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; //sleeps for 2 seconds &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Threading.Thread.Sleep(2000); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lblDate.Text = DateTime.Now.ToString(); &amp;nbsp;&amp;nbsp;&amp;nbsp; } Full Source Code &amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %&amp;gt; &amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt; &amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt; &amp;lt;head runat="server"&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt; &amp;lt;/head&amp;gt; &amp;lt;body&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;form id="form1" runat="server"&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt; &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;lt;asp:ScriptManager ID="ScriptManager1" runat="server"&amp;gt; &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;lt;/asp:ScriptManager&amp;gt; &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;lt;asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="UpdatePanel1" runat="server"&amp;gt; &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;lt;ProgressTemplate&amp;gt; &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;lt;div style="color:Red;font-size:xx-large;"&amp;gt;Please wait ......&amp;lt;/div&amp;gt; &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;lt;/ProgressTemplate&amp;gt; &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;lt;/asp:UpdateProgress&amp;gt; &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;&amp;nbsp; &amp;lt;asp:UpdatePanel runat="Server" ID="UpdatePanel1" UpdateMode="Conditional"&amp;gt; &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;lt;ContentTemplate&amp;gt; &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;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Label ID="lblDate" runat="server"&amp;gt;&amp;lt;/asp:Label&amp;gt; &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;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Button ID="UpdateTime" runat="server" onclick="Update</itunes:summary><itunes:keywords>ASP.NET, AJAX Control Toolkit, UpdateProgress</itunes:keywords><feedburner:origLink>http://makhaai.blogspot.com/2010/07/updateprogress-control.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-2980654757094503429</guid><pubDate>Wed, 07 Jul 2010 23:24:00 +0000</pubDate><atom:updated>2010-07-07T16:24:00.062-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">IRequiresSessionState</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">Session</category><title>How to get Session Variable in Class File</title><description>&lt;b&gt;How to get Session Variable in Class (.cs) File&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Normally Session is not accessible in Class file. when&amp;nbsp; one try to call Session in class file it return "Object reference not set to an instance of an object."  error description like " An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code." this error is thrown by  System.NullReferenceException. To access Session in class file Microsoft introduce a Interface &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.sessionstate.irequiressessionstate.aspx"&gt;&lt;b&gt;IRequiresSessionState&lt;/b&gt;&lt;/a&gt;, derived from &lt;b&gt;System.Web.SessionState&lt;/b&gt;&lt;br /&gt;
&lt;/br&gt;&lt;/br&gt;&lt;br /&gt;
&amp;nbsp;&lt;b&gt;The metadata of IRequiresSessionState&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;
namespace System.Web.SessionState
{
    // Summary:
    //     Specifies that the target HTTP handler requires read and write access to
    //     session-state values. This is a marker interface and has no methods.
    public interface IRequiresSessionState
    {
    }
}


&lt;/pre&gt;&lt;/br&gt;&lt;br /&gt;
IRequiresSessionState Specifies that the target HTTP handler requires read and write access to  session-state values. IRequiresSessionState has no methods.&lt;br /&gt;
&lt;/br&gt;&lt;br /&gt;
&lt;b&gt;How to Use&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/br&gt;&lt;br /&gt;
&lt;pre name="code" class="csharp"&gt;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
/// &lt;summary&gt;
/// Summary description for GetSessionHelper
/// &lt;/summary&gt;
public class SessionHelper : IRequiresSessionState
{
    public SessionHelper()
    {
        //
        // TODO: Add constructor logic here
        //
    }
    /// &lt;summary&gt;
    /// Get Session values
    /// &lt;/summary&gt;
    /// &lt;param name="key"&gt;session key&lt;/param&gt;    /// &lt;returns&gt;object value&lt;/returns&gt;
    public object GetSession(string key)
    {
        //check session 
        if (HttpContext.Current.Session[key] != null)
        {
            //return session value
            return HttpContext.Current.Session[key];
        }
        else
        {
            //return empty string
            return string.Empty;
        }
    }
}


&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Calling SessionHelper Class&lt;/b&gt;&lt;br /&gt;
&lt;br/&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //Creating object of SessionHelper Class
        SessionHelper objSessionHelper = new SessionHelper();
        //setting session value in a variable
        string sessionValue = objSessionHelper.GetSession("test").ToString();
        //writing session value in Page
        Response.Write(sessionValue);
    }
}


&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-2980654757094503429?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_Ak3O7unlIw:CZORTwMV_50:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_Ak3O7unlIw:CZORTwMV_50:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=_Ak3O7unlIw:CZORTwMV_50:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_Ak3O7unlIw:CZORTwMV_50:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_Ak3O7unlIw:CZORTwMV_50:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=_Ak3O7unlIw:CZORTwMV_50:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_Ak3O7unlIw:CZORTwMV_50:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_Ak3O7unlIw:CZORTwMV_50:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_Ak3O7unlIw:CZORTwMV_50:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=_Ak3O7unlIw:CZORTwMV_50:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_Ak3O7unlIw:CZORTwMV_50:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_Ak3O7unlIw:CZORTwMV_50:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=_Ak3O7unlIw:CZORTwMV_50:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_Ak3O7unlIw:CZORTwMV_50:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_Ak3O7unlIw:CZORTwMV_50:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=_Ak3O7unlIw:CZORTwMV_50:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_Ak3O7unlIw:CZORTwMV_50:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/_Ak3O7unlIw" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/_Ak3O7unlIw/how-to-get-session-variable-in-class.html</link><author>noreply@blogger.com (Raju.M)</author><thr:total>1</thr:total><feedburner:origLink>http://makhaai.blogspot.com/2010/07/how-to-get-session-variable-in-class.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-2340158017776565428</guid><pubDate>Tue, 06 Jul 2010 05:07:00 +0000</pubDate><atom:updated>2010-07-05T22:07:40.598-07:00</atom:updated><title>Get Value of Dynamically generated TextBox</title><description>how to get value of dynamically generated TextBox using javascript&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="csharp" name="code"&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;
public partial class placeholderissue : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            if (TextBox1.Text != string.Empty)
            {
                int count = 0;
                int.TryParse(TextBox1.Text, out count);
                
                for (int i = 0; i &amp;lt; count; i++)
                {
                    TextBox txt = new TextBox();
                    txt.ID = "dynamicText" + i.ToString();
                    if (PlaceHolder1.FindControl(txt.ID) != null)
                    {
                        PlaceHolder1.Controls.Add(txt);
                    }
                }
            }
        }
      
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (TextBox1.Text != string.Empty)
        {
            int count=0;
            int.TryParse(TextBox1.Text,out count);
            for (int i = 0; i &amp;lt; count; i++)
            {
                TextBox txt = new TextBox();
                txt.ID = "dynamicText" + i.ToString();
                PlaceHolder1.Controls.Add(txt);
            }
        }
    }
}



&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HTML   &lt;br /&gt;
&lt;pre class="html" name="code"&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="placeholderissue.aspx.cs" Inherits="placeholderissue" %&amp;gt;

&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;

&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;
&amp;lt;head runat="server"&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="form1" runat="server"&amp;gt;
    &amp;lt;div&amp;gt;
        &amp;lt;asp:TextBox ID="TextBox1" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
        &amp;lt;asp:Button ID="Button1"
            runat="server" Text="Button" onclick="Button1_Click" /&amp;gt;
        &amp;lt;br /&amp;gt;
        &amp;lt;asp:PlaceHolder ID="PlaceHolder1" runat="server"&amp;gt;&amp;lt;/asp:PlaceHolder&amp;gt;
        &amp;lt;input id="Button2" type="button" value="button" onclick="GetTextBoxValue();" /&amp;gt;
        &amp;lt;script language="javascript"&amp;gt;
            function GetTextBoxValue() {
                var count = document.getElementById("TextBox1").value;
                if (count &amp;gt; 0) {
                    for (i = 0; i &amp;lt; count; i++) {
                        alert(document.getElementById("dynamicText" + i).value);
                    }
                }
            }
        &amp;lt;/script&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;a href="http://cafekerala.com/makhaaiblogspot/getDyamictexBoxValue.rar"&gt;Source Code&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-2340158017776565428?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=rW4IXvni7HA:_Xnwv-qS9ZQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=rW4IXvni7HA:_Xnwv-qS9ZQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=rW4IXvni7HA:_Xnwv-qS9ZQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=rW4IXvni7HA:_Xnwv-qS9ZQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=rW4IXvni7HA:_Xnwv-qS9ZQ:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=rW4IXvni7HA:_Xnwv-qS9ZQ:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=rW4IXvni7HA:_Xnwv-qS9ZQ:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=rW4IXvni7HA:_Xnwv-qS9ZQ:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=rW4IXvni7HA:_Xnwv-qS9ZQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=rW4IXvni7HA:_Xnwv-qS9ZQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=rW4IXvni7HA:_Xnwv-qS9ZQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=rW4IXvni7HA:_Xnwv-qS9ZQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=rW4IXvni7HA:_Xnwv-qS9ZQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=rW4IXvni7HA:_Xnwv-qS9ZQ:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=rW4IXvni7HA:_Xnwv-qS9ZQ:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=rW4IXvni7HA:_Xnwv-qS9ZQ:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=rW4IXvni7HA:_Xnwv-qS9ZQ:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/rW4IXvni7HA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/rW4IXvni7HA/get-value-of-dynamically-generated.html</link><author>noreply@blogger.com (Raju.M)</author><thr:total>0</thr:total><enclosure url="http://cafekerala.com/makhaaiblogspot/getDyamictexBoxValue.rar" length="1159" type="application/octet-stream" /><media:content url="http://cafekerala.com/makhaaiblogspot/getDyamictexBoxValue.rar" fileSize="1159" type="application/octet-stream" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>how to get value of dynamically generated TextBox using javascript using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; public partial class placehold</itunes:subtitle><itunes:author>noreply@blogger.com (Raju.M)</itunes:author><itunes:summary>how to get value of dynamically generated TextBox using javascript using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; public partial class placeholderissue : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { if (TextBox1.Text != string.Empty) { int count = 0; int.TryParse(TextBox1.Text, out count); for (int i = 0; i &amp;lt; count; i++) { TextBox txt = new TextBox(); txt.ID = "dynamicText" + i.ToString(); if (PlaceHolder1.FindControl(txt.ID) != null) { PlaceHolder1.Controls.Add(txt); } } } } } protected void Button1_Click(object sender, EventArgs e) { if (TextBox1.Text != string.Empty) { int count=0; int.TryParse(TextBox1.Text,out count); for (int i = 0; i &amp;lt; count; i++) { TextBox txt = new TextBox(); txt.ID = "dynamicText" + i.ToString(); PlaceHolder1.Controls.Add(txt); } } } } HTML &amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="placeholderissue.aspx.cs" Inherits="placeholderissue" %&amp;gt; &amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt; &amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt; &amp;lt;head runat="server"&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="form1" runat="server"&amp;gt; &amp;lt;div&amp;gt; &amp;lt;asp:TextBox ID="TextBox1" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt; &amp;lt;asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /&amp;gt; &amp;lt;br /&amp;gt; &amp;lt;asp:PlaceHolder ID="PlaceHolder1" runat="server"&amp;gt;&amp;lt;/asp:PlaceHolder&amp;gt; &amp;lt;input id="Button2" type="button" value="button" onclick="GetTextBoxValue();" /&amp;gt; &amp;lt;script language="javascript"&amp;gt; function GetTextBoxValue() { var count = document.getElementById("TextBox1").value; if (count &amp;gt; 0) { for (i = 0; i &amp;lt; count; i++) { alert(document.getElementById("dynamicText" + i).value); } } } &amp;lt;/script&amp;gt; &amp;lt;div&amp;gt; &amp;lt;/form&amp;gt; &amp;lt;/body&amp;gt; &amp;lt;/html&amp;gt; Source CodeOpenSource.Net</itunes:summary><feedburner:origLink>http://makhaai.blogspot.com/2010/07/get-value-of-dynamically-generated.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-5600575041170431114</guid><pubDate>Tue, 06 Jul 2010 02:40:00 +0000</pubDate><atom:updated>2010-07-05T19:40:41.689-07:00</atom:updated><title>Insert Image in to Database</title><description>&lt;b&gt;Insert Image in to Database &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
datatype of image in database is Byte[], so we insert image byte in to Database&lt;br /&gt;
&lt;br /&gt;
FileUploader controls is used to select file, FileUploader control have a property FileBytes it return byte array (byte[]) of image, this Byte[] is stored in dataBase&lt;br /&gt;
&lt;br /&gt;
example&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="csharp" name="code"&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.Text;
using System.Data.SqlClient;
public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
       
    }
    protected void ImageUploadToDataBase(object sender, EventArgs e)
    {
        SqlConnection con = new SqlConnection("Your Connection string");
        try
        {
            con.Open();
            byte[] imageByte = FileUpload1.FileBytes;
            SqlCommand cmd = new SqlCommand("INSERT INTO table (image,imagename) VALUES (@0,@1))", con);
            object[] cmdParams = new object[2];
            cmdParams[0] = imageByte;
            cmdParams[1] = "Name of Image";
            for (int i = 0; i &lt; cmdParams.Length; i++)
            {
                cmd.Parameters.AddWithValue(i.ToString(), cmdParams[i]);
            }
            cmd.ExecuteNonQuery();
            cmd.Parameters.Clear();
        }
        finally { con.Close(); }
       
    }
    
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-5600575041170431114?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=Y71A1i1Fz_M:v4GGawtZTvc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=Y71A1i1Fz_M:v4GGawtZTvc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=Y71A1i1Fz_M:v4GGawtZTvc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=Y71A1i1Fz_M:v4GGawtZTvc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=Y71A1i1Fz_M:v4GGawtZTvc:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=Y71A1i1Fz_M:v4GGawtZTvc:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=Y71A1i1Fz_M:v4GGawtZTvc:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=Y71A1i1Fz_M:v4GGawtZTvc:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=Y71A1i1Fz_M:v4GGawtZTvc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=Y71A1i1Fz_M:v4GGawtZTvc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=Y71A1i1Fz_M:v4GGawtZTvc:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=Y71A1i1Fz_M:v4GGawtZTvc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=Y71A1i1Fz_M:v4GGawtZTvc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=Y71A1i1Fz_M:v4GGawtZTvc:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=Y71A1i1Fz_M:v4GGawtZTvc:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=Y71A1i1Fz_M:v4GGawtZTvc:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=Y71A1i1Fz_M:v4GGawtZTvc:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/Y71A1i1Fz_M" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/Y71A1i1Fz_M/insert-image-in-to-database.html</link><author>noreply@blogger.com (Raju.M)</author><thr:total>0</thr:total><feedburner:origLink>http://makhaai.blogspot.com/2010/07/insert-image-in-to-database.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-6172144171147828444</guid><pubDate>Mon, 05 Jul 2010 23:14:00 +0000</pubDate><atom:updated>2010-07-05T16:14:02.726-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Multiple File Upload</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><title>Multiple File Upload in ASP.Net</title><description>&lt;b&gt;ASP.Net Multiple File Upload &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Using &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.httpfilecollection.aspx"&gt;&lt;span class="selflink"&gt;HttpFileCollection&lt;/span&gt;&lt;/a&gt; class provide&amp;nbsp; to access and manage file uploaded from client. But still have the problem of multiple selection of files. With over limitation am am going to explain multiple&amp;nbsp; uploading by multiple FileUploader Controls. &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.httppostedfile.aspx"&gt;HttpPostedFile&lt;/a&gt; class is used to provide properties and methods if single files in HttpFileCollection class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="html" name="code"&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;
&amp;lt;head runat="server"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;form id="form1" runat="server"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:FileUpload ID="FileUpload1" runat="server" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:FileUpload ID="FileUpload2" runat="server" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Button ID="btnUpload" runat="server"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Text="Upload" onclick="btnUpload_Click" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;br /&gt;
&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;&amp;nbsp;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Collections;
public partial class generic : System.Web.UI.Page
{
&amp;nbsp;&amp;nbsp; &amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void Page_Load(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; protected void btnUpload_Click(object sender, EventArgs e)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Post file Collection Class
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HttpFileCollection files = Request.Files;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (files.Count &amp;gt; 0)
&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; for (int i = 0; i &amp;lt; files.Count; i++)
&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; //read Individual files 
&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; HttpPostedFile p = files[i];
&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 path = Server.MapPath(Guid.NewGuid().ToString() + ".jpg");
&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; p.SaveAs(path);
&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; }
}

&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-6172144171147828444?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=M2Hg8tkqdfE:st3Kx6fpRXs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=M2Hg8tkqdfE:st3Kx6fpRXs:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=M2Hg8tkqdfE:st3Kx6fpRXs:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=M2Hg8tkqdfE:st3Kx6fpRXs:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=M2Hg8tkqdfE:st3Kx6fpRXs:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=M2Hg8tkqdfE:st3Kx6fpRXs:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=M2Hg8tkqdfE:st3Kx6fpRXs:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=M2Hg8tkqdfE:st3Kx6fpRXs:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=M2Hg8tkqdfE:st3Kx6fpRXs:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=M2Hg8tkqdfE:st3Kx6fpRXs:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=M2Hg8tkqdfE:st3Kx6fpRXs:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=M2Hg8tkqdfE:st3Kx6fpRXs:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=M2Hg8tkqdfE:st3Kx6fpRXs:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=M2Hg8tkqdfE:st3Kx6fpRXs:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=M2Hg8tkqdfE:st3Kx6fpRXs:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=M2Hg8tkqdfE:st3Kx6fpRXs:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=M2Hg8tkqdfE:st3Kx6fpRXs:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/M2Hg8tkqdfE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/M2Hg8tkqdfE/multiple-file-upload-in-aspnet.html</link><author>noreply@blogger.com (Raju.M)</author><thr:total>0</thr:total><feedburner:origLink>http://makhaai.blogspot.com/2010/07/multiple-file-upload-in-aspnet.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-7211754625266585913</guid><pubDate>Fri, 02 Jul 2010 22:41:00 +0000</pubDate><atom:updated>2010-07-02T16:27:29.197-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ValidatorCallout</category><category domain="http://www.blogger.com/atom/ns#">AJAX Control Toolkit</category><title>Dynamically Add AJAX Control Toolkit  ValidatorCallout Extender</title><description>&lt;b&gt;How to add AJAX Control Toolkit&amp;nbsp; ValidatorCallout Extender to Dynamic TextBox&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
To add Ajax Control ToolKit ValidatorCallout we need one TextBox and RequiredFieldValidator. Now i am creating all controls are adding dynamically.&amp;nbsp; For more information, see&amp;nbsp; &lt;a href="http://www.asp.net/ajaxlibrary/act_ValidatorCallout.ashx"&gt;ValidatorCallout&lt;/a&gt; control.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="csharp" name="code"&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;
public partial class Default2 : System.Web.UI.Page
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void Page_Load(object sender, EventArgs e)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Dynamically Creating TextBox
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TextBox txtBox = new TextBox();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; txtBox.ID = "TextBox1";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; txtBox.MaxLength = 100;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Dynamically Creating RequiredFieldValidator Control
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RequiredFieldValidator requiredFieldValidater = new RequiredFieldValidator();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; requiredFieldValidater.ID = "RequiredFieldValidator1";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; requiredFieldValidater.ControlToValidate = txtBox.ID;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; requiredFieldValidater.ErrorMessage = "Name is required.";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; requiredFieldValidater.Text = "*";

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Dynamically Creating ValidatorCalloutExtender Control
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AjaxControlToolkit.ValidatorCalloutExtender validatorCalloutExtender = new AjaxControlToolkit.ValidatorCalloutExtender();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; validatorCalloutExtender.ID = "ValidatorCalloutExtender1";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; validatorCalloutExtender.TargetControlID = requiredFieldValidater.ID;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Dynamically Adding controls to PlaceHolder Control
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PlaceHolder1.Controls.Add(txtBox);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PlaceHolder1.Controls.Add(requiredFieldValidater);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PlaceHolder1.Controls.Add(validatorCalloutExtender);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Output Sample&lt;/b&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_atbH0-cQOmg/TC5nz9YQi7I/AAAAAAAAA5c/UbR3LUcA2yw/s1600/ValidatorCalloutExtender.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_atbH0-cQOmg/TC5nz9YQi7I/AAAAAAAAA5c/UbR3LUcA2yw/s320/ValidatorCalloutExtender.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="XML" name="code"&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %&amp;gt;

&amp;lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %&amp;gt;

&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;

&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;
&amp;lt;head runat="server"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;form id="form1" runat="server"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ScriptManager ID="ScriptManager1" runat="server"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/asp:ScriptManager&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:PlaceHolder ID="PlaceHolder1" runat="server"&amp;gt;&amp;lt;/asp:PlaceHolder&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Button ID="Button1" runat="server" Text="Button" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-7211754625266585913?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=a-9TZMWRi1g:sfz1Rkl7prY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=a-9TZMWRi1g:sfz1Rkl7prY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=a-9TZMWRi1g:sfz1Rkl7prY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=a-9TZMWRi1g:sfz1Rkl7prY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=a-9TZMWRi1g:sfz1Rkl7prY:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=a-9TZMWRi1g:sfz1Rkl7prY:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=a-9TZMWRi1g:sfz1Rkl7prY:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=a-9TZMWRi1g:sfz1Rkl7prY:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=a-9TZMWRi1g:sfz1Rkl7prY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=a-9TZMWRi1g:sfz1Rkl7prY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=a-9TZMWRi1g:sfz1Rkl7prY:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=a-9TZMWRi1g:sfz1Rkl7prY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=a-9TZMWRi1g:sfz1Rkl7prY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=a-9TZMWRi1g:sfz1Rkl7prY:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=a-9TZMWRi1g:sfz1Rkl7prY:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=a-9TZMWRi1g:sfz1Rkl7prY:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=a-9TZMWRi1g:sfz1Rkl7prY:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/a-9TZMWRi1g" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/a-9TZMWRi1g/dynamically-add-ajax-control-toolkit.html</link><author>noreply@blogger.com (Raju.M)</author><media:thumbnail url="http://4.bp.blogspot.com/_atbH0-cQOmg/TC5nz9YQi7I/AAAAAAAAA5c/UbR3LUcA2yw/s72-c/ValidatorCalloutExtender.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://makhaai.blogspot.com/2010/07/dynamically-add-ajax-control-toolkit.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-8335348378468612816</guid><pubDate>Thu, 01 Jul 2010 14:47:00 +0000</pubDate><atom:updated>2010-09-03T11:41:55.361-07:00</atom:updated><title>Creating Dynamic Controls in ASP.Net</title><description>&lt;b&gt; Server Side Code&lt;/b&gt;&lt;br /&gt;
Code snippet for creating Dynamic Controls in ASP.Net. adding dynamic contents and reading the values of dynamically generated controls  in ASP.Net have little issue. because after PostBack dynamic controls are disappear from the form. to avoid this we can regenerate controls in page. &lt;br /&gt;
&lt;br /&gt;
This is a simple sample to adding and reading Dynamic controls in ASP.Net.&lt;br /&gt;
in !IsPostBack i am create a new instance of ASP TextBox Control.then Adding it to the PlaceHolder Control&lt;br /&gt;
&lt;br /&gt;
&lt;pre name="code" class="c-sharp"&gt;if (!IsPostBack)
        {
            //bind textBox in placeholder
            TextBox textBox = new TextBox();
            textBox.ID = "TextBox1";
            PlaceHolder1.Controls.Add(textBox);
        }

&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;in IsPostBack Section&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Issue come in this part. after PostBack controls are hidden or disappear from the Form. To avoid this am checking the controls are available in PlaceHolder. if it returns null am binding the controls in PlaceHolder.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre name="code" class="c-sharp"&gt;//if postback dynamic generated controls are invisible
            //so we can bind in each post back
            TextBox textBox = new TextBox();
            if (PlaceHolder1.FindControl("TextBox1") == null)
            {
                textBox.ID = "TextBox1";
                PlaceHolder1.Controls.Add(textBox);
            }

&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt; Reading Values From Generated Control&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
In this section am explaining how to Read Contents from Dynamically generated TextBox.&lt;br /&gt;
&lt;br /&gt;
i think code is more than effective to explain this, Check the code&lt;br /&gt;
I am reading TextBox Value in a Button click. &lt;br /&gt;
first check the controls is available in PlaceHolder. if available, display the value using Responce.Write.&lt;br /&gt;
&lt;br /&gt;
&lt;pre name="code" class="c-sharp"&gt;TextBox text = PlaceHolder1.FindControl("TextBox1") as TextBox;
        if (text != null)
        {
            Response.Write(text.Text);
        }
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt; Full Source Code &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;HTML Side&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre name="code" class="c-sharp"&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot; CodeFile=&amp;quot;dynamiccontrols.aspx.cs&amp;quot; Inherits=&amp;quot;dynamiccontrols&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;/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;asp:PlaceHolder ID=&amp;quot;PlaceHolder1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/asp:PlaceHolder&amp;gt;
        &amp;lt;asp:Button ID=&amp;quot;Button1&amp;quot; runat=&amp;quot;server&amp;quot; onclick=&amp;quot;Button1_Click&amp;quot; Text=&amp;quot;Button&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;br /&gt;
&lt;br /&gt;
&lt;b&gt; Server Side Code&lt;/b&gt;&lt;br /&gt;
&lt;pre name="code" class="c-sharp"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class dynamiccontrols : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //bind textBox in placeholder
            TextBox textBox = new TextBox();
            textBox.ID = "TextBox1";
            PlaceHolder1.Controls.Add(textBox);
        }
        else
        { 
            //if postback dynamic generated controls are invisible
            //so we can bind in each post back
            TextBox textBox = new TextBox();
            if (PlaceHolder1.FindControl("TextBox1") == null)
            {
                textBox.ID = "TextBox1";
                PlaceHolder1.Controls.Add(textBox);
            }
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        TextBox text = PlaceHolder1.FindControl("TextBox1") as TextBox;
        if (text != null)
        {
            Response.Write(text.Text);
        }
    }
}

&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-8335348378468612816?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=dcgogI6NkVQ:SzHbuwqUpKs:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=dcgogI6NkVQ:SzHbuwqUpKs:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=dcgogI6NkVQ:SzHbuwqUpKs:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=dcgogI6NkVQ:SzHbuwqUpKs:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=dcgogI6NkVQ:SzHbuwqUpKs:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/dcgogI6NkVQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/dcgogI6NkVQ/server-side-code-code-snippet-for.html</link><author>noreply@blogger.com (Raju.M)</author><thr:total>0</thr:total><feedburner:origLink>http://makhaai.blogspot.com/2010/07/server-side-code-code-snippet-for.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-2404468010813110496</guid><pubDate>Thu, 01 Jul 2010 14:39:00 +0000</pubDate><atom:updated>2010-07-01T07:39:01.059-07:00</atom:updated><title>How to Find Controls in Content Page</title><description>How to find content page control in ASP.NET?&lt;br /&gt;
&lt;pre name="code" class="c-sharp"&gt;ContentPlaceHolder contentPage = Master.FindControl("ContentPlaceHolder1") as ContentPlaceHolder;
        Button button =contentPage.FindControl("Button1") as Button;
        if (button != null)
        {
            button.Text = "Message";
        }
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-2404468010813110496?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=75dGOMkyuHE:cH5qoTWfOJM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=75dGOMkyuHE:cH5qoTWfOJM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=75dGOMkyuHE:cH5qoTWfOJM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=75dGOMkyuHE:cH5qoTWfOJM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=75dGOMkyuHE:cH5qoTWfOJM:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=75dGOMkyuHE:cH5qoTWfOJM:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=75dGOMkyuHE:cH5qoTWfOJM:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=75dGOMkyuHE:cH5qoTWfOJM:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=75dGOMkyuHE:cH5qoTWfOJM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=75dGOMkyuHE:cH5qoTWfOJM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=75dGOMkyuHE:cH5qoTWfOJM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=75dGOMkyuHE:cH5qoTWfOJM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=75dGOMkyuHE:cH5qoTWfOJM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=75dGOMkyuHE:cH5qoTWfOJM:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=75dGOMkyuHE:cH5qoTWfOJM:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=75dGOMkyuHE:cH5qoTWfOJM:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=75dGOMkyuHE:cH5qoTWfOJM:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/75dGOMkyuHE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/75dGOMkyuHE/how-to-find-controls-in-content-page.html</link><author>noreply@blogger.com (Raju.M)</author><thr:total>0</thr:total><feedburner:origLink>http://makhaai.blogspot.com/2010/07/how-to-find-controls-in-content-page.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-2820330034384025920</guid><pubDate>Fri, 28 May 2010 21:01:00 +0000</pubDate><atom:updated>2010-06-22T16:25:46.469-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">GridView ASP.NET</category><title>Add GridView Column Dynamically  ASP.Net  and C #</title><description>&lt;b&gt;Add GridView Column Dynamically&amp;nbsp; &lt;/b&gt;&lt;br /&gt;
This code illustrate how to add a new Column in GridView on GridView1_RowCreated and add column value in GridView1_RowDataBound&lt;br /&gt;
&lt;pre name="code" class="c-sharp"&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;
public partial class dhilip : System.Web.UI.Page
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void Page_Load(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; //instance of a datatable
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataTable dt = new DataTable();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //instance of a datarow
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataRow drow;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //creating two datacolums Column1 and Column2 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataColumn dcol1 = new DataColumn("Column1", typeof(string));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataColumn dcol2 = new DataColumn("Column2", typeof(string));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //adding datacolumn to datatable
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt.Columns.Add(dcol1);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt.Columns.Add(dcol2);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //loop for 10 rows
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; 10; i++)
&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; //instance of a datarow
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drow = dt.NewRow();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //add rows to datatable
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt.Rows.Add(drow);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //add Column values
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt.Rows[i][dcol1] = i.ToString();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt.Rows[i][dcol2] = i.ToString();
&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; //set gridView Datasource as dataTable dt.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GridView1.DataSource = dt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Bind Datasource to gridview
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GridView1.DataBind();
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //create a instance of table cell
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // this table cell is going to add gridview as new column
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TableCell tc = new TableCell();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //first cell must be -1 ie the header of gridview. if it header
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (e.Row.RowIndex == -1)
&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; //add header column name. you can add more styles in this section
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tc.Text = "Multiple";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //add style for header column
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tc.Style.Add(HtmlTextWriterStyle.FontWeight, "bold");
&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; //cell add to gridview row
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.Row.Cells.Add(tc);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //if header column we dont need multiplication
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (e.Row.RowIndex != -1)
&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; //taking values from first cell. my first cell contain value, you can change
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string id = e.Row.Cells[0].Text;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //taking values from second cell. my second cell contain value, you can change
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string id2 = e.Row.Cells[1].Text;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //multiplication
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double mult = int.Parse(id) * int.Parse(id2);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //adding result to last column. coz we add new column in last.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.Row.Cells[e.Row.Cells.Count - 1].Text = mult.ToString();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-2820330034384025920?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=VNChPmtaxO4:8iVH7y89rA0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=VNChPmtaxO4:8iVH7y89rA0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=VNChPmtaxO4:8iVH7y89rA0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=VNChPmtaxO4:8iVH7y89rA0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=VNChPmtaxO4:8iVH7y89rA0:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=VNChPmtaxO4:8iVH7y89rA0:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=VNChPmtaxO4:8iVH7y89rA0:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=VNChPmtaxO4:8iVH7y89rA0:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=VNChPmtaxO4:8iVH7y89rA0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=VNChPmtaxO4:8iVH7y89rA0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=VNChPmtaxO4:8iVH7y89rA0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=VNChPmtaxO4:8iVH7y89rA0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=VNChPmtaxO4:8iVH7y89rA0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=VNChPmtaxO4:8iVH7y89rA0:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=VNChPmtaxO4:8iVH7y89rA0:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=VNChPmtaxO4:8iVH7y89rA0:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=VNChPmtaxO4:8iVH7y89rA0:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/VNChPmtaxO4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/VNChPmtaxO4/add-gridview-column-dynamically-aspnet.html</link><author>noreply@blogger.com (Raju.M)</author><thr:total>0</thr:total><feedburner:origLink>http://makhaai.blogspot.com/2010/05/add-gridview-column-dynamically-aspnet.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-7793315249938364277</guid><pubDate>Sun, 02 May 2010 13:07:00 +0000</pubDate><atom:updated>2010-07-01T07:37:58.000-07:00</atom:updated><title>Find Master Page Content From Content Page ASP.Net</title><description>&lt;b&gt;Find Master Page Content From Content Page&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
for example to find a Panel in the Master Page. we want to find the Panel from Content Page&lt;br /&gt;
// Casting Panel1 form MasterPage as Panel &lt;br /&gt;
&lt;pre name="code" class="c-sharp"&gt;Panel panel = (Panel)Master.FindControl("Panel1");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (panel != null)
&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; panel.Style.Add(HtmlTextWriterStyle.BackgroundColor, "Red");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-7793315249938364277?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=d49LFICxHX8:tN1Iet8vzbo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=d49LFICxHX8:tN1Iet8vzbo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=d49LFICxHX8:tN1Iet8vzbo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=d49LFICxHX8:tN1Iet8vzbo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=d49LFICxHX8:tN1Iet8vzbo:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=d49LFICxHX8:tN1Iet8vzbo:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=d49LFICxHX8:tN1Iet8vzbo:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=d49LFICxHX8:tN1Iet8vzbo:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=d49LFICxHX8:tN1Iet8vzbo:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=d49LFICxHX8:tN1Iet8vzbo:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=d49LFICxHX8:tN1Iet8vzbo:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=d49LFICxHX8:tN1Iet8vzbo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=d49LFICxHX8:tN1Iet8vzbo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=d49LFICxHX8:tN1Iet8vzbo:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=d49LFICxHX8:tN1Iet8vzbo:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=d49LFICxHX8:tN1Iet8vzbo:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=d49LFICxHX8:tN1Iet8vzbo:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/d49LFICxHX8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/d49LFICxHX8/find-master-page-content-from-content.html</link><author>noreply@blogger.com (Raju.M)</author><thr:total>0</thr:total><feedburner:origLink>http://makhaai.blogspot.com/2010/05/find-master-page-content-from-content.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-7321695861693603263</guid><pubDate>Wed, 28 Apr 2010 18:45:00 +0000</pubDate><atom:updated>2010-04-28T11:45:14.511-07:00</atom:updated><title>Dynamic DataTable ASP.Net</title><description>&lt;b&gt;This Article for How to Create a DataTable Dynamically.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
DataTable is Derived from &lt;b&gt;System.Data&lt;/b&gt; namespace&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
//Create a object of Datatable&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataTable dynamicTable = new DataTable();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //DataRow&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataRow dynamicRow;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //DataColumn for Name and Time&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataColumn NameColumn = new DataColumn("Name", typeof(string));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataColumn TimeColumn = new DataColumn("Time", typeof(string));&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //add Column to Datatable&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dynamicTable.Columns.Add(NameColumn);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dynamicTable.Columns.Add(TimeColumn);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //loop for 10 item in DataTable&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; 10; i++)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dynamicRow = dynamicTable.NewRow();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Add Rows to dymanicTable&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dynamicTable.Rows.Add(dynamicRow);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Assign Column value &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dynamicTable.Rows[i][NameColumn] = Guid.NewGuid().ToString();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dynamicTable.Rows[i][TimeColumn] = DateTime.Now.ToString();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Bind DynamicTable into a GridView&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GridView1.DataSource = dynamicTable;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GridView1.DataBind();&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-7321695861693603263?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=wWXSnpXAHpI:Bu3Ofg-bw3s:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=wWXSnpXAHpI:Bu3Ofg-bw3s:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=wWXSnpXAHpI:Bu3Ofg-bw3s:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=wWXSnpXAHpI:Bu3Ofg-bw3s:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=wWXSnpXAHpI:Bu3Ofg-bw3s:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=wWXSnpXAHpI:Bu3Ofg-bw3s:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=wWXSnpXAHpI:Bu3Ofg-bw3s:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=wWXSnpXAHpI:Bu3Ofg-bw3s:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=wWXSnpXAHpI:Bu3Ofg-bw3s:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=wWXSnpXAHpI:Bu3Ofg-bw3s:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=wWXSnpXAHpI:Bu3Ofg-bw3s:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=wWXSnpXAHpI:Bu3Ofg-bw3s:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=wWXSnpXAHpI:Bu3Ofg-bw3s:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=wWXSnpXAHpI:Bu3Ofg-bw3s:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=wWXSnpXAHpI:Bu3Ofg-bw3s:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=wWXSnpXAHpI:Bu3Ofg-bw3s:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=wWXSnpXAHpI:Bu3Ofg-bw3s:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/wWXSnpXAHpI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/wWXSnpXAHpI/dynamic-datatable-aspnet.html</link><author>noreply@blogger.com (Raju.M)</author><thr:total>2</thr:total><feedburner:origLink>http://makhaai.blogspot.com/2010/04/dynamic-datatable-aspnet.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-8901401018594405320</guid><pubDate>Tue, 27 Apr 2010 05:06:00 +0000</pubDate><atom:updated>2010-04-26T22:06:41.338-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">POP Access From ASP.Net</category><category domain="http://www.blogger.com/atom/ns#">C#.Net</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">Read Email From ASP.NET</category><title>Read E Mails from ASP.NET</title><description>&lt;b&gt;Read Mails from ASP.NET&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
This article Illustrate How to read mails from ASP.Net. Using POP commands you can access you email inbox from ASP.Net. Basic POP commands are USER, PASS, LIST, QUIT, RETR.&lt;br /&gt;
More details POP command help you can check these links&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://www.nthelp.com/pop_commands.htm&lt;br /&gt;
http://www.faqs.org/rfcs/rfc1939&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Creating Object for POPHelper&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Parameters are Gmail,Yahoo or MSN Pop Server,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Port number&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //bool isSSL&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; POPHelper objPopHelper = new POPHelper("pop.gmail.com", 995, true);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objPopHelper.UserName = "Your Gmail Username eg:youremail@gmail.com";&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objPopHelper.Password = "GmailPassword";&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objPopHelper.Connect();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GridView1.DataSource = p.DataSource;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GridView1.DataBind();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_atbH0-cQOmg/S9ZrCpUwWsI/AAAAAAAAA4Y/3dPIwVnV-E0/s1600/gmailPOP.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_atbH0-cQOmg/S9ZrCpUwWsI/AAAAAAAAA4Y/3dPIwVnV-E0/s320/gmailPOP.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;Code Of Connect Method&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
public void Connect()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string response = string.Empty;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ArrayList arrList = new ArrayList();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&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; //Connect to Host server &lt;br /&gt;
&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; #region Connect Host&lt;br /&gt;
&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; TcpClient _tcpClient = new TcpClient();&lt;br /&gt;
&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; try&lt;br /&gt;
&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; {&lt;br /&gt;
&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; _tcpClient.Connect(_hostname, _port);&lt;br /&gt;
&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; //if login is ssl&lt;br /&gt;
&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; if (_isSsl)&lt;br /&gt;
&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; {&lt;br /&gt;
&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; _stream = new SslStream(_tcpClient.GetStream());&lt;br /&gt;
&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; ((SslStream)_stream).AuthenticateAsClient(_hostname);&lt;br /&gt;
&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; }&lt;br /&gt;
&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; else&lt;br /&gt;
&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; {&lt;br /&gt;
&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; _stream = _tcpClient.GetStream();&lt;br /&gt;
&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; }&lt;br /&gt;
&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; }&lt;br /&gt;
&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 ex)&lt;br /&gt;
&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; {&lt;br /&gt;
&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; throw new POPCommandException("Connection to " + _hostname + " Port: " + _port + " failed. Error Details"+ex.Message);&lt;br /&gt;
&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; }&lt;br /&gt;
&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; #endregion&lt;br /&gt;
&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; // Send POP Commands (USER, PASS, LIST) to Host&lt;br /&gt;
&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; #region POP Commands&lt;br /&gt;
&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; _streamWriter = new StreamWriter(_stream, Encoding.ASCII);&lt;br /&gt;
&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; _streamReader = new StreamReader(_stream, Encoding.ASCII);&lt;br /&gt;
&lt;br /&gt;
&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; //POP command for send Username&lt;br /&gt;
&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; _streamWriter.WriteLine(POPCommands.USER.ToString()+" "+ UserName);&lt;br /&gt;
&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; //send to server&lt;br /&gt;
&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; _streamWriter.Flush();&lt;br /&gt;
&lt;br /&gt;
&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; //POP command for send&amp;nbsp; Password &lt;br /&gt;
&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; _streamWriter.WriteLine(POPCommands.PASS.ToString() + " " + Password);&lt;br /&gt;
&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; //send to server&lt;br /&gt;
&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; _streamWriter.Flush();&lt;br /&gt;
&lt;br /&gt;
&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; //POP command for List mails&lt;br /&gt;
&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; _streamWriter.WriteLine(POPCommands.LIST.ToString());&lt;br /&gt;
&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; //send to server&lt;br /&gt;
&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; _streamWriter.Flush();&lt;br /&gt;
&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; #endregion&lt;br /&gt;
&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; //Read Response Stream from Host&lt;br /&gt;
&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; #region Read Response Srteam&lt;br /&gt;
&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; //Read Response Stream&lt;br /&gt;
&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; response = null;&lt;br /&gt;
&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 resText = string.Empty;&lt;br /&gt;
&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; while ((resText = _streamReader.ReadLine()) != null)&lt;br /&gt;
&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; {&lt;br /&gt;
&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; if (resText == ".")&lt;br /&gt;
&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; { break; }&lt;br /&gt;
&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; if (resText.IndexOf("-ERR") != -1)&lt;br /&gt;
&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; { break; }&lt;br /&gt;
&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; response += resText;&lt;br /&gt;
&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; arrList.Add(resText);&lt;br /&gt;
&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; }&lt;br /&gt;
&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; #endregion&lt;br /&gt;
&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; //Binding Properties&lt;br /&gt;
&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; #region Bindings&lt;br /&gt;
&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; //Bind Message count&lt;br /&gt;
&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; BindMailCount(arrList);&lt;br /&gt;
&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; //mails returns List&lt;string&gt;&lt;br /&gt;
&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; _mail = ReadMail(messagecount);&lt;br /&gt;
&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; //get&amp;nbsp; mails Subjects returns List&lt;string&gt;&lt;br /&gt;
&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; _mailsub = FilterContent(_mail,FiltersOption.Subject);&lt;br /&gt;
&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; _from = FilterContent(_mail, FiltersOption.From);&lt;br /&gt;
&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; _to = FilterContent(_mail, FiltersOption.To);&lt;br /&gt;
&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; SetDataSource(_mailsub, _from);&lt;br /&gt;
&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; #endregion&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch (Exception ex)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&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; errors.Add(ex.Message);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/string&gt;&lt;/string&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Class Diagram of POPHelper&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_atbH0-cQOmg/S9Ztoa8-1RI/AAAAAAAAA4g/OtFKS3j3_Ls/s1600/Class+Diagram.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_atbH0-cQOmg/S9Ztoa8-1RI/AAAAAAAAA4g/OtFKS3j3_Ls/s320/Class+Diagram.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;Reading Mails Using POP Command RETR from ASP.NET&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
private List&lt;string&gt; ReadMail(int Count)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; List&lt;string&gt; lst = new List&lt;string&gt;();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&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; for (int i = 1; i &amp;lt;= Count; i++)&lt;br /&gt;
&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; {&lt;br /&gt;
&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; _streamWriter.WriteLine(POPCommands.RETR+" " + i.ToString());&lt;br /&gt;
&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; _streamWriter.Flush();&lt;br /&gt;
&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 resText = string.Empty;&lt;br /&gt;
&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; while ((resText = _streamReader.ReadLine()) != null)&lt;br /&gt;
&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; {&lt;br /&gt;
&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; if (resText == ".")&lt;br /&gt;
&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; { break; }&lt;br /&gt;
&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; if (resText.IndexOf("-ERR") != -1)&lt;br /&gt;
&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; { break; }&lt;br /&gt;
&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; lst.Add(resText);&lt;br /&gt;
&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; }&lt;br /&gt;
&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; }&lt;br /&gt;
&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; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch(Exception ex)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&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; errors.Add(ex.Message);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return lst;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/string&gt;&lt;/string&gt;&lt;/string&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Enumerates for Filer message subject and From Address and ToAddress&lt;/b&gt;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_atbH0-cQOmg/S9ZuvoWjosI/AAAAAAAAA4o/eNrVh_-pcXE/s1600/enum+types.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_atbH0-cQOmg/S9ZuvoWjosI/AAAAAAAAA4o/eNrVh_-pcXE/s320/enum+types.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;Method for Filer Content&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
private List&lt;string&gt; FilterContent(List&lt;string&gt; Mails,FiltersOption filter)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; List&lt;string&gt; filterItems = new List&lt;string&gt;();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&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; for (int i = 0; i &amp;lt; Mails.Count; i++)&lt;br /&gt;
&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; {&lt;br /&gt;
&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; if (Mails[i].StartsWith(filter.ToString() + ":"))&lt;br /&gt;
&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; {&lt;br /&gt;
&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 sub = Mails[i].Replace(filter.ToString() + ":", "");&lt;br /&gt;
&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; filterItems.Add(sub);&lt;br /&gt;
&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; }&lt;br /&gt;
&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; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch (Exception ex)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&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; errors.Add(ex.Message);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return filterItems;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/string&gt;&lt;/string&gt;&lt;/string&gt;&lt;/string&gt;&lt;br /&gt;
&lt;b&gt;Creating DataSource for GridView&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
private DataTable SetDataSource(List&lt;string&gt;subject,List&lt;string&gt;sender)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int messageCount = messagecount;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataTab = new DataTable();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataRow drow;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataColumn Sender = new DataColumn("Sender", typeof(string));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataColumn Subject = new DataColumn("Subject", typeof(string));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataTab.Columns.Add(Sender);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataTab.Columns.Add(Subject);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; subject.Count; i++)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&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; drow = dataTab.NewRow();&lt;br /&gt;
&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; dataTab.Rows.Add(drow);&lt;br /&gt;
&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; dataTab.Rows[i][Sender] = sender[i].ToString();&lt;br /&gt;
&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; dataTab.Rows[i][Subject] = subject[i].ToString();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return dataTab;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/string&gt;&lt;/string&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.cafekerala.com/makhaaiblogspot/ReadMailFromASP.NET.rar"&gt;Download SOURCE &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-8901401018594405320?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=m9Zys_iHwyw:UI52aXw388Y:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=m9Zys_iHwyw:UI52aXw388Y:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=m9Zys_iHwyw:UI52aXw388Y:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=m9Zys_iHwyw:UI52aXw388Y:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=m9Zys_iHwyw:UI52aXw388Y:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=m9Zys_iHwyw:UI52aXw388Y:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=m9Zys_iHwyw:UI52aXw388Y:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=m9Zys_iHwyw:UI52aXw388Y:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=m9Zys_iHwyw:UI52aXw388Y:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=m9Zys_iHwyw:UI52aXw388Y:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=m9Zys_iHwyw:UI52aXw388Y:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=m9Zys_iHwyw:UI52aXw388Y:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=m9Zys_iHwyw:UI52aXw388Y:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=m9Zys_iHwyw:UI52aXw388Y:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=m9Zys_iHwyw:UI52aXw388Y:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=m9Zys_iHwyw:UI52aXw388Y:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=m9Zys_iHwyw:UI52aXw388Y:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/m9Zys_iHwyw" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/m9Zys_iHwyw/read-e-mails-from-aspnet.html</link><author>noreply@blogger.com (Raju.M)</author><media:thumbnail url="http://3.bp.blogspot.com/_atbH0-cQOmg/S9ZrCpUwWsI/AAAAAAAAA4Y/3dPIwVnV-E0/s72-c/gmailPOP.jpg" height="72" width="72" /><thr:total>0</thr:total><enclosure url="http://www.cafekerala.com/makhaaiblogspot/ReadMailFromASP.NET.rar" length="38277" type="application/octet-stream" /><media:content url="http://www.cafekerala.com/makhaaiblogspot/ReadMailFromASP.NET.rar" fileSize="38277" type="application/octet-stream" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>Read Mails from ASP.NET This article Illustrate How to read mails from ASP.Net. Using POP commands you can access you email inbox from ASP.Net. Basic POP commands are USER, PASS, LIST, QUIT, RETR. More details POP command help you can check these links ht</itunes:subtitle><itunes:author>noreply@blogger.com (Raju.M)</itunes:author><itunes:summary>Read Mails from ASP.NET This article Illustrate How to read mails from ASP.Net. Using POP commands you can access you email inbox from ASP.Net. Basic POP commands are USER, PASS, LIST, QUIT, RETR. More details POP command help you can check these links http://www.nthelp.com/pop_commands.htm http://www.faqs.org/rfcs/rfc1939 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Creating Object for POPHelper &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Parameters are Gmail,Yahoo or MSN Pop Server, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Port number &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //bool isSSL &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; POPHelper objPopHelper = new POPHelper("pop.gmail.com", 995, true); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objPopHelper.UserName = "Your Gmail Username eg:youremail@gmail.com"; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objPopHelper.Password = "GmailPassword"; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objPopHelper.Connect(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GridView1.DataSource = p.DataSource; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GridView1.DataBind(); Code Of Connect Method&amp;nbsp; public void Connect() &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 response = string.Empty; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ArrayList arrList = new ArrayList(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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; //Connect to Host server &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; #region Connect Host &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; TcpClient _tcpClient = new TcpClient(); &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; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _tcpClient.Connect(_hostname, _port); &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; //if login is ssl &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; if (_isSsl) &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;&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; _stream = new SslStream(_tcpClient.GetStream()); &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; ((SslStream)_stream).AuthenticateAsClient(_hostname); &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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else &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;&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; _stream = _tcpClient.GetStream(); &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;&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 ex) &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;</itunes:summary><itunes:keywords>POP Access From ASP.Net, C#.Net, ASP.NET, Read Email From ASP.NET</itunes:keywords><feedburner:origLink>http://makhaai.blogspot.com/2010/04/read-e-mails-from-aspnet.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-8035073075813416747</guid><pubDate>Mon, 19 Apr 2010 13:02:00 +0000</pubDate><atom:updated>2010-04-19T06:05:37.958-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tracing</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><title>Tracing  ASP.NET</title><description>&lt;b&gt;Tracing&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
ASP.NET tracing enable diagnostic information about requested asp.net page.&lt;br /&gt;
Tracing Help to follow&lt;br /&gt;
&lt;br /&gt;
•&amp;nbsp;&amp;nbsp;&amp;nbsp; Page's execution path,&lt;br /&gt;
•&amp;nbsp;&amp;nbsp;&amp;nbsp; Display diagnostic information at run time&lt;br /&gt;
•&amp;nbsp;&amp;nbsp;&amp;nbsp; debug your application&lt;br /&gt;
&lt;br /&gt;
Tracing appends diagnostic information and custom tracing messages to the output of the page and sends this information to the requesting browser. Optionally, you can view this information from a separate trace viewer (Trace.axd) that displays trace information for every page in an ASP.NET Web application. Tracing information can help you investigate errors or unwanted results while ASP.NET processes a page request.&lt;br /&gt;
&lt;br /&gt;
Trace information can enable for single page and hole pages/ application level by configure the application's Web.config. Trace statements are processed and displayed only when tracing is enabled.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Code for Application Level tracing&lt;/b&gt;&lt;br /&gt;
in web.config file &amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;configuration&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;system.web&amp;gt;&lt;br /&gt;
&amp;lt;trace enabled="true" requestLimit="40" pageOutput="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; localOnly="false" /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/system.web&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Page level tracing&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Add Trace="true" in @page Directives &lt;br /&gt;
&lt;br /&gt;
Eg : &amp;lt;%@ Page Trace="true" %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Trace Configuration Attributes&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
PageOutput -&amp;nbsp; true to display trace both in pages and in the trace viewer (Trace.axd); otherwise, false. The default is false.&lt;br /&gt;
&lt;br /&gt;
requestLimit - The number of trace requests to store on the server. The default is 10.&lt;br /&gt;
&lt;br /&gt;
localOnly - true to make the trace viewer (Trace.axd) available only on the host Web server; otherwise, false. The default is true.&lt;br /&gt;
&lt;br /&gt;
When tracing is enabled for a page, trace information is displayed in any browser requests that page. Tracing displays sensitive information, such as the values of server variables, and can therefore represent a security threat. Be sure to disable page tracing before porting your application to a production server. You can do this by setting the Trace attribute to false or by removing it. You can also configure tracing in the Web.config file by setting the enabled, localOnly, and pageOutput attributes of the trace Element&lt;br /&gt;
&lt;br /&gt;
Source&amp;nbsp; from &lt;a href="http://msdn.microsoft.com/en-us/library/bb386420.aspx"&gt;MSDN&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-8035073075813416747?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=sM8C1eFB7jY:Ud5vGTS2Lsk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=sM8C1eFB7jY:Ud5vGTS2Lsk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=sM8C1eFB7jY:Ud5vGTS2Lsk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=sM8C1eFB7jY:Ud5vGTS2Lsk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=sM8C1eFB7jY:Ud5vGTS2Lsk:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=sM8C1eFB7jY:Ud5vGTS2Lsk:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=sM8C1eFB7jY:Ud5vGTS2Lsk:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=sM8C1eFB7jY:Ud5vGTS2Lsk:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=sM8C1eFB7jY:Ud5vGTS2Lsk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=sM8C1eFB7jY:Ud5vGTS2Lsk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=sM8C1eFB7jY:Ud5vGTS2Lsk:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=sM8C1eFB7jY:Ud5vGTS2Lsk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=sM8C1eFB7jY:Ud5vGTS2Lsk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=sM8C1eFB7jY:Ud5vGTS2Lsk:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=sM8C1eFB7jY:Ud5vGTS2Lsk:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=sM8C1eFB7jY:Ud5vGTS2Lsk:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=sM8C1eFB7jY:Ud5vGTS2Lsk:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/sM8C1eFB7jY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/sM8C1eFB7jY/tracing-aspnet.html</link><author>noreply@blogger.com (Raju.M)</author><thr:total>0</thr:total><feedburner:origLink>http://makhaai.blogspot.com/2010/04/tracing-aspnet.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-1640322352004602907</guid><pubDate>Fri, 16 Apr 2010 23:40:00 +0000</pubDate><atom:updated>2010-04-16T16:40:20.387-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">State Management</category><title>Control State - ASP.NET State Management</title><description>State management is the process by which you maintain state and page  information over multiple requests for the same or different pages.&lt;br /&gt;
Control state is an object comprised of critical view state data that  Web server controls need to function, and is contained in a separate  object from normal view state information. Control state data is not  affected when view state is disabled at the Page  level, but requires extra implementation steps to use.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://msdn.microsoft.com/en-us/library/75x4ha6s.aspx"&gt;More Reference for ASP.NET State Management Check this&lt;/a&gt; &amp;nbsp;&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-1640322352004602907?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_iFHIR66PlQ:d8WCK6TWv4Y:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_iFHIR66PlQ:d8WCK6TWv4Y:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=_iFHIR66PlQ:d8WCK6TWv4Y:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_iFHIR66PlQ:d8WCK6TWv4Y:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_iFHIR66PlQ:d8WCK6TWv4Y:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=_iFHIR66PlQ:d8WCK6TWv4Y:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_iFHIR66PlQ:d8WCK6TWv4Y:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_iFHIR66PlQ:d8WCK6TWv4Y:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_iFHIR66PlQ:d8WCK6TWv4Y:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=_iFHIR66PlQ:d8WCK6TWv4Y:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_iFHIR66PlQ:d8WCK6TWv4Y:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_iFHIR66PlQ:d8WCK6TWv4Y:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=_iFHIR66PlQ:d8WCK6TWv4Y:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_iFHIR66PlQ:d8WCK6TWv4Y:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_iFHIR66PlQ:d8WCK6TWv4Y:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=_iFHIR66PlQ:d8WCK6TWv4Y:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=_iFHIR66PlQ:d8WCK6TWv4Y:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/_iFHIR66PlQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/_iFHIR66PlQ/control-state-aspnet-state-management.html</link><author>noreply@blogger.com (Raju.M)</author><thr:total>0</thr:total><feedburner:origLink>http://makhaai.blogspot.com/2010/04/control-state-aspnet-state-management.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6236973097452836208.post-7602235215535754030</guid><pubDate>Mon, 12 Apr 2010 20:42:00 +0000</pubDate><atom:updated>2010-04-19T22:34:41.736-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">Encrypt and Decript String</category><title>Encrypt and Decrypt String ASP.NET</title><description>You can Encrypt and Decrypt string&amp;nbsp; variable like QueryString etc by FormsAuthentication class. This class is Derived from System.Web.Security. This is a simple method to encryption and decryption. I think the code will definitely explain how it works. if anyone want detailed description just drop a comment i will reply ASAP.&lt;br /&gt;
&lt;br /&gt;
First Initializes a new instance of&amp;nbsp; FormsAuthenticationTicket class, this ticket is used to encrypt via FormsAuthentication.Encrypt(FormsAuthenticationTicket tk) method. FormsAuthentication.Encrypt method return encrypted string.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FormsAuthenticationTicket has three parameters.parameters are&amp;nbsp; string  name, bool isPersistent, and int timeout.The time, in minutes, for which  the authentication ticket is valid. if isPersistent is true if the  ticket will be stored in a persistent cookie (saved across  browser sessions); otherwise, false. If the ticket is stored in  the URL, this value is ignored.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Encrypt Method&lt;/b&gt;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private string Encrypt(string stringToEncrypt)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FormsAuthenticationTicket tk = new FormsAuthenticationTicket(stringToEncrypt, false, 600);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // returns encrypted string&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return FormsAuthentication.Encrypt(tk); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Decrypt Method&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private string Decrypt(string encryptedString)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FormsAuthenticationTicket tk= FormsAuthentication.Decrypt(encryptedString);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return tk.Name;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;div class="blogger-post-footer"&gt;OpenSource.Net&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6236973097452836208-7602235215535754030?l=makhaai.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=GA0HSexptlY:VNg9VSHfDy8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=GA0HSexptlY:VNg9VSHfDy8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=GA0HSexptlY:VNg9VSHfDy8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=GA0HSexptlY:VNg9VSHfDy8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=GA0HSexptlY:VNg9VSHfDy8:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=GA0HSexptlY:VNg9VSHfDy8:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=GA0HSexptlY:VNg9VSHfDy8:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=GA0HSexptlY:VNg9VSHfDy8:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=GA0HSexptlY:VNg9VSHfDy8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=GA0HSexptlY:VNg9VSHfDy8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=GA0HSexptlY:VNg9VSHfDy8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=GA0HSexptlY:VNg9VSHfDy8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=GA0HSexptlY:VNg9VSHfDy8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=GA0HSexptlY:VNg9VSHfDy8:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=GA0HSexptlY:VNg9VSHfDy8:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?i=GA0HSexptlY:VNg9VSHfDy8:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/OpenSourcenet?a=GA0HSexptlY:VNg9VSHfDy8:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/OpenSourcenet?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OpenSourcenet/~4/GA0HSexptlY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OpenSourcenet/~3/GA0HSexptlY/encrypt-and-decript-string-aspnet.html</link><author>noreply@blogger.com (Raju.M)</author><thr:total>0</thr:total><feedburner:origLink>http://makhaai.blogspot.com/2010/04/encrypt-and-decript-string-aspnet.html</feedburner:origLink></item><language>en-us</language><media:rating>nonadult</media:rating></channel></rss>

