<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8246223763691022416</id><updated>2012-01-31T21:31:01.800-08:00</updated><category term='cultralinfo'/><category term='page life cycle'/><category term='boost up'/><category term='inspector'/><category term='master page'/><category term='toPrecision'/><category term='windows phone 7'/><category term='cookie'/><category term='google map'/><category term='string format'/><category term='32 bit'/><category term='response.redirect'/><category term='XML Parsing Error'/><category term='web service'/><category term='List'/><category term='IP'/><category term='MOSS'/><category term='performance'/><category term='aiub'/><category term='asp.net 4.0'/><category term='MSDN Community'/><category term='HTTP_ACCEPT_LANGUAGE'/><category term='aspx'/><category term='64 bit'/><category term='IE7'/><category term='table'/><category term='IEEE'/><category term='Dictionary'/><category term='linq'/><category term='CSS'/><category term='datatable'/><category term='security'/><category term='spac'/><category term='QueryStrings'/><category term='aloashbei'/><category term='MVP'/><category term='XML'/><category term='xm.datatable'/><category term='thick client'/><category term='language'/><category term='IIS'/><category term='Request format'/><category term='case'/><category term='mvc'/><category term='split'/><category term='VB.net'/><category term='Format'/><category term='DateTime'/><category term='android'/><category term='Firefox'/><category term='geolocation'/><category term='httpHandler'/><category term='Dom'/><category term='mac'/><category term='session'/><category term='optimization'/><category term='HTML'/><category term='asp.net'/><category term='parameter'/><category term='duplicate post'/><category term='longitude'/><category term='single web form'/><category term='community launch'/><category term='json'/><category term='modal'/><category term='code-behind'/><category term='latitue'/><category term='thin client'/><category term='content page'/><category term='xmlhttpRequest'/><category term='javascript'/><category term='dynamically add control'/><category term='permission'/><category term='kuet'/><category term='map'/><category term='Thanks'/><category term='event'/><category term='url rewriting'/><category term='export'/><category term='Visual Studio 2010'/><category term='currency'/><category term='ModalBackground'/><category term='murshed.wordpress.com'/><category term='relative path'/><category term='page loading progress'/><category term='Gridview'/><category term='Launch'/><category term='browser info'/><category term='Session StateServer mode'/><category term='toFixed'/><category term='Web Method'/><category term='absolute path'/><category term='database'/><category term='Windows 7'/><category term='debug'/><category term='speed'/><category term='new window'/><category term='ascx'/><category term='IE6'/><category term='sso'/><category term='ajax'/><category term='refresh page'/><category term='ckeditor'/><category term='SharePoint'/><category term='body'/><category term='view engine'/><category term='validation control'/><category term='extension method'/><category term='refresh'/><category term='strng format'/><category term='MS SQL'/><category term='ascii'/><category term='sharpcorne'/><category term='C#'/><category term='regex'/><category term='jquery'/><category term='Reflection'/><category term='Export to excel'/><category term='monodroid'/><category term='unrecognized'/><category term='aspnet_regiis'/><category term='country'/><category term='HttpRequest.UserLanguages'/><category term='user control'/><category term='HtmlForm'/><category term='razor'/><category term='microsoft'/><category term='DoS'/><category term='exception'/><category term='ip address'/><category term='web site'/><category term='Bangladesh'/><category term='virtual directory'/><category term='webmatrix'/><category term='httpModule'/><category term='no element found'/><category term='CheckBoxlist'/><category term='problem'/><title type='text'>ASP.net BOSS</title><subtitle type='html'>The site is for ASP.net/C# learner, ASP.Net/C# developer......</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>97</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-4251996204534422196</id><published>2012-01-31T03:29:00.000-08:00</published><updated>2012-01-31T03:29:52.089-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='split'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Useful overloads for String.Split()</title><content type='html'>Most of C# developers are familiar with this String.split() method. I have found some useful overloads for split method of the string class split the string in array of string. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Example 1:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;String.Split( char[])&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;br /&gt;string words = "string1,string2,string3,,string4 string5.";&lt;br /&gt;string [] split = words.Split(new Char [] {' ', ','}); &lt;br /&gt;&lt;br /&gt;Above code create a string array which has &lt;br /&gt;&lt;br /&gt;//result&lt;br /&gt;split[0]=string1&lt;br /&gt;split[1]=string2&lt;br /&gt;split[2]=string3&lt;br /&gt;split[3]=&lt;br /&gt;split[4]=string4&lt;br /&gt;split[5]=string5&lt;br /&gt;&lt;br /&gt;but What If I want to remove empty string from the array when I split string.&lt;br /&gt;Solution to this problem is to make use of second overload method of the the string Split where you can specify the option to remove string. So above code is rewritten as &lt;br /&gt;&lt;br /&gt;Overload method with option&lt;br /&gt;&lt;b&gt;String.Split(Char[], StringSplitOptions)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;br /&gt;string words = "string1,string2,string3,,string4 string5.";&lt;br /&gt;string [] split = words.Split(new Char [] {' ', ','},StringSplitOptions.&lt;b&gt;RemoveEmptyEntries&lt;/b&gt;); &lt;br /&gt;&lt;br /&gt;Return split array-&gt;&lt;br /&gt;&lt;br /&gt;//result&lt;br /&gt;split[0]=string1&lt;br /&gt;split[1]=string2&lt;br /&gt;split[2]=string3&lt;br /&gt;split[3]=string4&lt;br /&gt;split[4]=string5&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Example 2:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now consider case where I have to limit no of return string. Consider for example &lt;br /&gt;&lt;br /&gt;string a = "key:Testkey, Value : testValue1,testValue2";  &lt;br /&gt;&lt;br /&gt;Now I have to get the key:Testkeyin string 1 and Value : testValue1,testValue2in string 2.&lt;br /&gt;Overload function to split string in limited no. of string&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Split(Char[], Int32)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;br /&gt;string a = "key: Testkey, Value : testValue1,testValue2"; &lt;br /&gt;string [] split = words.Split(new Char [] {','},&lt;b&gt;2&lt;/b&gt;);   &lt;br /&gt;&lt;br /&gt;Return split array-&gt;&lt;br /&gt;&lt;br /&gt;//result&lt;br /&gt;split[0]= "key: Testkey";&lt;br /&gt;split[1]= "Value : testValue1,testValue2";&lt;br /&gt;&lt;br /&gt;For more information:&lt;br /&gt;String.Split Method (Char(), Int32):&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/c1bs0eda.aspx"&gt;http://msdn.microsoft.com/en-us/library/c1bs0eda.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;String.Split Method (Char(), Int32, StringSplitOptions):&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms131450.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms131450.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-4251996204534422196?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/4251996204534422196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=4251996204534422196' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4251996204534422196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4251996204534422196'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2012/01/useful-overloads-for-stringsplit.html' title='Useful overloads for String.Split()'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-8996288047514523041</id><published>2012-01-31T02:14:00.000-08:00</published><updated>2012-01-31T02:14:24.000-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='ckeditor'/><title type='text'>RequiredField Validator not working with CKEditor in ASP.Net</title><content type='html'>Last month I had worked on a project where we were using CKEDITOR. For validation using asp.net required field validator. It is working for all control but unfortunately required field validator is not working for CKEDITOR.&lt;br /&gt;&lt;br /&gt;After searching I have got the reason and solution for this. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Reason:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The requiredfield validator control will not work properly when it is used with a textarea that is configured with CKEditor. This is due to the fact that, the CKEditor content will not be synched to the page element(textarea) properly when the validator control fire.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;To overcome this difficulty, we need to call the method &lt;b&gt;updateElement()&lt;/b&gt; in order to sync or post the content back to the textarea. The below code does that,&lt;br /&gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;script src="_scripts/jquery-1.3.2.min.js" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript" src="ckeditor/ckeditor.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript" src="ckeditor/adapters/jquery.js"&amp;gt;&amp;lt;/script&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;script type="text/javascript" language="javascript"&amp;gt;&lt;br /&gt;        $(document).ready(function() {&lt;br /&gt;            $('#TextBox1').ckeditor();&lt;br /&gt;        });    &lt;br /&gt;&lt;br /&gt;        &lt;b&gt;function UpdateContent()&lt;/b&gt; {          &lt;br /&gt;            var ckeditorinstance = $('#TextBox1').ckeditorGet();&lt;br /&gt;            ckeditorinstance.updateElement();&lt;br /&gt;        }&lt;br /&gt;    &amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;    &amp;lt;form id="form1" runat="server"&amp;gt;&lt;br /&gt;    &amp;lt;div&amp;gt;&lt;br /&gt;        &amp;lt;asp:TextBox ID="TextBox1" TextMode="MultiLine" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt; &lt;br /&gt;         &amp;lt;asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"&lt;br /&gt;        ControlToValidate="TextBox1" ErrorMessage="No content in CKEditor!"&amp;gt;&amp;lt;/asp:RequiredFieldValidator&amp;gt; &lt;br /&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;    &amp;lt;asp:Button ID="btnSave" OnClientClick="&lt;b&gt;javascript:UpdateContent()&lt;/b&gt;" runat="server" Text="Save" onclick="btnSave_Click" /&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&lt;br /&gt;In the above code, the javascript method &lt;b&gt;UpdateContent()&lt;/b&gt; will update the page elements with ckeditor content whenever tha Save button is clicked. Thus, on save click the requiredfield validator control will fire properly now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-8996288047514523041?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/8996288047514523041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=8996288047514523041' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8996288047514523041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8996288047514523041'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2012/01/requiredfield-validator-not-working.html' title='RequiredField Validator not working with CKEditor in ASP.Net'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-4811477227452012183</id><published>2012-01-30T22:57:00.000-08:00</published><updated>2012-01-30T22:57:51.747-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mvc'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='json'/><title type='text'>"This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet."</title><content type='html'>Very recently I have worked on asp.net MVC application. Everything is working fine for MVC v1. But when move to MVC v2 I have gotten this error-&lt;br /&gt;&lt;br /&gt;&lt;i&gt;"This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet."&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;After making some r &amp; d I have found the solution:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Reason:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In MVC v2 they block Json for GET requests (as you can tell from the error) for security reasons. &lt;br /&gt;&lt;br /&gt;If your JSON payload:&lt;br /&gt;&lt;br /&gt;    1.Contains sensitive non-public data&lt;br /&gt;    2.Returns an Array&lt;br /&gt;    3.Responds to a GET request&lt;br /&gt;    4.Browser making the request has JavaScript enabled (very likely the case) &lt;br /&gt;    5.Browser making the request supports the __defineSetter__ method. &lt;br /&gt;&lt;br /&gt;Then the data is vulnerable to a JSON hijacking. Typically, it's not *your* data but the data of the users of your website.&lt;br /&gt;&lt;br /&gt;For more details about &lt;a href="http://haacked.com/archive/2009/06/25/json-hijacking.aspx"&gt;JSON Hijacking&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution:&lt;/b&gt;&lt;br /&gt;1.A possible solution I found online is to set the request to "&lt;b&gt;POST&lt;/b&gt;" method instead of "&lt;b&gt;GET&lt;/b&gt;" method.&lt;br /&gt;&lt;br /&gt;2.If you want to override the behavior, check out the overload for &lt;b&gt;Json that accepts a JsonRequestBehavior parameter&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;public ActionResult Index()&lt;br /&gt;{&lt;br /&gt;   //Return Json result using LINQ to SQL&lt;br /&gt;&lt;br /&gt;        //###################################################&lt;br /&gt;        //MVC 1.0 specific implementation - A JSON Result&lt;br /&gt;        //is returned.&lt;br /&gt;        //###################################################&lt;br /&gt;        //return new JsonResult&lt;br /&gt;        //{&lt;br /&gt;        //  Data = (from p in Product.GetProductDataList()&lt;br /&gt;        //          where p.ColorId == colorid&lt;br /&gt;        //          select p).ToArray&lt;Product&gt;()&lt;br /&gt;        //};&lt;br /&gt;&lt;br /&gt;        //###################################################&lt;br /&gt;        //MVC RC2 specific implementation - A JSON Result&lt;br /&gt;        //is returned, and the AllowGet property is set for&lt;br /&gt;        //the JsonRequestBehavior.&lt;br /&gt;        //###################################################&lt;br /&gt;        var data = (from p in Product.GetProductDataList()&lt;br /&gt;                    where p.ColorId == colorid&lt;br /&gt;                    select p).ToArray&lt;Product&gt;();&lt;br /&gt;&lt;br /&gt;        return Json(data, &lt;b&gt;JsonRequestBehavior.AllowGet&lt;/b&gt;);&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-4811477227452012183?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/4811477227452012183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=4811477227452012183' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4811477227452012183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4811477227452012183'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2012/01/this-request-has-been-blocked-because.html' title='&quot;This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet.&quot;'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-2791328340101055295</id><published>2012-01-25T21:47:00.000-08:00</published><updated>2012-01-25T21:47:10.165-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Stopwatch class to determine the execution time for an application</title><content type='html'>A Stopwatch instance can measure elapsed time for one interval, or the total of elapsed time across multiple intervals. In a typical Stopwatch scenario, you call the Start method, then eventually call the Stop method, and then you check elapsed time using the Elapsed property.&lt;br /&gt;&lt;br /&gt;If you want to measure the time required for your programs written in the C# language. This could be for a micro-benchmark or for routine and continuous performance monitoring.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Example&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;First sample:&lt;/b&gt;&lt;br /&gt;In this sample you must create Stopwatch as an instance. This makes it useful in &lt;b&gt;multithreaded &lt;/b&gt;applications or &lt;b&gt;websites&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Diagnostics;&lt;br /&gt;using System.Threading;&lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;    static void Main(string[] args)&lt;br /&gt;    {&lt;br /&gt;        Stopwatch stopWatch = new &lt;b&gt;Stopwatch&lt;/b&gt;();&lt;br /&gt;        stopWatch.Start();&lt;br /&gt;        Thread.Sleep(10000);//or do some work&lt;br /&gt;        stopWatch.Stop();&lt;br /&gt;        // Get the elapsed time as a TimeSpan value.&lt;br /&gt;        TimeSpan ts = stopWatch.Elapsed;&lt;br /&gt;&lt;br /&gt;        // Format and display the TimeSpan value.&lt;br /&gt;        string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",&lt;br /&gt;            ts.Hours, ts.Minutes, ts.Seconds,&lt;br /&gt;            ts.Milliseconds / 10);&lt;br /&gt;        Console.WriteLine("RunTime " + elapsedTime);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Second sample:&lt;/b&gt;&lt;br /&gt;In this sample we use the StartNew method. This uses a &lt;b&gt;creational design pattern&lt;/b&gt; to return a new instance from a static type method. It eliminates typing and simplifies your code.&lt;br /&gt;&lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;    static void Main(string[] args)&lt;br /&gt;    {&lt;br /&gt; // Create new stopwatch&lt;br /&gt; var stopwatch = System.Diagnostics.Stopwatch.&lt;b&gt;StartNew&lt;/b&gt;();&lt;br /&gt;&lt;br /&gt; // Do something&lt;br /&gt; &lt;br /&gt; // Stop timing&lt;br /&gt; stopwatch.Stop();&lt;br /&gt;&lt;br /&gt; // Write the results &lt;br /&gt;       TimeSpan ts = stopWatch.Elapsed;&lt;br /&gt;&lt;br /&gt;        // Format and display the TimeSpan value.&lt;br /&gt;        string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",&lt;br /&gt;            ts.Hours, ts.Minutes, ts.Seconds,&lt;br /&gt;            ts.Milliseconds / 10);&lt;br /&gt;        Console.WriteLine("RunTime " + elapsedTime);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;For more details please visits &lt;a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-2791328340101055295?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/2791328340101055295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=2791328340101055295' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2791328340101055295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2791328340101055295'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2012/01/stopwatch-class-to-determine-execution.html' title='Stopwatch class to determine the execution time for an application'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-1290193220985644183</id><published>2012-01-25T20:10:00.000-08:00</published><updated>2012-01-25T20:10:35.906-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='case'/><category scheme='http://www.blogger.com/atom/ns#' term='MS SQL'/><title type='text'>SQL Server case/when type conversion problem</title><content type='html'>In my last project I wrote a query where I have to sort data based on the user input but each column in table has different data type. So to meet with this type of requirement I have used case..when block of the sql server. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Problem: Sample query&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;DECLARE @sortby Varchar(10)&lt;br /&gt;Set @sortby = 'A1'&lt;br /&gt;&lt;br /&gt;Select String1,String2,DateCol&lt;br /&gt;from (&lt;br /&gt;select 'A1','B1', GetDateTime() &lt;br /&gt;union&lt;br /&gt;select 'A2','B2', GetDateTime()&lt;br /&gt;)  As d(String1,String2,DateCol)&lt;br /&gt;Order by&lt;br /&gt;Case&lt;br /&gt;When @sortby = 'A1' then String2&lt;br /&gt;When @sortby = 'B1' then String1&lt;br /&gt;When @sortby = 'Date' then Date1 &lt;br /&gt;End&lt;br /&gt;&lt;br /&gt;there is not syntax error when you check for the syntax error but when execute code you find there is error &lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;ERROR:&lt;/b&gt;Conversion failed when converting datetime from character string.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;the problem here is first two having databype Varchar and last one having datatype DateTime. So when you executing its found that one branch having datetime so its gives error even its not executing that.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;First Solution &lt;/b&gt;&lt;br /&gt;So to avoid this problem you require to convert dateTime to the string&lt;br /&gt;&lt;br /&gt;DECLARE @sortby Varchar(10)&lt;br /&gt;Set @sortby = 'A1'&lt;br /&gt;Select String1,String2,DateCol&lt;br /&gt;from (&lt;br /&gt;select 'A1','B1', GetDateTime() &lt;br /&gt;union&lt;br /&gt;select 'A2','B2', GetDateTime()&lt;br /&gt;)  As d(String1,String2,DateCol)&lt;br /&gt;Order by&lt;br /&gt;Case&lt;br /&gt;When @sortby = 'A1' then String2&lt;br /&gt;When @sortby = 'B1' then String1&lt;br /&gt;When @sortby = 'Date' then Cast(Date1  as varchar(20))&lt;br /&gt;End&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Second Solution&lt;/b&gt;&lt;br /&gt;Divide the Case when in multiple statement&lt;br /&gt;&lt;br /&gt;DECLARE @sortby Varchar(10)&lt;br /&gt;Set @sortby = 'A1'&lt;br /&gt;&lt;br /&gt;Select String1,String2,DateCol&lt;br /&gt;from (&lt;br /&gt;select 'A1','B1', GetDateTime() &lt;br /&gt;union&lt;br /&gt;select 'A2','B2', GetDateTime()&lt;br /&gt;)  As d(String1,String2,DateCol)&lt;br /&gt;Order by&lt;br /&gt;Case When @sortby = 'A1' then String2 End,&lt;br /&gt;Case When @sortby = 'B1' then String1 End,&lt;br /&gt;Case When @sortby = 'Date' then Date1  End&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-1290193220985644183?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/1290193220985644183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=1290193220985644183' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/1290193220985644183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/1290193220985644183'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2012/01/sql-server-casewhen-type-conversion.html' title='SQL Server case/when type conversion problem'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-3462709841652880766</id><published>2012-01-25T19:48:00.000-08:00</published><updated>2012-01-25T19:48:50.168-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Dictionary'/><category scheme='http://www.blogger.com/atom/ns#' term='List'/><category scheme='http://www.blogger.com/atom/ns#' term='linq'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>KeyValue pair/Dictionary with duplicate keys</title><content type='html'>Very recently for my development purpose I need to use Dictionary. And it works very nicely. But problem occurred when requirement changes and face a scenario that duplicate key's are needed to handle in Dictionary which is not possible. So I had written a custom class to handle this problem,please suggests me if there is any better idea.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Examble:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;public class &lt;b&gt;KeyValuePair&lt;/b&gt;&lt;br /&gt;        {&lt;br /&gt;            public string Key { get; set; }&lt;br /&gt;            public int Value { get; set; }&lt;br /&gt;            public string HdValue { get; set; }&lt;br /&gt;&lt;br /&gt;            public KeyValuePair(string key, int value, string hdValue)&lt;br /&gt;            {&lt;br /&gt;                this.Key = key;&lt;br /&gt;                this.Value = value;&lt;br /&gt;                this.HdValue = hdValue;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Insert Data:&lt;/b&gt;&lt;br /&gt;List&amp;lt;KeyValuePair&amp;gt; listKeyValuePair= new List&amp;lt;KeyValuePair&amp;gt;();&lt;br /&gt;listKeyValuePair.Add(new KeyValuePair("TAX",2,"Income Tax"));&lt;br /&gt;listKeyValuePair.Add(new KeyValuePair("TAX",4,"Vatlue added Tax"));&lt;br /&gt;listKeyValuePair.Add(new KeyValuePair("PORT",9,"Vehicle Test"));&lt;br /&gt;&lt;br /&gt;            &lt;br /&gt;&lt;b&gt;Sort Data:&lt;/b&gt;&lt;br /&gt;List&amp;lt;KeyValuePair&amp;gt; listSorted = listKeyValuePair.OrderByDescending(x =&amp;gt; x.key).ToList();&lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Filter Data:&lt;/b&gt;&lt;br /&gt;var filteredData = listKeyValuePair.where(keyValue=&amp;gt; string.Compare(keyVaue.Key,"TAX")==0).ToList();&lt;br /&gt;if(filteredData.Count &gt; 0)&lt;br /&gt;{&lt;br /&gt;//Do something&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-3462709841652880766?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/3462709841652880766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=3462709841652880766' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/3462709841652880766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/3462709841652880766'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2012/01/keyvalue-pairdictionary-with-duplicate.html' title='KeyValue pair/Dictionary with duplicate keys'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-5879105633241417089</id><published>2012-01-18T23:01:00.000-08:00</published><updated>2012-01-18T23:03:28.458-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='regex'/><title type='text'>Html stripper (Remove Html tag)</title><content type='html'>This is a common problem when we want to show any data in gridview(asp.net) or table or repeater it breaks the page or design of the page due to html tag inside the presented date. &lt;br /&gt;&lt;br /&gt;It will also cause the problem if we want use &lt;a href="http://ckeditor.com/"&gt;CKEDITOR &lt;/a&gt;to insert data. Because when we insert anything using rich editor it is wrap the text with &amp;lt;p&amp;gt;&amp;lt;/p&amp;gt;. If we want to show partial of the string it will cause page break because last &amp;lt;/p&amp;gt; is missing.&lt;br /&gt;&lt;br /&gt;So to avoid this problem we need to strip the Html tag from the string. We can do it in various ways such as regular expression and character array.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution 1(Good):&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;using System.Text.RegularExpressions;&lt;br /&gt;//Remove HTML from string with Regex.&lt;br /&gt;public static string &lt;b&gt;StripTagsRegex&lt;/b&gt;(string source)&lt;br /&gt;{&lt;br /&gt;return Regex.Replace(source, "&amp;lt;.*?&amp;gt;", string.Empty);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution 2(Better):&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;using System.Text.RegularExpressions;&lt;br /&gt;// Compiled regular expression for performance.&lt;br /&gt;static Regex _htmlRegex = new Regex("&amp;lt;.*?&amp;gt;", RegexOptions.Compiled);&lt;br /&gt;&lt;br /&gt;// Remove HTML from string with compiled Regex.&lt;br /&gt;public static string &lt;b&gt;StripTagsRegexCompiled&lt;/b&gt;(string source)&lt;br /&gt;{&lt;br /&gt;return _htmlRegex.Replace(source, string.Empty);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution 3:(Best)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;//Remove HTML tags from string using char array.&lt;br /&gt;public static string &lt;b&gt;StripTagsCharArray&lt;/b&gt;(string source)&lt;br /&gt;{&lt;br /&gt;char[] array = new char[source.Length];&lt;br /&gt;int arrayIndex = 0;&lt;br /&gt;bool inside = false;&lt;br /&gt;&lt;br /&gt;for (int i = 0; i &lt; source.Length; i++) {     char let = source[i];     if (let == '&lt;')     {  inside = true;  continue;     }     if (let == '&gt;')&lt;br /&gt;{&lt;br /&gt;inside = false;&lt;br /&gt;continue;&lt;br /&gt;}&lt;br /&gt;if (!inside)&lt;br /&gt;{&lt;br /&gt;array[arrayIndex] = let;&lt;br /&gt;arrayIndex++;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;return new string(array, 0, arrayIndex);&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-5879105633241417089?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/5879105633241417089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=5879105633241417089' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/5879105633241417089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/5879105633241417089'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2012/01/html-stripper.html' title='Html stripper (Remove Html tag)'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-224414058860397908</id><published>2012-01-18T22:07:00.000-08:00</published><updated>2012-01-25T23:09:00.287-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='regex'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Fixed problem for continuous string(long string without space) using regular expression</title><content type='html'>Last day I have faced a problem for a long string like(adfdsfsdfdsfdsfsdafdsfsdfsdfsdfsdfsdfsdfsdfsdffdsfsdfsdfsdafsdfsdfsdfsdfsdfsdafsdf) which make my application's UI design break. So to fixed this issue I have used regular expression which insert a space after n characters.&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/-3w_aUF_xgLI/TyD7LJ6FvPI/AAAAAAAAAJM/fmFD1L8wuek/s1600/long%2Bword.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="84" width="400" src="http://4.bp.blogspot.com/-3w_aUF_xgLI/TyD7LJ6FvPI/AAAAAAAAAJM/fmFD1L8wuek/s400/long%2Bword.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To insert a space after every n characters:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;var newString = Regex.Replace(oldString, new string('.', n), m =&gt; m.Value + " ");&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Sample solution:&lt;/b&gt;&lt;br /&gt;string longWord = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaassssssssssssssssssssssssdddddddddddddddddddddddddddddaaaaaaaaaafffffffffffffffffffffffffadfdsfsdfdsfdsfsdafdsfsdfsdfsdfsdfsdfsdfsdfsdffdsfsdfsdfsdafsdfsdfsdfsdfsdfsdafsdffdsfdsfdsfsdf";&lt;br /&gt;&lt;br /&gt;Regex.Replace(&lt;b&gt;longWord&lt;/b&gt;, new string('.', &lt;b&gt;16&lt;/b&gt;), m =&gt; m.Value + " ");&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/-PjpMXQIlKOY/TyD7UjLnyAI/AAAAAAAAAJY/K9MWILohIVQ/s1600/long_word%2Bfixed.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="180" width="400" src="http://4.bp.blogspot.com/-PjpMXQIlKOY/TyD7UjLnyAI/AAAAAAAAAJY/K9MWILohIVQ/s400/long_word%2Bfixed.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;In above image it shows that regex place a space after every 16 character for that long string.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-224414058860397908?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/224414058860397908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=224414058860397908' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/224414058860397908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/224414058860397908'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2012/01/fixed-problem-for-continuous-stringlong.html' title='Fixed problem for continuous string(long string without space) using regular expression'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-3w_aUF_xgLI/TyD7LJ6FvPI/AAAAAAAAAJM/fmFD1L8wuek/s72-c/long%2Bword.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-3703075908018687819</id><published>2012-01-18T21:56:00.000-08:00</published><updated>2012-01-18T21:59:17.830-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>Short circuit evaluations on &amp;&amp; and || in JavaScript</title><content type='html'>Like many other languages Javascript’s &amp;&amp; and || operators short-circuit evaluations,that is, for&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;&amp;&amp; if the first operand evaluates to false, the second operand is never evaluated because the result would always be false&lt;/b&gt;. &lt;/blockquote&gt;Similarly, for&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;|| if the result of the first operand is true, the second operand is never operated.&lt;/b&gt;&lt;/blockquote&gt;&lt;br /&gt;This means that in the following expression, x will never be compared to y.&lt;br /&gt;&lt;b&gt;true || x == y&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This short-circuiting is great for performance, as it allows significant bits of calculations to be skipped. In addition to that, it lets you to write e.g. the following in one expression without getting an ‘object has no properties’ error:&lt;br /&gt;&lt;b&gt;oNode &amp;&amp; oNode.firstChild&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Be mindful though when using &amp;&amp; with code that has side effects, e.g. say you have two objects with a hasError() method which return true or false depending on whether an error occurred and additionally output an error message:&lt;br /&gt;&lt;b&gt;x.hasError() &amp;&amp; y.hasError()&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Here, if x has an error, y will never be evaluated and thus the error message will never be shown.&lt;br /&gt;&lt;br /&gt;For more details pls visits &lt;a href="http://www.quirksmode.org/js/boolean.html"&gt;this &lt;/a&gt;and &lt;a href="http://www.grauw.nl/blog/entry/510"&gt;that&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-3703075908018687819?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/3703075908018687819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=3703075908018687819' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/3703075908018687819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/3703075908018687819'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2012/01/short-circuit-evaluations-on-and-in.html' title='Short circuit evaluations on &amp;&amp; and || in JavaScript'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-8735747899031359081</id><published>2012-01-18T21:43:00.000-08:00</published><updated>2012-01-18T21:45:11.436-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>JavaScript parseInt() bug</title><content type='html'>Very recently I have faced a strange problem with JavaScript parseInt() function. It returns incorrect result when try to parse value like "08","09"...... But it works for "01" to "07".&lt;br /&gt;So I have tried to find solution in community. Then find that this was a JavaScript bug.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Problem:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;There is a "bug" with the parseInt JavaScript function. The bug is not something that will affect you very often, but it is something you should be aware of. We've seen the bug in every browser except Opera.&lt;br /&gt;&lt;br /&gt;I've created a button to demonstrate the bug. The bug is that parseInt can return an incorrect value. For example, parseInt("08") results in 0 instead of 8. And parseInt("09") results in 0 instead of 9. The reason for this is because the zero in front is trying to tell the browser that this is an octal (base 8) number, and "08" and "09" are not valid octal numbers. The button below builds statements from parseInt("01") through parseInt("09") and shows what the resulting value is. But it also does parseFloat("01") through parseFloat("09"). This shows that the bug does not exist with parseFloat.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;parseInt(parseFloat(09))&lt;br /&gt;Or,&lt;br /&gt;parseInt(09, 10)&lt;br /&gt;The "10" in the second example tells the browser that base-10 values should be used. &lt;br /&gt;&lt;br /&gt;Hope that it will helpful for other developers.Thanks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-8735747899031359081?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/8735747899031359081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=8735747899031359081' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8735747899031359081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8735747899031359081'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2012/01/javascript-parseint-bug.html' title='JavaScript parseInt() bug'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-2862843979136396196</id><published>2011-08-04T01:24:00.000-07:00</published><updated>2011-08-04T01:24:13.670-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><title type='text'>Creating a SOLID Visual Studio Solution - Steven Smith</title><content type='html'>I found this article really a very important for developer. So I would like to share this with you. Hope that it may help you for better development.&lt;br /&gt;&lt;br /&gt;The SOLID acronym describes five object-oriented design principles that, when followed, produce code that is cleaner and more maintainable. The last principle, the Dependency Inversion Principle, suggests that details depend upon abstractions. Unfortunately, typical project relationships in .NET applications can make this principle difficult to follow. &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-S0zBU1Z-Q0A/TjpXDIkSnlI/AAAAAAAAAIU/plU1fzyi1XM/s1600/visual_soln.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="226" width="320" src="http://3.bp.blogspot.com/-S0zBU1Z-Q0A/TjpXDIkSnlI/AAAAAAAAAIU/plU1fzyi1XM/s320/visual_soln.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;In this article, describe how one can structure a set of projects in a Visual Studio solution such that DIP can be followed, allowing for the creation of a SOLID solution......&lt;br /&gt;&lt;br /&gt;For more details please visits: &lt;a href="http://aspalliance.com/2064_Creating_a_SOLID_Visual_Studio_Solution.all"&gt;Creating a SOLID Visual Studio Solution&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-2862843979136396196?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/2862843979136396196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=2862843979136396196' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2862843979136396196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2862843979136396196'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/08/creating-solid-visual-studio-solution.html' title='Creating a SOLID Visual Studio Solution - Steven Smith'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-S0zBU1Z-Q0A/TjpXDIkSnlI/AAAAAAAAAIU/plU1fzyi1XM/s72-c/visual_soln.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-3815898855167075488</id><published>2011-07-07T01:43:00.000-07:00</published><updated>2011-07-07T01:43:54.693-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='permission'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>"System.Security.SecurityException: Security error" error message when the virtual directory points to a remote share in ASP.NET</title><content type='html'>Very recently I have faced a problem when hosting a web application in hosting server. This application is running perfectly on local PC but security exceptions occurs when hosting  to a server.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Problem &lt;/b&gt;&lt;br /&gt;I have got the following error message:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.&lt;br /&gt;&lt;br /&gt;Exception Details: &lt;b&gt;System.Security.SecurityException&lt;/b&gt;: Security error.&lt;/blockquote&gt;&lt;br /&gt;After consult with senior guys they refer the solution which is sharing with you.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Main Cause&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The System.Web namespace does not have the &lt;b&gt;AllowPartiallyTrustedCallersAttribute &lt;/b&gt;applied to it.&lt;br /&gt;&lt;br /&gt;Any code that is not in the My_Computer_Zone code group that does not have this attribute requires the &lt;b&gt;FullTrust &lt;/b&gt;user right. Therefore, the remote share that holds the Web applications content requires &lt;b&gt;FullTrust&lt;/b&gt;. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;To resolve this behavior, grant the &lt;b&gt;FullTrust &lt;/b&gt;right to the remote share:&lt;br /&gt;&lt;br /&gt;    1.On the Web server, open &lt;b&gt;Administrative Tools&lt;/b&gt;, and then double-click Microsoft .NET Framework Configuration.&lt;br /&gt;    2.Expand Runtime Security Policy, expand Machine, and then expand Code Groups.&lt;br /&gt;    3.Right-click All_Code, and then click New.&lt;br /&gt;    4.Select Create a new code group. Give your code group a relevant name, such as the name of the applications share. Click Next.&lt;br /&gt;    5.In the Choose the condition type for this code group list, select URL.&lt;br /&gt;    6.In the URL box, type the path of the share in the following format:&lt;br /&gt;    &lt;b&gt;file:////\\computername\sharename\*&lt;/b&gt;&lt;br /&gt;    7.Note Replace &lt;b&gt;computername &lt;/b&gt;with the name of the computer that is hosting the remote share. Replace sharename with the name of the share.&lt;br /&gt;    8.Click Next. On the next page, select Use an existing &lt;b&gt;permission &lt;/b&gt;set, and then select &lt;b&gt;FullTrust&lt;/b&gt;.&lt;br /&gt;    9.Click Next, and then click Finish.&lt;br /&gt;    &lt;br /&gt;Restart Microsoft Internet Information Services (IIS) to &lt;b&gt;restart &lt;/b&gt;the ASP.NET worker process. &lt;br /&gt;&lt;br /&gt;If Microsoft .NET Framework Configuration is not displayed under Administrative Tools, you can install the .NET Framework SDK to add Microsoft .NET Framework Configuration. &lt;br /&gt;&lt;br /&gt;Alternatively, you can run the following command to make the change:&lt;br /&gt;&lt;i&gt;&lt;br /&gt;Drive:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\caspol.exe -m -ag 1 -url "file:////\\computername\sharename\*" FullTrust -exclusive on&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-3815898855167075488?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/3815898855167075488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=3815898855167075488' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/3815898855167075488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/3815898855167075488'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/07/systemsecuritysecurityexception.html' title='&quot;System.Security.SecurityException: Security error&quot; error message when the virtual directory points to a remote share in ASP.NET'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-4403635848387147603</id><published>2011-04-18T01:50:00.000-07:00</published><updated>2011-04-18T01:50:04.872-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='DoS'/><title type='text'>Web Security Tip: How to prevent Denial of Service (DoS)  attack?</title><content type='html'>&lt;b&gt;What is a denial-of-service (DoS) attack?&lt;/b&gt;&lt;br /&gt;In a denial-of-service (DoS) attack, an attacker attempts to prevent legitimate users from accessing information or services. By targeting your computer and its network connection, or the computers and network of the sites you are trying to use, an attacker may be able to prevent you from accessing email, websites, online accounts (banking, etc.), or other services that rely on the affected computer. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;How it works?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Let's see how it make the problem,"n" is a typical connection, the user sends a message asking the server to authenticate it. The server returns the authentication approval to the user. The user acknowledges this approval and then is allowed onto the server.&lt;br /&gt;&lt;br /&gt;In a denial of service attack, the user sends several authentication requests to the server, filling it up. All requests have false return addresses, so the server can,t find the user when it tries to send the authentication approval. The server waits, sometimes more than a minute, before closing the connection. When it does close the connection, the attacker sends a new batch of forged requests, and the process begins again--tying up the service indefinitely.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;How to Prevent?&lt;/b&gt;&lt;br /&gt;Unfortunately, there are no effective ways to prevent being the victim of a DoS or DDoS attack, but there are steps you can take to reduce the likelihood that an attacker will use your computer to attack other computers: &lt;br /&gt;&lt;br /&gt;1.Install a firewall, and configure it to restrict traffic coming into and leaving your computer.&lt;br /&gt;&lt;br /&gt;2.One of the more common methods of blocking a "denial of service" attack is to set up a filter, or "sniffer," on a network before a stream of information reaches a site,s Web servers. This filter can set in firewall or pro grammatically.&lt;br /&gt;&lt;br /&gt;The filter can look for attacks by noticing patterns or identifiers contained in the information. If a pattern comes in frequently, the filter can be instructed to block messages containing that pattern, protecting the Web servers from having their lines tied up.&lt;br /&gt;&lt;br /&gt;3.Follow good security practices for distributing your email address.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-4403635848387147603?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/4403635848387147603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=4403635848387147603' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4403635848387147603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4403635848387147603'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/04/web-security-tip-how-to-prevent-denial.html' title='Web Security Tip: How to prevent Denial of Service (DoS)  attack?'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-4897596059740143531</id><published>2011-04-17T01:49:00.000-07:00</published><updated>2011-04-17T01:49:23.107-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><title type='text'>How to save image from direct local URL to File</title><content type='html'>In my recent project its an requirement to save images from URL to hard disk or any media. After binged I have got several solutions. Now sharing you the right solution which is work for me.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code(C#):&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;    protected void &lt;b&gt;Page_Load&lt;/b&gt;(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        string url = "http://img510.imageshack.us/img510/5523/aspnet4jh.jpg";&lt;br /&gt;        string DestinationPath ="C:/temp";&lt;br /&gt;        string filename = url.Substring(url.LastIndexOf('/')+1);&lt;br /&gt;        byte[] bytes=&lt;b&gt;GetBytesFromUrl(url)&lt;/b&gt;;&lt;br /&gt;        &lt;b&gt;WriteBytesToFile&lt;/b&gt;(DestinationPath +"/"+filename, bytes);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    static public byte[] &lt;b&gt;GetBytesFromUrl&lt;/b&gt;(string url)&lt;br /&gt;    {&lt;br /&gt;        byte[] b;&lt;br /&gt;        HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(url);&lt;br /&gt;        WebResponse myResp = myReq.GetResponse();&lt;br /&gt;&lt;br /&gt;        Stream stream = myResp.GetResponseStream();&lt;br /&gt;        //int i;&lt;br /&gt;        using (BinaryReader br = new BinaryReader(stream))&lt;br /&gt;        {&lt;br /&gt;            //i = (int)(stream.Length);&lt;br /&gt;            b = br.ReadBytes(500000);&lt;br /&gt;            br.Close();&lt;br /&gt;        }&lt;br /&gt;        myResp.Close();&lt;br /&gt;        return b;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    static public void &lt;b&gt;WriteBytesToFile&lt;/b&gt;(string fileName, byte[] content)&lt;br /&gt;    {&lt;br /&gt;        FileStream fs = new FileStream(fileName, FileMode.Create);&lt;br /&gt;        BinaryWriter w = new BinaryWriter(fs);&lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;            w.Write(content);&lt;br /&gt;        }&lt;br /&gt;        finally&lt;br /&gt;        {&lt;br /&gt;            fs.Close();&lt;br /&gt;            w.Close();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;Hope that it may help other guys. Thanks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-4897596059740143531?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/4897596059740143531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=4897596059740143531' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4897596059740143531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4897596059740143531'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/04/how-to-save-image-from-direct-local-url.html' title='How to save image from direct local URL to File'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-5119386595837404163</id><published>2011-04-02T00:25:00.000-07:00</published><updated>2011-04-02T00:25:24.617-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVP'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><title type='text'>Achieve MVP award from Microsoft</title><content type='html'>Yesterday I got an email from Microsoft Community ..&lt;br /&gt;&lt;br /&gt;"&lt;br /&gt;&lt;i&gt;Dear Ahsan&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Congratulations on getting awarded as an MVP for contributing to the technical communities!&lt;/b&gt;&lt;br /&gt;                                                                 &lt;br /&gt;I am Abhishek Kant, your MVP Lead and would facilitate your interaction with Microsoft including administration of award benefits and providing latest information.............&lt;/i&gt;&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/-KKYsztgNd9A/TZbN3T4LSCI/AAAAAAAAAFo/1mx_BbhFSFk/s1600/MVP.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="83" width="200" src="http://1.bp.blogspot.com/-KKYsztgNd9A/TZbN3T4LSCI/AAAAAAAAAFo/1mx_BbhFSFk/s320/MVP.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Thanks to Microsoft Community to give this reward to the community contributor. It is really inspired the community member to keep up their activities.&lt;br /&gt;&lt;br /&gt;I feel lucky to join in MVP community for the first time, hope that this is a great opportunity for me to rich my experience by sharing knowledge with other MVP.&lt;br /&gt;&lt;br /&gt;Thanks to all for their co operation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-5119386595837404163?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/5119386595837404163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=5119386595837404163' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/5119386595837404163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/5119386595837404163'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/04/achieve-mvp-award-from-microsoft.html' title='Achieve MVP award from Microsoft'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-KKYsztgNd9A/TZbN3T4LSCI/AAAAAAAAAFo/1mx_BbhFSFk/s72-c/MVP.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-972355947350963718</id><published>2011-03-28T23:21:00.000-07:00</published><updated>2011-03-28T23:21:25.123-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='64 bit'/><category scheme='http://www.blogger.com/atom/ns#' term='32 bit'/><title type='text'>How to run 32-bit ASP.NET Applications on 64-bit Windows server</title><content type='html'>In my workstation I have used 32bit PC. There is no problem every this is working nice. But an unexpected situation arise recently when I try to deploy my application in to a 64 bit windows server. I never face this problem before. &lt;br /&gt;&lt;br /&gt;Don't worry &lt;a href="http://technet.microsoft.com/en-us/library/cc784530%28WS.10%29.aspx"&gt;Technet library(Microsoft)&lt;/a&gt; is there. Just one line need to execute to solve my problem. &lt;br /&gt;&lt;br /&gt;Actually I need to configure IIS to run 32-bit ASP.NET Applications on 64-bit Windows server.For this, &lt;b&gt;we must configure IIS to create 32-bit worker processes&lt;/b&gt;. For more information about running 32-bit applications on 64-bit Windows.&lt;br /&gt;&lt;br /&gt;IIS cannot run 32-bit and 64-bit applications concurrently on the same server.To enable IIS 6.0 to run 32-bit ASP.NET applications on 64-bit Windows.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;Follow this steps:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;    1.Open a command prompt and navigate to the &lt;b&gt;%systemdrive%\Inetpub\AdminScripts&lt;/b&gt; directory.&lt;br /&gt;&lt;br /&gt;    2.Type the following command:&lt;br /&gt;  &lt;b&gt;cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 true&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;    3.Press ENTER.&lt;br /&gt;&lt;br /&gt;Now your 64 bit server is ready for run 32 bit application.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Some Important information&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Before you configure IIS to run 32-bit applications on 64-bit Windows, note the following:&lt;br /&gt;&lt;br /&gt;    1.IIS only supports 32-bit worker processes in &lt;b&gt;Worker Process Isolation mode&lt;/b&gt; on 64-bit Windows.&lt;br /&gt;&lt;br /&gt;    2.On 64-bit Windows, the World Wide Web Publishing service can run 32-bit and 64-bit worker processes. Other IIS services like the &lt;b&gt;IIS Admin service&lt;/b&gt;, the &lt;b&gt;SMTP service&lt;/b&gt;, the &lt;b&gt;NNTP service&lt;/b&gt;, and the &lt;b&gt;FTP service&lt;/b&gt; run &lt;b&gt;64-bit processes&lt;/b&gt; only.&lt;br /&gt;&lt;br /&gt;    3.On 64-bit Windows, the World Wide Web Publishing service does not support running 32-bit and 64-bit worker processes concurrently on the same server. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;After configure problem may occurs&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;After you configure IIS 6.0 to run 32-bit Web applications, IIS stores 32-bit DLLs and ISAPIs in the %windir%\syswow64\inetsrv directory. All other IIS files, including the MetaBase.xml file, are stored in the %windir%\system32\inetsrv directory. &lt;br /&gt;&lt;br /&gt;File access to the System32 and sub directories are transparently redirected based on the bitness of the process making that file access (&lt;b&gt;64-bit processes have full access, while 32-bit processes have access to System32 redirected to Syswow64&lt;/b&gt;). &lt;br /&gt;&lt;br /&gt;If your legacy applications have specific 32-bit file access needs and you notice application failures, see if the &lt;b&gt;application needs to reference the new %windir%\syswow64\inetsrv to resolve the problem.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;For more information visits &lt;a href="http://technet.microsoft.com/en-us/library/cc784530%28WS.10%29.aspx"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-972355947350963718?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/972355947350963718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=972355947350963718' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/972355947350963718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/972355947350963718'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/03/how-to-run-32-bit-aspnet-applications.html' title='How to run 32-bit ASP.NET Applications on 64-bit Windows server'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-6776485912325878424</id><published>2011-03-28T22:13:00.000-07:00</published><updated>2011-03-28T22:38:27.707-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='httpHandler'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='httpModule'/><title type='text'>What is  HTTP Handler and HTTP Module in asp.net? Co-Relation and Differences</title><content type='html'>I have little bit confusion about HTTP Handler and HTTP Module. Then I move to community and get a huge response. After studying for a while now I get a clear idea. Now sharing with you hope that it will also help other guys.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;What is HTTP handler?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;An ASP.NET HTTP handler is the process (frequently referred to as the "endpoint") that runs in response to a request made to an ASP.NET Web application. The most common handler is an ASP.NET page handler that processes .aspx files. When users request an .aspx file, the request is processed by the page through the page handler. You can create your own HTTP handlers that render custom output to the browser.(&lt;a href="http://msdn.microsoft.com/en-us/library/bb398986.aspx"&gt;msdn&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;HTTP handlers process the request and are generally responsible for initiating necessary business logic tied to the request.&lt;/b&gt; Custom handlers must implement the System.Web.IHttpHandler interface. Additionally, a handler factory can be created which will analyze a request to determine what HTTP handler is appropriate. Custom handler factories implement the System.Web.IHttpHandlerFactory interface.&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/-EM6XRUSAHQo/TZFoAbaVrcI/AAAAAAAAAFU/x1MuurkbjFw/s1600/msdn_http.gif" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="234" width="320" src="http://2.bp.blogspot.com/-EM6XRUSAHQo/TZFoAbaVrcI/AAAAAAAAAFU/x1MuurkbjFw/s320/msdn_http.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="clear: both; text-align: center;"&gt;ASP.net execution process(Image source:MSDN)&lt;/div&gt;&lt;br /&gt;&lt;b&gt;What is HTTP Module?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;An HTTP module is an assembly that is called on every request that is made to your application. HTTP modules are called as part of the ASP.NET request pipeline and have access to life-cycle events throughout the request. HTTP modules let you examine incoming and outgoing requests and take action based on the request.(&lt;a href="http://msdn.microsoft.com/en-us/library/bb398986.aspx"&gt;msdn&lt;/a&gt;)&lt;br /&gt;&lt;b&gt;&lt;br /&gt;HTTP modules are executed before and after the handler and provide a method for interacting with the request.&lt;/b&gt; Custom modules must implement the System.Web.IHttpModule interface. Modules are typically synchronized with events of the System.Web.IHttpModule class (implemented within the Global.asax.cs or .vb file). &lt;br /&gt;&lt;br /&gt;The following consists of a list of events that should be considered when implementing your module:&lt;br /&gt;&lt;br /&gt;1.BeginRequest&lt;br /&gt;2.AuthenticateRequest&lt;br /&gt;3.AuthorizeRequest&lt;br /&gt;4.ResolveRequestCache&lt;br /&gt;5.AcquireRequestState&lt;br /&gt;6.PreRequestHandlerExecute&lt;br /&gt;7.PostRequestHandlerExecute&lt;br /&gt;8.ReleaseRequestState&lt;br /&gt;9.UpdateRequestCache&lt;br /&gt;10.EndRequest&lt;br /&gt;11.PreSendRequestHeaders&lt;br /&gt;12.PreSendRequestContent&lt;br /&gt;13.Error&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Co-Relation&lt;/b&gt;&lt;br /&gt;The co-relation between HTTP handler and HTTP module is both are an integral part of the ASP.NET application. &lt;br /&gt;Every request flows through a number of HTTP modules, which cover various areas of the application (i.e. authentication and session information). After passing through each module, the request is assigned to a single HTTP handler, which determines how the system will respond to the request. Upon completion of the request handler, the response flows back through the HTTP modules to the user.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;Differences&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;HTTP Module&lt;/b&gt;&lt;br /&gt;1.It represents more something like an modulare peace of code that's similar to another Global.asax.&lt;br /&gt;2.It represent code that is in play for all page requests.&lt;br /&gt;3.These are objects which also participate the pipeline.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;HTTP Handler&lt;/b&gt;&lt;br /&gt;1.Its a handler for one request.&lt;br /&gt;2.It is more like a single page.&lt;br /&gt;3.These are the end point objects in ASP.NET pipeline.&lt;br /&gt;4.These are essentially processes the request and produces the response&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-6776485912325878424?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/6776485912325878424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=6776485912325878424' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6776485912325878424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6776485912325878424'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/03/what-is-http-handler-and-http-module-in.html' title='What is  HTTP Handler and HTTP Module in asp.net? Co-Relation and Differences'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-EM6XRUSAHQo/TZFoAbaVrcI/AAAAAAAAAFU/x1MuurkbjFw/s72-c/msdn_http.gif' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-8408906551052050929</id><published>2011-03-21T22:50:00.000-07:00</published><updated>2011-03-21T22:50:55.792-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Dom'/><category scheme='http://www.blogger.com/atom/ns#' term='inspector'/><title type='text'>Javascript library for Dom inspector</title><content type='html'>Very recently, I have need to develop an application using JavaScript by which when any user click on an image of this site it will send image URL to a specific location. There is another business behind it.&lt;br /&gt;&lt;br /&gt;After binged I get nice script which is solved my problem. &lt;br /&gt;&lt;br /&gt;Now share this with you , hope that it will help other developers.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://userscripts.org/scripts/review/3006"&gt;http://userscripts.org/scripts/review/3006&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-8408906551052050929?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/8408906551052050929/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=8408906551052050929' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8408906551052050929'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8408906551052050929'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/03/javascript-library-for-dom-inspector.html' title='Javascript library for Dom inspector'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-7607290726714226195</id><published>2011-03-21T22:01:00.000-07:00</published><updated>2011-03-21T22:01:51.405-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='toFixed'/><category scheme='http://www.blogger.com/atom/ns#' term='toPrecision'/><title type='text'>JavaScript Numeric Format - Decimal Precision</title><content type='html'>Today's discussion about JavaScript number format based on decimal precision. Round a number to a certain number of places you can use JavaScript built-in methods toFixed and toPrecision. This two methods toFixed and toPrecision are part of the Number object. Any browser that supports ECMAScript version 3 should support toFixed and toPrecision.&lt;br /&gt;&lt;br /&gt;How to use?&lt;br /&gt;Its very simple and easy to use. Let's see some example which is help us to understand better.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Example : toFixed()&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Use toFixed to set precision after the decimal point. It doesn't matter how large the number is before the decimal point. For normal decimal formatting, this is your best option. &lt;br /&gt;&lt;br /&gt;// Example: toFixed(2) when the number has no decimal places&lt;br /&gt;// It will add trailing zeros&lt;br /&gt;var num = 10;&lt;br /&gt;var result = num.toFixed(2); // result will equal 10.00&lt;br /&gt;&lt;br /&gt;// Example: toFixed(3) when the number has decimal places&lt;br /&gt;// It will round to the thousandths place&lt;br /&gt;num = 930.9805;&lt;br /&gt;result = num.toFixed(3); // result will equal 930.981&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Example: toPrecision ()&lt;/b&gt;&lt;br /&gt;Use toPrecision when you're setting the overall precision. Here, it matters how large the number is before and after the decimal point. This is more useful for mathematical purposes than for formatting. &lt;br /&gt;&lt;br /&gt;// Example: toPrecision(4) when the number has 7 digits (3 before, 4 after)&lt;br /&gt;// It will round to the tenths place&lt;br /&gt;num = 500.2349;&lt;br /&gt;result = num.toPrecision(4); // result will equal 500.2&lt;br /&gt;&lt;br /&gt;// Example: toPrecision(4) when the number has 8 digits (4 before, 4 after)&lt;br /&gt;// It will round to the ones place&lt;br /&gt;num = 5000.2349;&lt;br /&gt;result = num.toPrecision(4); // result will equal 5000&lt;br /&gt;&lt;br /&gt;// Example: toPrecision(2) when the number has 5 digits (3 before, 2 after)&lt;br /&gt;// It will round to the tens place expressed as an exponential&lt;br /&gt;num = 555.55;&lt;br /&gt;result = num.toPrecision(2); // result will equal 5.6e+2&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Floating-point errors&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;toFixed and toPrecision are subject to floating-point errors. &lt;br /&gt;&lt;br /&gt;Here is a test where the starting number is 162.295. The following should show the JavaScript results: &lt;br /&gt;&lt;br /&gt;162.30 // toFixed(2)&lt;br /&gt;162.30 // toPrecision(5) 162.29 // toFixed(2)&lt;br /&gt;162.29 // toPrecision(5) &lt;br /&gt;&lt;br /&gt;Do they show up correctly as 162.30 in your browser? Most JavaScript implementations will display it as 162.29 &lt;br /&gt;&lt;br /&gt;Here is basically what happens when rounding 162.295 to two decimal places&lt;br /&gt;&lt;br /&gt;num = 162.295&lt;br /&gt;num *= 100 // 16229.499999999998&lt;br /&gt;num = Math.round(num) // 16229&lt;br /&gt;num /= 100 // 162.29 &lt;br /&gt;&lt;br /&gt;As you can tell, it's in the second step that the number changes from its actual value.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-7607290726714226195?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/7607290726714226195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=7607290726714226195' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7607290726714226195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7607290726714226195'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/03/javascript-numeric-format-decimal.html' title='JavaScript Numeric Format - Decimal Precision'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-7753890189418600914</id><published>2011-03-07T02:45:00.000-08:00</published><updated>2011-03-07T02:46:40.378-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sharpcorne'/><category scheme='http://www.blogger.com/atom/ns#' term='monodroid'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android-based applications using C# : MonoDroid</title><content type='html'>&lt;b&gt;MonoDroid &lt;/b&gt;is a development stack for using C# and core .NET APIs to develop &lt;b&gt;Android&lt;/b&gt;-based applications.&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/-1RS_hHYHn-8/TXS24s62y1I/AAAAAAAAAFM/LDYUaNwmX7M/s1600/monoDroid.jpeg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="106" width="148" src="http://3.bp.blogspot.com/-1RS_hHYHn-8/TXS24s62y1I/AAAAAAAAAFM/LDYUaNwmX7M/s320/monoDroid.jpeg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;MonoDroid will be a commercial product licensed in a similar fashion&lt;br /&gt;to our Mono for &lt;b&gt;iPhone&lt;/b&gt; product &lt;b&gt;MonoTouch&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;To quickly get started read the installation guide and our Tutorials. If you have questions, you can contact us or discuss directly with the MonoDroid community on the mailing list, or in our IRC Chat.&lt;br /&gt;&lt;br /&gt;You should familiarize yourself with the API, the API Design, MonoDroid's architecture, the list of class libraries that are part of MonoDroid, MonoDroid's Limitations.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Download MonoDroid from here &lt;/b&gt;&lt;br /&gt;&lt;a href="http://mono-android.net/"&gt;http://mono-android.net/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;For sample you can visit&lt;/b&gt;&lt;br /&gt;&lt;a href="http://www.c-sharpcorner.com/UploadFile/mahesh/5795/"&gt;http://www.c-sharpcorner.com/UploadFile/mahesh/5795/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-7753890189418600914?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/7753890189418600914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=7753890189418600914' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7753890189418600914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7753890189418600914'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/03/android-based-applications-using-c.html' title='Android-based applications using C# : MonoDroid'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-1RS_hHYHn-8/TXS24s62y1I/AAAAAAAAAFM/LDYUaNwmX7M/s72-c/monoDroid.jpeg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-6581255638573351647</id><published>2011-02-28T06:02:00.000-08:00</published><updated>2011-02-28T06:13:48.267-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='thin client'/><category scheme='http://www.blogger.com/atom/ns#' term='thick client'/><title type='text'>Thin Vs. Thick Clients</title><content type='html'>Basically, a thin client is a web based application and most of the processing is done on the server side.&lt;br /&gt;&lt;br /&gt;A thick client is installed into the client side. It is still connected to the server, but most of the processing is done on client side. With thick client, there won't be much processing via the network. In a way, it will be a much faster option if your network is slow or congested.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-kANKvYvoH8Q/TWuqkFVlF8I/AAAAAAAAAEk/-i_QVzozob4/s1600/smartClientDef.JPG" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="223" width="320" src="http://3.bp.blogspot.com/-kANKvYvoH8Q/TWuqkFVlF8I/AAAAAAAAAEk/-i_QVzozob4/s320/smartClientDef.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;The codes are different for thick and thin clients. I think if you code in components, you can reuse the code about 60% - 80% of the time depending on the requirements. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;More specific..&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Thin Client:&lt;/b&gt; Is a Web Application, and runs on Internet Explorer. You access the application using http://hostname:portNumber/iSupport=20 Here you have a webserver and database in the background. It can be 2-tier or N-tier.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-fz19H79ycsk/TWuqs-oEjAI/AAAAAAAAAEs/z1QEZTIyceY/s1600/thin_client_works.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="220" width="320" src="http://1.bp.blogspot.com/-fz19H79ycsk/TWuqs-oEjAI/AAAAAAAAAEs/z1QEZTIyceY/s320/thin_client_works.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;List of protocols used with thin clients&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;* Appliance Link Protocol&lt;br /&gt;* Citrix ICA&lt;br /&gt;* Remote Desktop Protocol&lt;br /&gt;* Secure Shell or SSH, an encrypted replacement for telnet.&lt;br /&gt;* Virtual Network Computing&lt;br /&gt;* X11, central to Unix windowing&lt;br /&gt;* XML, HTML, or JSON over HTTP (Ajax)&lt;br /&gt;* DisplayLink over USB&lt;br /&gt;* NFS&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Thick Client:&lt;/b&gt; Is the Application which runs on Windows. It's like any other Windows based program/software. It can be accessed on the same system on which you have it installed. &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-a-c65_HgeEQ/TWuqzBZ7uuI/AAAAAAAAAE0/l9tIcqwOTxc/s1600/thick_client.jpeg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="180" width="279" src="http://1.bp.blogspot.com/-a-c65_HgeEQ/TWuqzBZ7uuI/AAAAAAAAAE0/l9tIcqwOTxc/s320/thick_client.jpeg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;Advantages of thick clients&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;1. Fewer server requirements.&lt;/b&gt; A thick client server does not require as high a level of performance as a thin client server (since the thick clients themselves do much of the application processing). This results in drastically cheaper servers.&lt;br /&gt;&lt;b&gt;2.Offline working.&lt;/b&gt; Thick clients have advantages in that a constant connection to the central server is often not required.&lt;br /&gt;&lt;b&gt;3.Better multimedia performance.&lt;/b&gt; Thick clients have advantages in multimedia-rich applications that would be bandwidth intensive if fully served. For example, thick clients are well suited for video gaming.&lt;br /&gt;&lt;b&gt;4.More flexibility.&lt;/b&gt; On some operating systems software products are designed for personal computers that have their own local resources. Running this software in a thin client environment can be difficult.&lt;br /&gt;&lt;b&gt;5.Using existing infrastructure.&lt;/b&gt; As many people now have very fast local PCs, they already have the infrastructure to run thick clients at no extra cost.&lt;br /&gt;&lt;b&gt;6.Higher server capacity.&lt;/b&gt; The more work that is carried out by the client, the less the server needs to do, increasing the number of users each server can support.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-6581255638573351647?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/6581255638573351647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=6581255638573351647' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6581255638573351647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6581255638573351647'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/02/thin-vs-thick-clients.html' title='Thin Vs. Thick Clients'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-kANKvYvoH8Q/TWuqkFVlF8I/AAAAAAAAAEk/-i_QVzozob4/s72-c/smartClientDef.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-7921414023645299177</id><published>2011-02-28T02:48:00.000-08:00</published><updated>2011-02-28T02:48:57.158-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='string format'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='currency'/><title type='text'>String Format for Double [C#]</title><content type='html'>This information help me a lot to solve my currency related calculation... so share with you. Hope that it may also helpful for other guys...&lt;br /&gt;&lt;br /&gt;The following examples show how to format float numbers to string in C#. You can use static method String.Format or instance methods double.ToString() and float.ToString().&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Digits after decimal point&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This example formats double to string with fixed number of decimal places. For two decimal places use pattern „0.00“. If a float number has less decimal places, the rest digits on the right will be zeroes. If it has more decimal places, the number will be rounded.&lt;br /&gt;&lt;b&gt;[C#]&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;// just two decimal places&lt;br /&gt;String.Format("{0:0.00}", 123.4567);      // "123.46"&lt;br /&gt;String.Format("{0:0.00}", 123.4);         // "123.40"&lt;br /&gt;String.Format("{0:0.00}", 123.0);         // "123.00"&lt;br /&gt;&lt;br /&gt;Next example formats double to string with floating number of decimal places. E.g. for maximal two decimal places use pattern „0.##“.&lt;br /&gt;&lt;b&gt;[C#]&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;// max. two decimal places&lt;br /&gt;String.Format("{0:0.##}", 123.4567);      // "123.46"&lt;br /&gt;String.Format("{0:0.##}", 123.4);         // "123.4"&lt;br /&gt;String.Format("{0:0.##}", 123.0);         // "123"&lt;br /&gt;&lt;b&gt;&lt;br /&gt;Digits before decimal point&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;If you want a float number to have any minimal number of digits before decimal point use N-times zero before decimal point. E.g. pattern „00.0“ formats a float number to string with at least two digits before decimal point and one digit after that.&lt;br /&gt;&lt;b&gt;[C#]&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;// at least two digits before decimal point&lt;br /&gt;String.Format("{0:00.0}", 123.4567);      // "123.5"&lt;br /&gt;String.Format("{0:00.0}", 23.4567);       // "23.5"&lt;br /&gt;String.Format("{0:00.0}", 3.4567);        // "03.5"&lt;br /&gt;String.Format("{0:00.0}", -3.4567);       // "-03.5"&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Thousands separator&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;To format double to string with use of thousands separator use zero and comma separator before an usual float formatting pattern, e.g. pattern „0,0.0“ formats the number to use thousands separators and to have one decimal place.&lt;br /&gt;&lt;b&gt;[C#]&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;String.Format("{0:0,0.0}", 12345.67);     // "12,345.7"&lt;br /&gt;String.Format("{0:0,0}", 12345.67);       // "12,346"&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Zero&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Float numbers between zero and one can be formatted in two ways, with or without leading zero before decimal point. To format number without a leading zero use # before point. For example „#.0“ formats number to have one decimal place and zero to N digits before decimal point (e.g. „.5“ or „123.5“).&lt;br /&gt;&lt;br /&gt;Following code shows how can be formatted a zero (of double type).&lt;br /&gt;&lt;b&gt;[C#]&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;String.Format("{0:0.0}", 0.0);            // "0.0"&lt;br /&gt;String.Format("{0:0.#}", 0.0);            // "0"&lt;br /&gt;String.Format("{0:#.0}", 0.0);            // ".0"&lt;br /&gt;String.Format("{0:#.#}", 0.0);            // ""&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Align numbers with spaces&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;To align float number to the right use comma „,“ option before the colon. Type comma followed by a number of spaces, e.g. „0,10:0.0“ (this can be used only in String.Format method, not in double.ToString method). To align numbers to the left use negative number of spaces.&lt;br /&gt;&lt;b&gt;[C#]&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;String.Format("{0,10:0.0}", 123.4567);    // "     123.5"&lt;br /&gt;String.Format("{0,-10:0.0}", 123.4567);   // "123.5     "&lt;br /&gt;String.Format("{0,10:0.0}", -123.4567);   // "    -123.5"&lt;br /&gt;String.Format("{0,-10:0.0}", -123.4567);  // "-123.5    "&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Custom formatting for negative numbers and zero&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;If you need to use custom format for negative float numbers or zero, use semicolon separator „;“ to split pattern to three sections. The first section formats positive numbers, the second section formats negative numbers and the third section formats zero. If you omit the last section, zero will be formatted using the first section.&lt;br /&gt;&lt;b&gt;[C#]&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;String.Format("{0:0.00;minus 0.00;zero}", 123.4567);   // "123.46"&lt;br /&gt;String.Format("{0:0.00;minus 0.00;zero}", -123.4567);  // "minus 123.46"&lt;br /&gt;String.Format("{0:0.00;minus 0.00;zero}", 0.0);        // "zero"&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Some funny examples&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;As you could notice in the previous example, you can put any text into formatting pattern, e.g. before an usual pattern „my text 0.0“. You can even put any text between the zeroes, e.g. „0aaa.bbb0“.&lt;br /&gt;&lt;b&gt;[C#]&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;String.Format("{0:my number is 0.0}", 12.3);   // "my number is 12.3"&lt;br /&gt;String.Format("{0:0aaa.bbb0}", 12.3);          // "12aaa.bbb3"&lt;br /&gt;&lt;br /&gt;You will get more help from &lt;a href="http://www.csharp-examples.net/string-format-double/"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-7921414023645299177?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/7921414023645299177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=7921414023645299177' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7921414023645299177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7921414023645299177'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/02/string-format-for-double-c.html' title='String Format for Double [C#]'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-7503023252483806117</id><published>2011-02-12T02:05:00.000-08:00</published><updated>2011-02-12T02:05:37.695-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='json'/><title type='text'>Handling JSON Arrays returned from ASP.NET Web Services with jQuery</title><content type='html'>The Web Service methods that I will use revolve around cars. Having set up a web site in Visual Studio 2008, I have added a new item of type "Web Service" to the project, calling it &lt;b&gt;EmpInfoService&lt;/b&gt;.asmx. The code-behind - &lt;b&gt;EmpInfoService&lt;/b&gt;.cs - is automatically generated within the App_Code folder. The full code for that class file is as follows:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code: asmx&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;public class Employee&lt;br /&gt;{&lt;br /&gt;public string FullName;&lt;br /&gt;public string Designation;&lt;br /&gt;public string PhoneNo;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/// &amp;lt;summary&amp;gt;&lt;br /&gt;/// Summary description for Emp info&lt;br /&gt;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[WebService(Namespace = "http://tempuri.org/")]&lt;br /&gt;[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;[ScriptService]&lt;/b&gt;&lt;br /&gt;public class &lt;b&gt;EmpInfoService &lt;/b&gt;: WebService&lt;br /&gt;{&lt;br /&gt;List&lt;employee&gt; Employees = new List&lt;employee&gt;{&lt;br /&gt;new Employee{FullName="Shakil",Designation="Manager",PhoneNo=5555454},&lt;br /&gt;new Employee{FullName="Ahsan",Designation="Director",PhoneNo=4545454},&lt;br /&gt;new Employee{FullName="Murhsed",Designation="Director",PhoneNo=5454545},&lt;br /&gt;new Employee{FullName="Khurshid",Designation="Officer",PhoneNo=4545545},&lt;br /&gt;new Employee{FullName="Abdul",Designation="Sr.Executive",PhoneNo=45454545},&lt;br /&gt;new Employee{FullName="Yususf",Designation="Sr.Officer",PhoneNo=4545454545},&lt;br /&gt;new Employee{FullName="Farid",Designation="Executive",PhoneNo=45454545},&lt;br /&gt;new Employee{FullName="Munir",Designation="Executive",PhoneNo=454545454},&lt;br /&gt;new Employee{FullName="Foyez",Designation="Executive",PhoneNo=45454545454}&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;[WebMethod]&lt;/b&gt;&lt;br /&gt;public List&lt;employee&gt; GetAllEmployees()&lt;br /&gt;{&lt;br /&gt;return Employees;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;b&gt;[WebMethod]&lt;/b&gt;&lt;br /&gt;public List&lt;employee&gt; GetEmployeesByName(string name)&lt;br /&gt;{&lt;br /&gt;var query = from c in Employees &lt;br /&gt;where c.FullName == name&lt;br /&gt;select c;&lt;br /&gt;return query.ToList();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code: ASPX&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The mark-up in the aspx page that will call the Web Service is extremely simple:&lt;br /&gt;&lt;br /&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;input type="button" id="btnEmpId" value="Get Employe List" /&amp;gt;&lt;br /&gt;&amp;lt;div id="output"&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;All that's needed now is some Javascript for the &lt;b&gt;getEmployees&lt;/b&gt;() method that has been assigned to the onclick event of the html button. This will go into the &amp;lt;head&amp;gt; section of the page:&lt;br /&gt;&lt;br /&gt;First, &lt;b&gt;jQuery &lt;/b&gt;is referenced via the src attribute of the first &amp;lt;script&amp;gt; tag. Then a click event is registered with the button which will invoke the getEmployees() function. After that is the &lt;b&gt;getEmployees&lt;/b&gt;() function that is fired when the button is clicked. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Jquery:(Without parameter)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script type="text/javascript" src="script/jquery-1.3.2.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt; $(function()&lt;/b&gt; {&lt;br /&gt;$('#Button1').click(getEmployees);&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt; function getEmployees()&lt;/b&gt; {&lt;br /&gt;$.ajax({&lt;br /&gt;type: "POST",&lt;br /&gt;url: "EmployeeService.asmx/GetAllEmployees",&lt;br /&gt;data: "{}",&lt;br /&gt;contentType: "application/json; charset=utf-8",&lt;br /&gt;dataType: "json",&lt;br /&gt;success: function(response) {&lt;br /&gt;var Employees = response.d;&lt;br /&gt;$('#output').empty();&lt;br /&gt;$.each(Employees, function(index, Employee) {&lt;br /&gt;$('#output').append('&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;' + Employee.FullName + ' &amp;lt;br /&amp;gt;' +&lt;br /&gt;Employee.Designation + '&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt; Designation: ' +&lt;br /&gt;Employee.PhoneNo + '&amp;lt;br /&amp;gt;Phone: ' +'&amp;lt;/p&amp;gt;');&lt;br /&gt;});&lt;br /&gt;},&lt;br /&gt;&lt;br /&gt;failure: function(msg) {&lt;br /&gt;$('#output').text(msg);&lt;br /&gt;}&lt;br /&gt;});&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It makes use of the &lt;b&gt;$.ajax(options)&lt;/b&gt; function within jQuery, and accepts an object with a number of optional properties. &lt;br /&gt;&lt;b&gt;type &lt;/b&gt;specifies the HTTP method, which in this case is &lt;b&gt;POST&lt;/b&gt;. &lt;br /&gt;&lt;b&gt;url &lt;/b&gt;specifies the URL of the Web Service, together with the web method that is being called. This is followed by the parameters, which are applied to the data property.&lt;br /&gt;&lt;br /&gt;In this case, no parameters are being passed, as we are calling the method that retrieves the entire collection of Employee. &lt;br /&gt;The &lt;b&gt;contentType &lt;/b&gt;and &lt;b&gt;dataType &lt;/b&gt;MUST be specified. &lt;br /&gt;Following this are two further functions: &lt;b&gt;success &lt;/b&gt;defines what should be done if the call is successful, and &lt;b&gt;failure &lt;/b&gt;handles exceptions that are returned.&lt;br /&gt;&lt;br /&gt;In this case, the &lt;b&gt;success callback&lt;/b&gt; is passed the resulting HTTP response. In response an object with a &lt;b&gt;property - d - is returned&lt;/b&gt;, which contains an array of objects. Each object has a __type property which tells you that it is a Employee object, followed by the other properties of our Web Service Employee object. &lt;br /&gt;&lt;br /&gt;The div with the id of output is emptied, in case there was clutter there from a previous ajax call. The jQuery &lt;b&gt;each() function&lt;/b&gt; is used to iterate over the collection of objects. Each Employee object is accessed in turn, and its properties are written to a paragraph, which is then appended to the content of div output. &lt;br /&gt;&lt;br /&gt;Now, share with you how to send parameter using jquery,&lt;br /&gt;Here we want to filter employee info with employee name from DropDownList&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:DropDownList ID="ddlEmpName" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;asp:ListItem&gt;Shakil&amp;lt;/asp:ListItem&amp;gt;&lt;br /&gt;&amp;lt;asp:ListItem&gt;Ahsan&amp;lt;/asp:ListItem&amp;gt;&lt;br /&gt;&amp;lt;asp:ListItem&gt;Murshed&amp;lt;/asp:ListItem&amp;gt;&lt;br /&gt;&amp;lt;asp:ListItem&gt;Farid&amp;lt;/asp:ListItem&amp;gt;&lt;br /&gt;&amp;lt;/asp:DropDownList&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Jquery(with parameter see the bold):&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script type="text/javascript" src="script/jquery-1.3.2.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&lt;br /&gt;$(function() {&lt;br /&gt;$('#Button1').click(getEmployees);&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function &lt;b&gt;getEmployees&lt;/b&gt;() {&lt;br /&gt;$.ajax({&lt;br /&gt;type: "POST",&lt;br /&gt;&lt;b&gt; url: "EmployeeService.asmx/GetEmployeesByName",&lt;br /&gt;data: "{name: " + $('#&lt;%= ddlEmpName.ClientID %&gt;').val() + " }",&lt;/b&gt;&lt;br /&gt;contentType: "application/json; charset=utf-8",&lt;br /&gt;dataType: "json",&lt;br /&gt;success: function(response) {&lt;br /&gt;var Employees = response.d;&lt;br /&gt;$('#output').empty();&lt;br /&gt;$.each(Employees, function(index, Employee) {&lt;br /&gt;$('#output').append('&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;' + Employee.FullName + ' &amp;lt;br /&amp;gt;' +&lt;br /&gt;Employee.Designation + '&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt; Designation: ' +&lt;br /&gt;Employee.PhoneNo + '&amp;lt;br /&amp;gt;Phone: ' +'&amp;lt;/p&amp;gt;');&lt;br /&gt;});&lt;br /&gt;},&lt;br /&gt;&lt;br /&gt;failure: function(msg) {&lt;br /&gt;$('#output').text(msg);&lt;br /&gt;}&lt;br /&gt;});&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;The &lt;b&gt;url &lt;/b&gt;option now points to the appropriate method, and a parameter is passed into the &lt;b&gt;data &lt;/b&gt;option, which uses jQuery syntax to reference the selected value from the DropDownList. I have used inline ASP.NET tags in this case to dynamically render the ID of the DropDownList using the &lt;b&gt;ClientID &lt;/b&gt;property, so that there will be no issues in referencing the DropDownList if this code was transferred to a User Control or another control that implements INamingContainer.&lt;br /&gt;&lt;br /&gt;All credits goes to Mr.&lt;b&gt;Mikesdotnetting &lt;/b&gt;because I solved my problem from this superb &lt;a href="http://www.mikesdotnetting.com/Article/96/Handling-JSON-Arrays-returned-from-ASP.NET-Web-Services-with-jQuery"&gt;article&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-7503023252483806117?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/7503023252483806117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=7503023252483806117' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7503023252483806117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7503023252483806117'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/02/handling-json-arrays-returned-from.html' title='Handling JSON Arrays returned from ASP.NET Web Services with jQuery'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-6890675110828311942</id><published>2011-02-10T22:45:00.000-08:00</published><updated>2011-02-10T22:45:45.395-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><title type='text'>JScript Editor Extensions for the Visual Studio 2010 JScript editor</title><content type='html'>This really a nice extensions which is make life easy for developer specially for JavaScript development.&lt;br /&gt;&lt;br /&gt;Bundles the following extensions for the &lt;b&gt;Visual Studio 2010&lt;/b&gt; JScript editor:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Brace Matching&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Adds support for automatically highlighting the matching opening or closing brace to the one currently at the cursor. Supports matching parenthesis: (), square brackets: [], and curly braces: {}. Braces in strings, comments and regular expression literals are ignored.&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/-BqtrpF75wgI/TVTaho9OU1I/AAAAAAAAAEc/pgejAwbnaBc/s1600/jseditor_screenshot.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="200" width="200" src="http://3.bp.blogspot.com/-BqtrpF75wgI/TVTaho9OU1I/AAAAAAAAAEc/pgejAwbnaBc/s320/jseditor_screenshot.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Outlining / Cold-folding&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Adds support for automatically creating outlining regions for JScript blocks. Blocks are detected via opening and closing curly braces. Braces in strings, comments and regular expression literals are ignored.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Current Word Highlighting&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Adds support for highlighting all instances of the word currently at the cursor.&lt;br /&gt;IntelliSense Doc-Comments &lt;para&gt; Support&lt;br /&gt;&lt;br /&gt;Adds support for the &lt;para&gt; element in JScript IntelliSense doc-comments to allow display of new lines in IntelliSense tooltips, e.g.&lt;br /&gt;&lt;br /&gt;function hello(name) {&lt;br /&gt;    /// &lt;summary&gt;A great function&lt;br /&gt;    ///   &lt;para&gt;Some info on a new line&lt;/para&gt;&lt;br /&gt;    /// &lt;/summary&gt;&lt;br /&gt;    /// &lt;param name="name" type="String"&gt;The name to say hello to&lt;/param&gt;    return "hello " + name;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Updated vsdoc files for jQuery with &lt;para&gt; tags are available for jQuery 1.4.3, 1.4.4 and 1.5&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Source Code&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The source code for these extensions is available on the &lt;b&gt;ASP.NET CodePlex site&lt;/b&gt; in the folder: $/VisualStudioWebTooling/JScriptExtensions&lt;br /&gt;&lt;br /&gt;For more information:&lt;br /&gt;&lt;a href="http://visualstudiogallery.msdn.microsoft.com/872d27ee-38c7-4a97-98dc-0d8a431cc2ed/"&gt;http://visualstudiogallery.msdn.microsoft.com/872d27ee-38c7-4a97-98dc-0d8a431cc2ed/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-6890675110828311942?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/6890675110828311942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=6890675110828311942' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6890675110828311942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6890675110828311942'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/02/jscript-editor-extensions-for-visual.html' title='JScript Editor Extensions for the Visual Studio 2010 JScript editor'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-BqtrpF75wgI/TVTaho9OU1I/AAAAAAAAAEc/pgejAwbnaBc/s72-c/jseditor_screenshot.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-4454236049908108050</id><published>2011-02-10T02:30:00.000-08:00</published><updated>2011-02-10T02:30:24.274-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='CheckBoxlist'/><title type='text'>Check/Uncheck all items in a CheckBoxList using Javascript</title><content type='html'>In my previous article show &lt;a href="http://aspboss.blogspot.com/2011/02/checkuncheck-all-items-in-checkboxlist.html"&gt;how to check/uncheck all items in a CheckBoxList using ASP.NET&lt;/a&gt;. Today we do the same using javascript. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;Note:&lt;/i&gt;&lt;/b&gt; If you use the master page in your application remember that you need to use '&lt;b&gt;Control.ClientID&lt;/b&gt;'. Because When the page is rendered in the browser, the content and master pages get merged into a single page. This means that the IDs for the controls get renamed. ASP.NET renames the IDs to prevent naming conflicts. Now to handle the renamed controls, ASP.NET provides the ‘&lt;b&gt;Control.ClientID&lt;/b&gt;’ and ‘&lt;b&gt;Control.UniqueID&lt;/b&gt;’ to get the renamed ID’s. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Use the following code at the Page load event to add items to the &lt;b&gt;CheckBoxList &lt;/b&gt;programmatically:&lt;br /&gt;&lt;br /&gt;    protected void &lt;b&gt;Page_Load&lt;/b&gt;(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;  if (!Page.IsPostBack)&lt;br /&gt;  {&lt;br /&gt;   cblTest.Items.Add(new ListItem("Dhaka", "Dhaka"));&lt;br /&gt;   cblTest.Items.Add(new ListItem("Chittagong", "Chittagong"));&lt;br /&gt;   cblTest.Items.Add(new ListItem("Shylet", "Shylet"));&lt;br /&gt;   cblTest.Items.Add(new ListItem("Rajshahi", "Rajshahi"));&lt;br /&gt;  }&lt;br /&gt;    } &lt;br /&gt; &lt;br /&gt;The &lt;b&gt;prototype of our javascript function &lt;/b&gt;will be the following :&lt;br /&gt;function &lt;b&gt;CheckBoxListSelect&lt;/b&gt;(&amp;lt;pass the control&amp;gt;, &amp;lt;state i.e true or false&amp;gt;)&lt;br /&gt;{   &lt;br /&gt;      // Our code will come here&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Now drag and drop two asp:button which are named as "CheckedAll" and "UnCheckedAll" respectively.&lt;br /&gt;&lt;br /&gt;In this event, we will call the javascript function and pass the respective checkboxlist controls and the state which will describe ‘true’ for CheckedAll button or ‘false’ for UnCheckedAll button.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Check All:&lt;/b&gt;&lt;br /&gt;For Check all write the following code in the onClientClick event of "CheckedAll" button&lt;br /&gt;&amp;lt;asp:Button ID="btnCheckAll" runat="server" Text="CheckedAll" OnClientClick="&lt;b&gt;javascript: CheckBoxListSelect&lt;/b&gt; ('&amp;lt;%= cblTest.ClientID %&amp;gt;',&lt;b&gt;true&lt;/b&gt;)"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Uncheck All:&lt;/b&gt;&lt;br /&gt;For UnCheck all write the following code in the Click Event of "UnCheckedAll" button&lt;br /&gt;&amp;lt;asp:Button ID="btnUnCheckAll" Text="UnCheckedAll" runat="server" OnClientClick="&lt;b&gt;javascript: CheckBoxListSelect&lt;/b&gt; ('&amp;lt;%= cblTest.ClientID %&amp;gt;',&lt;b&gt;false&lt;/b&gt;)"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;JavaScript function:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"&amp;gt;&lt;br /&gt;&amp;lt;script language="javascript" type="text/javascript"&amp;gt;&lt;br /&gt;function &lt;b&gt;CheckBoxListSelect&lt;/b&gt;(cbControl, state)&lt;br /&gt;{   &lt;br /&gt;       var chkBoxList = document.getElementById(cbControl);&lt;br /&gt;        var chkBoxCount= chkBoxList.getElementsByTagName("input");&lt;br /&gt;        for(var i=0;i&amp;lt;chkBoxCount.length;i++)&lt;br /&gt;        {&lt;br /&gt;            chkBoxCount[i].checked = state;&lt;br /&gt;        }&lt;br /&gt;       &lt;br /&gt;        return false; &lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;// ASP.NET Controls are placed here&lt;br /&gt;&amp;lt;/asp:Content&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In this javascript function, we accept two parameters, the checkboxlist control and the state (i.e true or false) of each checkbox, that we would like it to be.Since asp.net renders each checkbox as an input tag, what we are really doing over here is first getting the checkboxlist control using  document.getElementById(cbControl) and then counting the number of &amp;lt;input&amp;gt; tags inside that control. Once we get the count, we use a loop to set the state of each control.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-4454236049908108050?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/4454236049908108050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=4454236049908108050' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4454236049908108050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4454236049908108050'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/02/checkuncheck-all-items-in-checkboxlist_10.html' title='Check/Uncheck all items in a CheckBoxList using Javascript'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-6731508843722177075</id><published>2011-02-06T10:22:00.000-08:00</published><updated>2011-02-06T10:22:27.244-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='CheckBoxlist'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Check/Uncheck all items in a CheckBoxList using ASP.NET</title><content type='html'>The CheckBoxList control in ASP.NET 2.0 is one of the useful control for asp.net developer. But it is not so easy(also not complicated :))to handling like checkbox. This control provides a group of checkboxes that can be dynamically generated by binding it to a data source. &lt;br /&gt;&lt;br /&gt;You can handling its operation programmatically using both asp.net or JavaScript. Today I discuss how to checked and unchecked items in &lt;b&gt;CheckBoxList &lt;/b&gt;using ASP.net/C#.&lt;br /&gt;&lt;br /&gt;First you can bind data to &lt;b&gt;CheckBoxList &lt;/b&gt;control using a &lt;b&gt;smart tag&lt;/b&gt; appears which allows you to specify a datasource or add items manually to the CheckBoxList.Click on the &lt;b&gt;‘Edit Items’&lt;/b&gt; to open the &lt;b&gt;ListItem &lt;/b&gt;Collection Editor and add items.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;Bind data into this control from data source like this:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;// Assuming that GetCityList() returns a list of CityID and CityName items in a sqldatareader&lt;br /&gt;&lt;br /&gt;SqlDataReader dr = GetCityList ();&lt;br /&gt;cblTest.DataSource = dr;&lt;br /&gt;cblTest.DataValueField = "CityID ";&lt;br /&gt;cblTest.DataTextField = "CityName ";&lt;br /&gt;cblTest.DataBind(); &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Or, use the following code at the Page load event to add items to the CheckBoxList &lt;b&gt;programmatically&lt;/b&gt;:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;protected void &lt;b&gt;Page_Load&lt;/b&gt;(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        if (!Page.IsPostBack)&lt;br /&gt;        {&lt;br /&gt;            cblTest.Items.Add(new ListItem("Dhaka", "Dhaka"));&lt;br /&gt;            cblTest.Items.Add(new ListItem("Chittagong", "Chittagong"));&lt;br /&gt;            cblTest.Items.Add(new ListItem("Shylet", "Shylet"));&lt;br /&gt;            cblTest.Items.Add(new ListItem("Rajshahi", "Rajshahi"));&lt;br /&gt;        }&lt;br /&gt;    } &lt;/blockquote&gt;&lt;br /&gt;Now drag and drop two &lt;b&gt;asp:button&lt;/b&gt; which are named as "&lt;b&gt;CheckedAll&lt;/b&gt;" and "&lt;b&gt;UnCheckedAll&lt;/b&gt;" respectively. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Check All:&lt;/b&gt;&lt;br /&gt;For Check all write the following code in the Click Event of "CheckedAll" button&lt;br /&gt;&lt;br /&gt;    protected void &lt;b&gt;CheckedAll_Click&lt;/b&gt;(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        foreach (ListItem li in cblTest.Items)&lt;br /&gt;        {&lt;br /&gt;             li.Selected = true;&lt;br /&gt;        }        &lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Uncheck All:&lt;/b&gt;&lt;br /&gt;For UnCheck all write the following code in the Click Event of "UnCheckedAll" button&lt;br /&gt;&lt;br /&gt;    protected void &lt;b&gt;UnCheckedAll_Click&lt;/b&gt;(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        foreach (ListItem li in cblTest.Items)&lt;br /&gt;        {&lt;br /&gt;            li.Selected = false;&lt;br /&gt;        }&lt;br /&gt;    }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-6731508843722177075?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/6731508843722177075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=6731508843722177075' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6731508843722177075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6731508843722177075'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/02/checkuncheck-all-items-in-checkboxlist.html' title='Check/Uncheck all items in a CheckBoxList using ASP.NET'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-4481182786216025654</id><published>2011-02-06T09:32:00.000-08:00</published><updated>2011-02-06T09:32:20.611-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='exception'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='virtual directory'/><title type='text'>"System.Security.SecurityException: Security error" error message when the virtual directory points to a remote share in ASP.NET</title><content type='html'>Very recently, We have faced a problem to deploy application. The problem is raised when virtual  directory points to a remote PC. The scenario is describe below..&lt;br /&gt;PC1-- Web server(where IIS and .net framework is installed) &lt;br /&gt;PC2-- Remote pc where precompile application directory located.&lt;br /&gt;&lt;br /&gt;When deploy application virtual directory is created in PC1 but precompile application folder is points to remote PC2. After configure everything it shows me exception about security permission. After searching I added  &amp;lt;trust level="Full"/ &amp;gt; in web.config file. Unfortunately, it shows me the same error &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Parser Error Description:&lt;/b&gt; &lt;blockquote&gt;An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. &lt;/blockquote&gt;&lt;br /&gt;After search in various site I found the solution in msdn.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Why this problem occur?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The &lt;b&gt;System.Web&lt;/b&gt; namespace does not have the AllowPartiallyTrusted CallersAttribute applied to it.&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms994923.aspx "&gt;http://msdn2.microsoft.com/en-us/library/ms994923.aspx&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Any code that is not in the &lt;b&gt;My_Computer_Zone&lt;/b&gt; code group that does not have this attribute requires the &lt;b&gt;FullTrust &lt;/b&gt;user right. Therefore, the remote share that holds the Web applications content requires &lt;b&gt;FullTrust&lt;/b&gt;. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution 1:Using Administrative Tools&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;To resolve this behavior, grant the &lt;b&gt;FullTrust &lt;/b&gt;right to the remote share:&lt;br /&gt;&lt;br /&gt;   1. On the Web server, open &lt;b&gt;Administrative Tools&lt;/b&gt;, and then double-click Microsoft .NET Framework Configuration.&lt;br /&gt;   2. Expand Runtime Security Policy, expand Machine, and then expand Code Groups.&lt;br /&gt;   3. Right-click&lt;b&gt; All_Code&lt;/b&gt;, and then click New.&lt;br /&gt;   4. Select Create a &lt;b&gt;new code group&lt;/b&gt;. Give your code group a relevant name, such as the name of the applications share. Click Next.&lt;br /&gt;   5. In the Choose the condition type for this &lt;b&gt;code group list&lt;/b&gt;, select URL.&lt;br /&gt;   6. In the URL box, type the path of the share in the following format:&lt;br /&gt;      &lt;b&gt;file:////\\computername\sharename\*&lt;/b&gt;&lt;br /&gt;      &lt;b&gt;Note:&lt;/b&gt;Replace computername with the name of the computer that is hosting the remote share. Replace sharename with the name of the share.&lt;br /&gt;   7. Click Next. On the next page, select &lt;b&gt;Use an existing permission set&lt;/b&gt;, and then select &lt;b&gt;FullTrust&lt;/b&gt;.&lt;br /&gt;   8. Click Next, and then click Finish.&lt;br /&gt;   9. Restart Microsoft &lt;b&gt;Internet Information Services&lt;/b&gt; (IIS) to restart the &lt;b&gt;ASP.NET worker process&lt;/b&gt;. &lt;br /&gt;&lt;br /&gt;&lt;i&gt;If Microsoft .NET Framework Configuration is not displayed under Administrative Tools, you can install the &lt;b&gt;.NET Framework SDK&lt;/b&gt; to add Microsoft .NET Framework Configuration.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution 2:Using Command line&lt;/b&gt;&lt;br /&gt;Alternatively, you can run the following command to make the change: &lt;br /&gt;&lt;br /&gt;Drive:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\caspol.exe -m -ag 1 -url "file:////\\computername\sharename\*" FullTrust -exclusive on&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Note &lt;/b&gt;For more information about what these arguments do, run the following command:&lt;br /&gt;caspol.exe -?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Additional Information:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In this configuration, the account under which the ASP.NET worker process runs must have sufficient rights to the remote share. You can set the account under which the worker process runs by using the &lt;b&gt;Processmodel &lt;/b&gt;tag in the Machine.config file.&lt;br /&gt;Back to the top&lt;br /&gt;Steps to reproduce the behavior&lt;br /&gt;&lt;br /&gt;   1. Create a new virtual directory that points to a remote share.&lt;br /&gt;   2. Create an application for the virtual directory. Make sure that the user who connects to the share has read access to the remote content.&lt;br /&gt;   3. In the Processmodel tag of the &lt;b&gt;Machine.config&lt;/b&gt; file, change the user to a domain user who has list, read, and execute permissions on the remote share.&lt;br /&gt;   4. Create an inline .aspx file, and then put the file in the remote share.&lt;br /&gt;   5. Make a request for the page.&lt;br /&gt;&lt;br /&gt;For more information:&lt;br /&gt;Please visits&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/317012"&gt;http://support.microsoft.com/kb/317012&lt;/a&gt;&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/306590"&gt;http://support.microsoft.com/kb/306590&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-4481182786216025654?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/4481182786216025654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=4481182786216025654' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4481182786216025654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4481182786216025654'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/02/systemsecuritysecurityexception.html' title='&quot;System.Security.SecurityException: Security error&quot; error message when the virtual directory points to a remote share in ASP.NET'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-7299780804201940533</id><published>2011-01-13T04:11:00.000-08:00</published><updated>2011-01-14T20:04:16.323-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='table'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Dynamically Add/Remove rows in HTML table using JavaScript</title><content type='html'>This is very often for web developer when we need to use dynamically generate HTML table using JavaScript. I have found frequent request in various forum about this issue...so now there is very easy sample for them...&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_QsXPTEkQU0k/TS7vyPjFRHI/AAAAAAAAAEQ/euaMPfqmOsM/s1600/dynamic-add-delete-row-table-javascript.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 279px;" src="http://2.bp.blogspot.com/_QsXPTEkQU0k/TS7vyPjFRHI/AAAAAAAAAEQ/euaMPfqmOsM/s320/dynamic-add-delete-row-table-javascript.png" alt="" id="BLOGGER_PHOTO_ID_5561646236295316594" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Demo: &lt;/span&gt;&lt;a href="http://viralpatel.net/blogs/demo/dynamic-add-delete-row-table-javascript.html" target="_blank"&gt;&lt;span&gt;Click here&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;Source code :(Html &amp;amp; JavaScript)&lt;/span&gt;&lt;br /&gt;&amp;lt;HTML&amp;gt;&lt;br /&gt;&amp;lt;HEAD&amp;gt;&lt;br /&gt;&amp;lt;TITLE&amp;gt; Add/Remove dynamic rows in HTML table &amp;lt;/TITLE&amp;gt;&lt;br /&gt;&amp;lt;SCRIPT language="javascript"&amp;gt;&lt;br /&gt;function addRow(tableID) {&lt;br /&gt;&lt;br /&gt;var table = document.getElementById(tableID);&lt;br /&gt;&lt;br /&gt;var rowCount = table.rows.length;&lt;br /&gt;var row = table.insertRow(rowCount);&lt;br /&gt;&lt;br /&gt;var cell1 = row.insertCell(0);&lt;br /&gt;var element1 = document.createElement("input");&lt;br /&gt;element1.type = "checkbox";&lt;br /&gt;cell1.appendChild(element1);&lt;br /&gt;&lt;br /&gt;var cell2 = row.insertCell(1);&lt;br /&gt;cell2.innerHTML = rowCount + 1;&lt;br /&gt;&lt;br /&gt;var cell3 = row.insertCell(2);&lt;br /&gt;var element2 = document.createElement("input");&lt;br /&gt;element2.type = "text";&lt;br /&gt;cell3.appendChild(element2);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function deleteRow(tableID) {&lt;br /&gt;try {&lt;br /&gt;var table = document.getElementById(tableID);&lt;br /&gt;var rowCount = table.rows.length;&lt;br /&gt;&lt;br /&gt;for(var i=0; i&amp;lt;rowCount; i++) {&lt;br /&gt;var row = table.rows[i];&lt;br /&gt;var chkbox = row.cells[0].childNodes[0];&lt;br /&gt;if(null != chkbox &amp;amp;&amp;amp; true == chkbox.checked) {&lt;br /&gt;table.deleteRow(i);&lt;br /&gt;rowCount--;&lt;br /&gt;i--;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}catch(e) {&lt;br /&gt;alert(e);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;lt;/SCRIPT&amp;gt;&lt;br /&gt;&amp;lt;/HEAD&amp;gt;&lt;br /&gt;&amp;lt;BODY&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;INPUT type="button" value="Add Row" onclick="addRow('dataTable')" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;INPUT type="button" value="Delete Row" onclick="deleteRow('dataTable')" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;TABLE id="dataTable" width="350px" border="1"&amp;gt;&lt;br /&gt;&amp;lt;TR&amp;gt;&lt;br /&gt;&amp;lt;TD&amp;gt;&amp;lt;INPUT type="checkbox" name="chk"/&amp;gt;&amp;lt;/TD&amp;gt;&lt;br /&gt;&amp;lt;TD&amp;gt; 1 &amp;lt;/TD&amp;gt;&lt;br /&gt;&amp;lt;TD&amp;gt; &amp;lt;INPUT type="text" /&amp;gt; &amp;lt;/TD&amp;gt;&lt;br /&gt;&amp;lt;/TR&amp;gt;&lt;br /&gt;&amp;lt;/TABLE&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/BODY&amp;gt;&lt;br /&gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;&lt;br /&gt;You can get more help from &lt;a href="http://viralpatel.net/blogs/2009/03/dynamically-add-remove-rows-in-html-table-using-javascript.html" target="_blank"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-7299780804201940533?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/7299780804201940533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=7299780804201940533' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7299780804201940533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7299780804201940533'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/01/dynamically-addremove-rows-in-html.html' title='Dynamically Add/Remove rows in HTML table using JavaScript'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_QsXPTEkQU0k/TS7vyPjFRHI/AAAAAAAAAEQ/euaMPfqmOsM/s72-c/dynamic-add-delete-row-table-javascript.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-7829093252590040684</id><published>2011-01-13T01:55:00.000-08:00</published><updated>2011-01-13T03:00:14.596-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='QueryStrings'/><title type='text'>Get URL Parameters (QueryStrings) using Javascript</title><content type='html'>Today I have got a request from a newbie .."How to get value from Querystring using Javascript in asp.net?"  So I want to share with you ....&lt;br /&gt;&lt;br /&gt;Unfortunately there is no method in JavaScript for parsing the querystring  to get the value. So we try with regular expression to solve this problem..&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;JavaScript method for get URL parameter(QueryStrings)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;function getQuerystring(key, default_)&lt;br /&gt;{&lt;br /&gt;  if (default_==null) default_="";&lt;br /&gt;  key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");&lt;br /&gt;  var regex = new RegExp("[\\?&amp;amp;]"+key+"=([^&amp;amp;#]*)");&lt;br /&gt;  var qs = regex.exec(window.location.href);&lt;br /&gt;  if(qs == null)&lt;br /&gt;    return default_;&lt;br /&gt;  else&lt;br /&gt;    return qs[1];&lt;br /&gt;}&lt;/blockquote&gt;The following javascript code snippet facilitates Javascript's built in &lt;strong&gt;regular expressions&lt;/strong&gt; to retrieve value of the &lt;strong&gt;key&lt;/strong&gt;. Optionally, you can specify a&lt;strong&gt; default value&lt;/strong&gt; to return&lt;strong&gt; when key does not exist&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;The getQuerystring function is simple to use. Let's say you have the following URL:&lt;br /&gt;&lt;br /&gt;http://www.dotentboss.com?author=ahsan&lt;br /&gt;&lt;br /&gt;and you want to get the "author" querystring's value:&lt;br /&gt;&lt;br /&gt;var author_value = getQuerystring('author');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-7829093252590040684?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/7829093252590040684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=7829093252590040684' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7829093252590040684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7829093252590040684'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/01/get-url-parameters-querystrings-using.html' title='Get URL Parameters (QueryStrings) using Javascript'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-1837894764433956849</id><published>2011-01-12T00:33:00.000-08:00</published><updated>2011-01-12T04:00:14.299-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='ascii'/><title type='text'>How to generate ASCII Table</title><content type='html'>&lt;pre&gt;Very recently I get some request about ASCII code generate.&lt;br /&gt;So that I share with this code...&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;using System;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;&lt;br /&gt;public partial class _Default : Page&lt;br /&gt;{&lt;br /&gt;protected void &lt;b&gt;Page_Load&lt;/b&gt;(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt; Response.Write("&amp;lt;table&amp;gt;&amp;lt;tbody&amp;lt;tr&amp;gt;&lt;br /&gt;        &amp;lt;td&amp;gt;Decimal&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;ASCII character&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Hexadecimal&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;\n");&lt;br /&gt; int min = 0;&lt;br /&gt; int max = 128;&lt;br /&gt; for (int i = min; i &lt;&gt;// Get ascii character.&lt;br /&gt;     char c = (char)i;&lt;br /&gt;&lt;br /&gt;     // Get display string&lt;br /&gt;     string display = string.Empty;&lt;br /&gt;     if (char.IsWhiteSpace(c))&lt;br /&gt;     {&lt;br /&gt;         display = c.ToString();&lt;br /&gt;         switch (c)&lt;br /&gt;         {&lt;br /&gt;             case '\t':&lt;br /&gt;                 display = "\\t";&lt;br /&gt;                 break;&lt;br /&gt;             case ' ':&lt;br /&gt;                 display = "space";&lt;br /&gt;                 break;&lt;br /&gt;             case '\n':&lt;br /&gt;                 display = "\\n";&lt;br /&gt;                 break;&lt;br /&gt;             case '\r':&lt;br /&gt;                 display = "\\r";&lt;br /&gt;                 break;&lt;br /&gt;             case '\v':&lt;br /&gt;                 display = "\\v";&lt;br /&gt;                 break;&lt;br /&gt;             case '\f':&lt;br /&gt;                 display = "\\f";&lt;br /&gt;                 break;&lt;br /&gt;         }&lt;br /&gt;     }&lt;br /&gt;     else if (char.IsControl(c))&lt;br /&gt;     {&lt;br /&gt;         display = "control";&lt;br /&gt;     }&lt;br /&gt;     else&lt;br /&gt;     {&lt;br /&gt;         display = c.ToString();&lt;br /&gt;     }&lt;br /&gt;     // Write table row&lt;br /&gt;     Response.Write(string.Format("&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;{0}&amp;lt;/td&amp;gt;&lt;br /&gt;    &amp;lt;td&amp;gt;{1}&amp;lt;/td&amp;gt;&amp;lt;td&gt;{0:X2}&amp;lt;/td&amp;gt;&lt;br /&gt;        &amp;lt;/tr&amp;gt;\n", i, display));&lt;br /&gt; }&lt;br /&gt; Response.Write("&amp;lt;/tbody&amp;gt;&amp;lt;/table&amp;gt;");&lt;br /&gt;}&lt;br /&gt;}&lt;/blockquote&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-1837894764433956849?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/1837894764433956849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=1837894764433956849' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/1837894764433956849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/1837894764433956849'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/01/how-to-generate-ascii-table.html' title='How to generate ASCII Table'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-4451518003764653742</id><published>2011-01-11T04:43:00.000-08:00</published><updated>2011-01-11T05:56:10.153-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='extension method'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Open new window with Response.Redirect() in Asp.net- 3rd part</title><content type='html'>In  2nd part of the following &lt;a href="http://aspboss.blogspot.com/2011/01/open-new-window-with-responseredirect.html"&gt;post &lt;/a&gt;I show you how to open a new window in asp.net using &lt;span style="font-weight: bold;"&gt;"ResponseHelper &lt;/span&gt;"class. Now today I want to share another approach with "&lt;span style="font-weight: bold;"&gt;Extension method&lt;/span&gt;".&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Third approach(Extension method)&lt;/span&gt;&lt;br /&gt;&lt;div class="codeSample"&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color:teal;"&gt;public&lt;/span&gt; &lt;span style="color:teal;"&gt;static&lt;/span&gt; &lt;span style="color:teal;"&gt;class&lt;/span&gt; &lt;span style="color:teal;"&gt;ResponseHelper&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;    &lt;span style="color:teal;"&gt;public&lt;/span&gt; &lt;span style="color:teal;"&gt;static&lt;/span&gt; &lt;span style="color:teal;"&gt;void&lt;/span&gt; Redirect(&lt;span style="color:teal;"&gt;this&lt;/span&gt; &lt;span style="color:teal;"&gt;HttpResponse&lt;/span&gt; response,&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;        &lt;span style="color:teal;"&gt;string&lt;/span&gt; url,&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;        &lt;span style="color:teal;"&gt;string&lt;/span&gt; target,&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;        &lt;span style="color:teal;"&gt;string&lt;/span&gt; windowFeatures) {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;        &lt;span style="color:teal;"&gt;if&lt;/span&gt; ((&lt;span style="color:teal;"&gt;String&lt;/span&gt;&lt;span style="color:aqua;"&gt;.&lt;/span&gt;IsNullOrEmpty(target) &lt;span style="color:aqua;"&gt;||&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            target&lt;span style="color:aqua;"&gt;.&lt;/span&gt;Equals(&lt;span style="color:gray;"&gt;"_self"&lt;/span&gt;, &lt;span style="color:teal;"&gt;&lt;br /&gt;                       StringComparison&lt;/span&gt;&lt;span style="color:aqua;"&gt;.&lt;/span&gt;OrdinalIgnoreCase)) &lt;span style="color:aqua;"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            &lt;span style="color:teal;"&gt;             String&lt;/span&gt;&lt;span style="color:aqua;"&gt;.&lt;/span&gt;IsNullOrEmpty(windowFeatures)) {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            response&lt;span style="color:aqua;"&gt;.&lt;/span&gt;Redirect(url);&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;        }&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;        &lt;span style="color:teal;"&gt;else&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            Page page &lt;span style="color:aqua;"&gt;=&lt;/span&gt; (Page)HttpContext&lt;span style="color:aqua;"&gt;.&lt;/span&gt;Current&lt;span style="color:aqua;"&gt;.&lt;/span&gt;Handler;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            &lt;span style="color:teal;"&gt;if&lt;/span&gt; (page &lt;span style="color:aqua;"&gt;==&lt;/span&gt; &lt;span style="color:teal;"&gt;null&lt;/span&gt;) {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                &lt;span style="color:teal;"&gt;throw&lt;/span&gt; &lt;span style="color:teal;"&gt;new&lt;/span&gt; InvalidOperationException(&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                    &lt;span style="color:gray;"&gt;"Cannot redirect to new window outside&lt;br /&gt;                    Page context."&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            }&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            url &lt;span style="color:aqua;"&gt;=&lt;/span&gt; page&lt;span style="color:aqua;"&gt;.&lt;/span&gt;ResolveClientUrl(url);&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            &lt;span style="color:teal;"&gt;string&lt;/span&gt; script;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            &lt;span style="color:teal;"&gt;if&lt;/span&gt; (&lt;span style="color:aqua;"&gt;!&lt;/span&gt;String&lt;span style="color:aqua;"&gt;.&lt;/span&gt;IsNullOrEmpty(windowFeatures)) {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                script &lt;span style="color:aqua;"&gt;=&lt;/span&gt; &lt;span style="color:gray;"&gt;@"window.open(""{0}"", ""{1}"",&lt;br /&gt;                                       ""{2}"");"&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            }&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            &lt;span style="color:teal;"&gt;else&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                script &lt;span style="color:aqua;"&gt;=&lt;/span&gt; &lt;span style="color:gray;"&gt;@"window.open(""{0}"", ""{1}"");"&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            }&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            script &lt;span style="color:aqua;"&gt;=&lt;/span&gt; String&lt;span style="color:aqua;"&gt;.&lt;/span&gt;Format(script, url, target,&lt;br /&gt;                                   windowFeatures);&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            ScriptManager&lt;span style="color:aqua;"&gt;.&lt;/span&gt;RegisterStartupScript(page,&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                &lt;span style="color:teal;"&gt;typeof&lt;/span&gt;(Page),&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                &lt;span style="color:gray;"&gt;"Redirect"&lt;/span&gt;,&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                script,&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                &lt;span style="color:teal;"&gt;true&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;        }&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;    }&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;}&lt;br /&gt;&lt;br /&gt;Note the 'this' keyword in the first parameter.&lt;br /&gt;Now whenever we include the namespace this class&lt;br /&gt;is defined within, we get a nice override on the&lt;br /&gt;actual Response object.&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;a href="http://3.bp.blogspot.com/_QsXPTEkQU0k/TSxaOLgAHCI/AAAAAAAAAEI/Ysjk4jiFgwI/s1600/ResponseRedirect_thumb.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 476px; height: 57px;" src="http://3.bp.blogspot.com/_QsXPTEkQU0k/TSxaOLgAHCI/AAAAAAAAAEI/Ysjk4jiFgwI/s320/ResponseRedirect_thumb.jpg" alt="" id="BLOGGER_PHOTO_ID_5560918839547403298" border="0" /&gt;&lt;/a&gt;Ex:&lt;br /&gt;&lt;/div&gt;Response.Redirect("popup.aspx", "_blank", "menubar=0,width=100,height=100");&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-4451518003764653742?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/4451518003764653742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=4451518003764653742' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4451518003764653742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4451518003764653742'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/01/open-new-window-with-responseredirect_11.html' title='Open new window with Response.Redirect() in Asp.net- 3rd part'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_QsXPTEkQU0k/TSxaOLgAHCI/AAAAAAAAAEI/Ysjk4jiFgwI/s72-c/ResponseRedirect_thumb.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-3337155406616791421</id><published>2011-01-05T20:32:00.000-08:00</published><updated>2011-01-05T22:01:52.978-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Open new window with Response.Redirect() in Asp.net- 2nd part</title><content type='html'>In my previous &lt;a href="http://aspboss.blogspot.com/2010/12/open-new-window-with-responseredirect.html"&gt;post &lt;/a&gt;I show you how to open a new window in asp.net using "aspnetForm.target".&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Second approach&lt;/span&gt;(Using &lt;span style="font-weight: bold;"&gt;ResponseHelper &lt;/span&gt;class)&lt;br /&gt;&lt;br /&gt;&lt;div class="codeSample"&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color:teal;"&gt;public&lt;/span&gt; &lt;span style="color:teal;"&gt;static&lt;/span&gt; &lt;span style="color:teal;"&gt;class&lt;/span&gt; &lt;span style="color:teal;"&gt;ResponseHelper&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;    &lt;span style="color:teal;"&gt;public&lt;/span&gt; &lt;span style="color:teal;"&gt;static&lt;/span&gt; &lt;span style="color:teal;"&gt;void&lt;/span&gt; Redirect(&lt;span style="color:teal;"&gt;string&lt;/span&gt; url, &lt;span style="color:teal;"&gt;string&lt;/span&gt; target,&lt;br /&gt;&lt;span style="color:teal;"&gt;string&lt;/span&gt; windowFeatures) {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;        &lt;span style="color:teal;"&gt;HttpContext&lt;/span&gt; context &lt;span style="color:aqua;"&gt;=&lt;/span&gt; &lt;span style="color:teal;"&gt;HttpContext&lt;/span&gt;&lt;span style="color:aqua;"&gt;.&lt;/span&gt;Current;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;        &lt;span style="color:teal;"&gt;if&lt;/span&gt; ((&lt;span style="color:teal;"&gt;String&lt;/span&gt;&lt;span style="color:aqua;"&gt;.&lt;/span&gt;IsNullOrEmpty(target) &lt;span style="color:aqua;"&gt;||&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            target&lt;span style="color:aqua;"&gt;.&lt;/span&gt;Equals(&lt;span style="color:gray;"&gt;"_self"&lt;/span&gt;, &lt;span style="color:teal;"&gt;&lt;br /&gt;           StringComparison&lt;/span&gt;&lt;span style="color:aqua;"&gt;.&lt;/span&gt;OrdinalIgnoreCase)) &lt;span style="color:aqua;"&gt;&lt;br /&gt;           &amp;amp;&amp;amp;&lt;/span&gt; &lt;span style="color:teal;"&gt;String&lt;/span&gt;&lt;span style="color:aqua;"&gt;.&lt;/span&gt;IsNullOrEmpty(windowFeatures))&lt;br /&gt;       {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;             context&lt;span style="color:aqua;"&gt;.&lt;/span&gt;Response&lt;span style="color:aqua;"&gt;.&lt;/span&gt;Redirect(url);&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;        }&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;        &lt;span style="color:teal;"&gt;else&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            &lt;span style="color:teal;"&gt;Page&lt;/span&gt; page &lt;span style="color:aqua;"&gt;=&lt;/span&gt; (&lt;span style="color:teal;"&gt;Page&lt;/span&gt;)context&lt;span style="color:aqua;"&gt;.&lt;/span&gt;Handler;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            &lt;span style="color:teal;"&gt;if&lt;/span&gt; (page &lt;span style="color:aqua;"&gt;==&lt;/span&gt; &lt;span style="color:teal;"&gt;null&lt;/span&gt;) {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                &lt;span style="color:teal;"&gt;throw&lt;/span&gt; &lt;span style="color:teal;"&gt;new&lt;/span&gt; &lt;span style="color:teal;"&gt;InvalidOperationException&lt;/span&gt;(&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                    &lt;span style="color:gray;"&gt;"Cannot redirect to new window outside&lt;br /&gt;Page context."&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            }&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            url &lt;span style="color:aqua;"&gt;=&lt;/span&gt; page&lt;span style="color:aqua;"&gt;.&lt;/span&gt;ResolveClientUrl(url);&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            &lt;span style="color:teal;"&gt;string&lt;/span&gt; script;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            &lt;span style="color:teal;"&gt;if&lt;/span&gt; (&lt;span style="color:aqua;"&gt;!&lt;/span&gt;&lt;span style="color:teal;"&gt;String&lt;/span&gt;&lt;span style="color:aqua;"&gt;.&lt;/span&gt;IsNullOrEmpty(windowFeatures)) {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                script &lt;span style="color:aqua;"&gt;=&lt;/span&gt; &lt;span style="color:gray;"&gt;@"window.open(""{0}"", ""{1}"",&lt;br /&gt;""{2}"");"&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            }&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            &lt;span style="color:teal;"&gt;else&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                script &lt;span style="color:aqua;"&gt;=&lt;/span&gt; &lt;span style="color:gray;"&gt;@"window.open(""{0}"", ""{1}"");"&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            }&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            script &lt;span style="color:aqua;"&gt;=&lt;/span&gt; &lt;span style="color:teal;"&gt;String&lt;/span&gt;&lt;span style="color:aqua;"&gt;.&lt;/span&gt;Format(script, url, target,&lt;br /&gt;                   windowFeatures);&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            &lt;span style="color:teal;"&gt;ScriptManager&lt;/span&gt;&lt;span style="color:aqua;"&gt;.&lt;/span&gt;RegisterStartupScript(page,&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                &lt;span style="color:teal;"&gt;typeof&lt;/span&gt;(&lt;span style="color:teal;"&gt;Page&lt;/span&gt;),&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                &lt;span style="color:gray;"&gt;"Redirect"&lt;/span&gt;,&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                script,&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                &lt;span style="color:teal;"&gt;true&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;        }&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;    }&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Now you can just call ResponseHelper.Redirect, first parameter is desired "&lt;span style="font-weight: bold;"&gt;url&lt;/span&gt;", second parameter is for specify a target to be "&lt;span style="font-weight: bold;"&gt;_self&lt;/span&gt;" or "&lt;span style="font-weight: bold;"&gt;_blank&lt;/span&gt;" and third parameter is "&lt;span style="font-weight: bold;"&gt;windowFeatures&lt;/span&gt;" by which  you can specify whether the new window  should have a menu bar, and what its width and height are.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Disclaimers:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note: If you use it outside the context of a Page request, you can't redirect to a new window. The reason is the need to call the &lt;span style="font-weight: bold;"&gt;ResolveClientUrl &lt;/span&gt;method on Page, which I can't do if there is no Page. I could have just built my own version of that method, but it's more involved than you might think to do it right. So if you need to use this from an &lt;span style="font-weight: bold;"&gt;HttpHandler &lt;/span&gt;other than a Page, you are on your own.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Note: Beware of popup blockers.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note: Obviously when you are redirecting to a new window, the current window will still be hanging around. Normally redirects abort the current request -- no further processing occurs. But for these redirects, processing continues, since we still have to serve the response for the current window (which also happens to contain the script to open the new window, so it is important that it completes).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-3337155406616791421?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/3337155406616791421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=3337155406616791421' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/3337155406616791421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/3337155406616791421'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2011/01/open-new-window-with-responseredirect.html' title='Open new window with Response.Redirect() in Asp.net- 2nd part'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-418053072304828630</id><published>2010-12-28T04:55:00.000-08:00</published><updated>2010-12-28T04:55:14.600-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='new window'/><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='response.redirect'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Open new window with Response.Redirect()  in Asp.net</title><content type='html'>Today I want share with you a very interesting tips using Response.Redirect(). In asp.net there are various ways to move from one page to another. Mostly used.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Response.Redirect()&lt;/li&gt;&lt;li&gt;Server.Transfer()&lt;/li&gt;&lt;/ol&gt;&amp;nbsp;But unfortunately you cant open a new window with those two methods. Which is possible with anchor link like &amp;lt;a href="#" target="_blank" &amp;gt;. When goggling I find that most of the answer is it is not possible or to make it possible you would add JavaScript method to using it. But I don't want this, at last I found two approaches. Now I want to share with these two approaches with asp.net&amp;nbsp; Response.Redirect() and&amp;nbsp; Server.Transfer().&lt;br /&gt;&lt;br /&gt;&lt;b&gt;First approach(easiest way):&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Just use the OnClientClick event of the button.&amp;nbsp; &lt;br /&gt;&amp;lt;asp:Button ID="btnHome" runat="Server" CssClass="button" Text="Go home"&lt;br /&gt;OnClick="btnHome_Click" &lt;b&gt;OnClientClick&lt;/b&gt;="aspnetForm.target ='_blank';"/&amp;gt;&lt;br /&gt;protected void btnHome_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Redirect("Home.aspx");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;If you want to access the form inside the &lt;b&gt;Master page&lt;/b&gt; to&lt;b&gt; Child page&lt;/b&gt; level&lt;br /&gt;&lt;br /&gt;Button1.OnClientClick=string.Format("{0}.target='_blank';",((HtmlForm)Page.Master.FindControl("form1")).ClientID);&lt;br /&gt;&lt;br /&gt;This code will find the controls collection and find your form and allow you to get access to the client id so you can be sure you have proper naming of it for the JavaScript to function correctly. Make sure you replace "&lt;b&gt;form1&lt;/b&gt;" with whatever you have your parent &lt;b&gt;form id="name"&lt;/b&gt; set to inside your &lt;b&gt;Master’s page&lt;/b&gt; markup.&lt;br /&gt;&lt;br /&gt;For &lt;b&gt;multiple buttons&lt;/b&gt; on a &lt;b&gt;single page&lt;/b&gt; and only want a  &lt;b&gt;specific button&lt;/b&gt; to launch into a new window.&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Button ID="btnHomePage" runat="Server" CssClass="button" Text="Your home"&lt;br /&gt;OnClick="btnHomePage_Click" &lt;b&gt;OnClientClick&lt;/b&gt;="aspnetForm.target ='_self';"/&amp;gt;&lt;br /&gt;&lt;br /&gt;protected void btnHomePage_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; //Do normal code for postback&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;For more details.&lt;a href="file:///C:/Documents%20and%20Settings/Ahsan/Desktop/blog%20post/open%20new%20page%20response%20redirect%20asp.net/C%23%20ASP.NET%20Response.Redirect%20Open%20Into%20New%20Window%20%C2%AB%20dotNetChris%20@%20Marisic.Net.htm"&gt;visits&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In next post I will share with you another approach to open new window using response.redirect() insha Allah.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-418053072304828630?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/418053072304828630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=418053072304828630' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/418053072304828630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/418053072304828630'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/12/open-new-window-with-responseredirect.html' title='Open new window with Response.Redirect()  in Asp.net'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-5865441631388889951</id><published>2010-12-27T22:10:00.000-08:00</published><updated>2010-12-27T22:10:19.780-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='aiub'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft'/><category scheme='http://www.blogger.com/atom/ns#' term='razor'/><title type='text'>Presentation @ Microsoft Talkz in AIUB</title><content type='html'>Yesterday I had joined a nice seminar at &lt;b&gt;AIUB&lt;/b&gt;(American International University Bangladesh) arranged by Microsoft which is titled by "&lt;b&gt;Microsoft Talkz&lt;/b&gt;". I amazed to see the interest of students at that seminar. Huge crowd in&amp;nbsp; the auditorium some students were waiting outside the hall for entrance but no single space is available for accommodate them.Really a new experience for me. I feel lucky to get the opportunity to participate that event.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_QsXPTEkQU0k/TRl9l7R5SKI/AAAAAAAAAD0/4viesWbrZwc/s1600/Talkz+%2540+AIUB+Leaflet.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/_QsXPTEkQU0k/TRl9l7R5SKI/AAAAAAAAAD0/4viesWbrZwc/s320/Talkz+%2540+AIUB+Leaflet.jpg" width="226" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Microsoft student partner(MSP) did a very good job to organize the whole event very nicely. There were also some expert technical guys discuss with new Microsoft technologies.&lt;br /&gt;&lt;br /&gt;Razor new view engine in asp.net was my presentation topic. One can download it from here: &lt;a href="http://www.slideshare.net/ahsanmm/razor-new-view-engine-aspnet%20"&gt;Razor view engine in asp.net &lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-5865441631388889951?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/5865441631388889951/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=5865441631388889951' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/5865441631388889951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/5865441631388889951'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/12/presentation-microsoft-talkz-in-aiub.html' title='Presentation @ Microsoft Talkz in AIUB'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_QsXPTEkQU0k/TRl9l7R5SKI/AAAAAAAAAD0/4viesWbrZwc/s72-c/Talkz+%2540+AIUB+Leaflet.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-3004239005625210354</id><published>2010-12-05T21:25:00.000-08:00</published><updated>2010-12-05T21:29:18.729-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IEEE'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='spac'/><category scheme='http://www.blogger.com/atom/ns#' term='kuet'/><title type='text'>Presentation@Kuet S-PAC Programm</title><content type='html'>Very recently IEEE KUET branch organized a awesome program &lt;b&gt;Students Professional Awareness Conference(S-PAC ).&amp;nbsp;&lt;/b&gt; IEEE Student Branch KUET link( www.kuet.ac.bd/ieee ) introducing First  S-PAC on Bangladesh  Dated 3,4,5 December,2010  on KUET campus.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Students Professional Awareness Conference(S-PAC ) covers &lt;/b&gt;Workshop,  Seminar, and Panel Discussions &amp;amp; Various Contests on the above  stated topics comprising national &amp;amp; international guests.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_QsXPTEkQU0k/TPxsqxGJNVI/AAAAAAAAADs/mEbfmTPjfcQ/s1600/spac.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="233" src="http://4.bp.blogspot.com/_QsXPTEkQU0k/TPxsqxGJNVI/AAAAAAAAADs/mEbfmTPjfcQ/s320/spac.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;It's really great initiative by KUET IEEE branch specially a big thanks to Shihab(who is chair for this event) and his team and also the KUET authority. I am also feeling lucky got an opportunity to attend this event as a speaker. My topic is "&lt;b&gt;How to improve security and performance in ASP.net&lt;/b&gt;".&lt;br /&gt;One can download it from here: &lt;a href="http://www.slideshare.net/ahsanmm/ieee-kuet-spac-presentation"&gt;How to improve security and performance in ASP.net&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Its really new experience for me. Huge no of audience(almost 3000) were attends this event. I'm&amp;nbsp; amazed to got huge response from audience after presentation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-3004239005625210354?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/3004239005625210354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=3004239005625210354' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/3004239005625210354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/3004239005625210354'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/12/presentationkuet-s-pac-programm.html' title='Presentation@Kuet S-PAC Programm'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_QsXPTEkQU0k/TPxsqxGJNVI/AAAAAAAAADs/mEbfmTPjfcQ/s72-c/spac.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-4571552983667381878</id><published>2010-11-07T04:01:00.000-08:00</published><updated>2010-11-27T11:04:26.815-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='map'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='google map'/><title type='text'>How to add Google Map in asp.net</title><content type='html'>Today I have added Google Map my asp.net application successfully !! Don't worry it's not a big deal. Very easy and you will find a lots of article, tutorial about it. For using google map you just need a google account for google map api and basic JavaScript knowledge. For non commercial use google map is free.&lt;br /&gt;&lt;br /&gt;In aspx page add &lt;strong&gt;Google Map API KEY&lt;/strong&gt; in header part of html....like this&lt;br /&gt;&lt;blockquote&gt;&lt;strong&gt;&amp;lt;head &amp;gt;&lt;/strong&gt;&lt;br /&gt;&amp;lt;script src="http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp; &lt;strong&gt;key=ABQIAAAAclK0B2lXQwV5lPy1rLiTFBSN1aiKepvDswXjKa4j2DDWdYvOjhQMO1tywqS8ObgP5dtO70AyyArhzA&lt;/strong&gt;"&lt;br /&gt;type="text/javascript"&amp;gt; &amp;lt;/script &amp;gt;&lt;br /&gt;&lt;strong&gt;&amp;lt;/head&amp;gt;&lt;/strong&gt;&lt;/blockquote&gt;You can get your own google map api key from this link. You can place your url&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&amp;nbsp;in " &lt;strong&gt;My web site url &lt;/strong&gt;" box. One can also get api key for http://localhost. See the below pictures...&lt;br /&gt;&lt;br /&gt;&lt;a href="http://code.google.com/apis/maps/signup.html"&gt;http://code.google.com/apis/maps/signup.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.dotnetboss.com/2010/10/20/how-to-add-google-map-in-asp-net/gmap_api/" rel="attachment wp-att-107"&gt;&lt;img alt="" class="alignnone size-medium wp-image-107" height="220" src="http://www.dotnetboss.com/wp-content/uploads/2010/10/gmap_api-300x160.jpg" title="gmap_api" width="400" /&gt;&lt;/a&gt;0&lt;br /&gt;&lt;br /&gt;In html body take a &amp;lt;div&amp;gt; with a height and width. It is used for loading google map in your application. Like this..&lt;br /&gt;&lt;blockquote&gt;&lt;strong&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;/strong&gt;&lt;br /&gt;&amp;lt;div&amp;gt;&lt;br /&gt;&amp;lt;div id="Gmap" style="width: 700px; height: 700px"&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;strong&gt;&amp;lt;/form&amp;gt;&lt;/strong&gt;&lt;/blockquote&gt;Then place this javascript code before close the &amp;lt;/head&amp;gt; tag:&lt;br /&gt;&lt;blockquote&gt;&lt;strong&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;/strong&gt;&lt;br /&gt;var map = null;&lt;br /&gt;var geocoder = null;&lt;br /&gt;&lt;br /&gt;function loadGmap() {&lt;br /&gt;if (GBrowserIsCompatible()) {&lt;br /&gt;var point;&lt;br /&gt;var map = new GMap2(document.getElementById("Gmap"));&lt;br /&gt;&lt;br /&gt;map.addControl(new GOverviewMapControl());&lt;br /&gt;map.enableDoubleClickZoom();&lt;br /&gt;map.enableScrollWheelZoom();&lt;br /&gt;map.addControl(new GMapTypeControl());&lt;br /&gt;map.addControl(new GSmallMapControl());&lt;br /&gt;var address = gmapAddress;&lt;br /&gt;point = new GLatLng(gmapLat,gmapLng);//new GLatLng(22.592057, 88.421815);&lt;br /&gt;&lt;br /&gt;var marker = new GMarker(point);&lt;br /&gt;map.setCenter(point, 17);&lt;br /&gt;map.addOverlay(marker);&lt;br /&gt;map.setMapType(G_HYBRID_MAP);&lt;br /&gt;GEvent.addListener(marker, "mouseover", function() { marker.openInfoWindowHtml(address); });&lt;br /&gt;marker.openInfoWindowHtml(address);&lt;br /&gt;map.setCenter(point, 17);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//]]&amp;gt;&lt;br /&gt;&lt;strong&gt;&amp;lt;/script &amp;gt;&lt;/strong&gt;&lt;/blockquote&gt;In this javascript function use several functions for getting some google map features ....&lt;br /&gt;&lt;blockquote&gt;&lt;strong&gt;GBrowserIsCompatible()&lt;/strong&gt;-- its a function which will return true only if your browser is compatible with google map.&lt;br /&gt;&lt;strong&gt;GMap2&lt;/strong&gt; -- function takes the control to load and returns a map object to the reference div.&lt;br /&gt;&lt;strong&gt;addControl()&lt;/strong&gt; --add a new control to the map&lt;br /&gt;&lt;strong&gt;GOverviewMapControl()&lt;/strong&gt; -- it will be shown an overview of the map just in the right hand bottom corner to the map.&lt;br /&gt;&lt;strong&gt;GSmallMapControl()&lt;/strong&gt; -- add a zoom control to the map&lt;br /&gt;&lt;strong&gt;GMapTypeControl() &lt;/strong&gt;-- add new map type control in gmap. There are mainly 3 types of map, one is Normal, Satellite and Hybrid.&lt;br /&gt;&lt;strong&gt;enableDoubleClickZoom&lt;/strong&gt; -- Doubleclick zoom is available to gmap.&lt;br /&gt;&lt;strong&gt;enableScrollWheelZoom&lt;/strong&gt; -- Scrollwheel for mouse is available to gmap.&lt;/blockquote&gt;Add a google map load function in &lt;strong&gt;body&lt;/strong&gt; tag..&lt;br /&gt;&lt;br /&gt;&amp;lt; body onload="loadGmap();" onunload="GUnload()" style=" background-color:Transparent" &amp;gt;&lt;br /&gt;&lt;br /&gt;You will get more from these links.. very useful reference for developers..&lt;br /&gt;&lt;a href="http://www.codeproject.com/KB/scripting/Use_of_Google_Map.aspx"&gt;http://www.codeproject.com/KB/scripting/Use_of_Google_Map.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/KB/web-image/Google_map.aspx"&gt;http://www.codeproject.com/KB/web-image/Google_map.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-4571552983667381878?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/4571552983667381878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=4571552983667381878' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4571552983667381878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4571552983667381878'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/11/how-to-add-google-map-in-aspnet.html' title='How to add Google Map in asp.net'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-4599343572369699514</id><published>2010-09-27T03:55:00.000-07:00</published><updated>2010-11-27T11:05:45.490-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='view engine'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='razor'/><title type='text'>“Razor” – a new view engine for ASP.NET</title><content type='html'>“&lt;b&gt;Razor&lt;/b&gt;” – a new view engine for ASP.NET developed by Microsoft.&lt;br /&gt;&lt;br /&gt;The new view-engine option have been working on is optimized around HTML generation using a code-focused templating approach. The codename for this new view engine is “&lt;b&gt;Razor&lt;/b&gt;”,&lt;br /&gt;&lt;br /&gt;Microsoft had a number of design goals when building and testing Razor, attempting to create a compact, expressive, and fluid ASP.NET view engine. &lt;br /&gt;&lt;br /&gt;In addition, the Redmond company worked to ensure that customers would be able to leverage Razor immediately, by using their existing language and HTML skills. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Design Goals for "Razor"&lt;/b&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1.Compact, Expressive, and Fluid:&lt;/b&gt; Razor minimizes the number of characters and keystrokes required in a file, and enables a fast, fluid coding workflow. Unlike most template syntaxes, you do not need to interrupt your coding to explicitly denote server blocks within your HTML. The parser is smart enough to infer this from your code. This enables a really compact and expressive syntax which is clean, fast and fun to type.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2.Easy to Learn:&lt;/b&gt; Razor is easy to learn and enables you to quickly be productive with a minimum of concepts. You use all your existing language and HTML skills.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;3.Is not a new language:&lt;/b&gt; We consciously chose not to create a new imperative language with Razor. Instead we wanted to enable developers to use their existing C#/VB (or other) language skills with Razor, and deliver a template markup syntax that enables an awesome HTML construction workflow with your language of choice.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;4.Works with any Text Editor:&lt;/b&gt; Razor doesn’t require a specific tool and enables you to be productive in any plain old text editor (notepad works great).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;5.Has great Intellisense:&lt;/b&gt; While Razor has been designed to not require a specific tool or code editor, it will have awesome statement completion support within Visual Studio. We’ll be updating Visual Studio 2010 and Visual Web Developer 2010 to have full editor intellisense for it.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;6. Unit Testable:&lt;/b&gt; The new view engine implementation will support the ability to unit test views (without requiring a controller or web-server, and can be hosted in any unit test project – no special app-domain required).&lt;br /&gt;&lt;br /&gt;For more details please visits&lt;br /&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2010/07/02/introducing-razor.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2010/07/02/introducing-razor.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.asp.net/webmatrix/tutorials/2-introduction-to-asp-net-web-programming-using-the-razor-syntax"&gt;http://www.asp.net/webmatrix/tutorials/2-introduction-to-asp-net-web-programming-using-the-razor-syntax&lt;/a&gt;&lt;br /&gt;&lt;a href="http://thegsharp.wordpress.com/2010/07/07/using-razor-from-a-console-application/"&gt;http://thegsharp.wordpress.com/2010/07/07/using-razor-from-a-console-application/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://blog.andrewnurse.net/2010/07/22/UsingTheRazorParserOutsideOfASPNet.aspx"&gt;http://blog.andrewnurse.net/2010/07/22/UsingTheRazorParserOutsideOfASPNet.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-4599343572369699514?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/4599343572369699514/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=4599343572369699514' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4599343572369699514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4599343572369699514'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/09/razor-new-view-engine-for-aspnet.html' title='“Razor” – a new view engine for ASP.NET'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-8009671912655301108</id><published>2010-09-26T02:40:00.000-07:00</published><updated>2010-11-27T11:05:28.953-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='user control'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><title type='text'>Access Properties of a UserControl from other UserControl in ASP.Net Page</title><content type='html'>Few days ago I have posted an article "&lt;a href="http://aspboss.blogspot.com/2010/09/how-to-access-one-usercontrol-from.html"&gt;How To Access One UserControl from Another UserControl Using ASP.NET&lt;/a&gt;". When I try to find out solution for this I have got some nice articles about this issue. Rami vermula shows how to access properties of UserControl from another UserControl In asp.net.&lt;br /&gt;&lt;br /&gt;This is really very helpful to solved my problem and immedidately me implement it in my solution.Now share for you .....&lt;br /&gt;&lt;br /&gt;&lt;b&gt;WebUserControl1.ascx&lt;/b&gt;&lt;br /&gt;===================&lt;br /&gt;This is the first UserControl on the page, from which we access the other UserControl (&lt;b&gt;WebUserControl2.ascx&lt;/b&gt;) Properties.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code&lt;/b&gt;&lt;br /&gt;======&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&amp;lt;%@ Control Language="C#" ClassName="WebUserControl1" %&amp;gt;&lt;br /&gt;&amp;lt;!-- Add a Reference to WebUserControl2 using the @Reference Directive as shown --&amp;gt;&lt;br /&gt;&amp;lt;%@ Reference VirtualPath="~/WebUserControl2.ascx"%&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;script runat="server"&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;// Create a Property to access the &lt;b&gt;txtTransfer &lt;/b&gt;of WebUserControl1&lt;br /&gt;public string WebUserControl1_txtTransfer&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;return txtTransfer.Text;&lt;br /&gt;}&lt;br /&gt;set&lt;br /&gt;{&lt;br /&gt;txtTransfer.Text = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Handle the btnSubmit Click Event&lt;br /&gt;protected void btnSubmit_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;// Access the WebUserControl2 control from the page.&lt;br /&gt;WebUserControl2 oWUCtrl2 = (WebUserControl2)Page.FindControl("uc2");&lt;br /&gt;&lt;br /&gt;// Set the TextBox Property of WebUserControl2 by accessing the public property of WebUserControl2&lt;br /&gt;if(oWUCtrl2 != null)&lt;br /&gt;oWUCtrl2.WebUserControl2_txtBalance = WebUserControl1_txtTransfer;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;/script&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;asp:Panel&lt;/b&gt; ID="Panel1" runat="server" BorderColor="#000066" BorderStyle="Solid" Width="400px"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Label ID="Label1" runat="server" Font-Italic="True" Font-Size="Large"&lt;br /&gt;Text="WebUserControl1" ForeColor="#000066"&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;;&lt;br /&gt;&lt;br /&gt;Enter a Value To transfer to WebUserControl2 -&lt;br /&gt;&amp;lt;asp:TextBox ID="&lt;b&gt;txtTransfer&lt;/b&gt;" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Button ID="btnSubmit" runat="server" Text="Take the Value to WebUserControl2" OnClick="btnSubmit_Click" /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;b&gt;&amp;lt;/asp:Panel&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;WebUserControl2.ascx&lt;/b&gt;&lt;br /&gt;====================&lt;br /&gt;This is the second UserControl on the page, we get data from to this UserControl from other UserControl (&lt;b&gt;WebUserControl1.ascx&lt;/b&gt;) .&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code&lt;/b&gt;&lt;br /&gt;======&lt;br /&gt;&amp;lt;%@ Control Language="C#" ClassName="WebUserControl2" %&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;script runat="server"&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;/* Create a Property to set, get the value of the &lt;b&gt;txtBalance&lt;/b&gt;, which is used in the other&lt;br /&gt;UserControl i.e., WebUserControl1 to set the value.*/&lt;br /&gt;public string WebUserControl2_txtBalance&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;return txtBalance.Text;&lt;br /&gt;}&lt;br /&gt;set&lt;br /&gt;{&lt;br /&gt;txtBalance.Text = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;/script&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;asp:Panel&lt;/b&gt; ID="Panel1" runat="server" BorderColor="Red" BorderStyle="Solid" Width="400px"&amp;gt;&lt;br /&gt;&amp;lt;asp:Label ID="Label1" runat="server" Text="WebUserControl2" Font-Italic="True"&lt;br /&gt;Font-Size="Large" ForeColor="Red"&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;Display the value got from WebUserControl1 -&lt;br /&gt;&amp;lt;asp:TextBox ID="&lt;b&gt;txtBalance&lt;/b&gt;" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;;&lt;br /&gt;&lt;b&gt;&amp;lt;/asp:Panel&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;DefaltPage.aspx&lt;/b&gt;&lt;br /&gt;=================&lt;br /&gt;Now we have used those two UserControls &lt;b&gt;WebUserControl1 &lt;/b&gt;and &lt;b&gt;WebUserControl2 &lt;/b&gt;in this page.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code&lt;/b&gt;&lt;br /&gt;=======&lt;br /&gt;&amp;lt;%@ Page Language="C#"%&amp;gt;&lt;br /&gt;&amp;lt;!-- Add References to WebUserControl2, WebUserControl1 using the @Reference Directive as shown --&amp;gt;&lt;br /&gt;&amp;lt;%@ Register Src="~/WebUserControl1.ascx" TagPrefix="UserControl" TagName="uc1" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register Src="~/WebUserControl2.ascx" TagPrefix="UserControl" TagName="uc2" %&amp;gt;&lt;br /&gt;&lt;br /&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;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;script runat="server"&amp;gt;&lt;/b&gt;&lt;br /&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;/* Here the UserControls are loaded dynamically, using Page.Loadcontrol() method&lt;br /&gt;Give the ID's of the Dynamic UserControls, by which we can access them on the page. */&lt;br /&gt;WebUserControl1 oWUCtrl1 = (WebUserControl1)Page.LoadControl("~/WebUserControl1.ascx");&lt;br /&gt;WebUserControl2 oWUCtrl2 = (WebUserControl2)Page.LoadControl("~/WebUserControl2.ascx");&lt;br /&gt;oWUCtrl1.ID = "uc1";&lt;br /&gt;oWUCtrl2.ID = "uc2";&lt;br /&gt;&lt;br /&gt;// Create a normal Html Tag control to get the breaks between dynamic Usercontrols&lt;br /&gt;HtmlGenericControl hgc = new HtmlGenericControl();&lt;br /&gt;hgc.InnerHtml = "&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;";&lt;br /&gt;&lt;br /&gt;// Add the created dynamic control to the page&lt;br /&gt;Page.Form.Controls.Add(oWUCtrl1);&lt;br /&gt;Page.Form.Controls.Add(hgc);&lt;br /&gt;Page.Form.Controls.Add(oWUCtrl2);&lt;br /&gt;}&lt;br /&gt;&lt;b&gt;&lt;b&gt;&amp;lt;/script&amp;gt;&lt;/b&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;html&lt;/b&gt; xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;br /&gt;&amp;lt;head id="Head1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;div&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&lt;b&gt;&amp;lt;/html&amp;gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-8009671912655301108?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/8009671912655301108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=8009671912655301108' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8009671912655301108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8009671912655301108'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/09/access-properties-of-usercontrol-from.html' title='Access Properties of a UserControl from other UserControl in ASP.Net Page'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-2946330617585970773</id><published>2010-09-26T00:28:00.000-07:00</published><updated>2010-11-27T11:05:14.606-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><title type='text'>Automatic URL re-basing in the HtmlHead control</title><content type='html'>If you're using &lt;b&gt;Master Pages in ASP.NET&lt;/b&gt; and trying to &lt;b&gt;resolve &amp;lt;script&amp;gt;&lt;/b&gt; or &amp;lt;style&amp;gt; references in the page head, you may have run into this this show-stopper. If so, here's why it's happening, and here's an easy way to fix it.&lt;br /&gt;&lt;br /&gt;If you've worked with &lt;b&gt;ASP.NET Master Pages&lt;/b&gt;, you've no doubt taken advantage of automatic &lt;b&gt;URL re-basing &lt;/b&gt;within the &lt;b&gt;HtmlHead control&lt;/b&gt;. This bit of ASP.NET magic helps assure that a &lt;b&gt;content page has access to the correct resources&lt;/b&gt;:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;head id="head1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;My Page&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;link href="css/common.css" rel="stylesheet" type="text/css" /&amp;gt;&lt;br /&gt;&amp;lt;/head &amp;gt;&lt;/blockquote&gt;&lt;br /&gt;When you add the &lt;b&gt;runat="server"&lt;/b&gt; attribute to the tag,&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&amp;nbsp;the runtime treats it as an &lt;b&gt;HtmlHead control&lt;/b&gt;. The HtmlHead control has the ability to parse child &lt;b&gt;&amp;lt;link&amp;gt;&lt;/b&gt; controls contained withing it, so that when a content page is rendered, the URL in the &lt;b&gt;href &lt;/b&gt;attribute points to the correct file. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;The Problem&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now, let's say you also want to &lt;b&gt;place a reference to an external JavaScript file&lt;/b&gt; in the &lt;b&gt;&amp;lt;head&amp;gt;&lt;/b&gt;, so you do this:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;head id="head1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;My Page&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;link href="css/common.css" rel="stylesheet" type="text/css" /&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript" src="javascript/leesUtils.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;Naturally, you might assume that URL re-basing will help you out here, but you'd be mistaken. &lt;b&gt;Unfortunately, the runtime doesn't automatically re-base URLs in &lt;/b&gt;&lt;b&gt;&amp;lt;script&amp;gt;&lt;/b&gt; or &lt;b&gt;&amp;lt;style&amp;gt;&lt;/b&gt; tags, so any page not in the same directory as your master page won't find your script or CSS files. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;The Solution&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;So, if &lt;b&gt;HtmlHead &lt;/b&gt;won't resolve your URL automatically, you'll wrestle that sucker manually by using the &lt;b&gt;Control.ResolveUrl&lt;/b&gt; method. &lt;br /&gt;&lt;blockquote&gt;ResolveUrl can take a URL that is relative to the root of the application and correct it for the current request path. &lt;/blockquote&gt;&lt;br /&gt;&lt;b&gt;You'd then use a code block to substitute the correct URL at runtime:&lt;/b&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;head id="head1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;My Page&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;link href="css/common.css" rel="stylesheet" type="text/css" /&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript" src="&amp;lt;%# ResolveUrl("~/javascript/leesUtils.js") %&amp;gt;"&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head &amp;gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-2946330617585970773?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.dotnetboss.com' title='Automatic URL re-basing in the HtmlHead control'/><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/2946330617585970773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=2946330617585970773' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2946330617585970773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2946330617585970773'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/09/automatic-url-re-basing-in-htmlhead.html' title='Automatic URL re-basing in the HtmlHead control'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-7322592788885613256</id><published>2010-09-23T05:02:00.000-07:00</published><updated>2010-11-27T11:04:59.012-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>The Controls collection cannot be modified because the control contains code blocks (i.e. &lt;% ... %&gt;).</title><content type='html'>&lt;div class="MsoNormal" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; line-height: normal; margin: 0in 0in 10pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;"&gt;&lt;span style="color: red; font-family: &amp;quot;Verdana&amp;quot;, sans-serif; font-size: 18pt;"&gt;Server Error in 'ASP.Net' Application. &lt;/span&gt;&lt;/div&gt;&lt;div align="center" class="MsoNormal" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; line-height: normal; margin: 0in 0in 10pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in; text-align: center;"&gt;&lt;span style="color: red; font-family: &amp;quot;Verdana&amp;quot;, sans-serif; font-size: 18pt;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;hr noshade="noshade" size="1" width="100%" /&gt;&lt;div class="MsoNormal" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; line-height: normal; margin: 0in 0in 10pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;"&gt;&lt;i&gt;&lt;span style="color: maroon; font-family: &amp;quot;Verdana&amp;quot;, sans-serif; font-size: 14pt;"&gt;The Controls collection cannot be modified because the control contains code blocks (i.e. &amp;lt;% ... %&amp;gt;).&lt;/span&gt;&lt;/i&gt;&lt;span style="color: maroon; font-family: &amp;quot;Verdana&amp;quot;, sans-serif; font-size: 14pt;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;b&gt;&lt;span style="color: black; font-family: &amp;quot;Verdana&amp;quot;, sans-serif; font-size: 8.5pt; line-height: 115%;"&gt;Description: &lt;/span&gt;&lt;/b&gt;&lt;span style="color: black; font-family: Arial, sans-serif; font-size: 8.5pt; line-height: 115%;"&gt;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. &lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: black; font-family: &amp;quot;Verdana&amp;quot;, sans-serif; font-size: 8.5pt; line-height: 115%;"&gt;Exception Details: &lt;/span&gt;&lt;/b&gt;&lt;span style="color: black; font-family: Arial, sans-serif; font-size: 8.5pt; line-height: 115%;"&gt;System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. &amp;lt;% ... %&amp;gt;).&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial, sans-serif; font-size: 8.5pt; line-height: 100%;"&gt;____________________________________________________________________________&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Recently I have faced this type of error on browse my application after add JavaScript method. This is the first time I have faced this issue. Newly written method is double checked by me but nothing found. Then try to find in asp.net forum now this time got the solution :).&lt;br /&gt;&lt;br /&gt;Very silly mistake......now I have share with you.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Problem&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;if we are adding some server side controls to the head section of aspx page, we used the following JavaScript which had the &amp;lt;% %&amp;gt; tags to get the ClientID of a server side control.&lt;br /&gt;&lt;br /&gt;&amp;lt;head runat="server"&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Untitled Page&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type = "text/javascript"&amp;gt;&lt;br /&gt;function GetAgentName()&lt;br /&gt;{&lt;br /&gt;var lblAgentName = document.getElementById("&amp;lt;%=lblAgent.ClientID%&amp;gt;");&lt;br /&gt;alert(lblAgentName.value);&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&lt;br /&gt;Therefore we have used ASP.Net Server tags to get the ClientID we need to use &amp;lt;% %&amp;gt; tags but unfortunately you cannot add controls dynamically at head section of a page.&lt;br /&gt;It causes the same error.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1.&lt;/b&gt;Remove the part which has server tags and place it somewhere else if you want to add dynamic controls from code behind. You can &lt;b&gt;add this javascript code to the html body&lt;/b&gt; it will solve your problem.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2.&lt;/b&gt; You can use &amp;lt;%# instead of &amp;lt;%=&lt;br /&gt;&lt;br /&gt;&lt;b&gt;This changes the code block from a Response.Write code block to a databinding expression. Since &amp;lt;%# ... % &amp;gt; databinding expressions aren't code blocks, the CLR won't complain.&lt;/b&gt; If you use Master page then you'd add the following:&lt;br /&gt;&lt;br /&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;Page.Header.DataBind(); &lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-7322592788885613256?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/7322592788885613256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=7322592788885613256' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7322592788885613256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7322592788885613256'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/09/controls-collection-cannot-be-modified.html' title='The Controls collection cannot be modified because the control contains code blocks (i.e. &lt;% ... %&gt;).'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-8913162662976655314</id><published>2010-09-22T05:26:00.000-07:00</published><updated>2010-09-22T05:26:26.048-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DateTime'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Format'/><title type='text'>DateTime Custom Picture Formatting</title><content type='html'>&lt;h3&gt;Using Picture Formats for Custom Formatting&lt;/h3&gt;The standard format specifiers are useful in most cases whilst still  maintaining the correct style of date and time for the user's location.  On some occasions however, it is necessary to have complete control over  the positioning and styling of each element of date and time  information.&lt;br /&gt;&lt;br /&gt;For this, &lt;em&gt;picture formats&lt;/em&gt; must be used. These allow an exact format to be created using any combination of elements from a DateTime.&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;pre&gt;DateTime theDate = DateTime.Parse("3 Jan 2007 21:25:30");&lt;br /&gt;string result;&lt;br /&gt;&lt;br /&gt;result = theDate.ToString("d-MM-yy");&lt;i&gt;//result ="3-01-07"&lt;/i&gt;&lt;br /&gt;result = theDate.ToString("HH:mm");&lt;i&gt;//result ="21:25"&lt;/i&gt;&lt;br /&gt;result = theDate.ToString("h:mm tt");&lt;i&gt;//result ="9:25 PM"&lt;/i&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3&gt;Available Picture Formatting Codes&lt;/h3&gt;The above example shows several formats and the results. The full list of available formatting codes is as follows:&lt;br /&gt;&lt;table class="reftable"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;Specifier&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;th&gt;Examples&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;y&lt;/td&gt;&lt;td&gt;One-digit year. If the year cannot be specified in one digit then two digits are used automatically.&lt;/td&gt;&lt;td&gt;"7"&lt;br /&gt;"95"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;yy&lt;/td&gt;&lt;td&gt;Two-digit year with leading zeroes if required.&lt;/td&gt;&lt;td&gt;"07"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;yyyy&lt;/td&gt;&lt;td&gt;Full four-digit year.&lt;/td&gt;&lt;td&gt;"2007"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;g or gg&lt;/td&gt;&lt;td&gt;Indicator of &lt;a href="http://en.wikipedia.org/wiki/Anno_domini" target="_blank"&gt;Anno Domini&lt;/a&gt; (AD).&lt;/td&gt;&lt;td&gt;"A.D."&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;M&lt;/td&gt;&lt;td&gt;One-digit month number. If the month cannot be specified in one digit then two digits are used automatically.&lt;/td&gt;&lt;td&gt;"1"&lt;br /&gt;"12"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;MM&lt;/td&gt;&lt;td&gt;Two-digit month number with leading zeroes if required.&lt;/td&gt;&lt;td&gt;"01"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;MMM&lt;/td&gt;&lt;td&gt;Three letter month abbreviation.&lt;/td&gt;&lt;td&gt;"Jan"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;MMMM&lt;/td&gt;&lt;td&gt;Month name.&lt;/td&gt;&lt;td&gt;"January"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;d&lt;/td&gt;&lt;td&gt;One-digit day number. If the day cannot be specified in one digit then two digits are used automatically.&lt;/td&gt;&lt;td&gt;"3"&lt;br /&gt;"31"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;dd&lt;/td&gt;&lt;td&gt;Two-digit day number with leading zeroes if required.&lt;/td&gt;&lt;td&gt;"03"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ddd&lt;/td&gt;&lt;td&gt;Three letter day name abbreviation.&lt;/td&gt;&lt;td&gt;"Wed"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;dddd&lt;/td&gt;&lt;td&gt;Day name.&lt;/td&gt;&lt;td&gt;"Wednesday"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;h&lt;/td&gt;&lt;td&gt;One-digit hour using the twelve hour clock. If the hour cannot be specified in one digit then two digits are used automatically.&lt;/td&gt;&lt;td&gt;"9"&lt;br /&gt;"12"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;hh&lt;/td&gt;&lt;td&gt;Two-digit hour using the twelve hour clock with leading zeroes if required.&lt;/td&gt;&lt;td&gt;"09"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;H&lt;/td&gt;&lt;td&gt;One-digit  hour using the twenty four hour clock. If the hour cannot be specified  in one digit then two digits are used automatically.&lt;/td&gt;&lt;td&gt;"1"&lt;br /&gt;"21"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;HH&lt;/td&gt;&lt;td&gt;Two-digit hour using the twenty four hour clock with leading zeroes if required.&lt;/td&gt;&lt;td&gt;"09"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;t&lt;/td&gt;&lt;td&gt;Single letter indicator of AM or PM, generally for use with twelve hour clock values.&lt;/td&gt;&lt;td&gt;"A"&lt;br /&gt;"P"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;tt&lt;/td&gt;&lt;td&gt;Two letter indicator of AM or PM, generally for use with twelve hour clock values.&lt;/td&gt;&lt;td&gt;"AM"&lt;br /&gt;"PM"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;m&lt;/td&gt;&lt;td&gt;One-digit minute. If the minute cannot be specified in one digit then two digits are used automatically.&lt;/td&gt;&lt;td&gt;"1"&lt;br /&gt;"15"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;mm&lt;/td&gt;&lt;td&gt;Two-digit minute with leading zeroes if required.&lt;/td&gt;&lt;td&gt;"01"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;s&lt;/td&gt;&lt;td&gt;One-digit second. If the second cannot be specified in one digit then two digits are used automatically.&lt;/td&gt;&lt;td&gt;"1"&lt;br /&gt;"59"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ss&lt;/td&gt;&lt;td&gt;Two-digit second with leading zeroes if required.&lt;/td&gt;&lt;td&gt;"01"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;f&lt;/td&gt;&lt;td&gt;Fraction of a second. Up to seven f's can be included to determine the number of decimal places to display.&lt;/td&gt;&lt;td&gt;"0"&lt;br /&gt;"0000000"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;z&lt;/td&gt;&lt;td&gt;One-digit  time zone offset indicating the difference in hours between local time  and UTC time. If the offset cannot be specified in one digit then two  digits are used automatically.&lt;/td&gt;&lt;td&gt;"+6"&lt;br /&gt;"-1"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;zz&lt;/td&gt;&lt;td&gt;Two-digit time zone offset indicating the difference in hours between local time and UTC time with leading zeroes if required.&lt;/td&gt;&lt;td&gt;"+06"&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;zzz&lt;/td&gt;&lt;td&gt;Full  time zone offset indicating the difference in hours and minutes between  local time and UTC time with leading zeroes if required.&lt;/td&gt;&lt;td&gt;"+06:00"&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Some of the formatting codes use the same letter as a format  specifier. When used within a format string that is greater than one  character in length this does not present a problem.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;If you need to use a  single character picture format string, the letter must be preceded by a  percentage sign (%) to indicate that the standard format specifier is  not to be used.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;&lt;pre&gt;DateTime theDate = DateTime.Parse("3 Jan 2007 21:25:30");&lt;br /&gt;string result;&lt;br /&gt;&lt;br /&gt;result = theDate.ToString("d");&lt;i&gt;// result = "03/01/2007"&lt;/i&gt;&lt;br /&gt;result = theDate.ToString("%d");&lt;i&gt;// result = "3"&lt;/i&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-8913162662976655314?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/8913162662976655314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=8913162662976655314' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8913162662976655314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8913162662976655314'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/09/datetime-custom-picture-formatting.html' title='DateTime Custom Picture Formatting'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-3897838910008015699</id><published>2010-09-22T04:40:00.000-07:00</published><updated>2010-11-27T11:07:29.615-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>How To Access One UserControl from Another UserControl Using ASP.NET</title><content type='html'>Few days ago, I need to access one UserControlfrom to another UserControl.The scenario is like,When I press a button it will assign a value from UserControl-1's TextBox to UserControl-2's TextBox. I have developed it but I made a silly mistake so that it was not working.&lt;br /&gt;&lt;br /&gt;Now this is the time turn to google......:). Fortunately I have got almost similar solution from KaushaL PariK(MVP). Very simple.....from his solution I found out my problem....now place this here for you guys....hope that you enjoy it.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Some known tips&lt;/b&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;Everybody knows the purpose of &lt;b&gt;FindControl (Control.FindControl Method (String) (System.Web.UI))&lt;/b&gt; method; it searches the current naming container for a server control with the specified id parameter.&lt;br /&gt;&lt;br /&gt;In addition, there is one property called &lt;b&gt;NamingContainer (Control.NamingContainer Property (System.Web.UI)) which Gets a reference to the server control's naming container&lt;/b&gt;, that means it will give the parent container reference of current server control's.&lt;br /&gt;&lt;br /&gt;We need to set the Text property of txtTransfer from UserControl-1 with the value of UserControl-2's TextBox txtBalance.&lt;br /&gt;&lt;br /&gt;The idea to accomplish this; is, to get the parent control reference (using NamingContainer, for Ex., txtTransfer.NamingContainer will give the reference of its container UserControl - 1) of TextBox; that is UserControl - 1, again get the parent control reference of the UserControl - 1; that is _Page. &lt;br /&gt;&lt;br /&gt;As now we got the reference of the Current Page, we can now easily find the second user control's TextBox txtBalance with findcontrol method. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Below is the Code:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;WebUserControl1.ASPX:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This UserControl1 just contains a simple TextBox may having some value...provides by user..this value is transfer to txtBalance TextBox of UserControl-2.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl1.ascx.cs" Inherits="WebUserControl" %&amp;gt;&lt;br /&gt;&amp;lt;asp:TextBox ID="txtTransfer" runat="server" %&amp;gt; &amp;lt;/asp:TextBox%&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;b&gt;WebUserControl1.ASPX.CS:&lt;/b&gt;&lt;br /&gt;A Simple One Line of code will access txtBalance TextBox of UserControl-2 on the page and set the Text Property of that TextBox with the value of UserControl-1's TextBox txtTransfer:&lt;br /&gt;&lt;br /&gt;protected void &lt;b&gt;Page_Load&lt;/b&gt;(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;if (!Page.IsPostBack) { }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;protected void &lt;b&gt;btnTransfer_Click&lt;/b&gt;(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;//reaching to get the _Page reference with NamingContainer Property and using FindControl method to get the TextBox&lt;br /&gt;//txtTransfer.NamingContainer will give reference of the UserControl1's instance reference on the page&lt;br /&gt;//txtTransfer.NamingContainer.NamingContainer will give reference of the _Page's reference&lt;br /&gt;//Using FindControl Method to find UserControl - Control2&lt;br /&gt;//again using FindControl Method to find TextBox inside UserControl - Control2&lt;br /&gt;&lt;b&gt;((TextBox)((UserControl)((Panel)txtTransfer.NamingContainer.NamingContainer.FindControl("Panel1")).FindControl("Control2")).FindControl("txtBalance")).Text = txtTransfer.Text;&lt;/b&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;b&gt;WebUserControl2.ASPX (No Code in Code Behind):&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Simple defining a TextBox:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;%@Control Language="C#" AutoEventWireup="true" CodeFile= "WebUserControl2.ascx.cs" Inherits ="WebUserControl2" %&amp;gt;&lt;br /&gt;&amp;lt;asp:TextBox ID="txtTransfer" runat="server" &amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;b&gt;Finally Default.ASPX Page (No Code in Code Behind):&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Placing both the controls inside a Panel Server Container control:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;%@Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&amp;gt;&lt;br /&gt;&amp;lt;%@Register Src="~/WebUserControl1.ascx" TagPrefix="kk1" TagName="Control1" %&amp;gt;&lt;br /&gt;&amp;lt;%@Register Src="~/WebUserControl2.ascx" TagPrefix="kk2" TagName="Control2" %&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" &lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;br /&gt;&amp;lt;head runat="server"&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Untitled Page&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;asp:Panel ID="Panel1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;div&amp;gt;&amp;lt;kk1:Control1 ID="Control" runat="Server" /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;div&amp;gt;&amp;lt;kk2:Control2 ID="Control2" runat="Server" /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/asp:Panel&amp;gt; &lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;In, above example, you can see that with the benefit and use of &lt;b&gt;NamingContainer Property&lt;/b&gt;; there doesn't require to take the reference of UserControl2 in UserControl1 to access TextBox inside. Hope that it may helps other developers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-3897838910008015699?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/3897838910008015699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=3897838910008015699' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/3897838910008015699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/3897838910008015699'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/09/how-to-access-one-usercontrol-from.html' title='How To Access One UserControl from Another UserControl Using ASP.NET'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-5530030103480770573</id><published>2010-09-22T02:18:00.000-07:00</published><updated>2010-09-23T03:18:02.140-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='debug'/><title type='text'>Missing debug menu on Visual Studio 2008</title><content type='html'>Before using Visual Studio 2010 I had usually developed application in Visual studio 2008. I don't remember, for some reason I can't find debug menu on my VS 2008. After  goggling I have found the solution. I would like to share with you. It may help other guys.&lt;br /&gt;&lt;br /&gt;Its very simple just use it:&lt;br /&gt;&lt;br /&gt;Run &lt;b&gt;"devenv /resetskippkgs" &lt;/b&gt;from&lt;b&gt; command prompt&lt;/b&gt;, it will solve your problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-5530030103480770573?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/5530030103480770573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=5530030103480770573' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/5530030103480770573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/5530030103480770573'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/09/missing-debug-menu-on-visual-studio.html' title='Missing debug menu on Visual Studio 2008'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-6312207968124695810</id><published>2010-09-22T02:10:00.000-07:00</published><updated>2010-11-27T11:08:02.698-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='debug'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><title type='text'>"It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level" in asp.net</title><content type='html'>Very recently, I have got this error message when try to browsing my developed application in asp.net. So I try to solve in many ways but failed then move to google...:). I got some nice solutions...now share with you:&lt;br /&gt;&lt;br /&gt;This error occurs primarily out of 2 scenarios.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;First scenario:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;When you create an new web application using visual studio.net, it automatically creates the virtual directory and configures it as an application.&lt;br /&gt;&lt;br /&gt;However, &lt;b&gt;if you manually create the virtual directory and it is not configured as an application, then you will not be able to browse the application and may get the above error.&lt;/b&gt; The debug information you get as mentioned above, is applicable to this scenario.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;To resolve it, Right Click on the virtual directory - select properties and then click on "Create" next to the "Application" Label and the textbox. It will automatically create the "application" using the virtual directory's name. Now the application can be accessed.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Second scenario:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;When you have sub-directories in your application, you can have web.config file for the sub-directory. However, there are certain properties which cannot be set in the web.config of the sub-directory such as authentication, session state (you may see that the error message shows the line number where the authentication or sessionstate is declared in the web.config of the sub-directory). &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;The reason is, these settings cannot be overridden at the sub-directory level unless the sub-directory is also configured as an application&lt;/b&gt; (as mentioned in the above point).&lt;/blockquote&gt;&lt;br /&gt;Mostly we have the practice of adding web.config in the sub-directory if we want to protect access to the sub-directory files (say, the directory is admin and we&lt;br /&gt;wish to protect the admin pages from unathorized users).&lt;br /&gt;&lt;br /&gt;But actually, &lt;b&gt;this can be achieved in the web.config at the application's root level itself, by specifing the location path tags and authorization&lt;/b&gt;, as follows:-&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;location path="Admin"&amp;gt;&lt;br /&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;&amp;lt;authorization&amp;gt;&lt;br /&gt;&amp;lt;allow roles="administrators" /&amp;gt;&lt;br /&gt;&amp;lt;deny users="*" /&amp;gt;&lt;br /&gt;&amp;lt;/authorization&amp;gt;&lt;br /&gt;&amp;lt;/system.web&amp;gt;&lt;br /&gt;&amp;lt;/location&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;However, &lt;b&gt;if you wish to have a web.config at the sub-directory level and protect the sub-directory, you can just specify the Authorization mode&lt;/b&gt; as follows:-&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;&amp;lt;authorization&amp;gt;&lt;br /&gt;&amp;lt;allow roles="administrators" /&amp;gt;&lt;br /&gt;&amp;lt;deny users="*" /&amp;gt;&lt;br /&gt;&amp;lt;/authorization&amp;gt;&lt;br /&gt;&amp;lt;/system.web&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;b&gt;Thus you can protect the sub-directory from unauthorized access.&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-6312207968124695810?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/6312207968124695810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=6312207968124695810' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6312207968124695810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6312207968124695810'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/09/it-is-error-to-use-section-registered.html' title='&quot;It is an error to use a section registered as allowDefinition=&apos;MachineToApplication&apos; beyond application level&quot; in asp.net'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-6629936518276667524</id><published>2010-08-23T23:32:00.000-07:00</published><updated>2010-11-27T11:08:13.390-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='webmatrix'/><category scheme='http://www.blogger.com/atom/ns#' term='razor'/><title type='text'>Introducing WebMatrix</title><content type='html'>WebMatrix is a free, lightweight Web development stack that makes it easy to build web sites that can grow with you, from installation to product deployment &amp;amp; maintenance. Developers can take advantage of mastering fundamental concepts of building apps for the web by using WebMatrix.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_QsXPTEkQU0k/THNmpDIWMBI/AAAAAAAAADU/UpWC8DEQGAM/s1600/webMatrix.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_QsXPTEkQU0k/THNmpDIWMBI/AAAAAAAAADU/UpWC8DEQGAM/s320/webMatrix.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;ASP.Net Web Matrix is a free tool released by Microsoft for the rapid development of web applications running on servers which support ASP.NET. It is a managed application written in the programming language C#.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;It is a a lightweight development tool, IIS Express, SQL Compact Edition, and a set of ASP.NET extensions that enable you to build standalone ASP.NET Pages using the new Razor syntax, as well as a set of easy to use database and HTML helpers for performing common web-tasks. &lt;br /&gt;&lt;br /&gt;WebMatrix can be installed side-by-side with Visual Studio 2010 and Visual Web Developer 2010 Express.&lt;br /&gt;&lt;br /&gt;For more info.....pls visits..&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.asp.net/webmatrix"&gt;http://www.asp.net/webmatrix&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.asp.net/webmatrix"&gt;http://www.asp.net/webmatrix&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/web/webmatrix/"&gt;http://www.microsoft.com/web/webmatrix/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://rachelappel.com/webmatrix/webmatrix-what-is-it-why-use-it-and-who-rsquo-s-it-for/"&gt;http://rachelappel.com/webmatrix/webmatrix-what-is-it-why-use-it-and-who-rsquo-s-it-for/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-6629936518276667524?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/6629936518276667524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=6629936518276667524' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6629936518276667524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6629936518276667524'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/08/introducing-webmatrix.html' title='Introducing WebMatrix'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_QsXPTEkQU0k/THNmpDIWMBI/AAAAAAAAADU/UpWC8DEQGAM/s72-c/webMatrix.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-754286905285178931</id><published>2010-08-11T21:38:00.000-07:00</published><updated>2010-08-11T21:38:17.099-07:00</updated><title type='text'>Presentation slide @aloashbei community</title><content type='html'>Now my presented slid "Mobile Application development using .NET framework" at Aloashbei community get together is available at here...&lt;br /&gt;&lt;a href="https://www.aloashbei.com.bd/blog/aloashbei-get-together-contents"&gt;Aloashbei get-together contents&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-754286905285178931?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/754286905285178931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=754286905285178931' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/754286905285178931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/754286905285178931'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/08/presentation-slide-aloashbei-community.html' title='Presentation slide @aloashbei community'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-4846937537206734027</id><published>2010-08-01T05:38:00.000-07:00</published><updated>2010-11-27T11:07:19.481-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><title type='text'>Disable Browser Back Button</title><content type='html'>&lt;span style="font-family: Calibri; font-size: small;"&gt;It is a common question for developer how to to prevent user’s from going to previous page using Browser Back button.&lt;br /&gt;You can do it in various way:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&lt;br /&gt;&lt;b&gt;Javascript Codesnippet1:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script type = "text/javascript" &amp;gt;&lt;br /&gt;function disableBackButton()&lt;br /&gt;{window.history.forward();&lt;br /&gt;}&lt;br /&gt;setTimeout("disableBackButton()", 0);&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&lt;br /&gt;&lt;b&gt;For internet explorer: &lt;/b&gt;&amp;lt;body &lt;b&gt;onload="disableBackButton()"&lt;/b&gt;&amp;gt;&lt;br /&gt;If you are using &lt;b&gt;firefox &lt;/b&gt;then use &lt;b&gt;&amp;lt;body &lt;b&gt;onunload="disableBackButton()"&lt;/b&gt;&amp;gt;&lt;/b&gt; instead of onload.&lt;/span&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;b&gt;For Server side:&lt;/b&gt;&lt;br /&gt;C#-&amp;gt; Asp.net 2.0&lt;br /&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&lt;br /&gt;ASP.NET 2.0 (there is a new HttpCachePolicy class) :&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; /*&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Code disables caching by browser. Hence hitting the back browser button&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * causes the Page_Load event to fire again.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;Response.Cache.SetCacheability(HttpCacheability.NoCache);&lt;br /&gt;Response.Cache.SetExpires(DateTime.Now); //or a date much earlier than current time&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-4846937537206734027?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/4846937537206734027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=4846937537206734027' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4846937537206734027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4846937537206734027'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/08/disable-browser-back-button.html' title='Disable Browser Back Button'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-3536655236799752059</id><published>2010-07-30T21:03:00.000-07:00</published><updated>2010-07-30T21:03:09.628-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>How to disable  CheckBoxList using Javascript</title><content type='html'>I have faced this problem very recently,how to disable CheckBoxList using Javascript. It is not possible to disable like other object(textbox,combobox..) . After goggling I have found the solution now its sharing with you.....&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Javascript code:&lt;/b&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; // Get the checkboxlist object.&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; var objCtrl = document.getElementById('&amp;lt;%=chkNeighborhoodFeatures.ClientID %&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; // Does the checkboxlist not exist?&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; if(objCtrl == 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;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&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;&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; var i = 0;&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; var chkNeighborhoodFeaturesArray = objCtrl.getElementsByTagName('input');&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; // iterate through listitems that need to be enabled or disabled&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(i = 0; i&lt;chkneighborhoodfeaturesarray.length; i++)=""&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; {&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; objItem = document.getElementById('&amp;lt;%=chkNeighborhoodFeatures.ClientID %&amp;gt;' + '_' + 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(objItem == 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; continue;&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; // Disable/Enable the checkbox.&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; objItem.disabled = true;&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; // Should the checkbox be disabled?&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; objItem.checked = false;&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; }&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/chkneighborhoodfeaturesarray.length;&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-3536655236799752059?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/3536655236799752059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=3536655236799752059' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/3536655236799752059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/3536655236799752059'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/07/how-to-disable-checkboxlist-using.html' title='How to disable  CheckBoxList using Javascript'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-6312000133600856603</id><published>2010-07-19T21:50:00.000-07:00</published><updated>2010-07-19T21:50:55.130-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='aloashbei'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft'/><title type='text'>Presentation@aloashbei community</title><content type='html'>Last 17th July I had presented&amp;nbsp; "&lt;b&gt;Mobile Application development using .NET framework&lt;/b&gt;" at Aloashbei  community get together&lt;b&gt;. &lt;/b&gt;The aloashbei community was meeting together for the first time in  Emmanuel’s Banquet Hall (House#4, Road# 134-135, Gulshan – 1, Dhaka) on  17&lt;sup&gt;th&lt;/sup&gt;&amp;nbsp;July at 10:30 AM.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-6312000133600856603?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/6312000133600856603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=6312000133600856603' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6312000133600856603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6312000133600856603'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/07/presentationaloashbei-community.html' title='Presentation@aloashbei community'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-5726118402835953805</id><published>2010-06-21T04:38:00.000-07:00</published><updated>2010-06-21T04:38:02.044-07:00</updated><title type='text'>Microsoft Expression Studio 4 released !!</title><content type='html'>Microsoft Expression Blend is a user interface design tool developed and sold by Microsoft for creating graphical interfaces for web and desktop applications that blend the features of these two types of applications. It is an interactive, WYSIWYG front-end for designing XAML-based interfaces for Windows Presentation Foundation  and Silverlight applications. It is one of the applications in the Microsoft Expression Studio suite.&lt;br /&gt;&lt;br /&gt;Expression Blend supports the WPF text engine with advanced OpenType typography and ClearType, vector-based 2D widgets, and 3D widgets with hardware acceleration via DirectX.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;create rich web experiences, games, desktop apps, and more&lt;/li&gt;&lt;li&gt;design apps that use the full power of Silverlight&lt;/li&gt;&lt;li&gt;take your ideas from concept to finished project work effectively with design tools, Expression Blend and Visual Studio&lt;/li&gt;&lt;/ul&gt;You will find the new version from here:&lt;a href="http://www.microsoft.com/expression/"&gt; http://www.microsoft.com/expression/ &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-5726118402835953805?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/5726118402835953805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=5726118402835953805' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/5726118402835953805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/5726118402835953805'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/06/microsoft-expression-studio-4-released.html' title='Microsoft Expression Studio 4 released !!'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-2439560447792924415</id><published>2010-06-13T02:11:00.000-07:00</published><updated>2010-06-13T02:25:36.968-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows 7'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='64 bit'/><category scheme='http://www.blogger.com/atom/ns#' term='32 bit'/><title type='text'>How to compile C# Application for both 32 bit and 64 bit system?</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;I have faced this problem when one of my client try to run &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;SMS Suit software &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;in &lt;b&gt;Windows 7 64 bit&lt;/b&gt;.&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;Previously it is working perfectly in vista and windows xp 32 bit .&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;After searching online I have found lots of solutions on it now I want to share these with you... &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution :1&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;You can edit your visual studio c# project file (.csproj) and put  this snippet:&lt;br /&gt;1.&amp;lt;PlatformTarget&amp;gt;&lt;b&gt; x86 &lt;/b&gt;&amp;lt;/PlatformTarget&amp;gt;&lt;br /&gt;&lt;br /&gt;inside&lt;br /&gt;&lt;br /&gt;2.&amp;lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "&amp;gt;&lt;br /&gt;&lt;/br&gt;&lt;br /&gt;&lt;b&gt;Solution :2(&lt;/b&gt;Command-line form&lt;b&gt;)&lt;/b&gt;&lt;br /&gt;Using CorFlags to set the 32BIT flag on  the executable. E.g:&lt;br /&gt;&lt;b&gt;corflags.exe myapp.exe /32BIT+&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This will modify your exe, so you might wanna keep a backup just in  case. You can also revert the flag using &lt;b&gt;/32BIT- instead of /32BIT+.&lt;/b&gt;&lt;br /&gt;&lt;/br&gt;&lt;br /&gt;&lt;b&gt;Solution :3(Simplest way)&lt;/b&gt;&lt;br /&gt;1.Right click your &lt;b&gt;Project&lt;/b&gt;,  and select &lt;b&gt;Properties&lt;/b&gt;.&lt;br /&gt;2.In properties, select the &lt;b&gt;Build&lt;/b&gt; tab. Under &lt;b&gt;Platform target&lt;/b&gt;,  select &lt;b&gt;x86&lt;/b&gt;.&lt;br /&gt;3.Hit Ctrl+Shift+S to save all files, right click the &lt;b&gt;Solution &lt;/b&gt;and  select "&lt;b&gt;Clean&lt;/b&gt;" to get rid of old binaries. Any builds after that  should be 32 bit .&lt;br /&gt;Now it is ready for both 32 bit and 64 bit OS.  &lt;br /&gt;&lt;/br&gt;&lt;br /&gt;&lt;br /&gt;This should solve the problem ! Please inform me if there is  another better way.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-2439560447792924415?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/2439560447792924415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=2439560447792924415' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2439560447792924415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2439560447792924415'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/06/how-to-compile-c-application-for-both.html' title='How to compile C# Application for both 32 bit and 64 bit system?'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-7456106165301931195</id><published>2010-06-08T23:30:00.000-07:00</published><updated>2010-06-08T23:40:59.448-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='master page'/><title type='text'>Looping Through Controls in ASP.NET</title><content type='html'>In my recent development I have badly needed to read all the controls from asp.net page. After searching I have found lots of solution. Now I want share with you one of these solution. In this solution we read all the control from asp.net page with out using master page.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;**Remember to add namespace&amp;nbsp; System.Collections.Generic&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt; &lt;br /&gt;&lt;b&gt;Code: C#&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="coloredcode"&gt;&lt;span class="kwd"&gt;private static&lt;/span&gt; Control &lt;b&gt;FindControlIterative&lt;/b&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="coloredcode"&gt;(Control root, &lt;span class="kwd"&gt;string&lt;/span&gt; id)&lt;br /&gt;        {&lt;br /&gt;            Control ctl = root;&lt;br /&gt;            LinkedList ctls = &lt;span class="kwd"&gt;new&lt;/span&gt; LinkedList();&lt;br /&gt;&lt;br /&gt;            &lt;span class="kwd"&gt;while&lt;/span&gt; (ctl != &lt;span class="kwd"&gt;null&lt;/span&gt;)&lt;br /&gt;            {&lt;br /&gt;                &lt;span class="kwd"&gt;if&lt;/span&gt; (ctl.ID == id)&lt;br /&gt;                    &lt;span class="kwd"&gt;return&lt;/span&gt; ctl;&lt;br /&gt;                &lt;span class="kwd"&gt;foreach&lt;/span&gt; (Control child &lt;span class="kwd"&gt;in&lt;/span&gt; ctl.Controls)&lt;br /&gt;                {&lt;br /&gt;                    &lt;span class="kwd"&gt;if&lt;/span&gt; (child.ID == id)&lt;br /&gt;                        &lt;span class="kwd"&gt;return&lt;/span&gt; child;&lt;br /&gt;                    &lt;span class="kwd"&gt;if&lt;/span&gt; (child.HasControls())&lt;br /&gt;                        ctls.AddLast(child);&lt;br /&gt;                }&lt;br /&gt;                ctl = ctls.First.Value;&lt;br /&gt;                ctls.Remove(ctl);&lt;br /&gt;            }&lt;br /&gt;            &lt;span class="kwd"&gt;return null&lt;/span&gt;;&lt;br /&gt;        }&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;Code: VB.net&lt;/b&gt;&lt;br /&gt;&amp;nbsp;&lt;span class="kwd"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwd"&gt;Private Shared Function&lt;/span&gt; &lt;b&gt;FindControlIterative&lt;/b&gt;&lt;br /&gt;(&lt;span class="kwd"&gt;ByVal&lt;/span&gt; root &lt;span class="kwd"&gt;As&lt;/span&gt; Control, _&lt;br /&gt;&lt;pre class="coloredcode"&gt;&lt;span class="kwd"&gt;ByVal&lt;/span&gt; id &lt;span class="kwd"&gt;As String&lt;/span&gt;) &lt;span class="kwd"&gt;As&lt;/span&gt; Control&lt;br /&gt;&lt;br /&gt;  &lt;span class="kwd"&gt;Dim&lt;/span&gt; ctl &lt;span class="kwd"&gt;As&lt;/span&gt; Control = root&lt;br /&gt;  &lt;span class="kwd"&gt;Dim&lt;/span&gt; ctls &lt;span class="kwd"&gt;As&lt;/span&gt; LinkedList(Of Control) =&amp;nbsp;&lt;/pre&gt;&lt;pre class="coloredcode"&gt;&lt;span class="kwd"&gt;                  New&lt;/span&gt; LinkedList(Of Control)&lt;br /&gt;&lt;br /&gt;  &lt;span class="kwd"&gt;Do While&lt;/span&gt; (ctl IsNot &lt;span class="kwd"&gt;Nothing&lt;/span&gt;)&lt;br /&gt;   &lt;span class="kwd"&gt;If&lt;/span&gt; ctl.ID = id &lt;span class="kwd"&gt;Then&lt;br /&gt;    Return&lt;/span&gt; ctl&lt;br /&gt;   &lt;span class="kwd"&gt;End If&lt;br /&gt;   For Each&lt;/span&gt; child &lt;span class="kwd"&gt;As&lt;/span&gt; Control &lt;span class="kwd"&gt;In&lt;/span&gt; ctl.Controls&lt;br /&gt;    &lt;span class="kwd"&gt;If&lt;/span&gt; child.ID = id &lt;span class="kwd"&gt;Then&lt;br /&gt;     Return&lt;/span&gt; child&lt;br /&gt;    &lt;span class="kwd"&gt;End If&lt;br /&gt;    If&lt;/span&gt; child.HasControls() &lt;span class="kwd"&gt;Then&lt;/span&gt;&lt;br /&gt;     ctls.AddLast(child)&lt;br /&gt;    &lt;span class="kwd"&gt;End If&lt;br /&gt;   Next&lt;/span&gt;&lt;br /&gt;   ctl = ctls.First.Value&lt;br /&gt;   ctls.Remove(ctl)&lt;br /&gt;  &lt;span class="kwd"&gt;Loop&lt;br /&gt;&lt;br /&gt;  Return Nothing&lt;br /&gt;&lt;br /&gt; End Function&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;Read Control when use Master Page:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;And this is where things get a bit tricky  with  MasterPages. The problem is that when you use MasterPages the page  hierarchy drastically changes. Where a simple this.FindControl() used to  give you a control instance you now have to drill into the container  hierarchy pretty deeply just to get to the content container.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code:C#&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;public static  Control &lt;b&gt;FindControlRecursive&lt;/b&gt;(Control Root, string  Id)&lt;br /&gt;{&lt;br /&gt;if (Root.ID == Id)&lt;br /&gt;return Root;&lt;br /&gt;&lt;br /&gt;foreach (Control Ctl in Root.Controls)&lt;br /&gt;{&lt;br /&gt;Control FoundCtl = FindControlRecursive(Ctl, Id);&lt;br /&gt;if (FoundCtl != null)&lt;br /&gt;return FoundCtl;&lt;br /&gt;}&lt;br /&gt;return null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;You can use this method this way..&lt;br /&gt;&lt;br /&gt;this.lblError = &lt;b&gt;FindControlRecursive&lt;/b&gt;(this.Master,"lblError") as Label;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-7456106165301931195?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/7456106165301931195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=7456106165301931195' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7456106165301931195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7456106165301931195'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/06/looping-through-controls-in-aspnet.html' title='Looping Through Controls in ASP.NET'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-6757332897715936909</id><published>2010-06-08T23:07:00.000-07:00</published><updated>2010-06-08T23:07:51.816-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MS SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='parameter'/><title type='text'>MS Sql server: How to do multiple rows insert ?</title><content type='html'>Recently I have faced a problem when insert multiple row insert at single call. After first row insert then problem arise from&amp;nbsp; second row insert. After goggling I have found a solution : it need to clear parameter after each row insert. I want to share that example with you:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code :C# &lt;/b&gt;&lt;br /&gt;// Arranging  Data in an Array.&lt;br /&gt;const int no_of_values = 2;&lt;br /&gt;int[] val1 =  new int[no_of_values];&lt;br /&gt;int[] val2 = new int[no_of_values];&lt;br /&gt;val1[0] = val1;&lt;br /&gt;val2[0] = val2;&lt;br /&gt;val1[1] = val11;&lt;br /&gt;val2[1] =  val22;&lt;br /&gt;// Do the inserts using Parameterized queries.&lt;br /&gt;Connection.Open();&lt;br /&gt;SqlCeCommand command =  Connection.CreateCommand();&lt;br /&gt;command.CommandText = "Insert INTO  [Table] (col1, col2) Values (...val1, ...val2)";&lt;br /&gt;for (int i = 0; i  &amp;lt; no_of_values; i++)&lt;br /&gt;{&lt;br /&gt;&lt;b&gt;command.Parameters.Clear(); //it needs to clear parameter after each row inserted.&lt;/b&gt;&lt;br /&gt;command.Parameters.Add("...val1", val1[ i ]);&lt;br /&gt;command.Parameters.Add("...val2", val2[ i ]);&lt;br /&gt;command.ExecuteNonQuery();&lt;br /&gt;}&lt;br /&gt;Connection.Close();&lt;br /&gt;&lt;br /&gt;I have fixed this problem for MS SQL Server, it is also same for oracle too. &lt;br /&gt;Hope that it may helpful for developers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-6757332897715936909?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/6757332897715936909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=6757332897715936909' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6757332897715936909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6757332897715936909'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/06/ms-sql-server-how-to-do-multiple-rows.html' title='MS Sql server: How to do multiple rows insert ?'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-7307312490140071444</id><published>2010-06-07T05:21:00.000-07:00</published><updated>2010-06-07T05:22:29.583-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='strng format'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>String Formatting in C#</title><content type='html'>&lt;h3&gt;&lt;span style="font-family: Verdana;"&gt;Numbers&lt;/span&gt;&lt;/h3&gt;&lt;b&gt;Basic number formatting specifiers:&lt;/b&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td align="middle" bgcolor="#c0c0c0"&gt;&lt;b&gt;&lt;span style="font-size: x-small;"&gt;Specifier&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td align="middle" bgcolor="#c0c0c0"&gt;&lt;b&gt;&lt;span style="font-size: x-small;"&gt;Type&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td align="middle" bgcolor="#c0c0c0"&gt;&lt;b&gt;&lt;span style="font-size: x-small;"&gt;Format  &lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td align="middle" bgcolor="#c0c0c0"&gt;&lt;b&gt;&lt;span style="font-size: x-small;"&gt;Output (Passed  Double 1.42)&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td align="middle" bgcolor="#c0c0c0"&gt;&lt;b&gt;&lt;span style="font-size: x-small;"&gt;Output (Passed  Int -12400)&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td align="middle"&gt;&lt;span style="font-size: x-small;"&gt;c&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;Currency&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-family: Courier New; font-size: x-small;"&gt;{0:c}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;$1.42&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;-$12,400&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td align="middle"&gt;&lt;span style="font-size: x-small;"&gt;d&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;Decimal (Whole number)&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-family: Courier New; font-size: x-small;"&gt;{0:d}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;&lt;span style="font-size: x-small;"&gt;System.FormatException&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;-12400&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td align="middle"&gt;&lt;span style="font-size: x-small;"&gt;e&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;Scientific&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-family: Courier New; font-size: x-small;"&gt;{0:e}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;1.420000e+000&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;-1.240000e+004&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td align="middle"&gt;&lt;span style="font-size: x-small;"&gt;f&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;Fixed point&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-family: Courier New; font-size: x-small;"&gt;{0:f}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;1.42&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;-12400.00&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td align="middle"&gt;&lt;span style="font-size: x-small;"&gt;g&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;General&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-family: Courier New; font-size: x-small;"&gt;{0:g}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;1.42&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;-12400&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td align="middle"&gt;&lt;span style="font-size: x-small;"&gt;n&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;Number with commas for thousands&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-family: Courier New; font-size: x-small;"&gt;{0:n}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;1.42&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;-12,400&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td align="middle"&gt;&lt;span style="font-size: x-small;"&gt;r&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;Round trippable&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-family: Courier New; font-size: x-small;"&gt;{0:r}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;1.42&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;&lt;span style="font-size: x-small;"&gt;System.FormatException&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td align="middle"&gt;&lt;span style="font-size: x-small;"&gt;x&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;Hexadecimal&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-family: Courier New; font-size: x-small;"&gt;{0:x4}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;b&gt;&lt;span style="font-size: x-small;"&gt;System.FormatException&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;cf90&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;/tbody&gt; &lt;/table&gt;&lt;br /&gt;&lt;b&gt;Custom number formatting:&lt;/b&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td align="middle" bgcolor="#c0c0c0"&gt;&lt;b&gt;&lt;span style="font-size: x-small;"&gt;Specifier&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td align="middle" bgcolor="#c0c0c0"&gt;&lt;b&gt;&lt;span style="font-size: x-small;"&gt;Type&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td align="middle" bgcolor="#c0c0c0"&gt;&lt;b&gt;&lt;span style="font-size: x-small;"&gt;Example   &lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td align="middle" bgcolor="#c0c0c0"&gt;&lt;b&gt;&lt;span style="font-size: x-small;"&gt;Output (Passed  Double 1500.42)&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td align="middle" bgcolor="#c0c0c0"&gt;&lt;b&gt;&lt;span style="font-size: x-small;"&gt;Note&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td align="middle"&gt;&lt;span style="font-size: x-small;"&gt;0&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;Zero placeholder&lt;/span&gt;&lt;/td&gt; &lt;td align="middle"&gt;&lt;span style="font-family: Courier New; font-size: x-small;"&gt;{0:00.0000}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;1500.4200&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;Pads with zeroes.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td align="middle"&gt;&lt;span style="font-size: x-small;"&gt;#&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;Digit placeholder&lt;/span&gt;&lt;/td&gt; &lt;td align="middle"&gt;&lt;span style="font-family: Courier New; font-size: x-small;"&gt;{0:(#).##}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;(1500).42&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt; &lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td align="middle"&gt;&lt;span style="font-size: x-small;"&gt;.&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;Decimal point&lt;/span&gt;&lt;/td&gt; &lt;td align="middle"&gt;&lt;span style="font-family: Courier New; font-size: x-small;"&gt;{0:0.0}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;1500.4&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt; &lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td align="middle"&gt;&lt;span style="font-size: x-small;"&gt;,&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;Thousand separator&lt;/span&gt;&lt;/td&gt; &lt;td align="middle"&gt;&lt;span style="font-family: Courier New; font-size: x-small;"&gt;{0:0,0}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;1,500&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;Must be between two zeroes.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td align="middle"&gt;&lt;span style="font-size: x-small;"&gt;,.&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;Number scaling&lt;/span&gt;&lt;/td&gt; &lt;td align="middle"&gt;&lt;span style="font-family: Courier New;"&gt;{0:0,.}&lt;/span&gt;  &lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;2&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;Comma adjacent to Period scales by 1000.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td align="middle"&gt;&lt;span style="font-size: x-small;"&gt;%&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;Percent&lt;/span&gt;&lt;/td&gt; &lt;td align="middle"&gt;&lt;span style="font-family: Courier New; font-size: x-small;"&gt;{0:0%}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;150042%&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;Multiplies by 100, adds % sign.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td align="middle"&gt;&lt;span style="font-size: x-small;"&gt;e&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;Exponent placeholder&lt;/span&gt;&lt;/td&gt; &lt;td align="middle"&gt;&lt;span style="font-family: Courier New; font-size: x-small;"&gt;{0:00e+0}&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;15e+2&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;Many exponent formats available.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td align="middle"&gt;&lt;span style="font-size: x-small;"&gt;;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt;Group separator&lt;/span&gt;&lt;/td&gt; &lt;td align="middle"&gt;&lt;span style="font-size: x-small;"&gt;see below&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size: x-small;"&gt; &lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt;&lt;/tbody&gt; &lt;/table&gt;&lt;br /&gt;The group separator is especially useful for formatting currency  values which require that negative values be enclosed in parentheses.&lt;br /&gt;&lt;br /&gt;This table will help you to format the string value to &lt;b&gt;double value&lt;/b&gt;:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Value &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; Format String &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Result&lt;/b&gt;&lt;br /&gt;1234.567 &amp;nbsp;&amp;nbsp;&amp;nbsp; {0:0.00} &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 1234.57&lt;br /&gt;1234.567 &amp;nbsp;&amp;nbsp;&amp;nbsp; {0:00000.0000} &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 01234.5670&lt;br /&gt;1234.567 &amp;nbsp;&amp;nbsp;&amp;nbsp; {0:#####.##} &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1234.57&lt;br /&gt;1234.567 &amp;nbsp;&amp;nbsp;&amp;nbsp; {0:#.###} &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 1234.567&lt;br /&gt;1234.567 &amp;nbsp;&amp;nbsp;&amp;nbsp; {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;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1234.6&lt;br /&gt;1234.567 &amp;nbsp;&amp;nbsp;&amp;nbsp; {0:#,#.##} &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1,234.57&lt;br /&gt;1234.567 &amp;nbsp;&amp;nbsp;&amp;nbsp; {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; $1,234.57&lt;br /&gt;1234.567 &amp;nbsp;&amp;nbsp;&amp;nbsp; {0:$ #,#.##} &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $ 1,234.57&lt;br /&gt;1234.567 &amp;nbsp;&amp;nbsp;&amp;nbsp; {0:($ #,#.##)} &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ($ 1,234.57)&lt;br /&gt;-1234.567 &amp;nbsp;&amp;nbsp; {0:#,#.##} &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; -1,234.57&lt;br /&gt;.1234 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {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; 12%&lt;br /&gt;.1234 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {0:Percent = #.0%} &amp;nbsp;&amp;nbsp;&amp;nbsp; Percent = 12.3%&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;br /&gt;&lt;blockquote&gt;double dValue=1234.567;&lt;br /&gt;string sCurrency =&amp;nbsp; dValue.ToString(" {0:0.00}",dValue);&lt;br /&gt;Output: 1234.57&lt;/blockquote&gt;&lt;br /&gt;Or,&lt;br /&gt;&lt;blockquote&gt;double dValue=23.00; &lt;br /&gt;&lt;span style="font-family: Courier New; font-size: x-small;"&gt;String.Format("{0:$#,##0.00;($#,##0.00);Zero}",&lt;/span&gt;dValue&lt;span style="font-family: Courier New; font-size: x-small;"&gt; );&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;This will output “$1,240.00″ if passed 1243.50.  It will output the same  format but in parentheses if the number is negative, and will output  the string “Zero” if the number is zero.&lt;/blockquote&gt;&lt;br /&gt;For more info: &lt;a href="http://blog.stevex.net/string-formatting-in-csharp/"&gt;http://blog.stevex.net/string-formatting-in-csharp/ &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-7307312490140071444?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/7307312490140071444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=7307312490140071444' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7307312490140071444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7307312490140071444'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/06/string-formatting-in-c.html' title='String Formatting in C#'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-2358912173180183517</id><published>2010-06-06T11:35:00.000-07:00</published><updated>2010-06-06T11:35:49.006-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Deprecated HTML elements /Bad Tag</title><content type='html'>There are several HTML elements and attributes that have now been declared deprecated  by the &lt;b&gt;&lt;a href="http://www.w3.org/"&gt;World Wide Web Consortium&lt;/a&gt;&lt;/b&gt; (the organization that sets HTML standards). &lt;br /&gt;&lt;br /&gt;&lt;b&gt;'Deprecated'&lt;/b&gt; means that the elements no longer serve a purpose and have been replaced by other methods, mostly involving cascading &lt;b&gt;stylesheets (CSS)&lt;/b&gt;. Although it is recommended that web browsers continue to support them, eventually they will become obsolete.&lt;br /&gt;&lt;br /&gt;Here lists all the deprecated elements and attributes of HTML 4..&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&amp;nbsp;The FONT and BASEFONT tags&lt;/li&gt;&lt;li&gt;&amp;nbsp;The CENTER tag and ALIGN attribute&lt;/li&gt;&lt;li&gt;The U, S and STRIKE elements&lt;/li&gt;&lt;li&gt;The BACKGROUND and BGCOLOR attribute&lt;/li&gt;&lt;li&gt;The BORDER attribute&lt;/li&gt;&lt;li&gt;The TEXT, LINK, ALINK and VLINK attributes&lt;/li&gt;&lt;li&gt;The HPSACE and VSPACE attributes&lt;/li&gt;&lt;li&gt;The LANGUAGE attribute&lt;/li&gt;&lt;li&gt;The CLEAR attribute&lt;/li&gt;&lt;li&gt;The WIDTH and HEIGHT attributes&lt;/li&gt;&lt;li&gt;The TYPE attribute for lists&lt;/li&gt;&lt;li&gt;The START and VALUE attributes for lists&lt;/li&gt;&lt;li&gt;The COMPACT attribute for lists&lt;/li&gt;&lt;li&gt;The APPLET element&lt;/li&gt;&lt;li&gt;The DIR and MENU elements&lt;/li&gt;&lt;li&gt;The ISINDEX element&lt;/li&gt;&lt;li&gt;The NOSHADE and SIZE attributes for HR&lt;/li&gt;&lt;li&gt;The NOWRAP attribute&lt;/li&gt;&lt;li&gt;The VERSION attribute&lt;/li&gt;&lt;/ol&gt;For more details....&lt;a href="http://www.doheth.co.uk/codelair/html-css/deprecated"&gt;Deprecated HTML element/ Bad Tag&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-2358912173180183517?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/2358912173180183517/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=2358912173180183517' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2358912173180183517'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2358912173180183517'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/06/deprecated-html-elements-bad-tag.html' title='Deprecated HTML elements /Bad Tag'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-3500601836578837444</id><published>2010-06-06T11:27:00.000-07:00</published><updated>2010-06-06T11:27:17.233-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>How to get File size in ASP.NET/C#</title><content type='html'>In asp.net forum I have got this question many times like this, "How to get File size" or "How to get File Length". For this today I want to share with you how to get the file size in asp.net. Its very simple but helpful...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code:C#&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Add namespace:&lt;br /&gt;Using System.IO;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;string sMyFileName = "~/photos/test.jpg";&lt;br /&gt;&lt;br /&gt;FileInfo finfo = new FileInfo(Server.MapPath(sMyFileName ));&lt;br /&gt;long FileInBytes = finfo.Length;&lt;br /&gt;long FileInKB = finfo.Length / 1024;&lt;br /&gt;long FileInMB = FileInKB /1024;&lt;br /&gt;&lt;br /&gt;Response.Write("File Size: " + FileInBytes.ToString() + &lt;br /&gt;  " bytes (" + FileInMB.ToString() + " MB)");&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-3500601836578837444?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/3500601836578837444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=3500601836578837444' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/3500601836578837444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/3500601836578837444'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/06/how-to-get-file-size-in-aspnetc.html' title='How to get File size in ASP.NET/C#'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-2623734039830251260</id><published>2010-06-06T10:52:00.000-07:00</published><updated>2010-06-13T02:23:30.957-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows 7'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Windows 7 : C# Error:'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine</title><content type='html'>&lt;b&gt;Problem&lt;/b&gt;&lt;br /&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;&lt;br /&gt;Today I have faced this error when try to use MS Access database from SMS software. After goggling I have found the solution in ...&lt;br /&gt;&lt;a href="http://social.msdn.microsoft.com/Forums/en/netfx64bit/thread/4ff1791f-3bc8-4716-a15a-356206d750ba"&gt;MSDN forum&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;The behavior you described is expected. If your  application runs in 64-bit mode, all of the components it uses must also  be 64-bit. There is no 64-bit Jet OLE DB Provider, so you get the  message described. You would receive a similar error when trying to  connect to a database using OLE DB or ODBC if there is no 64-bit version  of the specified OLE DB provider or ODBC driver.&lt;/span&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="margin: 6pt 0in;"&gt;&lt;span style="font-family: Calibri; font-size: small;"&gt;This problem only occurs in applications that run in  64-bit mode. Compiling the application so it runs only in 32-bit mode is  the best current solution.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Calibri;"&gt;How to compile application to run in both 32 bit or 64 bit&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;?&lt;br /&gt;You can do it several ways...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution :1&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;You can edit your visual studio c# project file (.csproj) and put this snippet:&lt;br /&gt;1.&amp;lt;PlatformTarget&amp;gt;x86&amp;lt;/PlatformTarget&amp;gt;&lt;br /&gt;inside&lt;br /&gt;2.&amp;lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution :2&lt;/b&gt;&lt;br /&gt;Using CorFlags to set the 32BIT flag on the executable. E.g:&lt;br /&gt;&lt;b&gt;corflags.exe myapp.exe /32BIT+&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This will modify your exe, so you might wanna keep a backup just in case. You can also revert the flag using &lt;b&gt;/32BIT- instead of /32BIT+.&lt;/b&gt;&lt;br /&gt;&lt;b&gt; &lt;/b&gt;&lt;br /&gt;&lt;b&gt;Solution :3(Simplest way)&lt;/b&gt;&lt;br /&gt;1.Right click your &lt;b&gt;Project&lt;/b&gt;, and select &lt;b&gt;Properties&lt;/b&gt;.&lt;br /&gt;2.In properties, select the &lt;b&gt;Build&lt;/b&gt; tab. Under &lt;b&gt;Platform target&lt;/b&gt;, select &lt;b&gt;x86&lt;/b&gt;.&lt;br /&gt;3.Hit Ctrl+Shift+S to save all files, right click the &lt;b&gt;Solution &lt;/b&gt;and select "&lt;b&gt;Clean&lt;/b&gt;" to get rid of old binaries. Any builds after that should be 32 bit .&lt;br /&gt;Now it is ready for both 32 bit and 64 bit OS. &lt;br /&gt;&lt;br /&gt;This should solve the problem ! Please inform me if there is another better way.&lt;br /&gt;&lt;b&gt; &lt;/b&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-2623734039830251260?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/2623734039830251260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=2623734039830251260' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2623734039830251260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2623734039830251260'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/06/windows-7-c-errormicrosoftjetoledb40.html' title='Windows 7 : C# Error:&apos;Microsoft.Jet.OLEDB.4.0&apos; provider is not registered on the local machine'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-2777242606553538692</id><published>2010-05-31T04:53:00.000-07:00</published><updated>2010-05-31T04:53:58.131-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='absolute path'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='relative path'/><title type='text'>Which path you have to use in your application?</title><content type='html'>&lt;b&gt;What is Absolute path?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Absolute paths are called that because they refer to the very specific location, including the domain name. The absolute path to a Web element is also often referred to as the URL. For example, the absolute path to this Web page is: http://aspboss.blogspot.com/2010/04/how-to-get-client-ip-address-using.html&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What is Relative path?&lt;/b&gt;&lt;br /&gt;Relative paths change depending upon what page the links are located on. Another word,A relative path is a path relative to the working directory of the user or application, so the full absolute path may not need to be given. There are several rules to creating a link using the relative path:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; links in the same directory as the page have no path information listed&amp;nbsp;&amp;nbsp; filename&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sub-directories are listed without any preceding slashes weekly/file-name&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; links up one directory are listed as&amp;nbsp;&amp;nbsp; ../filename&lt;/li&gt;&lt;/ul&gt;Linking to a resource from a reusable control in different levels in your web app folder tree can be a tedious and not so obvious task.&lt;br /&gt;&lt;br /&gt;Now have a look where to use absolute paths or relative paths&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.&lt;b&gt;Absolute paths&lt;/b&gt; - http://www.yoururl.com/a/b/c/page.aspx - It is not acceptable for reusable components.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2. &lt;b&gt;Relative paths&lt;/b&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; o current level based - a/b/c/page.aspx - Doesn't work for reusable components.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; o root based - /a/b/c/page.aspx - That works good in some cases but not in every.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; o app based - ~/a/b/c/page.aspx - Perfect when you can use it&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What's wrong with root based paths?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;When you work on a project you often use built-in WebServer of the Visual Studio and your app runs on http://localhost:XXXX/. Everything seems to be working fine with the root based paths. Now it's time to deploy your app on a test machine. You deploy it on http://test/myBestApp/. Now all your root based paths are pointing to http://test/Page.aspx instead of http://test/myBestApp/Page.aspx. That's a good reason not to use root based paths.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Is ~ (tilde) can solve it?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;That's a good solution that comes out of the box and takes care finding the root of your app. Ok, but what if need to build the URL on the fly like in this example:&lt;br /&gt;&lt;br /&gt;~/Item.aspx?id=&amp;lt;% Request.QueryString[ "id" ] %&amp;gt;&lt;br /&gt;&lt;br /&gt;This won't work if you put it in a Hyperlink like this:&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:hyperlink id="hlnkItemDetails" navigateurl="~/Item.aspx?id=&amp;lt;% Request.QueryString[ &amp;quot;id&amp;quot; ] %&amp;gt;" runat="server"&gt;&lt;br /&gt;&lt;br /&gt;Don't think about changing the quotation marks. It won't work however you try.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The universal solution - Page.ResolveUrl&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now that's what can help you in every situation (or at least all cases I can think of). &lt;br /&gt;Think about this case: you have a custom control in ~/items/controls/ItemViewControl.ascx. This control is used in ~/Default.aspx and ~/items/Default.aspx. You need to link to ~/items/Item.aspx?id=&amp;lt;query param="" string=""&amp;gt;from ItemViewControl.ascx. &lt;br /&gt;&lt;br /&gt;You can't use ~ (tilde), root based, current folder relative or absolute path for some of the reasons written above. &lt;br /&gt;&lt;br /&gt;This is where &lt;b&gt;Page.ResoulveUrl&lt;/b&gt; comes into help. You can build your link in this way:&lt;br /&gt;&lt;br /&gt;&amp;lt;a href='&amp;lt;% String.Format( "{0}?id={1}", Page.ResolveUrl( "~/items/Item.aspx" ), Request.QueryString[ &amp;quot;id&amp;quot; ] %&amp;gt;'&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&lt;br /&gt;Yes, it is a bit complicated, but at least you won't be worried about broken links and they will work as expected wherever you put them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-2777242606553538692?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/2777242606553538692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=2777242606553538692' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2777242606553538692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2777242606553538692'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/05/which-path-you-have-to-use-in-your.html' title='Which path you have to use in your application?'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-7795991215668606343</id><published>2010-05-27T03:51:00.000-07:00</published><updated>2010-05-27T03:51:02.140-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='master page'/><title type='text'>Accessing Master page functions from a content page</title><content type='html'>Accessing Master page functions from content page we must include a &lt;b&gt;MasterType directive&lt;/b&gt; at the top of the Content page ASPX file:&lt;br /&gt;&lt;br /&gt;      &lt;b&gt;&lt;%@ MasterType virtualpath="~/DetailsMaster.master" %&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In &lt;b&gt;DetailsMaster.master.cs&lt;/b&gt; page&lt;br /&gt;          public void SavePageData()&lt;br /&gt;   {&lt;br /&gt;         // function definition &lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;After place the MasterType directive is in place in the Content page, then public functions in the Master page are available to the Content page code.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;C# Code:&lt;/b&gt;&lt;br /&gt;     //Call the SavePageData function from the Master page &lt;br /&gt;      Master.SavePageData();&lt;br /&gt;&lt;br /&gt;I hope it will helpfull for other developer.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-7795991215668606343?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/7795991215668606343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=7795991215668606343' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7795991215668606343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7795991215668606343'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/05/accessing-master-page-functions-from.html' title='Accessing Master page functions from a content page'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-8363004595899572840</id><published>2010-05-27T03:36:00.000-07:00</published><updated>2010-05-27T03:38:58.302-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.net'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='master page'/><title type='text'>Accessing Master page controls from a content page</title><content type='html'>Today I want to share with you how to use master page control from content page.&lt;br /&gt;Suppose there is a Label on the Master page that we want to write to from the Content page.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. &lt;/b&gt;We must include a MasterType directive at the top of the Content page ASPX file:&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;%@ MasterType virtualpath="~/DetailsMaster.master" %&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt; 2. &lt;/b&gt;We must include a public function in the Master page that returns a typed reference to the Label:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;VB.net&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Public Function LabelReference() As Label &lt;br /&gt;' Create a reference to an actual label on the page &lt;br /&gt;LabelReference = lblDetailsItemName &lt;br /&gt;End Function&lt;/blockquote&gt;&lt;b&gt;C#&lt;/b&gt;&lt;br /&gt;&lt;blockquote&gt;public Label LabelReference()&lt;br /&gt;{&lt;br /&gt;// Create a reference to an actual label on the page &lt;br /&gt;return lblDetailsItemName;&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;&lt;b&gt;3.&lt;/b&gt; We can access the Label from the Content page using the Master syntax:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Master.LabelReference.Text = "Demo text";&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Hope that it will help for developer.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-8363004595899572840?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/8363004595899572840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=8363004595899572840' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8363004595899572840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8363004595899572840'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/05/accessing-master-page-controls-from.html' title='Accessing Master page controls from a content page'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-8313809806594681245</id><published>2010-05-25T05:13:00.000-07:00</published><updated>2010-05-25T05:13:49.626-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Reflection'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Creating Object to a Class dynamically using Reflection</title><content type='html'>&lt;b&gt;What is Reflection?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Reflection is the feature in .Net, which enables us to get some information about object in run time. That information contains data of the class. Also it can get the names of the methods that are inside the class and constructors of that object.&lt;br /&gt;&lt;br /&gt;To write a C# .Net program which uses reflection, the program should use the namespace &lt;b&gt;System.Reflection&lt;/b&gt;. To get type of the object, the &lt;b&gt;typeof &lt;/b&gt;operator can be used. There is one more method &lt;b&gt;GetType()&lt;/b&gt;. This also can be used for retrieving the type information of a class. The Operator typeof allow us to get class name of our object and &lt;b&gt;GetType()&lt;/b&gt; method uses to get data about object's type.&lt;br /&gt;&lt;br /&gt;One can use the &lt;b&gt;Activator &lt;/b&gt;class for creating objects and then you can use &lt;b&gt;reflection &lt;/b&gt;to call &lt;b&gt;methods &lt;/b&gt;on the new instance, e.g.:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Example-1: C#&lt;/b&gt;&lt;br /&gt;In this example simply show that how to create instance of a object dynamically,&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;using System;&lt;br /&gt;using System.Runtime.Remoting;&lt;br /&gt;using System.Reflection;&lt;br /&gt;namespace ConsoleApplication3&lt;br /&gt;{&lt;br /&gt;    interface IBase&lt;br /&gt;    {&lt;br /&gt;        void fu();&lt;br /&gt;    }&lt;br /&gt;    class Emp: IBase&lt;br /&gt;    {&lt;br /&gt;        public void fu()&lt;br /&gt;        {&lt;br /&gt;            Console.Write("Hello");&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    class Class1&lt;br /&gt;    {&lt;br /&gt;        [STAThread]&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            Type type = Type.GetType("ConsoleApplication3.Emp");&lt;br /&gt;            IBase obj = (IBase)Activator.CreateInstance(type);&lt;br /&gt;            obj.fu();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;b&gt;Example-2: C#&lt;/b&gt;&lt;br /&gt;In this example just show that how to create instance of a object dynamically and GET and SET the property value at runtime.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;using System;&lt;br /&gt;using System.Runtime.Remoting;&lt;br /&gt;using System.Reflection;&lt;br /&gt;&lt;br /&gt;namespace SampleApp&lt;br /&gt;{&lt;br /&gt;    public class Person&lt;br /&gt;    {&lt;br /&gt;        private string name = string.Empty;&lt;br /&gt;&lt;br /&gt;        public Person()&lt;br /&gt;        {&lt;br /&gt;        }&lt;br /&gt;        public string Name&lt;br /&gt;        {&lt;br /&gt;            get { return name; }&lt;br /&gt;            set { name = value; }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            object obj = ((ObjectHandle)Activator.CreateInstance(null, "SampleApp.Person")).Unwrap();&lt;br /&gt;            Type type = obj.GetType();&lt;br /&gt;            type.GetProperty("Name").SetValue(obj,"Hello World", null);&lt;br /&gt;            string personName = type.GetProperty("Name").GetValue(obj, null).ToString();&lt;br /&gt;&lt;br /&gt;            Console.WriteLine(personName);&lt;br /&gt;            Console.ReadLine();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-8313809806594681245?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/8313809806594681245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=8313809806594681245' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8313809806594681245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8313809806594681245'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/05/creating-object-to-class-dynamically.html' title='Creating Object to a Class dynamically using Reflection'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-4510300233126051119</id><published>2010-05-25T04:40:00.000-07:00</published><updated>2010-05-25T04:45:56.972-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='CheckBoxlist'/><title type='text'>How to get the CheckBoxlist Value using Javascript</title><content type='html'>A &lt;b&gt;CheckBoxList &lt;/b&gt;renders as an HTML Table tag and does not have checked property. The child controls are &lt;b&gt;CheckBoxes &lt;/b&gt;and do have the checked property.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;There is no client-side "&lt;b&gt;value&lt;/b&gt;" property in a CheckBoxList.&lt;/blockquote&gt;&lt;br /&gt;That is a server-side only property. You can only get the &lt;b&gt;Text &lt;/b&gt;property of the &lt;b&gt;ListItem &lt;/b&gt;(Item 1, Item 2, etc in this example).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;asp:CheckBoxList id="CheckBoxList1" runat="server"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;asp:listitem Value="1"&amp;gt;Item 1&amp;lt;/asp:listitem&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;asp:listitem Value="2"&amp;gt;Item 2&amp;lt;/asp:listitem&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;asp:listitem Value="3"&amp;gt;Item 3&amp;lt;/asp:listitem&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;/asp:CheckBoxList&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;input type="button" onclick="readCheckBoxList();" value="Read CheckBoxList" /&amp;gt; &lt;br /&gt;&amp;lt;/form&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;function getCheckBoxListItemsChecked(elementId) &lt;br /&gt;{&lt;br /&gt;&amp;nbsp;var elementRef = document.getElementById(elementId);&lt;br /&gt;&amp;nbsp;var checkBoxArray = elementRef.getElementsByTagName('input');&lt;br /&gt;&amp;nbsp;var checkedValues = '';&lt;/p&gt;&lt;p&gt;&amp;nbsp;for (var i=0; i&amp;lt;checkBoxArray.length; i++) &lt;br /&gt;&amp;nbsp;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;var checkBoxRef = checkBoxArray[i];&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;if ( checkBoxRef.checked == true ) &lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;////////////&lt;br /&gt;// AFAIK, you cannot get the value property of a &lt;b&gt;ListItem &lt;/b&gt;in a CheckBoxList.&lt;br /&gt;// You can only get the &lt;b&gt;Text property&lt;/b&gt;, which will be in an HTML label element.&lt;br /&gt;////////////&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var labelArray = checkBoxRef.parentNode.getElementsByTagName('label');&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if ( labelArray.length &amp;gt; 0 )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if ( checkedValues.length &amp;gt; 0 )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;checkedValues += ', ';&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;checkedValues += labelArray[0].innerHTML;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;}&lt;/p&gt;&lt;p&gt;&amp;nbsp;return checkedValues;&lt;br /&gt;}&lt;br /&gt;function readCheckBoxList() &lt;br /&gt;{&lt;br /&gt;&amp;nbsp;var checkedItems = getCheckBoxListItemsChecked('&amp;lt;%= CheckBoxList1.ClientID %&amp;gt;');&lt;br /&gt;&amp;nbsp;alert('Items checked: ' + checkedItems);&lt;br /&gt;}&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-4510300233126051119?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/4510300233126051119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=4510300233126051119' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4510300233126051119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4510300233126051119'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/05/how-to-get-checkboxlist-value-using.html' title='How to get the CheckBoxlist Value using Javascript'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-353100108113814870</id><published>2010-05-25T04:27:00.000-07:00</published><updated>2010-05-25T04:27:17.711-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net 4.0'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='url rewriting'/><title type='text'>Url rewritng in ASP.net 4.0</title><content type='html'>&lt;b&gt;What is URL Routing?&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;URL routing was a capability we first introduced with ASP.NET 3.5 SP1, and which is already used within ASP.NET MVC applications to expose clean, SEO-friendly “web 2.0” URLs.  URL routing lets you configure an application to accept request URLs that do not map to physical files. Instead, you can use routing to define URLs that are semantically meaningful to users and that can help with search-engine optimization (SEO).&lt;br /&gt;&lt;br /&gt;For example, the URL for a traditional page that displays product categories might look like below:&lt;br /&gt;&lt;br /&gt;     http://www.mysite.com/products.aspx?category=software&lt;br /&gt;&lt;br /&gt;Using the URL routing engine in ASP.NET 4 you can now configure the application to accept the following URL instead to render the same information:&lt;br /&gt;&lt;br /&gt;     http://www.mysite.com/products/software&lt;br /&gt;&lt;br /&gt;With ASP.NET 4.0, URLs like above can now be mapped to both ASP.NET MVC Controller classes, as well as ASP.NET Web Forms based pages.&lt;br /&gt;For more info please visits scottgu's article..&lt;br /&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2009/10/13/url-routing-with-asp-net-4-web-forms-vs-2010-and-net-4-0-series.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2009/10/13/url-routing-with-asp-net-4-web-forms-vs-2010-and-net-4-0-series.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-353100108113814870?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/353100108113814870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=353100108113814870' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/353100108113814870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/353100108113814870'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/05/url-rewritng-in-aspnet-40.html' title='Url rewritng in ASP.net 4.0'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-2734890366141911803</id><published>2010-05-16T01:17:00.000-07:00</published><updated>2010-05-16T02:03:26.768-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='HtmlForm'/><category scheme='http://www.blogger.com/atom/ns#' term='Gridview'/><category scheme='http://www.blogger.com/atom/ns#' term='Export to excel'/><title type='text'>How to export Excel uisng HtmlForm(GridView) object in asp.net</title><content type='html'>Today I want to show you another way how to export Excel file from &lt;b&gt;HtmlForm &lt;/b&gt;object. This is a serial post for How to export Excel file. Using HtmlForm object we should&amp;nbsp; use a Control which is rendering by &lt;b&gt;HtmlTextWriter&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;In this article, I use the &lt;b&gt;GridView &lt;/b&gt;control. Here I provide a method where you pass a GridView control as parameter after that this method render this gridview control as a excel file from html object.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code:C#&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Namespace:&lt;br /&gt;&lt;b&gt;using System.Web.UI.HtmlControls&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;public void ExportFromHtmlForm(GridView gvEmployee)&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; HtmlForm form = new HtmlForm();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string attachment = "attachment; filename=Employee.xls";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.ClearContent();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.AddHeader("content-disposition", attachment);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.ContentType = "application/ms-excel";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StringWriter stw = new StringWriter();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HtmlTextWriter htextw = new HtmlTextWriter(stw);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; form.Controls.Add(gvEmployee);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Controls.Add(form);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; form.RenderControl(htextw);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Write(stw.ToString());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.End();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-2734890366141911803?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/2734890366141911803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=2734890366141911803' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2734890366141911803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2734890366141911803'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/05/how-to-export-excel-uisng.html' title='How to export Excel uisng HtmlForm(GridView) object in asp.net'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-5303057093367490011</id><published>2010-05-15T23:40:00.000-07:00</published><updated>2010-05-16T02:13:32.407-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='export'/><category scheme='http://www.blogger.com/atom/ns#' term='xm.datatable'/><category scheme='http://www.blogger.com/atom/ns#' term='web service'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Export to excel'/><title type='text'>Write As XML with .XLS extensions</title><content type='html'>Today I want to share with you how to write XML file as an excel file from DataTable. Here I&amp;nbsp; provide you a function where you just send a DataTable as a parameter and this function is responsible for generate the Excel file.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void ExportAsXMLtoXLS(DataTable dt)&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; System.Data.DataTable dt = GetData();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt.TableName = "Employees";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt.WriteXml(Server.MapPath(".")+ @"\GenerateData.xls", XmlWriteMode.IgnoreSchema);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Redirect("GenerateData.xls");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-5303057093367490011?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/5303057093367490011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=5303057093367490011' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/5303057093367490011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/5303057093367490011'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/05/write-as-xml-with-xls-extensions.html' title='Write As XML with .XLS extensions'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-7351602563946746009</id><published>2010-05-15T23:08:00.000-07:00</published><updated>2010-05-15T23:08:17.720-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='no element found'/><category scheme='http://www.blogger.com/atom/ns#' term='XML Parsing Error'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><title type='text'>XML Parsing Error: no element found</title><content type='html'>Recently when I am working with web service which returns data as XML format. But unfortunately I always found that the page always show error : &lt;b&gt;XML Parsing Error: no element found&lt;/b&gt;. Error does not contain specific information about the source of error. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Problem:&lt;/b&gt;&lt;br /&gt;The common reason for XML Parsing Error: no element found is missing closing tag for one or two html element, so I checked whole xml docs several times to make sure not miss any start and closing(  or  ) tags.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;Solution:&lt;/b&gt;&lt;br /&gt;After searching for while I found that somehow ASP.NET treat the response of page as XML document and that’s why we receive XML Parsing Error: no element found error.&lt;br /&gt;To solve this error I added a line&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;Response.ContentType = "text/HTML"&lt;/b&gt;&amp;nbsp;&lt;/blockquote&gt;to .cs page. This line tells ASP.NET runtime that &lt;b&gt;response is HTML text and not XML&lt;/b&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-7351602563946746009?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/7351602563946746009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=7351602563946746009' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7351602563946746009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7351602563946746009'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/05/xml-parsing-error-no-element-found.html' title='XML Parsing Error: no element found'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-6863718510452293764</id><published>2010-05-13T01:49:00.000-07:00</published><updated>2010-05-13T01:49:38.962-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='datatable'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><category scheme='http://www.blogger.com/atom/ns#' term='Export to excel'/><title type='text'>How to DataTable export to Excel in asp.net</title><content type='html'>It is a very common question is asp.net forum and other forum that how to export DataTable to excel in asp.net.&lt;br /&gt;There are various ways to export data to excel, such as:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;Write As XML with .XLS extensions&lt;/b&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;Render DataTable as Excel&lt;/b&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;Uisng HtmlForm object&lt;/b&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;Using VerifyRenderingInServerForm&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Insha Allah, I will discuss all these export types gradually. Today I want to discuss here &lt;b&gt;how to export DataTable to Excel&lt;/b&gt;. Its very simple ,I write down a method here just call it ana pass your DataTable as a parameter then this method generate a Excel file for you. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;public void ExportDataTable(DataTable dt)&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 attachment = "attachment; filename=" + FileName.xls + "";&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; HttpContext.Current.Response.Clear();&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; HttpContext.Current.Response.AddHeader("content-disposition", attachment);&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; HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";&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 sTab = "";&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; foreach (DataColumn dc in dt.Columns)&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; HttpContext.Current.Response.Write(sTab + dc.ColumnName);&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; sTab = "\t";&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; HttpContext.Current.Response.Write("\n");&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; int 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; foreach (DataRow dr in dt.Rows)&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; sTab = "";&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 (i = 0; i &amp;lt; dt.Columns.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; HttpContext.Current.Response.Write(sTab + dr[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; sTab = "\t";&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; HttpContext.Current.Response.Write("\n");&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; HttpContext.Current.Response.End();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-6863718510452293764?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/6863718510452293764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=6863718510452293764' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6863718510452293764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6863718510452293764'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/05/how-to-datatable-export-to-excel-in.html' title='How to DataTable export to Excel in asp.net'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-5365100209985298534</id><published>2010-05-10T22:37:00.000-07:00</published><updated>2010-05-16T02:06:22.789-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='page life cycle'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='community launch'/><title type='text'>Presentation @ Visual Studio 2010 community launch program</title><content type='html'>I have presented&amp;nbsp; "&lt;b&gt;ASP.net page life cycle&lt;/b&gt;" at Visual Studio 2010 community launch program&lt;b&gt;.&lt;/b&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_QsXPTEkQU0k/S-kiwi9E5VI/AAAAAAAAACw/wkBTVuNHuoI/s1600/29906_390283948739_610263739_4130549_5395691_n.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="213" src="http://2.bp.blogspot.com/_QsXPTEkQU0k/S-kiwi9E5VI/AAAAAAAAACw/wkBTVuNHuoI/s320/29906_390283948739_610263739_4130549_5395691_n.jpg" width="320" /&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://1.bp.blogspot.com/_QsXPTEkQU0k/S-ki4QoAFAI/AAAAAAAAAC4/T4zWQ4ptr94/s1600/29906_390283963739_610263739_4130551_3266104_n.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="213" src="http://1.bp.blogspot.com/_QsXPTEkQU0k/S-ki4QoAFAI/AAAAAAAAAC4/T4zWQ4ptr94/s320/29906_390283963739_610263739_4130551_3266104_n.jpg" width="320" /&gt;&lt;/a&gt;&lt;a href="http://1.bp.blogspot.com/_QsXPTEkQU0k/S-ki9V0UCpI/AAAAAAAAADA/fZYCTxfjrp4/s1600/29906_390283973739_610263739_4130553_5226100_n.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_QsXPTEkQU0k/S-ki9V0UCpI/AAAAAAAAADA/fZYCTxfjrp4/s320/29906_390283973739_610263739_4130553_5226100_n.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt; &lt;/b&gt;You can download the presentations from &lt;a href="http://rapidshare.com/files/385544058/Presentation.zip" target="_blank"&gt;this link.&lt;/a&gt; this rapidshare link collected from Omi Azad blog.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-5365100209985298534?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/5365100209985298534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=5365100209985298534' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/5365100209985298534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/5365100209985298534'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/05/presentation-visual-studio-2010.html' title='Presentation @ Visual Studio 2010 community launch program'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_QsXPTEkQU0k/S-kiwi9E5VI/AAAAAAAAACw/wkBTVuNHuoI/s72-c/29906_390283948739_610263739_4130549_5395691_n.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-4558469035730780937</id><published>2010-05-10T05:29:00.000-07:00</published><updated>2010-05-10T05:29:03.996-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows phone 7'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Bangladesh'/><category scheme='http://www.blogger.com/atom/ns#' term='community launch'/><title type='text'>Visual Studio 2010 Community Launch Successfully!!</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_QsXPTEkQU0k/S-f8Bhc4oYI/AAAAAAAAACo/n-o1B8qIZ4I/s1600/n122898944394255_2164.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_QsXPTEkQU0k/S-f8Bhc4oYI/AAAAAAAAACo/n-o1B8qIZ4I/s320/n122898944394255_2164.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;Visual Studio 2010 community launch program successfully held at 8 May 2010. Really its a great events those who are attends at that program. Trust me, those who are failed to attend this ceremony they missed a great event. &lt;br /&gt;C# 4.0 Demystified presented by Tanzim bhai and Silverlight for Windows Mobile 7 using VS 2010 presented  by  Asif bhai make this events more fruitful specially for developers. And Omi bhai organized the whole ceremony very nicely.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-4558469035730780937?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/4558469035730780937/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=4558469035730780937' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4558469035730780937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4558469035730780937'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/05/visual-studio-2010-community-launch_10.html' title='Visual Studio 2010 Community Launch Successfully!!'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_QsXPTEkQU0k/S-f8Bhc4oYI/AAAAAAAAACo/n-o1B8qIZ4I/s72-c/n122898944394255_2164.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-8817801569798271038</id><published>2010-05-04T06:13:00.000-07:00</published><updated>2010-05-16T02:08:17.089-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='latitue'/><category scheme='http://www.blogger.com/atom/ns#' term='geolocation'/><category scheme='http://www.blogger.com/atom/ns#' term='longitude'/><category scheme='http://www.blogger.com/atom/ns#' term='country'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='ip address'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>How to get visitor's Country,longitude,latitude from IP address is asp.net</title><content type='html'>It is very common questions for new web developer how to get the client's country location to track the user.In various forum I &lt;br /&gt;&lt;br /&gt;have faced this questions. So that today I want to share how to get client's country location,longitude,latitude,country code etc.&lt;br /&gt;To get this you need to use a &lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;free database which has IP to Location mapping&lt;/b&gt; &lt;br /&gt;or &lt;br /&gt;&lt;b&gt;call a web service that does the same for you&lt;/b&gt;.&lt;/blockquote&gt;&lt;br /&gt;Using free web services is the easy way to get the location of the user based on its IP address. After goggling I have found the &lt;br /&gt;&lt;br /&gt;following web service which provide this service absolutely free and that too without any complex interface to do the same.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;a href="http://freegeoip.appspot.com/"&gt;http://freegeoip.appspot.com/&lt;/a&gt;&lt;/blockquote&gt;&lt;br /&gt;The above website provides &lt;b&gt;free IP Geolocation Web Service&lt;/b&gt; that returns data in three formats .&lt;br /&gt;&lt;br /&gt;1.&lt;b&gt; XML&lt;/b&gt;   [Extended Markup Language]&lt;br /&gt;2.&lt;b&gt; CSV &lt;/b&gt;  [Comma Separated Values]&lt;br /&gt;3.&lt;b&gt; JSON &lt;/b&gt;[JavaScript Object Notation]&lt;br /&gt;&lt;br /&gt;Here I am explaining how to get the data in XML format.&lt;br /&gt;It is very easy to use this web service,just send your ip address through the URL&lt;br /&gt;like:&lt;br /&gt;&lt;blockquote&gt;&lt;a href="http://freegeoip.appspot.com/xml/116.68.204.254"&gt;http://freegeoip.appspot.com/xml/116.68.204.254&lt;/a&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;b&gt;The returned XML with result are as below:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;&lt;span class="start-tag"&gt;Response&lt;/span&gt;&amp;gt;&lt;br /&gt;&lt;div class="expander-content"&gt;&lt;div&gt;&amp;lt;&lt;span class="start-tag"&gt;Status&lt;/span&gt;&amp;gt;&lt;span class="text"&gt;true&lt;/span&gt;&amp;lt;/&lt;span class="end-tag"&gt;Status&lt;/span&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;&lt;span class="start-tag"&gt;Ip&lt;/span&gt;&amp;gt;&lt;span class="text"&gt;116.68.204.254&lt;/span&gt;&amp;lt;/&lt;span class="end-tag"&gt;Ip&lt;/span&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;&lt;span class="start-tag"&gt;CountryCode&lt;/span&gt;&amp;gt;&lt;span class="text"&gt;BD&lt;/span&gt;&amp;lt;/&lt;span class="end-tag"&gt;CountryCode&lt;/span&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;&lt;span class="start-tag"&gt;CountryName&lt;/span&gt;&amp;gt;&lt;span class="text"&gt;Bangladesh&lt;/span&gt;&amp;lt;/&lt;span class="end-tag"&gt;CountryName&lt;/span&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;&lt;span class="start-tag"&gt;RegionCode&lt;/span&gt;&amp;gt;&lt;span class="text"&gt;81&lt;/span&gt;&amp;lt;/&lt;span class="end-tag"&gt;RegionCode&lt;/span&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;&lt;span class="start-tag"&gt;RegionName&lt;/span&gt;&amp;gt;&lt;span class="text"&gt;Dhaka&lt;/span&gt;&amp;lt;/&lt;span class="end-tag"&gt;RegionName&lt;/span&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;&lt;span class="start-tag"&gt;City&lt;/span&gt;&amp;gt;&lt;span class="text"&gt;Dhaka&lt;/span&gt;&amp;lt;/&lt;span class="end-tag"&gt;City&lt;/span&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;&lt;span class="start-tag"&gt;ZipCode&lt;/span&gt;/&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;&lt;span class="start-tag"&gt;Latitude&lt;/span&gt;&amp;gt;&lt;span class="text"&gt;23.723&lt;/span&gt;&amp;lt;/&lt;span class="end-tag"&gt;Latitude&lt;/span&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;&lt;span class="start-tag"&gt;Longitude&lt;/span&gt;&amp;gt;&lt;span class="text"&gt;90.4086&lt;/span&gt;&amp;lt;/&lt;span class="end-tag"&gt;Longitude&lt;/span&gt;&amp;gt;&lt;/div&gt;&lt;/div&gt;&amp;lt;/&lt;span class="end-tag"&gt;Response&lt;/span&gt;&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;b&gt;How to consume this web service and get the result:&lt;/b&gt;&lt;br /&gt;Here  &lt;b&gt;WebRequest &lt;/b&gt;and &lt;b&gt;WebProxy &lt;/b&gt;is responsible for make call this url and xml response is received by &lt;b&gt;WebResponse &lt;/b&gt;and store it to dataset using  &lt;b&gt;XMLTextReader&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;br /&gt;&lt;blockquote&gt;private DataTable GetGeoLocation(string ipaddress)&lt;br /&gt;{&lt;br /&gt;//Create a WebRequest&lt;br /&gt;WebRequest rssReq =  WebRequest.Create("http://freegeoip.appspot.com/xml/"&lt;br /&gt;+ ipaddress);&lt;br /&gt;//Create a Proxy&lt;br /&gt;WebProxy px =new WebProxy("http://freegeoip.appspot.com/xml/" + ipaddress, true);&lt;br /&gt;&lt;br /&gt;//Assign the proxy to the WebRequest&lt;br /&gt;rssReq.Proxy = px;&lt;br /&gt;&lt;br /&gt;//Set the timeout in Seconds for the WebRequest&lt;br /&gt;rssReq.Timeout = 2000;&lt;br /&gt;try&lt;br /&gt;{   //Get the WebResponse&lt;br /&gt;WebResponse rep = rssReq.GetResponse();&lt;br /&gt;&lt;br /&gt;//Read the Response in a XMLTextReader&lt;br /&gt;XmlTextReader xtr = new XmlTextReader(rep.GetResponseStream());&lt;br /&gt;&lt;br /&gt;//Create a new DataSet&lt;br /&gt;DataSet ds = new DataSet();&lt;br /&gt;&lt;br /&gt;//Read the Response into the DataSet&lt;br /&gt;ds.ReadXml(xtr);&lt;br /&gt;return ds.Tables[0];&lt;br /&gt;}&lt;br /&gt;catch&lt;br /&gt;{&lt;br /&gt;return null;&lt;br /&gt;}&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;&lt;b&gt;How to show result in aspx page:&lt;/b&gt;&lt;br /&gt;You can place this code on Page_Load event or under any button event whenever you like:&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;Protected void ShowGeoLocatio()&lt;/b&gt;&lt;br /&gt;{&lt;br /&gt;string sIpaddress;&lt;br /&gt;sIpaddress= Request.ServerVariables["HTTP_X_FORWARDED_FOR"];&lt;br /&gt;if(sIpaddress== "" || sIpaddress== null)&lt;br /&gt;{&lt;br /&gt;sIpaddress= Request.ServerVariables["REMOTE_ADDR"];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//call the function to consume web service and store result into datatable&lt;br /&gt;DataTable odtGeoLocation = GetGeoLocation(sIpaddress);&lt;br /&gt;if (odtGeoLocation != null)&lt;br /&gt;{&lt;br /&gt;if (odtGeoLocation .Rows.Count &amp;gt; 0)&lt;br /&gt;{&lt;br /&gt;lblCity.Text = odtGeoLocation .Rows[0]["City"].ToString();&lt;br /&gt;lblRegion.Text = odtGeoLocation .Rows[0]["RegionName"].ToString();&lt;br /&gt;lblCountry.Text = odtGeoLocation .Rows[0]["CountryName"].ToString();&lt;br /&gt;lblCountryCode.Text = odtGeoLocation .Rows[0]["CountryCode"].ToString();&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;lblError="Sorry,no data found!!";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;Hope that it may helps the developer.Thanks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-8817801569798271038?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/8817801569798271038/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=8817801569798271038' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8817801569798271038'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8817801569798271038'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/05/how-to-get-visitors-countrylongitudelat.html' title='How to get visitor&apos;s Country,longitude,latitude from IP address is asp.net'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-4613102723729361771</id><published>2010-05-03T01:26:00.000-07:00</published><updated>2010-05-03T01:26:42.041-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cultralinfo'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='HttpRequest.UserLanguages'/><category scheme='http://www.blogger.com/atom/ns#' term='language'/><category scheme='http://www.blogger.com/atom/ns#' term='HTTP_ACCEPT_LANGUAGE'/><title type='text'>How to get client's languages using Asp.net</title><content type='html'>Recently I have fall in a situation that I need the clients language for fulfill the business requirement. I have found lots of resources about it. Today I want to share with you how to get client's language using asp.net.&lt;br /&gt;&lt;br /&gt;You can get the language from Browser using&lt;br /&gt;  &lt;blockquote&gt;&lt;b&gt;HttpRequest.Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")&lt;/b&gt;.&lt;/blockquote&gt;&lt;br /&gt;or, You can also use this&lt;br /&gt; &lt;blockquote&gt;&lt;b&gt;HttpRequest.UserLanguages();&lt;/b&gt;&lt;/blockquote&gt;&lt;br /&gt;Here HttpRequest.UserLanguages return a array of languages,so to retrieve the language you can use index of array like,&lt;br /&gt; &lt;blockquote&gt;&lt;b&gt;HttpRequest.UserLanguages(0)&lt;/b&gt;;&lt;/blockquote&gt;&lt;br /&gt;But there are some differents between them.HttpRequest.UserLanguages() &lt;b&gt;returns a sorted array &lt;/b&gt;of language preferences, whereas the Request.ServerVariables("HTTP_ACCEPT_LANGUAGE") &lt;b&gt;returns a (comma-separated) string&lt;/b&gt;.  In other words, HttpRequest.UserLanguages appears to take the value of Request.ServerVariables("HTTP_ACCEPT_LANGUAGE").&lt;br /&gt;&lt;br /&gt;There are another way you can get it from CulturalInfo class.&lt;br /&gt; &lt;blockquote&gt;&lt;b&gt;CultureInfo ci = System.Threading.Thread.CurrentThread.CurrentUICulture;&lt;/b&gt;&lt;/blockquote&gt;&lt;br /&gt;This will give you what is set in the browser as the current language.But you need to &lt;b&gt;set UICulture="Auto" on page or global level&lt;/b&gt; before using System.Threading.Thread.CurrentThread.CurrentUICulture. Otherwise it will not give you the expected result. It is really a more direct way to get the client's culture.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-4613102723729361771?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/4613102723729361771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=4613102723729361771' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4613102723729361771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4613102723729361771'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/05/how-to-get-clients-languages-using.html' title='How to get client&apos;s languages using Asp.net'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-2339607482672975876</id><published>2010-05-02T23:39:00.000-07:00</published><updated>2010-05-16T02:08:56.564-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MSDN Community'/><category scheme='http://www.blogger.com/atom/ns#' term='Launch'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Bangladesh'/><title type='text'>Visual Studio 2010 Community Launch @Bangladesh</title><content type='html'>&lt;h3&gt;&lt;/h3&gt;&lt;table cellpadding="0" cellspacing="0" class="profileTable info_table" id="Time and Place"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td class="label"&gt;Date:&lt;/td&gt; &lt;td class="data"&gt;&lt;div class="datawrap"&gt;Saturday, 08 May 2010&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td class="label"&gt;Time:&lt;/td&gt; &lt;td class="data"&gt;&lt;div class="datawrap"&gt;10:30 - 14:00&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td class="label"&gt;Location:&lt;/td&gt; &lt;td class="data"&gt;&lt;div class="datawrap"&gt;Auditorium, IDB Bhaban&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td class="label"&gt;Street:&lt;/td&gt; &lt;td class="data"&gt;&lt;div class="datawrap"&gt;Sher-E-Bangla Nagar&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td class="label"&gt;Town/City:&lt;/td&gt; &lt;td class="data"&gt;&lt;div class="datawrap"&gt;Dhaka, Bangladesh&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;MSDN Bangladesh Community cordially invites you to attend Visual Studio 2010 Community Launch.&lt;/b&gt;&lt;/blockquote&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;b&gt;Program Flow:&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;- &lt;b&gt;Opening Speech&lt;/b&gt; - Omi Azad, Developer Evangelist, Microsoft Bangladesh Ltd.&lt;br /&gt;&lt;br /&gt;- &lt;b&gt;A Quick Look at Visual Studio 2010&lt;/b&gt; - Irtiza A. Akhter, CTO, Micro Web Planet&lt;br /&gt;&lt;br /&gt;- &lt;b&gt;C# 4.0 Demystified&lt;/b&gt; - Tanzim Saqib, Software Designer, British Telecom&lt;br /&gt;&lt;br /&gt;- &lt;b&gt;ASP.Net page life cycle&lt;/b&gt; - Ahsan Murshed, Software Engineer, Cyber Jahan Ltd.&lt;br /&gt;&lt;br /&gt;-&lt;b&gt; Silverlight for Windows Mobile 7 using VS 2010&lt;/b&gt; - Asif Huque, SaaS Developer, British Telecom&lt;br /&gt;&lt;br /&gt;- &lt;b&gt;T Shirt &amp;amp; CD Distribution&lt;/b&gt; - Lunch and Closing&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-2339607482672975876?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/2339607482672975876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=2339607482672975876' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2339607482672975876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2339607482672975876'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/05/visual-studio-2010-community-launch.html' title='Visual Studio 2010 Community Launch @Bangladesh'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-703394570951979029</id><published>2010-04-29T05:55:00.000-07:00</published><updated>2010-04-29T05:55:39.037-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='murshed.wordpress.com'/><category scheme='http://www.blogger.com/atom/ns#' term='IP'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>How to get client  "IP Address" using Asp.net /C#</title><content type='html'>I have found that in various forum newbie are very frequently asked this type of question how to get client IP or get mac address or country. So that I would like to share this for that user. Though its very simple but helpful.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Tip:1&lt;/b&gt;&lt;br /&gt;To get the client IP you can use the following function&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; string sClientIp=Request.UserHostAddress();&lt;br /&gt;or&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; string strHostName = System.Net.Dns.GetHostName();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();&lt;br /&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Tip:2:To avoid Proxy IP:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;To get the IP address of the machine and not the proxy use the following code&lt;br /&gt;&lt;blockquote&gt;HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];&lt;/blockquote&gt;&amp;nbsp;This will returns the client ip in string format.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;br /&gt;&lt;i&gt;C#&lt;/i&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; string ip;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ip=Request.ServerVariables("HTTP_X_FORWARDED_FOR");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(ip==string.Empty)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ip=Request.ServerVariables("REMOTE_ADDR");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;REMOTE_ADDR&lt;/b&gt; does not always provide the users IP but rather the ISPs' IP address so first test &lt;b&gt;HTTP_X_FORWARDED_FOR&lt;/b&gt; as this one is the real user IP.&lt;/blockquote&gt;&lt;br /&gt;Another important note to this the &lt;b&gt;HTTP_X_FORWARDED_FOR&lt;/b&gt; may contain an array of IP, this can happen if you connect through a proxy.What also happens when this happens is that the &lt;b&gt;REMOTE_ADDR &lt;/b&gt;may contain the proxy IP. To avoid this problem you can parse the &lt;b&gt;HTTP_X_FORWARDED_FOR&lt;/b&gt; for first entery IP.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;br /&gt;&lt;i&gt;C#&lt;/i&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; string ip;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ip=Request.ServerVariables("HTTP_X_FORWARDED_FOR") ;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!string.IsNullOrEmpty(ip))&lt;br /&gt;&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; string[] ipRange = ip.Split(',');&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string trueIP = ipRange[0].Trim();&lt;br /&gt;&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; else&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; ip=Request.ServerVariables("REMOTE_ADDR");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/blockquote&gt;&lt;br /&gt;Hope that it may helpful for the newbie.Please inform me if anything wrong in this article.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-703394570951979029?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/703394570951979029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=703394570951979029' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/703394570951979029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/703394570951979029'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/04/how-to-get-client-ip-address-using.html' title='How to get client  &quot;IP Address&quot; using Asp.net /C#'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-1502718282690299348</id><published>2010-04-28T05:20:00.000-07:00</published><updated>2010-05-16T02:14:16.398-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='IE7'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='validation control'/><category scheme='http://www.blogger.com/atom/ns#' term='IE6'/><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title type='text'>Validation control not work in FireFox or other browser</title><content type='html'>When I use validation control on asp.net it works for IE fine but failed to work in Firefox. After goggling I will find the solution. I share this code here, hope it may help others.&lt;br /&gt;&lt;br /&gt;The ASP.Net validations controls only work client side in IE.&lt;br /&gt;You can make them work in other browsers, coding as below:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;C#&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Page.Validate();&lt;br /&gt;&lt;br /&gt;if ( !Page.IsValid )&lt;br /&gt;{&lt;br /&gt;return;&lt;br /&gt;}&lt;br /&gt;//Continue Your code&lt;/blockquote&gt;&lt;br /&gt;&lt;b&gt;VB.NET&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Page.Validate()&lt;br /&gt;&lt;br /&gt;If Not Page.IsValid Then&lt;br /&gt;Return&lt;br /&gt;End If&lt;br /&gt;'Continue Your code&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Have a nice day.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-1502718282690299348?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/1502718282690299348/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=1502718282690299348' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/1502718282690299348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/1502718282690299348'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/04/validation-control-not-work-in-firefox.html' title='Validation control not work in FireFox or other browser'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-8396285782582266054</id><published>2010-04-27T06:16:00.000-07:00</published><updated>2010-05-16T02:49:09.952-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='mac'/><title type='text'>how to get  MAC address using C#</title><content type='html'>&lt;b&gt;How to get the MAC address of&amp;nbsp; system using Asp.net/C# &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now I want to share with you some simple but important for our rapid development.&lt;br /&gt;Here I want to discuss how to get system MAC address using c# , &lt;br /&gt;&lt;br /&gt;&lt;b&gt;First way:&lt;/b&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;You need to import the System.Net namespace for this to work.&lt;br /&gt;This will support IPv4 and IPv6.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();&lt;br /&gt;foreach (NetworkInterface adapter in nics)&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; IPInterfaceProperties properties = adapter.GetIPProperties();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; adapter.GetPhysicalAddress().ToString();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&lt;div style="color: black;"&gt;&lt;b&gt;&lt;span id="ctl00_ContentPlaceHolder1_lblDescription"&gt;Second way:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;span id="ctl00_ContentPlaceHolder1_lblDescription" style="color: darkblue;"&gt;&lt;span style="color: black;"&gt;public string GetMACAddress()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");&lt;br /&gt;&amp;nbsp; ManagementObjectCollection moc = mc.GetInstances();&lt;br /&gt;&amp;nbsp; string MACAddress = String.Empty;&lt;br /&gt;&amp;nbsp;foreach (ManagementObject mo in moc)&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (MACAddress == String.Empty) // only return MAC Address from first card&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; {&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; if ((bool)mo["IPEnabled"] == true) MACAddress = mo["MacAddress"].ToString();&lt;br /&gt;&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; mo.Dispose();&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp; MACAddress = MACAddress.Replace(":", "");&lt;br /&gt;&amp;nbsp;return MACAddress;&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You might want to also add&amp;nbsp; "&lt;b&gt;&lt;span id="ctl00_ContentPlaceHolder1_lblDescription" style="color: darkblue;"&gt;&lt;span style="color: black;"&gt;mo&lt;/span&gt;&lt;/span&gt;["Caption"].ToString()&lt;/b&gt;"  to test before the mac address so that you know which devices you  are looking at. &lt;br /&gt;Also, don't forget to use try/catch blocks on these as a &lt;b&gt; NullPointerReference &lt;/b&gt;will kill the app.&lt;br /&gt;&lt;span id="ctl00_ContentPlaceHolder1_lblDescription" style="color: darkblue;"&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span id="ctl00_ContentPlaceHolder1_lblDescription" style="color: darkblue;"&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span id="ctl00_ContentPlaceHolder1_lblDescription" style="color: darkblue;"&gt;&lt;span style="color: black;"&gt;How to get Client MAC address(Web):&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span id="ctl00_ContentPlaceHolder1_lblDescription" style="color: darkblue;"&gt;&lt;span style="color: black;"&gt;To get the client MAC address only way we can rely on JavaScript and Active X control of Microsoft.It is only work in IE if Active X enable for IE. &lt;/span&gt;&lt;/span&gt;&lt;b&gt;As the ActiveXObject is not available with the Firefox, its not working  with the firefox and is working fine in IE.&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;This script is for IE only:&lt;/b&gt;&lt;br /&gt;&lt;span id="ctl00_ContentPlaceHolder1_lblDescription" style="color: darkblue;"&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;lt;script language="javascript"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function showMacAddress(){&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;var obj = new ActiveXObject("WbemScripting.SWbemLocator");&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;var s = obj.ConnectServer(".");&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;var properties = s.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration");&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;var e = new Enumerator (properties);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;var output;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;output='&amp;lt;table border="0" cellPadding="5px" cellSpacing="1px" bgColor="#CCCCCC"&amp;gt;';&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;output=output + '&amp;lt;tr bgColor="#EAEAEA"&amp;gt;&amp;lt;td&amp;gt;Caption&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;MACAddress&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;';&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;while(!e.atEnd())&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;e.moveNext();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;var p = e.item ();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if(!p) continue;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;output=output + '&amp;lt;tr bgColor="#FFFFFF"&amp;gt;';&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;output=output + '&amp;lt;td&amp;gt;' + p.Caption; + '&amp;lt;/td&amp;gt;';&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;output=output + '&amp;lt;td&amp;gt;' + p.MACAddress + '&amp;lt;/td&amp;gt;';&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;output=output + '&amp;lt;/tr&amp;gt;';&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;output=output + '&amp;lt;/table&amp;gt;';&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;document.getElementById("box").innerHTML=output;&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;Hope that it may help you.Please inform me if any one get any wrong with me.&lt;br /&gt;Thanks&lt;br /&gt;&lt;span id="ctl00_ContentPlaceHolder1_lblDescription" style="color: darkblue;"&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-8396285782582266054?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/8396285782582266054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=8396285782582266054' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8396285782582266054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8396285782582266054'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/04/how-to-get-mac-address-using-c.html' title='how to get  MAC address using C#'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-8194337424112843424</id><published>2010-04-26T05:29:00.000-07:00</published><updated>2010-05-16T02:10:20.701-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='browser info'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='IE7'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='IE6'/><title type='text'>How to detect browser Information in Asp.net</title><content type='html'>Sometimes some fresher asked me how they get browser information when using asp.net. In online you can find lots of resources about. I have placed this code snippet form msdn which may help newbie.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Place this code under any button event or Page_Load event:&lt;/b&gt;&lt;br /&gt;&lt;blockquote&gt;System.Web.HttpBrowserCapabilities browser = Request.Browser;&lt;br /&gt;string s = "Browser Capabilities\n"&lt;br /&gt;+ "Type = "                    + browser.Type + "\n"&lt;br /&gt;+ "Name = "                    + browser.Browser + "\n"&lt;br /&gt;+ "Version = "                 + browser.Version + "\n"&lt;br /&gt;+ "Major Version = "           + browser.MajorVersion + "\n"&lt;br /&gt;+ "Minor Version = "           + browser.MinorVersion + "\n"&lt;br /&gt;+ "Platform = "                + browser.Platform + "\n"&lt;br /&gt;+ "Is Beta = "                 + browser.Beta + "\n"&lt;br /&gt;+ "Is Crawler = "              + browser.Crawler + "\n"&lt;br /&gt;+ "Is AOL = "                  + browser.AOL + "\n"&lt;br /&gt;+ "Is Win16 = "                + browser.Win16 + "\n"&lt;br /&gt;+ "Is Win32 = "                + browser.Win32 + "\n"&lt;br /&gt;+ "Supports Frames = "         + browser.Frames + "\n"&lt;br /&gt;+ "Supports Tables = "         + browser.Tables + "\n"&lt;br /&gt;+ "Supports Cookies = "        + browser.Cookies + "\n"&lt;br /&gt;+ "Supports VBScript = "       + browser.VBScript + "\n"&lt;br /&gt;+ "Supports JavaScript = "     + &lt;br /&gt;browser.EcmaScriptVersion.ToString() + "\n"&lt;br /&gt;+ "Supports Java Applets = "   + browser.JavaApplets + "\n"&lt;br /&gt;+ "Supports ActiveX Controls = " + browser.ActiveXControls &lt;br /&gt;+ "\n"&lt;br /&gt;+ "Supports JavaScript Version = " +&lt;br /&gt;browser["JavaScriptVersion"] + "\n";&lt;/blockquote&gt;&lt;br /&gt;For more info please visits:&lt;br /&gt;&lt;a +="" 3yekbd5b%28v="VS.100%29.aspx&amp;quot;" ;="" \n="" ]="" activex="" aol="                  + browser.AOL + " applets="   + browser.JavaApplets + " beta="                 + browser.Beta + " browser="" capabilities\n="" controls=" + browser.ActiveXControls                + " cookies="        + browser.Cookies + " crawler="              + browser.Crawler + " en-us="" for="" frames="         + browser.Frames + " href="http://www.blogger.com/Sometimes%20fresher%20asked%20me%20how%20they%20get%20browser%20information%20when%20using%20asp.net.%20Online%20you%20can%20get%20lots%20of%20source%20to%20get%20this%20information.%20I%20have%20placed%20this%20code%20snippet%20form%20msdn%20which%20may%20help%20you.%20%20%20%20%20%09System.Web.HttpBrowserCapabilities%20browser%20=%20Request.Browser;%20%20%20%20%20string%20s%20=%20" http:="" info="" is="" java="" javascript="     +              browser.EcmaScriptVersion.ToString() + " javascriptversion="" library="" major="" minor="" more="" msdn.microsoft.com="" name="                    + browser.Browser + " platform="                + browser.Platform + " please="" supports="" tables="         + browser.Tables + " type="                    + browser.Type + " vbscript="       + browser.VBScript + " version="                 + browser.Version + " visits:="" win16="                + browser.Win16 + " win32="                + browser.Win32 + "&gt;http://msdn.microsoft.com/en-us/library/3yekbd5b%28v=VS.100%29.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-8194337424112843424?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/8194337424112843424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=8194337424112843424' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8194337424112843424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8194337424112843424'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/04/how-to-detect-browser-information-in.html' title='How to detect browser Information in Asp.net'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-2047578833809428507</id><published>2010-04-25T22:54:00.000-07:00</published><updated>2010-05-16T02:10:38.234-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Gridview'/><title type='text'>How to bind Data in Customized Gridview</title><content type='html'>In asp.net gridview control is widely used control. It has lots of properties and attributes which help the developers for rapid development. Generally we can use Gridvew to show data in tabular format.&lt;br /&gt;But It has a lots of events and features which is make this control a most powerful control for asp.net. &lt;br /&gt;There are various types of field in Gridview such as:&lt;br /&gt;&lt;blockquote&gt;1.BoundField&lt;br /&gt;2.ImageField&lt;br /&gt;3.HyperLinkField &lt;br /&gt;4.ButtonField&lt;br /&gt;5.TemplateField&lt;br /&gt;6.CommandField&lt;br /&gt;7.CheckBoxField&lt;/blockquote&gt;&lt;br /&gt;These fields gives developer more flexibility to customize the gridview. Paging is efficiently handling by Gridview it is one of cool feature of it. There are various way to bind data into gridview.&lt;br /&gt;&lt;br /&gt;Today I want to focus how to bind data to a customized gridview. I have used this following way to bind customized gridview very frequently. Obviously,there may be more easier way to bind in customize gridview.&lt;br /&gt;Here I have used BoundField,Templatefield to customize the grid.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Here is the aspx code for Gridview:&lt;/b&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;lt;asp:GridView ID="gvUser" runat="server" AutoGenerateColumns="False" OnRowCommand="gvUser_RowCommand"&amp;nbsp; ShowHeader="true"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;Columns&amp;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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:boundfield datafield="User_ID" headertext="User ID" visible="false"&amp;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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:boundfield datafield="User_NAME" headertext="User Name"&amp;gt;&amp;lt;/asp:boundfield&amp;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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:boundfield datafield="User_ADDRESS" headertext="User Address"&amp;gt;&amp;lt;/asp:boundfield&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; &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; &amp;lt;asp:templatefield headertext="Edit Info"&amp;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;&amp;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;itemtemplate&amp;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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;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:linkbutton commandname="EditRowData" d="lbtnEdit" runat="server"&amp;gt;&amp;lt;/asp:linkbutton&amp;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;&amp;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;/itemtemplate&amp;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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/asp:templatefield&amp;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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:templatefield headertext="Delete Info"&amp;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;&amp;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;itemtemplate&amp;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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;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:linkbutton commandname="DeleteRowData" id="lbtnDelete" runat="server"&amp;gt;&amp;lt;/asp:linkbutton&amp;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;&amp;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;/itemtemplate&amp;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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/asp:templatefield&amp;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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:templatefield headertext="User Status"&amp;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;&amp;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;itemtemplate&amp;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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;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:linkbutton commandname="ActiveRowData" id="lbtnActiveRow" runat="server"&amp;gt;&amp;lt;/asp:linkbutton&amp;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;&amp;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;/itemtemplate&amp;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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/asp:templatefield&amp;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;&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;lt;/asp:boundfield&amp;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; &lt;/blockquote&gt;&lt;b&gt;Here is the aspx.cs code:&lt;/b&gt;&lt;br /&gt;I have placed this code under Search button click event:&lt;br /&gt;&amp;nbsp; &lt;br /&gt;protected void btnSearch_Click(object sender, EventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp; &lt;br /&gt;&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;oUserDeatilList = GetList();//Get List Of data from database.&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//You can retrieve data as you like it may be in dataset or datatable no matter.&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//I have discussed after that scenario.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataTable oDataTable = new DataTable("Sample");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oDataTable.Columns.Add(new DataColumn("User_ID", typeof(string))); ;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oDataTable.Columns.Add(new DataColumn("User_NAME", typeof(string)));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oDataTable.Columns.Add(new DataColumn("User_ADDRESS", typeof(string)));&lt;br /&gt;&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; // list of User Info are loaded into dataTable&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (oUserDeatilList != null)&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; if (oUserDeatilList.UserDetailList.Count &amp;gt; 0)&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; foreach (CUserDetail oUserDetail in oUserDeatilList.UserDetailList)&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; DataRow row = oDataTable.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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row["User_ID"] = oUserDetail.UserID;&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; row["User_NAME"] = oUserDetail.PersonName;&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; row["User_ADDRESS"] = oUserDetail.UserAddress;&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; oDataTable.Rows.Add(row);&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; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gvUser.Columns[0].Visible = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gvUser.Columns[1].Visible = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gvUser.Columns[2].Visible = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gvUser.Columns[3].Visible = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gvUser.Columns[4].Visible = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//bind data to gridview&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gvUser.DataSource = oDataTable;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gvUser.DataBind();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gvUser.Columns[0].Visible = false;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // to generat linkButton text&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; gvUser.Rows.Count; 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; LinkButton lblEdit = ((LinkButton)gvUser .Rows[i].FindControl("lbtnEdit"));&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; lblEdit.Text = "Edit";//you can do whatever you like with this control's property &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; LinkButton lblDelete = ((LinkButton)gvUser.Rows[i].FindControl("lbtnDelete"));&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; lblDelete.Text ="Delete";//you can do whatever you like with this control's property &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; LinkButton lblActive = ((LinkButton)gvUser.Rows[i].FindControl("lbtnActiveRow"));&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; lblActive.Text = "Active";//you can do whatever you like with this control's property &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; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;b&gt;protected void gvUser_RowCommand(object sender, GridViewCommandEventArgs e)&lt;/b&gt;&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; GridViewRow gvRow = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string sButtonText = ((LinkButton)e.CommandSource).CommandName;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string sUserID = gvRow.Cells[0].Text;&lt;br /&gt;&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; if (sButtonText.Equals("EditRowData"))&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; if (sUserID.Length &amp;gt; 0)&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; LinkButton oLinkButton = (LinkButton)gvRow.Cells[5].FindControl("lbtnEdit");&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;string sUrl = "AddEditUser.aspx?" + USERID + "=" + sUserID;&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.Redirect(sUrl, false);&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;//do whatever you like&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;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (sButtonText.Equals("DeleteRowData"))&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; if (sUserID.Length &amp;gt; 0)&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; LinkButton oLinkButton = (LinkButton)gvRow.Cells[5].FindControl("lbtnDelete");&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;//or do whatever you like&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;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (sButtonText.Equals("ActiveRowData"))&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; if (sUserID.Length &amp;gt; 0)&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; LinkButton oLinkButton = (LinkButton)gvRow.Cells[5].FindControl("lbtnActiveRow");&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; if (oLinkButton.Text.Equals("ACTIVE")&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; oLinkButton.Text = "INACTIVE";&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; 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; {&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; oLinkButton.Text = "ACTIVE";&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;//do whatever you like&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; &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; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;Hope that it may help you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-2047578833809428507?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/2047578833809428507/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=2047578833809428507' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2047578833809428507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2047578833809428507'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/04/how-to-bind-data-in-customized-gridview.html' title='How to bind Data in Customized Gridview'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-6896668581566882858</id><published>2010-04-20T04:51:00.000-07:00</published><updated>2010-05-16T02:49:32.400-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='aspnet_regiis'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><title type='text'>Unable to start debugging on the web server. Could not start ASP.NET or ATL Server debugging.....</title><content type='html'>Yesterday I had started my work at new work station. Very recently I needed to test a web application on localhost. I found that IIS is not installed so that I installed it myself. Then I hosted it in localhost and try run but showed me an error. Today I want to share with you how to solve this problem. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Problem:&lt;/b&gt;&lt;br /&gt;After developing an ASP.NET Web application by using localhost as the Web server, and config the Web site settings in Microsoft Internet Information Services (IIS) to use the localhost or specific IP address for Web Site Identification. Then, when I try to run the application, then  receive the following error message: &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;Error while trying to run project: Unable to start debugging on the web server. Could not start ASP.NET or ATL Server debugging.&lt;br /&gt;Verify that ASP.NET or ATL Server is correctly installed on the server.&lt;/b&gt;&lt;/blockquote&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_QsXPTEkQU0k/S82UknffwGI/AAAAAAAAACg/57Fff_yQ7pI/s1600/error-3.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="82" src="http://1.bp.blogspot.com/_QsXPTEkQU0k/S82UknffwGI/AAAAAAAAACg/57Fff_yQ7pI/s400/error-3.gif" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution:&lt;/b&gt;&lt;br /&gt;After search in google I have found lots of solution. But suddenly remembered that I have insatalled IIS after .net framework installed. I hope that &lt;b&gt;this error occurs because Microsoft Internet Information Server (IIS) is not functioning properly. Then to resolve this issue IIS must be registered with .net framework.&lt;/b&gt; You can registered IIS with .net framework by executing this command from command prompt:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;gt;C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\&lt;b&gt;aspnet_regiis -i &lt;/b&gt;&lt;/blockquote&gt;&lt;br /&gt;Now its fixed my problem.&lt;br /&gt;Have a nice day!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-6896668581566882858?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/6896668581566882858/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=6896668581566882858' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6896668581566882858'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6896668581566882858'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/04/unable-to-start-debugging-on-web-server.html' title='Unable to start debugging on the web server. Could not start ASP.NET or ATL Server debugging.....'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_QsXPTEkQU0k/S82UknffwGI/AAAAAAAAACg/57Fff_yQ7pI/s72-c/error-3.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-8878763385355799107</id><published>2010-04-19T06:01:00.000-07:00</published><updated>2010-05-16T02:00:06.323-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cookie'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='sso'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Single Sign on (SSO) Using Cookie in asp.net</title><content type='html'>There are various ways to use &lt;b&gt;Single Sign on(SSO)&lt;/b&gt; in asp.net web application. We can use cookies, session (state server), SAML and web services etc. Now we would like to give a brief overview of how to use cookie to implement Single Sign on(SSO) in asp.net web application.&lt;br /&gt;&lt;br /&gt;Assume that we have two web application hosted on different virtual directory but under same domain. As for example, our root domain is: &lt;b&gt;http://www.cookietest.com&lt;/b&gt; and&lt;br /&gt;Other two virtual directory hosted under this domain are&lt;br /&gt;&lt;b&gt;http://www.cookietest.com/cookiesite1/Login.aspx&lt;/b&gt;&lt;br /&gt;&lt;b&gt;http://www.cookietest.com/cookiesite2/Default.aspx&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;If we login successfully in cookiesite1 then it writes the login information in cookie and now opens another tab or a new window in same browser (IE, FF whatever you like). Place this address &lt;b&gt;http://www.cookietest.com/cookiesite2/Default.aspx&lt;/b&gt; in address bar logged in automatically in cookiesite2. When we try to access in cookiesite2 –&amp;gt; Default.aspx it checks the login information from cookie. If desired value found in cookie then you logged in automatically. Remember you need to enable cookie in your browser for all of these activities. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Configuration:&lt;/b&gt;&lt;br /&gt;&lt;b&gt;1.&lt;/b&gt; Web.Config&lt;br /&gt;Before coding we need to some configure in our web.config file. Though cookiesite1 and cookiesite2 are in different virtual directory their web.config file must contains the same machine validationKey, decryptionKey and validation.&lt;br /&gt;&lt;br /&gt;Like this,&lt;br /&gt;&lt;br /&gt;&amp;lt;machineKey validationKey="282487E295028E59B8F411ACB689CCD6F39DDD21E6055A3EE480424315994760ADF21B580D8587DB675FA02F79167413044E25309CCCDB647174D5B3D0DD9141"&lt;br /&gt;decryptionKey="8B6697227CBCA902B1A0925D40FAA00B353F2DF4359D2099"&lt;br /&gt;validation="SHA1" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2.&lt;/b&gt; IIS&lt;br /&gt;In IIS-&amp;gt;Directory security tab add the "ASPNET Machine Account" user and set the full rights. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Coding:&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;Write cookie after login complete:&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;Place this code in &lt;b&gt;cookiesite1-&amp;gt;Login.aspx.cs&lt;/b&gt;&lt;br /&gt;&lt;blockquote&gt;If(login_Successful)&lt;br /&gt;{&lt;br /&gt;//Create a new cookie, passing the name into the constructor&lt;br /&gt;HttpCookie cookie = new HttpCookie(“strCookieName”);&lt;br /&gt;&lt;br /&gt;//Set the cookies value&lt;br /&gt;cookie.Value =”set_cookie_value”;&lt;br /&gt;&lt;br /&gt;//Set the cookie to expire in 5 minute&lt;br /&gt;DateTime dtNow = DateTime.Now;&lt;br /&gt;TimeSpan tsMinute = new TimeSpan(0, 0, 5, 0);&lt;br /&gt;cookie.Expires = dtNow + tsMinute;&lt;br /&gt;&lt;br /&gt;//Add the cookie&lt;br /&gt;Response.Cookies.Add(cookie);&lt;br /&gt;&lt;br /&gt;Response.Write("Cookie written. ");&lt;br /&gt;}&lt;/blockquote&gt;&lt;b&gt;Check cookie is exist or not on page_load&lt;/b&gt;&lt;br /&gt;Place this code in &lt;b&gt;cookiesite2-&amp;gt;Default.aspx.cs&lt;/b&gt;&lt;br /&gt;&lt;blockquote&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;//Grab the cookie&lt;br /&gt;HttpCookie cookie = Request.Cookies[“strCookieName”];&lt;br /&gt;&lt;br /&gt;//Check to make sure the cookie exists&lt;br /&gt;if (cookie != null)&lt;br /&gt;{ &lt;br /&gt;ReadCookie();&lt;br /&gt;}&lt;br /&gt;Else&lt;br /&gt;{&lt;br /&gt;lblCookie.Text = "Cookie not found. ";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;&lt;b&gt;Read  cookie when page load:&lt;/b&gt;&lt;br /&gt;Add this method in &lt;b&gt;cookiesite2-&amp;gt;Default.aspx.cs&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;protected void ReadCookie()&lt;br /&gt;{ &lt;br /&gt;//Get the cookie name the user entered&lt;br /&gt;&lt;br /&gt;//Grab the cookie&lt;br /&gt;HttpCookie cookie = Request.Cookies[“strCookieName”];&lt;br /&gt;&lt;br /&gt;//Check to make sure the cookie exists&lt;br /&gt;if (cookie == null)&lt;br /&gt;{ &lt;br /&gt;lblCookie.Text = "Cookie not found. ";&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{ &lt;br /&gt;//Write the cookie value&lt;br /&gt;String strCookieValue = cookie.Value.ToString();&lt;br /&gt;lblCookie.Text = "The  cookie contains: &lt;b&gt;" + strCookieValue + "&lt;/b&gt;";&lt;br /&gt;}&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;Test the application in localhost.And for more information:&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa289495%28VS.71%29.aspx#vbtchaspnetcookies101anchor10"&gt;http://msdn.microsoft.com/en-us/library/aa289495%28VS.71%29.aspx#vbtchaspnetcookies101anchor10&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.aspnettutorials.com/tutorials/network/cookies-csharp.aspx"&gt;http://www.aspnettutorials.com/tutorials/network/cookies-csharp.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.developer-corner.com/Resources/KnowledgeBase/tabid/118/articleType/ArticleView/articleId/23/PageID/10/Single-Sign-On-across-multiple-ASPNET-applications.aspx"&gt;http://www.developer-corner.com/Resources/KnowledgeBase/tabid/118/articleType/ArticleView/articleId/23/PageID/10/Single-Sign-On-across-multiple-ASPNET-applications.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-8878763385355799107?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/8878763385355799107/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=8878763385355799107' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8878763385355799107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8878763385355799107'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/04/single-sign-on-sso-using-cookie-in.html' title='Single Sign on (SSO) Using Cookie in asp.net'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-8548374158063998716</id><published>2010-03-25T01:24:00.000-07:00</published><updated>2010-05-16T02:50:10.728-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web Method'/><category scheme='http://www.blogger.com/atom/ns#' term='unrecognized'/><category scheme='http://www.blogger.com/atom/ns#' term='Request format'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='web service'/><title type='text'>Request format is unrecognized for URL unexpectedly ending in</title><content type='html'>Today I want to share with you a new problem which I had faced yesterday. &lt;br /&gt;&lt;b&gt;Problem:&lt;/b&gt;&lt;br /&gt;It was about web service related error. I have used Web Method() in my application to fill up a country dropdown. Everything was going well but when I had used this web method it showed me an error like this:&lt;br /&gt;&lt;br /&gt;System.InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/GetCountyList'.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Information:&lt;/b&gt;&lt;br /&gt;After googling, I have found the solution.&lt;br /&gt;&lt;blockquote&gt;This error was occured because GET and POST are disabled by default in ASP.NET 2.0 and greater.&lt;/blockquote&gt;Now I would like to share this with you. From msdn I have got some relative information which may help you to get understand clearly.&lt;br /&gt;&lt;br /&gt;The .NET-connected Web services support HTTP GET, HTTP POST and SOAP protocols. By default, in .NET Framework 1.0, all three protocols are enabled. By default, in .NET Framework 1.1 or greater, HTTP GET and HTTP POST are both disabled. This is for security reasons.&lt;br /&gt;&lt;br /&gt;Applications that use HTTP GET or HTTP POST to invoke a Web service fail when the Web service is upgraded to .NET Framework 1.1 or greater. These applications receive a exception: System.InvalidOperationException: Request format is unrecognized.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution:&lt;/b&gt;&lt;br /&gt;HTTP GET and HTTP POST may be enabled by editing the Web.config file for the vroot where the Web service resides. The following configuration enables both HTTP GET and HTTP POST: &lt;br /&gt;&lt;br /&gt;&amp;lt;configuration&amp;gt; &lt;br /&gt;&amp;lt;system.web&amp;gt; &lt;br /&gt;&amp;lt;webServices&amp;gt; &lt;br /&gt;&amp;lt;protocols&amp;gt; &lt;br /&gt;&amp;lt;add name="HttpGet"/&amp;gt; &lt;br /&gt;&amp;lt;add name="HttpPost"/&amp;gt; &lt;br /&gt;&amp;lt;/protocols&amp;gt; &lt;br /&gt;&amp;lt;/webServices&amp;gt; &lt;br /&gt;&amp;lt;/system.web&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;For more info pls visits these links:&lt;/b&gt;&lt;br /&gt;&lt;a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;819267"&gt;http://support.microsoft.com/default.aspx?scid=kb;en-us;819267&lt;/a&gt;&lt;br /&gt;&lt;a href="http://forums.asp.net/t/1459560.aspx"&gt;http://forums.asp.net/t/1459560.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://aspadvice.com/blogs/ssmith/archive/2007/09/04/FIX-Request-format-is-unrecognized-for-URL-unexpectedly-ending-in.aspx"&gt;http://aspadvice.com/blogs/ssmith/archive/2007/09/04/FIX-Request-format-is-unrecognized-for-URL-unexpectedly-ending-in.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://forums.asp.net/t/988377.aspx"&gt;http://forums.asp.net/t/988377.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-8548374158063998716?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/8548374158063998716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=8548374158063998716' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8548374158063998716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8548374158063998716'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/03/request-format-is-unrecognized-for-url.html' title='Request format is unrecognized for URL unexpectedly ending in'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-3305699999376542482</id><published>2010-03-21T23:02:00.000-07:00</published><updated>2010-05-16T02:12:23.687-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='modal'/><category scheme='http://www.blogger.com/atom/ns#' term='page loading progress'/><category scheme='http://www.blogger.com/atom/ns#' term='ModalBackground'/><category scheme='http://www.blogger.com/atom/ns#' term='HtmlForm'/><title type='text'>How to show Page loading progress with modal background</title><content type='html'>&lt;b&gt;Problem:&lt;/b&gt;&lt;br /&gt;In my recent application development I have faced a strange problem to show modal background with page loading progress. I had tried in different way but not working perfectly. Then I have solved it. I think that there is another efficient way to solved it but now this time it is working for me.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;In css class:&lt;/b&gt;&lt;br /&gt;.divModalBackground&lt;br /&gt;{&lt;br /&gt;filter: alpha(opacity=50); -moz-opacity:0.5; opacity: 0.5;&lt;br /&gt;width:100%;&lt;br /&gt;background-color: #999988;&lt;br /&gt;position: absolute;&lt;br /&gt;top: 0px; &lt;br /&gt;left: 0px;&lt;br /&gt;z-index: 800;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;b&gt;In aspx page: &lt;/b&gt;&lt;br /&gt;&amp;lt;asp:Panel ID="Panel1" runat="server" Height="900px" Width="100%" CssClass="divModalBackground" Visible="true" &amp;gt;&lt;br /&gt;&amp;lt;asp:Image runat="Server" ID="ImageLoader" CssClass="LoadingProgress" ImageUrl="../../App_Themes/Black/images/ajax-loader.gif" /&amp;gt;&lt;br /&gt;&amp;lt;/asp:Panel&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;In aspx.cs&lt;/b&gt; page I put the code like this:&lt;br /&gt;//to show modal popup at page startup &lt;br /&gt;protected override void OnInit(EventArgs e)&lt;br /&gt;{&lt;br /&gt;base.OnInit(e);&lt;br /&gt;Panel1.Visible = true;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;b&gt;In aspx page&lt;/b&gt; place this&lt;br /&gt;// to clear the modal background when page load complete, place this code at the end of your page just before the end of the form tag&lt;br /&gt;&amp;lt;script type="text/javascript" &amp;gt;  &lt;br /&gt;function init()    &lt;br /&gt;{   &lt;br /&gt;var objdiv=document.getElementById('&amp;lt;%=Panel1.ClientID%&amp;gt;')   &lt;br /&gt;if(objdiv)   &lt;br /&gt;{&lt;br /&gt;objdiv.style.visibility = 'hidden';    &lt;br /&gt;}             &lt;br /&gt;}   &lt;br /&gt;&lt;br /&gt;init();    &lt;br /&gt;&amp;lt;/script&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-3305699999376542482?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/3305699999376542482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=3305699999376542482' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/3305699999376542482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/3305699999376542482'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/03/how-to-show-page-loading-progress-with.html' title='How to show Page loading progress with modal background'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-1230202760495869623</id><published>2010-03-04T02:01:00.000-08:00</published><updated>2010-03-04T02:13:32.863-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='event'/><category scheme='http://www.blogger.com/atom/ns#' term='refresh page'/><category scheme='http://www.blogger.com/atom/ns#' term='duplicate post'/><category scheme='http://www.blogger.com/atom/ns#' term='refresh'/><title type='text'>Prevent Duplicate record insertion on page refresh in asp.net</title><content type='html'>&lt;b&gt;Problem:&lt;/b&gt;&lt;br /&gt;Today I have faced a new problem(new for me), when I press save button it works fine and then refresh(F5 or Refresh button on browser) the page but this time it is execute the button click event again. For this duplicate data posting on the server.&lt;br /&gt;&lt;br /&gt;I try to find out the problem, nothing wrong in my code. Now turn to google and figure out the problem with solution. I have got several solutions. Now I would like to share this solution which solved my problem ......&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Assume that in &lt;b&gt;Test.aspx page&lt;/b&gt; you have a button and a TextBox:&lt;br /&gt;&lt;blockquote&gt;&amp;lt;asp:Button ID="btnSubmit" runat="server" Text="Submit" Width="110px"  OnClick="btnSubmit_Click" /&amp;gt;&lt;br /&gt;&amp;lt;asp:TextBox ID="TxtName" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;b&gt;In Test.aspx.cs..:&lt;/b&gt;&lt;br /&gt;&lt;blockquote&gt;public partial class Test : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;&lt;b&gt;protected override void OnInit(EventArgs e)&lt;/b&gt;&lt;br /&gt;{&lt;br /&gt;btnSubmit.Click += new EventHandler(btnSubmit_Click);base.OnInit(e);&lt;br /&gt;}&lt;br /&gt;&lt;b&gt;protected void Page_Load(object sender, EventArgs e)&lt;/b&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;b&gt;private void Save_Click(object sender, EventArgs e)&lt;/b&gt;&lt;br /&gt;{&lt;br /&gt;if (CheckIfDuplicateRequest())&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;return;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;//Your code to insert the value of the SomeText textbox into the database.&lt;br /&gt;//Set the value of one of the key fields in your web form in session&lt;br /&gt;Session["Refresh"] = TxtName.Text;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;b&gt;private Boolean CheckIfDuplicateRequest()&lt;/b&gt;&lt;br /&gt;{&lt;br /&gt;if (Session["Refresh"] == null)&lt;br /&gt;{&lt;br /&gt;//Probably submitting the page for the first time&lt;br /&gt;return false;&lt;br /&gt;}&lt;br /&gt;String previousValue = Session["Refresh"].ToString();&lt;br /&gt;if (previousValue != TxtName.Text)&lt;br /&gt;{&lt;br /&gt;//Submitting the page with a different set of values&lt;br /&gt;return false;&lt;br /&gt;}&lt;br /&gt;//Duplicate request.&lt;br /&gt;return true;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;you can get more help from these post:&lt;br /&gt;&lt;a href="http://aspalliance.com/687"&gt;http://aspalliance.com/687&lt;/a&gt;&lt;br /&gt;&lt;a href="http://forums.asp.net/p/1296011/3702515.aspx"&gt;http://forums.asp.net/p/1296011/3702515.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://forums.asp.net/p/1190997/2045619.aspx"&gt;http://forums.asp.net/p/1190997/2045619.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-1230202760495869623?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/1230202760495869623/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=1230202760495869623' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/1230202760495869623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/1230202760495869623'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/03/duplicate-post-when-press-refresh-page.html' title='Prevent Duplicate record insertion on page refresh in asp.net'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-5676138020103944533</id><published>2010-02-15T04:08:00.001-08:00</published><updated>2010-05-16T02:51:17.294-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='boost up'/><category scheme='http://www.blogger.com/atom/ns#' term='speed'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='optimization'/><category scheme='http://www.blogger.com/atom/ns#' term='web site'/><title type='text'>How to speed up your web site/application</title><content type='html'>In my recent experience I have faced some performance issues one of them is web application becomes very much slow. To identify this problem I have searched over the net and I have found a lots of topics.&lt;br /&gt;&lt;br /&gt;Now I want to share some of the topics with you in summarized way:&lt;br /&gt;&lt;br /&gt;1.Minimize HTTP Requests&lt;br /&gt;2.Use a Content Delivery Network&lt;br /&gt;3.Add an Expires or a Cache-Control Header&lt;br /&gt;4.Gzip Components&lt;br /&gt;5.Put Stylesheets at the Top&lt;br /&gt;6.Put Scripts at the Bottom&lt;br /&gt;7.Avoid CSS Expressions&lt;br /&gt;8.Make JavaScript and CSS External&lt;br /&gt;9.Reduce DNS Lookups&lt;br /&gt;10.Minify JavaScript and CSS&lt;br /&gt;11.Avoid Redirects&lt;br /&gt;12.Remove Duplicate Scripts&lt;br /&gt;13.Configure ETags&lt;br /&gt;14.Make Ajax Cacheable&lt;br /&gt;15.Flush the Buffer Early&lt;br /&gt;16.Use GET for AJAX Requests&lt;br /&gt;17.Post-load Components&lt;br /&gt;18.Preload Components&lt;br /&gt;19.Reduce the Number of DOM Elements&lt;br /&gt;20.Split Components Across Domains&lt;br /&gt;21.Minimize the Number of iframes&lt;br /&gt;22.No 404s&lt;br /&gt;23.Reduce Cookie Size&lt;br /&gt;24.Use Cookie-free Domains for Components&lt;br /&gt;25.Minimize DOM Access&lt;br /&gt;26.Develop Smart Event Handlers&lt;br /&gt;27.Choose &lt;link&gt;&lt;/link&gt; over @import&lt;br /&gt;28.Avoid Filters&lt;br /&gt;29.Optimize Images&lt;br /&gt;30.Optimize CSS Sprites&lt;br /&gt;31.Don't Scale Images in HTML&lt;br /&gt;32.Make favicon.ico Small and Cacheable&lt;br /&gt;33.Keep Components under 25K&lt;br /&gt;34.Pack Components into a Multipart Document&lt;br /&gt;35.Enable HTTP Keep-Alives&lt;br /&gt;36.Adjust Connection Timeouts&lt;br /&gt;37.Enable HTTP Compression&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-5676138020103944533?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/5676138020103944533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=5676138020103944533' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/5676138020103944533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/5676138020103944533'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/02/how-to-speed-up-your-web.html' title='How to speed up your web site/application'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-8604335820560237450</id><published>2010-02-10T04:30:00.000-08:00</published><updated>2010-05-16T02:13:07.253-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='user control'/><category scheme='http://www.blogger.com/atom/ns#' term='ascx'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='dynamically add control'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Dynamically add control in asp.net</title><content type='html'>Recently I have faced a problem when try to dynamically add controls in asp.net, like this,&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;In test.aspx page&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;body&amp;gt;    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;form id="form1" runat="server"&amp;gt;     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt;     &lt;br /&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/asp:PlaceHolder&amp;gt;     &lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/form&amp;gt;     &lt;br /&gt;&amp;lt;/body&amp;gt;  &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;In test.aspx.cs&lt;/span&gt;&lt;br /&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;Button btn = new Button();&lt;br /&gt;btn.ID = "btnSave";&lt;br /&gt;this.PlaceHolder1.Controls.Add(btn);        &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It is working fine but when I press any button I mean any post back occur It disappears.&lt;br /&gt;After search for a long time I got the proper solution, now I would like to share this with you.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;To avoid this problem one should dynamically load the controls during Page_Init because we may want to hook up our events with proper handler at an early stage. &lt;br /&gt;&lt;br /&gt;protected void Page_Init(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;Button btn = new Button();&lt;br /&gt;btn.ID = "btnSave";&lt;br /&gt;btn.Click+=new EventHandler(btn_Click);&lt;br /&gt;this.PlaceHolder1.Controls.Add(btn);&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Some Tips: &lt;/span&gt;&lt;br /&gt;In addition I have got more tips on it,&lt;br /&gt;&lt;br /&gt;Control's Lify cycle:&lt;br /&gt;&lt;br /&gt;1.Initialization&lt;br /&gt;2.Load view state&lt;br /&gt;3.Process postback data&lt;br /&gt;4.Load&lt;br /&gt;5.Send postback change notifications&lt;br /&gt;6.Handle postback events&lt;br /&gt;7.Prerender&lt;br /&gt;8.Save state&lt;br /&gt;9.Render&lt;br /&gt;10.Dispose&lt;br /&gt;11.Unload&lt;br /&gt;&lt;br /&gt;You will get details from here:&lt;a href="http://msdn.microsoft.com/en-us/library/aa719775%28VS.71%29.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa719775%28VS.71%29.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1.&lt;/span&gt;During Page_Init you cannot assign dynamic control property,because in Page_Init event Initialization happens before loadViewState in control's life cycle.The value assigned to the properties during Initialization will simply get overwritten by the ViewState values.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2.&lt;/span&gt;If you are expecting your ViewState to retain after the postback, always assign same ID to the dynamic control,if you use like this,&lt;br /&gt;&lt;br /&gt;protected void Page_Init(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;TextBox t = new TextBox();&lt;br /&gt;t.ID = Guid.NewGuid().ToString();&lt;br /&gt;this.form1.Controls.Add(t);       &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;It will not work. You should use same id or fixed id ,&lt;br /&gt;like this, t.ID="txtName";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Original info:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://geekswithblogs.net/shahed/archive/2008/06/26/123391.aspx"&gt;http://geekswithblogs.net/shahed/archive/2008/06/26/123391.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-8604335820560237450?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/8604335820560237450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=8604335820560237450' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8604335820560237450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8604335820560237450'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/02/dynamically-add-control-in-aspnet.html' title='Dynamically add control in asp.net'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-2491720779648172922</id><published>2010-02-09T03:23:00.000-08:00</published><updated>2010-02-09T04:36:47.024-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='content page'/><category scheme='http://www.blogger.com/atom/ns#' term='master page'/><category scheme='http://www.blogger.com/atom/ns#' term='body'/><title type='text'>Use Master page &lt;body&gt; tag in Content page of asp.net</title><content type='html'>&lt;span style="font-weight:bold;"&gt;How to use the &amp;lt;body&amp;gt; onclick from content page in asp.net?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Master page is introducing from asp.net 2.0, this is the main layout page for whole application content page just inherit it.&lt;br /&gt;&lt;br /&gt;So that,we get the &amp;lt;body&amp;gt; tag only in Master page,in content page there is no body tag. But I need to use this body tag from content page.&lt;br /&gt;&lt;br /&gt;After search it I found a solution in asp.net forum. Original link: &lt;a href="http://forums.asp.net/t/1062445.aspx"&gt;http://forums.asp.net/t/1062445.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Sample:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" Title="Test Page" %&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"&amp;gt;&lt;br&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br&gt;&lt;br /&gt;function ClearBox()&lt;br /&gt;{&lt;br /&gt; var divBoxID=document.getElementById('BoxDiv');&lt;br /&gt; divBoxID.style.display='none';&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;document.body.onclick= ClearBox;&lt;br /&gt;&lt;br&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input id="Button1" type="button" value="button" /&amp;gt;&lt;br&gt;&amp;nbsp; &lt;br&gt;&amp;lt;/asp:Content&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;For more info pls visit:&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/7a9d6h4f.aspx"&gt;http://msdn.microsoft.com/en-us/library/7a9d6h4f.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://forums.asp.net/t/1225951.aspx"&gt;http://forums.asp.net/t/1225951.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-2491720779648172922?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/2491720779648172922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=2491720779648172922' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2491720779648172922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2491720779648172922'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/02/use-master-page-tag-in-content-page-of.html' title='Use Master page &amp;lt;body&amp;gt; tag in Content page of asp.net'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-7057615335577507375</id><published>2010-02-09T00:51:00.000-08:00</published><updated>2010-05-16T02:11:39.452-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='aspx'/><category scheme='http://www.blogger.com/atom/ns#' term='single web form'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='code-behind'/><title type='text'>Converting Single-File Web Forms Pages to Code-Behind Pages</title><content type='html'>Sometimes I face some problem with single web form(only aspx page no code behind page) page. I am used to work in code-behind page,so that I try to solve this problem in may way but at last I found the solution in msdn. So I want to share this portion of the article with you: &lt;br /&gt;&lt;br /&gt;It might be that the only thing you want to do with a single-file Web Forms page in Visual Studio is to convert it to a code-behind Web Forms page. Using Visual Studio to convert a single-file page to a code-behind page automatically accomplishes the following: &lt;br /&gt;&lt;br /&gt;1. Generates a code-behind class file for the page. &lt;br /&gt;2. Adds the appropriate page directives to the page so it is linked with the code-behind file. &lt;br /&gt;&lt;br /&gt;The conversion does not do the following: &lt;br /&gt;&lt;br /&gt;a. Convert inline code to code in the class file. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;To convert a single-file .aspx page to code-behind&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;1. Open an existing project, or create a new ASP.NET Web application. &lt;br /&gt;2. On the Project menu, click Add Existing Item. &lt;br /&gt;3. Browse to the .aspx page that you want to convert. &lt;br /&gt;4. Click Open. Visual Studio will display the following message: &lt;br /&gt;&lt;br /&gt;There is no class file in the project associated with the Web Form '&lt;web forms="" name="" page=""&gt;'. Create a new class file now? &lt;br /&gt;5. Click Yes. Visual Studio will create the code-behind file and link it to the .aspx page. &lt;br /&gt;6. Click the Show All Files button in Solution Explorer, and expand the tree below your newly converted file to see the code-behind class file. &lt;br /&gt;7. Open the new .aspx file. &lt;br /&gt;8. In HTML view, inspect the file to make sure it contains an @ Page directive at the top that contains the CodeBehind attribute. &lt;br /&gt;9. Inspect the file to make sure it contains an HTML &lt;/web&gt;&lt;br /&gt;&lt;form&gt;element within the HTML  tags. If not, add &amp;lt;form&amp;gt; and &amp;lt;/form&amp;gt; tags around your controls, and in the opening tag, set the runat = "server" attribute so it looks similar to the following: &lt;br /&gt;&lt;br /&gt;&amp;lt;form id="Form1" method="post" runat="server"&amp;gt; &lt;br /&gt;&lt;br /&gt;10. If the file contains calls to COM components — for example, ADO code — add the AspCompat attribute to the Page directive in HTML view: &lt;br /&gt;&lt;br /&gt;&amp;lt;%@ Page [...] AutoEventWireup="false" AspCompat="true" %&amp;gt; &lt;br /&gt;&lt;br /&gt;If you do not have any calls to COM components, you do not need to add the AspCompat attribute. &lt;br /&gt;11. Move your code out of the .aspx file and into the .aspx.vb or .aspx.cs file. &lt;br /&gt;If you are working with a legacy file that contains ASP code, you must convert it to ASP.NET code before you can move it to the code-behind page. Converting to ASP.NET also will help you to take advantage of dynamic browser customization, state maintenance, and other features the ASP.NET server controls provide. For details, see Converting ASP to ASP.NET. &lt;br /&gt;12. Save the form, compile the project, and view it in the browser. &lt;br /&gt;13. Check for issues that appear in the Task List window, and resolve them. &lt;br /&gt;&lt;br /&gt;For more info please visit: &lt;br /&gt;&lt;a href="http://www.blogger.com/%20%20http://msdn.microsoft.com/en-us/library/aa290385%28VS.71%29.aspx"&gt;  http://msdn.microsoft.com/en-us/library/aa290385%28VS.71%29.aspx&lt;/a&gt;&lt;/form&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-7057615335577507375?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/7057615335577507375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=7057615335577507375' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7057615335577507375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7057615335577507375'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/02/converting-single-file-web-forms-pages.html' title='Converting Single-File Web Forms Pages to Code-Behind Pages'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-3270225064056831157</id><published>2010-02-09T00:43:00.000-08:00</published><updated>2010-02-09T01:04:52.903-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='json'/><title type='text'>Basic Idea on JSON</title><content type='html'>&lt;span style="font-weight:bold;"&gt;What is JSON?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;JSON is a very lightweight data format based on a subset of the JavaScript syntax, namely array and object literals. JSON allows communicating with server in a standard way. JSON is used as communication notation instead of XML.&lt;br /&gt;&lt;br /&gt;JSON objects are typed while XML data is typeless&lt;br /&gt;1.JSON types: string, number, array, boolean,&lt;br /&gt;2.XML data are all string&lt;br /&gt;&lt;br /&gt;JSON stands for Javascript Object Notation which is a data structuring format that is extremely clean and lightweight. Even though JSON is native to javascript (as in, it can be turned into an object directly by javascript), it is quite easy to handle with other languages, making it an ideal replacement of XML when javascript is involved with the exchange of data (i.e. ajax).&lt;br /&gt;&lt;br /&gt; var fruitColors =&lt;br /&gt;    {&lt;br /&gt;     "apple":"green",&lt;br /&gt;     "banana":"yellow",&lt;br /&gt;     "orange":"orange"&lt;br /&gt;    };&lt;br /&gt;&lt;br /&gt;alert(fruitColors .apple); //outputs "green"&lt;br /&gt;alert(fruitColors .orange); //outputs "orange"&lt;br /&gt;&lt;br /&gt;The above code creates an javascript object bike with two properties apple and orange&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;JSON Structures&lt;/span&gt;&lt;br /&gt;• A collection of name/value pairs&lt;br /&gt;In various languages, this is realized as an object, record,struct, dictionary, hash table, keyed list, or associative array&lt;br /&gt;• An ordered list of values&lt;br /&gt;In most languages, this is realized as an array, vector, list, or sequence&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;JSON Object Notation&lt;/span&gt;&lt;br /&gt;• A JSON object is an unordered set of name/value pairs&lt;br /&gt;• A JSON object begins with { (left brace) and ends with } (right brace)&lt;br /&gt;• Each name is followed by : (colon) and the name/value pairs are separated by , (comma) &lt;br /&gt;&lt;br /&gt;For more info please visit:&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb299886.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb299886.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.json.org/"&gt;http://www.json.org/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/JSON"&gt;http://en.wikipedia.org/wiki/JSON&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-3270225064056831157?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/3270225064056831157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=3270225064056831157' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/3270225064056831157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/3270225064056831157'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/02/what-is-json-json-is-very-lightweight.html' title='Basic Idea on JSON'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-4712979872631481893</id><published>2010-02-08T02:59:00.000-08:00</published><updated>2010-05-16T02:15:51.587-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='problem'/><category scheme='http://www.blogger.com/atom/ns#' term='xmlhttpRequest'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='IE7'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='IE6'/><title type='text'>Problem using AJAX call in IE6 and IE7</title><content type='html'>IE6 &amp;amp; IE7 makes problem when use xmlhttprequest for ajax &lt;br /&gt;&lt;br /&gt;At first time when I used core ajax using xmlhttprequest. Using this technique we sent parameter as querystring through the url,like this, &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;function GetEmailId() &lt;br /&gt;{   &lt;br /&gt;var url="http://server.com/test.aspx"; &lt;br /&gt;url=url+"&amp;amp;sid=test"; &lt;br /&gt;xmlhttp.onreadystatechange=statechangedLogin; &lt;br /&gt;xmlhttp.open("GET", url, true); &lt;br /&gt;xmlhttp.send(null); &lt;br /&gt;} &lt;br /&gt;function statechangedLogin() &lt;br /&gt;{  &lt;br /&gt;if(xmlhttp.readyState==4) &lt;br /&gt;{ &lt;br /&gt;if(xmlhttp.responseText=="Login") &lt;br /&gt;{ &lt;br /&gt;//write your code &lt;br /&gt;} &lt;br /&gt;} &lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;For the first time it is working fine,but when you try to second time in the same browser(IE6) its not work. &lt;br /&gt;&lt;br /&gt;This is becuse Internet Explorer will also cache dynamic pages and this is a problem because the URL of the page may not change but the content will.A workaround for this situation can be achieved by adding a unique time stamp or random number, or possibly both, typically using the &lt;span style="font-weight: bold;"&gt;Date object and/or Math.random()&lt;/span&gt; such as url=url+"&amp;amp;sid=test"+Math.random();. &lt;br /&gt;&lt;br /&gt;As for example: &lt;br /&gt;&lt;blockquote&gt;function GetEmailId() &lt;br /&gt;{   &lt;br /&gt;var url="http://server.com/test.aspx"; &lt;br /&gt;url=url+"&amp;amp;sid=test"+&lt;span style="font-weight: bold;"&gt;Math.random()&lt;/span&gt;; &lt;br /&gt;xmlhttp.onreadystatechange=statechangedLogin; &lt;br /&gt;xmlhttp.open("GET", url, true); &lt;br /&gt;xmlhttp.send(null); &lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;For simple document request the query string delimiter '?' can be used, or for existing queries a final sub-query can be added after a final '&amp;amp;' – to append the unique query term to the existing query. The downside is that each such request will fill up the cache with useless (never reused) content that could otherwise be used for other cached content (more useful data will be purged from cache to make room for these one-time responses). &lt;br /&gt;&lt;br /&gt;A better workaround can be achieved by adding meta tags to dynamic pages in order to make them no-cachable: &lt;br /&gt;&lt;br /&gt;&amp;lt;meta http-equiv="Pragma" content="no-cache" /&amp;gt;&lt;br /&gt;&amp;lt;meta http-equiv="Expires" content="-1" /&amp;gt;&lt;br /&gt;&lt;br /&gt;For more info please visit: &lt;br /&gt;&lt;a href="http://en.wikibooks.org/wiki/JavaScript/XMLHttpRequest"&gt;http://en.wikibooks.org/wiki/JavaScript/XMLHttpRequest&lt;/a&gt; &lt;br /&gt;&lt;a href="http://blogs.msdn.com/ie/archive/2006/01/23/516393.aspx"&gt;http://blogs.msdn.com/ie/archive/2006/01/23/516393.aspx&lt;/a&gt; &lt;br /&gt;&lt;a href="http://stackoverflow.com/questions/1229821/problem-using-ajax-call-in-ie6-and-ie7-i-am-asking-the-same-question-again-ca"&gt;http://stackoverflow.com/questions/1229821/problem-using-ajax-call-in-ie6-and-ie7-i-am-asking-the-same-question-again-ca&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-4712979872631481893?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/4712979872631481893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=4712979872631481893' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4712979872631481893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/4712979872631481893'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/02/problem-using-ajax-call-in-ie6-and-ie7.html' title='Problem using AJAX call in IE6 and IE7'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-7157140951898754934</id><published>2010-02-08T01:21:00.000-08:00</published><updated>2010-05-16T02:16:09.423-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='IE6'/><title type='text'>scrollTop not work in IE6</title><content type='html'>scrollTop problem in IE6&lt;br /&gt;I face a lots of problem ie6.Now I want to share one with you and how to solve it.&lt;br /&gt;Hope that it may helps you.&lt;br /&gt;divObj.scrollTop=0 moves to top of the div but it is not working in IE6.&lt;br /&gt;&lt;br /&gt;To solve this you can use:&lt;br /&gt;&lt;br /&gt;divObj.scrollTop = divBody.offsetTop; //for scroll to top of the div&lt;br /&gt;divObj.scrollHeight = divBody.offsetHeight; //for scroll to bottom of the div&lt;br /&gt;&lt;br /&gt;for more info please visit:&lt;br /&gt;&lt;a href="http://radio.javaranch.com/pascarello/2005/12/14/1134573598403.html"&gt;http://radio.javaranch.com/pascarello/2005/12/14/1134573598403.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-7157140951898754934?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/7157140951898754934/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=7157140951898754934' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7157140951898754934'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7157140951898754934'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/02/scrolltop-not-work-in-ie6.html' title='scrollTop not work in IE6'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-126468961776173086</id><published>2010-01-17T22:28:00.000-08:00</published><updated>2010-05-16T02:17:04.666-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Session StateServer mode'/><category scheme='http://www.blogger.com/atom/ns#' term='session'/><title type='text'>Problem with Session StateServer mode</title><content type='html'>StateServer mode stores session state in a process, referred to as the ASP.NET state service, that is separate from the ASP.NET worker process or IIS application pool. Using this mode ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm.&lt;br /&gt;&lt;br /&gt;But new user are facing problem with this Session state mode.&lt;br /&gt;&lt;br /&gt;First ensure to use StateServer mode, you must first be sure the ASP.NET state service is running on the server used for the session store. The ASP.NET state service is installed as a service when ASP.NET and the .NET Framework are installed.&lt;br /&gt;&lt;br /&gt;The ASP.Net state service is installed at the following location:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;systemroot\Microsoft.NET\Framework\versionNumber\aspnet_state.exe&lt;/span&gt;&lt;br /&gt;To configure an ASP.NET application to use StateServer mode, in the application's Web.config file do the following:&lt;br /&gt;1.Set the mode attribute of the sessionState element to StateServer.&lt;br /&gt;2.Set the stateConnectionString attribute to tcpip=&lt;span style="font-style: italic;"&gt;serverName&lt;/span&gt;:42424.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Example:&lt;/span&gt;&lt;br /&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;&amp;lt;sessionState mode="StateServer"&lt;br /&gt;stateConnectionString="tcpip=SampleStateServer:42424"&lt;br /&gt;cookieless="false"&lt;br /&gt;timeout="20"/&amp;gt;&lt;br /&gt;&amp;lt;/system.web&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem:&lt;/span&gt;&lt;br /&gt;"Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection. If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either 'localhost' or '127.0.0.1' as the server name.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;Main solution is allow remote connection from registry.&lt;br /&gt;To allow remote connection:&lt;br /&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection set value to 1&lt;br /&gt;Restart ASP.NetStateService from systemroot\Microsoft.NET\Framework\versionNumber\aspnet_state.exe.&lt;br /&gt;&lt;br /&gt;For more information visit: &lt;a href="http://msdn.microsoft.com/en-us/library/ms178586.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms178586.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-126468961776173086?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/126468961776173086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=126468961776173086' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/126468961776173086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/126468961776173086'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2010/01/problem-with-session-stateserver-mode.html' title='Problem with Session StateServer mode'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-7948625396870862416</id><published>2008-02-01T07:11:00.001-08:00</published><updated>2010-05-16T02:46:30.229-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='web service'/><title type='text'>ASP.NET AJAX ARCHITECTURE</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;span style="font-size: 85%;"&gt;Microsoft ASP.NET AJAX enables you to quickly create Web pages that include a rich user experience with responsive and familiar user interface (UI) elements. ASP.NET AJAX provides client-script libraries that incorporate cross-browser ECMAScript (JavaScript) and dynamic HTML (DHTML) technologies, and it integrates them with the ASP.NET 2.0 server-based development platform. By using ASP.NET AJAX, you can improve the user experience and the efficiency of your Web applications.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;ASP.NET AJAX Architecture&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size: 85%;"&gt;ASP.NET AJAX consists of client-script libraries and of server components that are integrated to provide a robust development framework. In addition to ASP.NET AJAX, you can use the ASP.NET AJAX Control Toolkit and the features in the ASP.NET AJAX Futures releases, which are both community supported.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: #ff6666;"&gt;&lt;span style="color: #cc0000; font-weight: bold;"&gt;AJAX Client-Server Architecture&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://4.bp.blogspot.com/_QsXPTEkQU0k/R6M9H3WvbrI/AAAAAAAAAAc/dAhhxXJzuGE/s1600-h/AJAX_Architecture.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5162036803224432306" src="http://4.bp.blogspot.com/_QsXPTEkQU0k/R6M9H3WvbrI/AAAAAAAAAAc/dAhhxXJzuGE/s320/AJAX_Architecture.png" style="cursor: pointer; display: block; margin: 0px auto 10px; text-align: center;" /&gt;&lt;/a&gt;&lt;span style="font-size: 85%;"&gt;The ASP.NET AJAX server components basically consists of ASP.NET web server  controls  and  components to manage UI and and flow of an application, and to manage serialization, validation, control extensibility.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;ASP.NET Web server controls:&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;ol&gt;&lt;li style="text-align: justify;"&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="color: #33cc00;"&gt;ScriptManager :&lt;/span&gt; Manages script resources for client components, partial-page rendering, localization, globalization, and custom user scripts. &lt;/span&gt;&lt;/li&gt;&lt;li style="text-align: justify;"&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="color: #33cc00;"&gt;UpdatePanel &lt;/span&gt;: Enables you to refresh selected parts of the page, instead of refreshing the whole page by using a synchronous postback.&lt;/span&gt;&lt;/li&gt;&lt;li style="text-align: justify;"&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="color: #009900;"&gt;UpdateProgress&lt;/span&gt; : Provides status information about partial-page updates in &lt;a href="http://www.asp.net/AJAX/Documentation/Live/mref/T_System_Web_UI_UpdatePanel.aspx"&gt;UpdatePanel&lt;/a&gt;&lt;/span&gt; &lt;span style="font-size: 85%;"&gt;controls.&lt;/span&gt;&lt;/li&gt;&lt;li style="text-align: justify;"&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="color: #009900;"&gt;Timer&lt;/span&gt; : Performs postbacks at defined intervals. You can use the &lt;a href="http://www.asp.net/AJAX/Documentation/Live/mref/T_System_Web_UI_Timer.aspx"&gt;Timer&lt;/a&gt; control to post the whole page, or use it together with the &lt;a href="http://www.asp.net/AJAX/Documentation/Live/mref/T_System_Web_UI_UpdatePanel.aspx"&gt;UpdatePanel&lt;/a&gt; control to perform partial-page updates at a defined interval.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-weight: bold;"&gt;ASP.NET AJAX Web Services&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size: 85%;"&gt;ASP.NET AJAX provides Web services that you can use from client script to work with ASP.NET application services for forms authentication and user profiles.&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size: 85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-weight: bold;"&gt;ASP.NET AJAX Client Architecture&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size: 85%;"&gt;The ASP.NET AJAX client-script libraries be made of JavaScript (.js) files that provide features for object-oriented development. The object-oriented features included in the ASP.NET AJAX client-script libraries enable a high level of consistency and modularity in client scripting. The following layers are included in the ASP.NET AJAX script libraries:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="color: #009900;"&gt;A browser compatibility layer&lt;/span&gt;. This provides compatibility across the most frequently used browsers (including Microsoft Internet Explorer, Mozilla Firefox, and Apple Safari) for your ASP.NET AJAX scripts.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="color: #009900;"&gt;ASP.NET AJAX core services&lt;/span&gt;, which include extensions to JavaScript, such as classes, namespaces, event handling, inheritance, data types, and object serialization.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="color: #009900;"&gt;An ASP.NET AJAX base class library&lt;/span&gt;, which includes components such as string builders and extended error handling.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="color: #33cc00;"&gt;A networking layer&lt;/span&gt; that handles communication with Web-based services and applications, and that manages asynchronous remote method calls.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="color: #009900;"&gt;Support for JavaScript libraries&lt;/span&gt; that are either embedded in an assembly or are provided as standalone JavaScript (.js) files. Embedding JavaScript libraries in an assembly can make it easier to deploy applications and can solve versioning issues.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style="text-align: justify;"&gt;       &lt;br /&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="color: #009900;"&gt;Support for accessing server-based forms authentication&lt;/span&gt; and profile information in client script. This support is also available to Web applications that are not created by using ASP.NET, as long as the application has access to the Microsoft AJAX Library.&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h2 class="subsectionTitle" style="font-weight: normal;"&gt;&lt;span style="font-size: 100%;"&gt;ASP.NET AJAX Control Toolkit&lt;/span&gt;&lt;/h2&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size: 85%;"&gt;The ASP.NET AJAX Control Toolkit is a collection of samples and components that show you some of the experiences you can create with rich client ASP.NET AJAX controls and extenders. The Control Toolkit provides samples and a powerful SDK to make it simple to create and reuse custom controls and extenders. You can download the ASP.NET AJAX Control Toolkit from the &lt;a href="http://go.microsoft.com/fwlink/?linkid=57512"&gt;ASP.NET Ajax&lt;/a&gt; Web site. The ASP.NET AJAX Control Toolkit is community supported.&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size: 85%;"&gt;For more information:&lt;a href="http://www.asp.net/AJAX/Documentation/Live/overview/default.aspx"&gt;http://www.asp.net/AJAX/Documentation/Live/overview/default.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 78%;"&gt;Reference: asp.net site, wikipedia&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-7948625396870862416?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/7948625396870862416/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=7948625396870862416' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7948625396870862416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/7948625396870862416'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2008/02/aspnet-ajax-architecture_01.html' title='ASP.NET AJAX ARCHITECTURE'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_QsXPTEkQU0k/R6M9H3WvbrI/AAAAAAAAAAc/dAhhxXJzuGE/s72-c/AJAX_Architecture.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-8290306017456391982</id><published>2008-02-01T06:38:00.000-08:00</published><updated>2010-05-16T02:15:00.580-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Gridview'/><title type='text'>How to add checkbox in Gridview in Asp.net</title><content type='html'>&lt;div style="text-align: justify;"&gt;In this article, we shall try discuss about the most powerful and strong  feature of  Asp.net,  GridView. Now we move to our discussion. As a developer and learner of Asp.net I faced a problem several times how to use asp.net sever side controls like, Button, Checkbox, Radio button and others.&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Then I try to find out the solution in net. I found lot of information about this query. But I got the accurate information  from  the  asp.net site.&lt;/div&gt;&lt;br /&gt;Now I make available  information through this site...&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;In this article discuss how to add a column of radio buttons to the GridView for the purpose of selecting a particular record. A column of radio buttons is a suitable user interface when the user is limited to choosing at most one item from the grid. At times, however, we may want to allow the user to pick an arbitrary number of items from the grid. Web-based email clients, for example, typically display the list of messages with a column of checkboxes. The user can select an arbitrary number of messages and then perform some action, such as moving the emails to another folder or deleting them.&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://4.bp.blogspot.com/_QsXPTEkQU0k/R6M1I3WvbqI/AAAAAAAAAAU/JT43fU-DCUE/s1600-h/52fig05CS.gif" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5162028024311279266" src="http://4.bp.blogspot.com/_QsXPTEkQU0k/R6M1I3WvbqI/AAAAAAAAAAU/JT43fU-DCUE/s320/52fig05CS.gif" style="cursor: pointer; display: block; margin: 0px auto 10px; text-align: center;" /&gt;&lt;/a&gt;&lt;br /&gt;For more information browse: &lt;a href="http://www.asp.net/learn/data-access/tutorial-52-cs.aspx"&gt;http://www.asp.net/learn/data-access/tutorial-52-cs.aspx&lt;/a&gt;&lt;br /&gt;Reference:Asp.net&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-8290306017456391982?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/8290306017456391982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=8290306017456391982' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8290306017456391982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8290306017456391982'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2008/02/how-to-add-checkbox-in-gridview-in.html' title='How to add checkbox in Gridview in Asp.net'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_QsXPTEkQU0k/R6M1I3WvbqI/AAAAAAAAAAU/JT43fU-DCUE/s72-c/52fig05CS.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-807269605212848452</id><published>2007-11-17T17:31:00.000-08:00</published><updated>2010-05-16T02:47:16.373-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS'/><title type='text'>Integrate Search Into Your Site With ASP.NET</title><content type='html'>&lt;div style="text-align: justify;"&gt;Windows Live™ Search crawls content on the Internet and also exposes search functionality to developers through a Web service that allows the search to be scoped down to just your site. You can then render the results however you see fit.&lt;br /&gt;&lt;br /&gt;Microsoft&lt;sup class="clsSmall"&gt;®&lt;/sup&gt; Office SharePoint&lt;sup class="clsSmall"&gt;®&lt;/sup&gt; Server 2007 is another good choice. It's a complete site-building and management solution that also provides robust search functionality. &lt;span class="clsFigs" user="http://msdn.microsoft.com"&gt;Figure 1&lt;/span&gt; shows the results of a SharePoint Search integrated into a custom ASP.NET page.&lt;br /&gt;&lt;br /&gt;If you're only interested in enterprise search, you may opt for the Microsoft Office SharePoint Server (MOSS) 2007 for Search edition (rather than the Standard or Enterprise versions of MOSS). The main differences are the maximum number of documents they can index and the ability to index advanced content such as external databases. However, even with the Standard version of the Search edition you can index file shares, Exchange public folders, Windows SharePoint Services (WSS) sites, and external Web sites.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;For more information: &lt;a href="http://http//msdn.microsoft.com/msdnmag/issues/07/09/WebSearch/default.aspx"&gt;http://msdn.microsoft.com/msdnmag/issues/07/09/WebSearch/default.aspx&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-807269605212848452?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/807269605212848452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=807269605212848452' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/807269605212848452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/807269605212848452'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2007/11/integrate-search-into-your-site-with.html' title='Integrate Search Into Your Site With ASP.NET'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-8795394382417032328</id><published>2007-11-17T17:13:00.000-08:00</published><updated>2010-05-16T02:48:16.986-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><title type='text'></title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;blockquote&gt;&lt;blockquote&gt;&lt;span style="font-size: 100%;"&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="color: #ff6666;"&gt;Microsoft joins the OpenAjax Alliance&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 100%;"&gt; Microsoft is joining the OpenAJAX Alliance to collaborate with other industry leaders to help evolve AJAX-style development by ensuring a high degree of interoperability,” said Keith Smith, group product manager of the Core Web Platform &amp;amp; Tools to UX Web/Client Platform &amp;amp; Tools team at Microsoft Corp. “By joining OpenAJAX, Microsoft is continuing its commitment to empower Web developers with technology that works cross-browser and cross-platform.”&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 100%;"&gt;The newest OpenAjax Alliance members include: 24SevenOffice, ActiveGrid, ActiveState, Appeon, Aptana, Arimaan Global Consulting, Custom Credit Systems (Thinwire), ESRI, Getahead (DWR), Global Computer Enterprises, GoETC, Helmi Technologies, HR-XML, iPolipo, Isomorphic Software, JSSL, Lightstreamer, Microsoft, MobileAware, NetScript Technologies, OpenSpot, OpenSymphony (OpenQA), OpSource, OS3.IT, Redmonk, Tealeaf Technology, Teleca Mobile, Transmend, Visible Measures, Visual WebGui and Volantis Systems.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 100%;"&gt;The Alliance is also announcing that the following members have all been awarded OpenAjax Interoperability certificates: Apache XAP, Dojo Foundation, ICEsoft, ILOG, Isomorphic, IT Mill, Lightstreamer, Open Link, Open Spot, Nexaweb, Software AG and TIBCO. The interoperability certificates represent progress by both OpenAjax Alliance and its members towards defining and achieving industry support for OpenAjax Conformance. &lt;/span&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;pre id="line1"&gt;** Reference:ajaxian.com&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-8795394382417032328?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/8795394382417032328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=8795394382417032328' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8795394382417032328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/8795394382417032328'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2007/11/microsoft-joins-openajax-alliance.html' title=''/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-6393814850651617156</id><published>2007-11-12T07:53:00.000-08:00</published><updated>2010-05-16T02:48:02.309-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><title type='text'>ASP.NET Site Navigation</title><content type='html'>To create a consistent, easily managed navigation solution for the site, one can use ASP.NET site navigation. ASP.NET site navigation offers the following features:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; &lt;br /&gt;&lt;b&gt;Site maps   &lt;/b&gt;You can use a site map to describe the logical structure of your site. You can then manage page navigation by modifying the site map as pages are added or removed, instead of modifying hyperlinks in all of your Web pages.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;br /&gt;&lt;b&gt;ASP.NET controls   &lt;/b&gt;You can use ASP.NET controls to display navigation menus on your Web pages. The navigation menus are based on the site map.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;br /&gt;&lt;b&gt;Programmatic control   &lt;/b&gt;You can work with ASP.NET site navigation in code to create custom navigation controls or to modify the location of information that is displayed in a navigation menu.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;br /&gt;&lt;b&gt;Access rules   &lt;/b&gt;You can configure access rules that display or hide a link in your navigation menu.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;br /&gt;&lt;b&gt;Custom site-map providers   &lt;/b&gt;You can create custom site-map providers that allow you to work with your own site-map back end (for example, a database where you store link information) and plug your provider into the ASP.NET site-navigation system.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h1 class="heading"&gt;&lt;span style="font-size: 85%;"&gt;Relationships Between Site-Navigation Components&lt;/span&gt;&lt;/h1&gt;The following illustration shows the relationships between the ASP.NET site-navigation components:&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_QsXPTEkQU0k/Rzh4LAa61qI/AAAAAAAAAAM/RxhmvWAYId0/s1600-h/navigation.gif" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5131983905875482274" src="http://1.bp.blogspot.com/_QsXPTEkQU0k/Rzh4LAa61qI/AAAAAAAAAAM/RxhmvWAYId0/s320/navigation.gif" style="cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 431px;" /&gt;&lt;/a&gt;                 Figure: Relationships between the ASP.NET site-navigation components(From msdn)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-6393814850651617156?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/6393814850651617156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=6393814850651617156' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6393814850651617156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6393814850651617156'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2007/11/aspnet-site-navigation.html' title='ASP.NET Site Navigation'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_QsXPTEkQU0k/Rzh4LAa61qI/AAAAAAAAAAM/RxhmvWAYId0/s72-c/navigation.gif' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-2340769370357220007</id><published>2007-11-10T20:16:00.000-08:00</published><updated>2007-11-10T20:23:35.614-08:00</updated><title type='text'>Earn Money From Home</title><content type='html'>&lt;a href="http://www.getacoder.com/affiliates/ref.php?u=USER"&gt;&lt;img src="http://www.getacoder.com/img/affiliates/getacoder120x60.gif" alt="Get custom programming done at GetACoder.com!" border="0" height="60" width="120" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-2340769370357220007?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/2340769370357220007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=2340769370357220007' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2340769370357220007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/2340769370357220007'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2007/11/get-custom-programming-done-at.html' title='Earn Money From Home'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246223763691022416.post-6187985573442222798</id><published>2007-10-22T02:56:00.000-07:00</published><updated>2007-10-22T02:59:20.836-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Thanks'/><title type='text'>Bismillaahir Rahmanir Rahim</title><content type='html'>Assalamu Alaikum. You can put your knowledge about asp.net or php here.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8246223763691022416-6187985573442222798?l=aspboss.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspboss.blogspot.com/feeds/6187985573442222798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8246223763691022416&amp;postID=6187985573442222798' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6187985573442222798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246223763691022416/posts/default/6187985573442222798'/><link rel='alternate' type='text/html' href='http://aspboss.blogspot.com/2007/10/bismillaahir-rahmanir-rahim.html' title='Bismillaahir Rahmanir Rahim'/><author><name>Ahsan Murshed</name><uri>http://www.blogger.com/profile/08373599952120969541</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>
