<?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-439848007702804277</id><updated>2012-02-16T00:49:06.022-08:00</updated><category term='User Details'/><category term='WebService'/><category term='Attachment'/><category term='Export'/><category term='MVC'/><category term='Download'/><category term='SQL'/><category term='javascript'/><category term='Email'/><category term='Stored Procedure'/><category term='ads'/><category term='Control'/><category term='Model'/><category term='Online'/><category term='WebRequest'/><category term='Navigation'/><category term='Encryption'/><category term='CreateUserWizard'/><category term='Favorite'/><category term='User'/><category term='cookie'/><category term='Connection String'/><category term='crystal Report'/><category term='Remotion'/><category term='voice recorder'/><category term='Decryption'/><category term='DeCompress'/><category term='.net'/><category term='Drag and Drop'/><category term='performance'/><category term='form authentication'/><category term='Bookmark'/><category term='image'/><category term='window form'/><category term='interview help'/><category term='Video'/><category term='DataAdapter'/><category term='Dot Net'/><category term='Get name'/><category term='jQuery'/><category term='basic'/><category term='security'/><category term='GridView'/><category term='culture'/><category term='View State'/><category term='YouTube'/><category term='website'/><category term='Generics'/><category term='VB'/><category term='View Controller'/><category term='APIs'/><category term='C#'/><category term='framework 2.0'/><category term='DateTime'/><category term='Array'/><category term='Dataset'/><category term='Count'/><category term='FileUpload Control'/><category term='Database'/><category term='Validation'/><category term='html'/><category term='upload'/><category term='Resize'/><category term='Auto Refreshing'/><category term='asp.net'/><category term='ImageMap'/><category term='error'/><category term='password'/><category term='google'/><title type='text'>Sharing my Experience</title><subtitle type='html'>asp.net, C#, VB, Gridview, code Examples, Dot net code, project samples...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>69</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-5807957886784381069</id><published>2011-03-02T05:35:00.000-08:00</published><updated>2011-03-02T05:35:04.113-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='website'/><title type='text'>Increase ASP.NET Web site performance</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;In the Application Web.Config File&lt;br /&gt;&lt;br /&gt;1. Set debug=false under compilation as follows:-&lt;br /&gt;&lt;br /&gt;&lt;compilation debug="false" defaultlanguage="c#"&gt;&lt;/compilation&gt;&lt;br /&gt;&lt;br /&gt;When you create the application, by default this attribute is set to "true" which is very useful while developing. However, when you are deploying your application, always set it to "false"&lt;br /&gt;&lt;br /&gt;Setting it to "true" requires the pdb information to be inserted into the file and this results in a comparatively larger file and hence processing will be slow.&lt;br /&gt;&lt;br /&gt;Therefore, always set debug="false" before deployment.&lt;br /&gt;&lt;br /&gt;2. Turn off Tracing unless until required.&lt;br /&gt;&lt;br /&gt;Tracing is one of the wonderful features which enable us to track the application's trace and the sequences. However, again it is useful only for developers and you can set this to "false" unless you require to monitor the trace logging. You can turn off tracing as follows:-&lt;br /&gt;&lt;br /&gt;&lt;trace enabled="false" localonly="true" pageoutput="false" requestlimit="10" tracemode="SortByTime"&gt;&lt;/trace&gt;&lt;br /&gt;&lt;br /&gt;3. Turn off Session State, if not required.&lt;br /&gt;&lt;br /&gt;ASP.NET Manages session state automatically. However, in case you dont require Sessions, disabling it will help in improving the performance.&lt;br /&gt;&lt;br /&gt;You may not require seesion state when ur pages r static or whn u dont need to store infor captured in the page.&lt;br /&gt;&lt;br /&gt;You can turn off session state as follows:-&lt;br /&gt;&lt;br /&gt;&lt;sessionstate cookieless="false" mode="Off" sqlconnectionstring="data source=127.0.0.1;Trusted_Connection=no" stateconnectionstring="tcpip=127.0.0.1:42424" timeout="20"&gt;&lt;/sessionstate&gt;&lt;br /&gt;&lt;br /&gt;While developing using Visual Studio.NET&lt;br /&gt;&lt;br /&gt;1. Select the Release mode before making the final Build for your application. This option is available in the Top Frame just under the Window Menu option. By default, the Mode is Debug&lt;br /&gt;&lt;br /&gt;There are several things happening when you Build/Re-Build applications in the Debug Mode. First of all, it creates an additional PDB File under your BIN directory. This holds all the Debug information.&lt;br /&gt;&lt;br /&gt;Secondly, the Timeout is very high since you require higher time out frequency while debugging such that your process hangs on until you get to the exact break point where error is there.&lt;br /&gt;&lt;br /&gt;So, selecting Release Mode will greatly improve the performance of the application when u deploy.&lt;br /&gt;&lt;br /&gt;General Methods to improve the Performance&lt;br /&gt;&lt;br /&gt;1. Disable ViewState as and when not required.&lt;br /&gt;ViewState is a wonderful technique which preserves the state of your form and controls. However, its a overhead since all the information needs to be stored in the viewstate and particularly if you are building applications which target Dial Up Internet Connection Users, ViewState can make your application very slow. In case you dont require viewstate, disable it.&lt;br /&gt;&lt;br /&gt;You can disable it at different levels ex., for Page, Control etc., by setting&lt;br /&gt;EnableViewState="false"&lt;br /&gt;&lt;br /&gt;2. Avoid Frequent round trips to the Database.&lt;br /&gt;Calls made to Database can be quite expensive in terms of response time as well as resources and it can be avoided by using Batch Processing.&lt;br /&gt;&lt;br /&gt;Make calls to Database as mininal as possible and make them last even lesser time. Use of DataAdapter wherever applicable is very useful since, it automatically opens and closes Connection whenever required and doesnt require user to explicitly open the connection.&lt;br /&gt;&lt;br /&gt;A number of connections opened and not closed adequately can directly influence in performance slow down.&lt;br /&gt;&lt;br /&gt;3. Avoid Throwing Exceptions.&lt;br /&gt;Exceptions are a greate way to handle errors that occur in your application logic. However, throwing exceptions is a costly resource and must be avoided. Use specific exceptions and use as minimal as possible to avoid resource overhead.&lt;br /&gt;&lt;br /&gt;For example, catching a SQLException is better when you expect only those kind of exceptions instead of a generic Exception.&lt;br /&gt;&lt;br /&gt;4. Use Caching to improve the performance of your application.&lt;br /&gt;OutputCaching enables your page to be cached for specific duration and can be made invalid based on various paramters that can be specified. The Cache exists for the duration you specify and until that time, the requests do not go to the server and are served from the Cache.&lt;br /&gt;&lt;br /&gt;Do not assign cached items a short expiration. Items that expire quickly cause unnecessary turnover in the cache and frequently cause more work for cleanup code and the garbage collector.&lt;br /&gt;&lt;br /&gt;In case you have static as well as dynamic sections of your page, try to use Partial Caching (Fragment Caching) by breaking up your page into user controls and specify Caching for only those Controls which are more-or-less static.&lt;br /&gt;&lt;br /&gt;For more details regarding caching look into ASP.NET Caching Features&lt;br /&gt;&lt;br /&gt;5. Use appropriate Authentication Mechanism.&lt;br /&gt;The Authentication Mechanism you choose determines the cost associated with it and hence select the appropriate mechanism. An informal but useful order is as follows:-&lt;br /&gt;&lt;br /&gt;Authentication Modes&lt;br /&gt;&lt;br /&gt;1. None&lt;br /&gt;2. Windows&lt;br /&gt;3. Forms&lt;br /&gt;4. Passport&lt;br /&gt;&lt;br /&gt;6. Validate all Input received from the Users.&lt;br /&gt;User Input is Evil and it must be thoroughly validated before processing to avoid overhead and possible injections to your applications. Use Client Side Validations as much as possible. However, do a check at the Server side too to avoid the infamous Javascript disabled scenarios.&lt;br /&gt;&lt;br /&gt;7. Use Finally Method to kill resources.&lt;br /&gt;In your Try..Catch.. Block, always use the Finally method to close Open connections, Open DataReaders, Files and other resources such that they get executed independent of whether the code worked in Try or went to Catch.&lt;br /&gt;&lt;br /&gt;The Finally method gets executed independent of the outcome of the Block.&lt;br /&gt;&lt;br /&gt;8. The String and Stringbuilder Magic.&lt;br /&gt;Perhaps the most ignored type in .NET is the stringbuilder. I am sure many of us are not even aware of Stringbuilder and its advantage over string (atleast I didnt know for 1 year :))&lt;br /&gt;&lt;br /&gt;String is Evil when you want to append and concatenate text to your string. In other words, if you are initially creating a string say s = "Hello". Then you are appending to it as s = s + " World"; You are actually creating two instances of string in memory. Both the original as well as the new string will be stored in the memory. For that matter, all the activities you do to the string are stored in the memory as separate references and it must be avoided as much as possible.&lt;br /&gt;&lt;br /&gt;Use StringBuilder which is very useful in these kind of scenarios. For the example above, using a StringBuilder as s.Append(" World"); which only stores the value in the original string and no additional reference is created.&lt;br /&gt;&lt;br /&gt;9. Avoid Recursive Functions / Nested Loops&lt;br /&gt;These are general things to adopt in any programming language, which consumes lot of memory. Always avoid Nested Loops, Recursive functions, to improve performance.&lt;br /&gt;&lt;br /&gt;Having said that, proper functions and call backs do increase the performance instead of having a huge chunk of lines of code in single method.&lt;br /&gt;&lt;br /&gt;The above are just pointers to improve the performance of your application and are just illustrative. There are many more ways in which you can improve the performance of your applications. I havent dealt with IIS and SQL Server side tips to improve performance which I would explain in my forthcoming articles.&lt;br /&gt;&lt;br /&gt;The above are my view and a collective response from various resources and you are welcome to share your views / corrections if any.&lt;br /&gt;&lt;br /&gt;Cheers and Happy Programming !!!&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=sharingmy-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=B003JTHBVU&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-5807957886784381069?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/5807957886784381069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=5807957886784381069' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5807957886784381069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5807957886784381069'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2011/03/increase-aspnet-web-site-performance.html' title='Increase ASP.NET Web site performance'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-8684859051270805675</id><published>2011-02-05T10:32:00.000-08:00</published><updated>2011-04-25T08:08:16.725-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='View Controller'/><category scheme='http://www.blogger.com/atom/ns#' term='Model'/><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='View State'/><title type='text'>Difference Between ASP.NET MVC and ASP.NET WebForms</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="line-height: 13.5pt; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Lucida Sans Unicode', sans-serif; font-size: 10pt;"&gt;One of the frequently asked questions about ASP.NET MVC is that how is different from ASP.NET WebForms. Is ASP.NET MVC a replacement for WebForms.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: 13.5pt; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Lucida Sans Unicode', sans-serif; font-size: 10pt;"&gt;The answer is No. ASP.NET MVC, is not a replacement for WebForms. Both ASP.NET MVC and ASP.NET WebForms are built on top of the Core ASP.NET Framework. In fact a lot of features we use in ASP.NET such as Roles, Membership, Authentication and a lot of namespaces, classes and interfaces can be used in an ASP.NET MVC application&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: 13.5pt; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Lucida Sans Unicode', sans-serif; font-size: 10pt;"&gt;Here are some points that I wrote in an article for&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'Lucida Sans Unicode', sans-serif; font-size: 10pt;"&gt;&lt;span class="Apple-style-span" style="color: #cc0000;"&gt;www.dotnetcurry.com&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Lucida Sans Unicode', sans-serif; font-size: 10pt;"&gt;&amp;nbsp;that differentiate ASP.NET WebForms from ASP.NET MVC:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="width: 540px;"&gt;&lt;tbody&gt;&lt;tr&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 203.25pt;" valign="top" width="271"&gt;&lt;div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-align: center;"&gt;&lt;b&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;ASP.NET WebForms&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 200.25pt;" valign="top" width="267"&gt;&lt;div align="center" class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-align: center;"&gt;&lt;b&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;ASP.NET MVC&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 203.25pt;" valign="top" width="271"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;Uses the   ‘Page Controller’ pattern. Each page has a code-behind class that acts as a   controller and is responsible for rendering the layout.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 200.25pt;" valign="top" width="267"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;Uses the   ‘Front Controller’ pattern. There is a single central controller for all   pages to process web application requests and facilitates a rich routing   architecture&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 203.25pt;" valign="top" width="271"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;Uses an   architecture that combines the Controller (code behind) and the View (.aspx).   Thus the Controller has a dependency on the View. Due to this, testing and   maintainability becomes an issue.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 200.25pt;" valign="top" width="267"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;ASP.NET MVC   enforces a "separation of concerns". The Model does not know   anything about the View. The View does not know there’s a Controller. This   makes MVC applications easier to test and maintain&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 203.25pt;" valign="top" width="271"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;The View is   called before the Controller.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 200.25pt;" valign="top" width="267"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;Controller   renders View based on actions as a result of the User Interactions on the UI.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 203.25pt;" valign="top" width="271"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;At its core,   you ‘cannot’ test your controller without instantiating a View. There are   ways to get around it using tools.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 200.25pt;" valign="top" width="267"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;At its core,   ASP.NET MVC was designed to make test-driven development easier. You ‘can’   test your Controller without instantiating a View and carry out unit-tests   without having to run the controllers in an ASP.NET process.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 203.25pt;" valign="top" width="271"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;WebForms   manage state by using view state and server-based controls.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 200.25pt;" valign="top" width="267"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;ASP.NET MVC   does not maintain state information by using view state&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 203.25pt;" valign="top" width="271"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;WebForms   supports an event-driven programming style that is like Windows applications   and is abstracted from the user. The State management is made transparent by   using sessions, viewstate etc. In the process, the HTML output is not clean   making it difficult to manage later. The ViewState also increases your page   size.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 200.25pt;" valign="top" width="267"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;In ASP.NET   MVC, the output is clean and you have full control over the rendered HTML.   The orientation is towards building standard compliant pages and provides   full control over the behavior of an application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 203.25pt;" valign="top" width="271"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;Deep   understanding of HTML, CSS and JavaScript is not required to a large extent   since the WebForm model abstracts a lot of these details and provides   automatic plumbing. While abstracting details to provide ease of use,   sometimes a solution is overcomplicated, than it needs to be.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 200.25pt;" valign="top" width="267"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;A thorough   understanding of how HTML, CSS and JavaScript work together is required. The   advantage is you can do a lot of jQuery and AJAX stuff in an efficient and   simple manner than you would do in an ASP.NET application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 203.25pt;" valign="top" width="271"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;WebForms can   drastically reduce time while building up intranet and internet applications   that use a lot of controls (drag and drop model). Although this is true for   development, a lot of time is spent later to code around limitations.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 200.25pt;" valign="top" width="267"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;You lose the   'drag and drop' quick model of building your web applications. The focus is   on control over the application behavior and test-driven development. The   model is extensible and you do not have to spend time working around   limitations.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 203.25pt;" valign="top" width="271"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;Relatively   simple to learn and pickup. Works very well for developers who initially have   trouble with the HTTP/HTML model and are coming from a similar WinForms   oriented event model.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 200.25pt;" valign="top" width="267"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;There is a   learning curve to understand the why, when and how of ASP.NET MVC.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 203.25pt;" valign="top" width="271"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;Lesser amount   of code is required to build webapps since a lot of components are integrated   and provided out of the box. You can also use a lot of data controls provided   out of the box that rely on ViewState.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 200.25pt;" valign="top" width="267"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;Since the   application tasks are separated into different components, amount of code   required is more. Since ASP.NET MVC does not use ViewState, you cannot use   Data controls like GridView, Repeater.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 203.25pt;" valign="top" width="271"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;Works very   well for small teams where focus is on rapid application development&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="padding: 1.5pt 1.5pt 1.5pt 1.5pt; width: 200.25pt;" valign="top" width="267"&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt;"&gt;Works well   for large projects where focus in on testability and maintainability&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="MsoNormal"&gt;&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=sharingmy-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=1430234040&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&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/439848007702804277-8684859051270805675?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/8684859051270805675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=8684859051270805675' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/8684859051270805675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/8684859051270805675'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2011/02/difference-between-aspnet-mvc-and.html' title='Difference Between ASP.NET MVC and ASP.NET WebForms'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-8355975943123359149</id><published>2010-07-26T07:41:00.000-07:00</published><updated>2011-01-22T07:30:12.090-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Encryption'/><category scheme='http://www.blogger.com/atom/ns#' term='password'/><category scheme='http://www.blogger.com/atom/ns#' term='Decryption'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Password encryption and decryption in C#</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;b&gt;HOW TO ENCODE A PASSWORD :&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;private string base64Encode(string sData)&lt;br /&gt;{&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;byte[] encData_byte = new byte[sData.Length];&lt;br /&gt;&lt;br /&gt;encData_byte = System.Text.Encoding.UTF8.GetBytes(sData);&lt;br /&gt;&lt;br /&gt;string encodedData = Convert.ToBase64String(encData_byte);&lt;br /&gt;&lt;br /&gt;return encodedData;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;catch(Exception ex)&lt;br /&gt;{&lt;br /&gt;throw new Exception("Error in base64Encode" + ex.Message);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;b&gt;HOW TO DECODE IT :&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public string base64Decode(string sData)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();&lt;br /&gt;&lt;br /&gt;System.Text.Decoder utf8Decode = encoder.GetDecoder();&lt;br /&gt;&lt;br /&gt;byte[] todecode_byte = Convert.FromBase64String(sData);&lt;br /&gt;&lt;br /&gt;int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length);&lt;br /&gt;&lt;br /&gt;char[] decoded_char = new char[charCount];&lt;br /&gt;&lt;br /&gt;utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);&lt;br /&gt;&lt;br /&gt;string result = new String(decoded_char);&lt;br /&gt;&lt;br /&gt;return result;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;HOW TO USE :&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;pass the passwd at the time of registration process to that function and save it in database .at the time of login retrive it and decode it and compare with password entered by user,if satisfy then redirect to another page else will be in correct email or userid or password.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;calling function for encode&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;string pwed = base64encode(val);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;calling function for decode&lt;br /&gt;&lt;br /&gt;string pwed = base64Decode(val);&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-8355975943123359149?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/8355975943123359149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=8355975943123359149' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/8355975943123359149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/8355975943123359149'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/07/password-encryption-and-decryption-in-c.html' title='Password encryption and decryption in C#'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-4204809998197618059</id><published>2010-03-07T09:29:00.000-08:00</published><updated>2010-06-29T03:12:08.505-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Dot Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Generics'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='basic'/><title type='text'>Introduction to generics in .net</title><content type='html'>&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;div&gt;&lt;b&gt;What Are Generics?&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When we look at the term "generic", unrelated to the programming world, it simply means something that is not tied to any sort of brand name. For example, if we purchase some generic dish soap, soap that has no brand name on it, we know that we are buying dish soap and expect it to help us clean our dishes, but we really don't know what exact brand (if any) will be inside the bottle itself. We can treat it as dish soap even though we don't really have any idea of its exact contents.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Think of Generics in this manner. We can refer to a class, where we don't force it to be related to any specific Type, but we can still perform work with it in a Type-Safe manner. A perfect example of where we would need Generics is in dealing with collections of items (integers, strings, Orders etc.). We can create a generic collection than can handle any Type in a generic and Type-Safe manner. For example, we can have a single array class that we can use to store a list of Users or even a list of Products, and when we actually use it, we will be able to access the items in the collection directly as a list of Users or Products, and not as objects (with boxing/unboxing, casting).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;"Generic" Collections as we see them today&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Currently, if we want to handle&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt; our Types in a generic manner, we always need to cast them to a System.Object, and we lose any benefit of a rich-typed development experience. For example, I'm sure most of us are familiar with the System.Collection.ArrayList class in Framework v1 and v1.1. If you have used it at all, you will notice a few things about it:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. It requires that you store everything in it as an object&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;public virtual int Add(object value);&lt;/div&gt;&lt;div&gt;public virtual object this[int index] {get; set;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. You need to cast up in order to get your object back to its actual Type&lt;/div&gt;&lt;div&gt;3. Performance is really lacking, especially when iterating with foreach()&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;4. It performs no type safety for you (no exceptions are thrown even if you add objects of different types to a single list)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;System.Collections.ArrayList list = new System.Collections.ArrayList();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;list.Add("a string");&lt;/div&gt;&lt;div&gt;list.Add(45); //no exception thrown&lt;/div&gt;&lt;div&gt;list.Add(new System.Collections.ArrayList()); //no exception&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;foreach(string s in list) { //exception will be thrown!&lt;/div&gt;&lt;div&gt;System.Console.WriteLine(s);&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For some situations we may feel the need to implement IEnumerable and IEnumerator in order to create a custom collection of our given Type, that is, a Type-safe collection for our needs. If you had a User object, you could create another class (which implements IEnumerable and IEnumerator, or just IList) that allows you to only add and access User objects, even though most implementations will still store them as objects. It is a lot of work implementing these two interfaces, and you can imagine the work needed to create this additional collection class every time you wanted a Type-safe collection.&lt;/div&gt;&lt;div&gt;The third and final way of creating a collection of items is by simply creating an array of that type, for example:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;string[] mystrings = new string[]{"a", "b", "c"};&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This will guarantee Type safety, but is not very reusable nor very friendly to work with. Adding a new item to this collection would mean needing to create a temporary array and copy the elements into this new temporary array, resizing the old array, copying the data back into it, and then adding the new item to the end of that collection. In my humble opinion, this is too much work that tends to be very error prone.&lt;/div&gt;&lt;div&gt;What we need is a way to create a Type-safe collection of items that we can use for any type imaginable. This template, or generic class, should be able to perform all of the existing duties that we need for our collections: adding, removing, inserting, etc. The ideal situation is for us to be able to create this generic collection functionality once and never have to do it again. You must also consider other types of collections that we commonly work with and their functionality, such as a Stack (First in, Last out) or a Queue (First In, First out), etc. It would be nice to be able to create different types of generic collections that behave in standard ways.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the next I will show you how to create your first Generic Type.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Creating Our First Generic Type&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In this section we will create a very simple generic class and demonstrate how it can be used as a container for a variety of other Types. Below is a simple example of what a generic class could look like:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;public class Col&lt;t&gt; {&lt;/t&gt;&lt;/div&gt;&lt;div&gt;T t;&lt;/div&gt;&lt;div&gt;public T Val{get{return t;}set{t=value;}}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There are a few things to notice. The class name "Col&lt;t&gt;" is our first indication that this Type is generic, specifically the brackets containing the Type placeholder. This Type placeholder "T" is used to show that if we need to refer to the actual Type that is going to be used when we write this class, we will represent it as "T". Notice on the next line the variable declaration "T t;" creates a member variable with the type of T, or the generic Type which we will specify later during construction of the class (it will actually get inserted by the Common Language Runtime (CLR) automatically for us). The final item in the class is the public property. Again, notice that we are using the Type placeholder "T" to represent that generic type for the type of that property. Also notice that we can freely use the private variable "t" within the class.&lt;/t&gt;&lt;/div&gt;&lt;div&gt;In order to use this class to hold any Type, we simply need to create a new instance of our new Type, providing the name of the Type within the "&amp;lt;&amp;gt;" brackets and then use that class in a Type-safe manner. For example:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;public class ColMain {&lt;/div&gt;&lt;div&gt;public static void Main() {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;//create a string version of our generic class&lt;/div&gt;&lt;div&gt;Col&lt;string&gt; mystring = new Col&lt;string&gt;();&lt;/string&gt;&lt;/string&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;//set the value&lt;/div&gt;&lt;div&gt;mystring.Val = "hello";&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;//output that value&lt;/div&gt;&lt;div&gt;System.Console.WriteLine(mystring.Val);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;//output the value's type&lt;/div&gt;&lt;div&gt;System.Console.WriteLine(mystring.Val.GetType());&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;//create another instance of our generic class, using a different type&lt;/div&gt;&lt;div&gt;Col&lt;int&gt; myint = new Col&lt;int&gt;();&lt;/int&gt;&lt;/int&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;//load the value&lt;/div&gt;&lt;div&gt;myint.Val = 5;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;//output the value&lt;/div&gt;&lt;div&gt;System.Console.WriteLine(myint.Val);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;//output the value's type&lt;/div&gt;&lt;div&gt;System.Console.WriteLine(myint.Val.GetType());&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When we compile the two classes above and then run them, we will see the following output:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;hello&lt;/div&gt;&lt;div&gt;System.String&lt;/div&gt;&lt;div&gt;5&lt;/div&gt;&lt;div&gt;System.Int32&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Even though we used the same class to actually hold our string and int, it keeps their original type intact. That is, we are not going to and from a System.Object type just to hold them.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Generic Collections&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The .NET team has provided us with a number of generic collections to work with in the the latest version of the .NET Framework. List, Stack, and Queue are all going to be implemented for us. Let's see an example on how to use the provided Generic List class.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For this example we want to be able to hold a collection of a Type that we create, which we used to represent a User in our system. Here is the definition for that class:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;namespace Rob {&lt;/div&gt;&lt;div&gt;public class User {&lt;/div&gt;&lt;div&gt;protected string name;&lt;/div&gt;&lt;div&gt;protected int age;&lt;/div&gt;&lt;div&gt;public string Name{get{return name;}set{name=value;}}&lt;/div&gt;&lt;div&gt;public int Age{get{return age;}set{age=value;}}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now that we have our User defined, let's create an instance of the .NET Framework Generic version of a simple List:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;System.Collections.Generic.List&lt;rob.user&gt; users&lt;/rob.user&gt;&lt;/div&gt;&lt;div&gt;= new System.Collections.Generic.List&lt;rob.user&gt;();&lt;/rob.user&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Notice the new "Generic" namespace within the System.Collections namespace. This is where we will find all the new classes for our use. The "List" class within that namespace is synonymous with the typical System.Collections.ArrayList class, which I'm sure most of us are very familiar with by now. Please note that although they are similar there are several important differences.&lt;/div&gt;&lt;div&gt;So now that we have a Type-safe list of our User class, let's see how we can use this class. What we will do is simply loop 5 times and create a new User and add that User to our users collection above:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;for(int x=0;x&amp;lt;5;x++)&amp;gt;&lt;br /&gt;&lt;div&gt;Rob.User user = new Rob.User();&lt;/div&gt;&lt;div&gt;user.Name="Rob" + x;&lt;/div&gt;&lt;div&gt;user.Age=x;&lt;/div&gt;&lt;div&gt;users.Add(user);&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This should seem straight forward to you by now. In the next step we will iterate over that same collection and output each item to the console:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;foreach(Rob.User user in users) {&lt;/div&gt;&lt;div&gt;System.Console.WriteLine(&lt;/div&gt;&lt;div&gt;System.String.Format("{0}:{1}", user.Name, user.Age)&lt;/div&gt;&lt;div&gt;);&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is slightly different that what we are used to. What you should notice right off the bat is that we do not have to worry about the Type being "Rob.User". This is because our generic collection is working in a Type-safe manner; it will always be what we expect.&lt;/div&gt;&lt;div&gt;Another way to output the same list would be to use a simple for() loop instead, and in this case we do not have to cast the object out of the collection in order to use it properly:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;for(int x=0;x&lt;users.count;x++)&gt;&lt;/users.count;x++)&gt;&lt;br /&gt;&lt;div&gt;System.Console.WriteLine(&lt;/div&gt;&lt;div&gt;System.String.Format("{0}:{1}", users[x].Name, users[x].Age)&lt;/div&gt;&lt;div&gt;);&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;No more silly casting or boxing involved. Here is the complete listing of the source plus the output of the result of executing the console application:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;User.cs&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;namespace Rob {&lt;/div&gt;&lt;div&gt;public class User {&lt;/div&gt;&lt;div&gt;protected string name;&lt;/div&gt;&lt;div&gt;protected int age;&lt;/div&gt;&lt;div&gt;public string Name{get{return name;}set{name=value;}}&lt;/div&gt;&lt;div&gt;public int Age{get{return age;}set{age=value;}}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Main.cs&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;public class M {&lt;/div&gt;&lt;div&gt;public static void Main(string[] args) {&lt;/div&gt;&lt;div&gt;System.Collections.Generic.List&lt;rob.user&gt; users = new System.Collections.Generic.List&lt;rob.user&gt;();&lt;/rob.user&gt;&lt;/rob.user&gt;&lt;/div&gt;&lt;div&gt;for(int x=0;x&amp;lt;5;x++)&amp;gt;&lt;br /&gt;&lt;div&gt;Rob.User user = new Rob.User();&lt;/div&gt;&lt;div&gt;user.Name="Rob" + x;&lt;/div&gt;&lt;div&gt;user.Age=x;&lt;/div&gt;&lt;div&gt;users.Add(user);&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;foreach(Rob.User user in users) {&lt;/div&gt;&lt;div&gt;System.Console.WriteLine(System.String.Format("{0}:{1}", user.Name, user.Age));&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;System.Console.WriteLine("press enter");&lt;/div&gt;&lt;div&gt;System.Console.ReadLine();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;for(int x=0;x&lt;users.count;x++)&gt;&lt;/users.count;x++)&gt;&lt;br /&gt;&lt;div&gt;System.Console.WriteLine(System.String.Format("{0}:{1}", users[x].Name, users[x].Age));&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Output&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Rob0:0&lt;/div&gt;&lt;div&gt;Rob1:1&lt;/div&gt;&lt;div&gt;Rob2:2&lt;/div&gt;&lt;div&gt;Rob3:3&lt;/div&gt;&lt;div&gt;Rob4:4&lt;/div&gt;&lt;div&gt;press enter&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Rob0:0&lt;/div&gt;&lt;div&gt;Rob1:1&lt;/div&gt;&lt;div&gt;Rob2:2&lt;/div&gt;&lt;div&gt;Rob3:3&lt;/div&gt;&lt;div&gt;Rob4:4&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;More on Generics&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;More Generics features in the latest release of the .NET Framework include Generic Methods and Constraints. A generic method is very straight forward. Consider this example:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;public static T[] CreateArray&lt;t&gt;(int size) {&lt;/t&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;return new T[size];&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This static method simply creates a method of the given Type "T" and of the given "size" and returns it to the caller. An example of calling this method would be:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;string[] myString = CreateArray&lt;string&gt;(5);&lt;/string&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This will new up an instance of our string array, with an initial size of 5. You should take time to investigate the new version of the framework. You will be surprised at all the little helpful features like this.&lt;/div&gt;&lt;div&gt;Lastly, we should take a quick look at constraints. A constraint is setup to limit the Types which the Generic can accept. Let's say for example we had a generic type:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;public class Dictionary&lt;k,&gt; where K : IComparable {}&lt;/k,&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Notice the "where" clause on this class definition. It is forcing the K Type to be of Type IComparable. If K does NOT implement IComparable, you will get a Compiler error. Another type of constraint is a constructor constraint:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;public class Something&lt;v&gt; where V: new() {}&lt;/v&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In this example V must have at least the default constructor available, if not the Compiler will throw an error.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-4204809998197618059?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/4204809998197618059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=4204809998197618059' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/4204809998197618059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/4204809998197618059'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/03/introduction-to-generics-in-net.html' title='Introduction to generics in .net'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-6819929094832103632</id><published>2010-03-02T06:15:00.000-08:00</published><updated>2010-06-29T03:12:43.875-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Control'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Validation'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='basic'/><title type='text'>Use Validation Summary Control in asp.net</title><content type='html'>&lt;div&gt;&lt;div&gt;&lt;b&gt;ValidationSummaryExample.aspx&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;%@ Page Language="C#" %&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&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;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;script runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;protected void Button1_Click(object sender, System.EventArgs e) {&lt;/div&gt;&lt;div&gt;Label1.Text = "Your Country: " +&lt;/div&gt;&lt;div&gt;TextBox1.Text.ToString() +&lt;/div&gt;&lt;div&gt;"&amp;lt;br /&amp;gt;Region: " +&lt;/div&gt;&lt;div&gt;TextBox2.Text.ToString() +&lt;/div&gt;&lt;div&gt;"&amp;lt;br /&amp;gt;City: " +&lt;/div&gt;&lt;div&gt;TextBox3.Text.ToString();&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&amp;lt;/script&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;head runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;title&amp;gt;ValidationSummary example: how to use ValidationSummary control in asp.net&amp;lt;/title&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/head&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label ID="Label1" runat="server" Font-Size="Large" ForeColor="BlueViolet"&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label ID="Label2" runat="server" Text="Country Name" AssociatedControlID="TextBox1"&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:TextBox ID="TextBox1" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:RequiredFieldValidator&lt;/div&gt;&lt;div&gt;ID="RequiredFieldValidator1"&lt;/div&gt;&lt;div&gt;runat="server"&lt;/div&gt;&lt;div&gt;ControlToValidate="TextBox1"&lt;/div&gt;&lt;div&gt;ErrorMessage='Input Country!'&lt;/div&gt;&lt;div&gt;EnableClientScript="true"&lt;/div&gt;&lt;div&gt;SetFocusOnError="true"&lt;/div&gt;&lt;div&gt;Text="*"&lt;/div&gt;&lt;div&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:RequiredFieldValidator&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label ID="Label3" runat="server" Text="Region Name" AssociatedControlID="TextBox2"&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:TextBox ID="TextBox2" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:RequiredFieldValidator&lt;/div&gt;&lt;div&gt;ID="RequiredFieldValidator2"&lt;/div&gt;&lt;div&gt;runat="server"&lt;/div&gt;&lt;div&gt;ControlToValidate="TextBox2"&lt;/div&gt;&lt;div&gt;ErrorMessage='Input Region!'&lt;/div&gt;&lt;div&gt;EnableClientScript="true"&lt;/div&gt;&lt;div&gt;SetFocusOnError="true"&lt;/div&gt;&lt;div&gt;Text="*"&lt;/div&gt;&lt;div&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:RequiredFieldValidator&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label ID="Label4" runat="server" Text="City Name" AssociatedControlID="TextBox3"&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:TextBox ID="TextBox3" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:RequiredFieldValidator&lt;/div&gt;&lt;div&gt;ID="RequiredFieldValidator3"&lt;/div&gt;&lt;div&gt;runat="server"&lt;/div&gt;&lt;div&gt;ControlToValidate="TextBox3"&lt;/div&gt;&lt;div&gt;ErrorMessage='Input Region!'&lt;/div&gt;&lt;div&gt;EnableClientScript="true"&lt;/div&gt;&lt;div&gt;SetFocusOnError="true"&lt;/div&gt;&lt;div&gt;Text="*"&lt;/div&gt;&lt;div&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:RequiredFieldValidator&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Button ID="Button1" runat="server" Text="Submit" OnClick="Button1_Click" /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:ValidationSummary ID="ValidationSummary1" runat="server" HeaderText="Following error occurs:" ShowMessageBox="false" DisplayMode="BulletList" ShowSummary="true" /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/form&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href="http://1.bp.blogspot.com/_FLcwCs9yNAc/S40d_HBdgRI/AAAAAAAABB0/-NAZJz10IBc/s1600-h/ValidationSummaryExample1.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5444040494614937874" src="http://1.bp.blogspot.com/_FLcwCs9yNAc/S40d_HBdgRI/AAAAAAAABB0/-NAZJz10IBc/s320/ValidationSummaryExample1.jpg" style="cursor: hand; cursor: pointer; display: block; height: 196px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_FLcwCs9yNAc/S40d-puEdCI/AAAAAAAABBs/kzLo5qSGgzk/s1600-h/ValidationSummaryExample.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5444040486748976162" src="http://2.bp.blogspot.com/_FLcwCs9yNAc/S40d-puEdCI/AAAAAAAABBs/kzLo5qSGgzk/s320/ValidationSummaryExample.jpg" style="cursor: hand; cursor: pointer; display: block; height: 214px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-6819929094832103632?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/6819929094832103632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=6819929094832103632' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/6819929094832103632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/6819929094832103632'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/03/use-validation-summary-control-in.html' title='Use Validation Summary Control in asp.net'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_FLcwCs9yNAc/S40d_HBdgRI/AAAAAAAABB0/-NAZJz10IBc/s72-c/ValidationSummaryExample1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-370592597858184687</id><published>2010-03-02T06:11:00.000-08:00</published><updated>2010-06-29T03:13:12.027-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ImageMap'/><category scheme='http://www.blogger.com/atom/ns#' term='image'/><category scheme='http://www.blogger.com/atom/ns#' term='Control'/><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 use ImageMap Control</title><content type='html'>&lt;div&gt;&lt;div&gt;&lt;b&gt;ImageMap.aspx&lt;/b&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="ImageMap.aspx.cs" Inherits="ImageMap" %&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&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;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;head runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;title&amp;gt;asp.net ImageMap: how to use&amp;lt;/title&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/head&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;h2 style="color:Red"&amp;gt;ImageMap&amp;lt;/h2&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label &lt;/div&gt;&lt;div&gt;ID="Label1"&lt;/div&gt;&lt;div&gt;runat="server"&lt;/div&gt;&lt;div&gt;Font-Size="Medium"&lt;/div&gt;&lt;div&gt;ForeColor="DodgerBlue"&lt;/div&gt;&lt;div&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:ImageMap &lt;/div&gt;&lt;div&gt;ID="ImageMap1"&lt;/div&gt;&lt;div&gt;runat="server"&lt;/div&gt;&lt;div&gt;ImageUrl="~/Images/Doll.gif"&lt;/div&gt;&lt;div&gt;HotSpotMode="PostBack"&lt;/div&gt;&lt;div&gt;OnClick="ImageMap1_Click"&lt;/div&gt;&lt;div&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:RectangleHotSpot&lt;/div&gt;&lt;div&gt;Top="0" &lt;/div&gt;&lt;div&gt;Bottom="360"&lt;/div&gt;&lt;div&gt;Left="0" &lt;/div&gt;&lt;div&gt;Right="180" &lt;/div&gt;&lt;div&gt;AlternateText="Green Doll" &lt;/div&gt;&lt;div&gt;PostBackValue="Green Doll"&lt;/div&gt;&lt;div&gt;/&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:RectangleHotSpot &lt;/div&gt;&lt;div&gt;Top="0"&lt;/div&gt;&lt;div&gt;Bottom="360"&lt;/div&gt;&lt;div&gt;Left="181"&lt;/div&gt;&lt;div&gt;Right="360"&lt;/div&gt;&lt;div&gt;AlternateText="Pink Doll"&lt;/div&gt;&lt;div&gt;PostBackValue="Pink Doll"&lt;/div&gt;&lt;div&gt;/&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:ImageMap&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/form&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;ImageMap.aspx.cs&lt;/b&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;using System;&lt;/div&gt;&lt;div&gt;using System.Collections;&lt;/div&gt;&lt;div&gt;using System.Configuration;&lt;/div&gt;&lt;div&gt;using System.Data;&lt;/div&gt;&lt;div&gt;using System.Linq;&lt;/div&gt;&lt;div&gt;using System.Web;&lt;/div&gt;&lt;div&gt;using System.Web.Security;&lt;/div&gt;&lt;div&gt;using System.Web.UI;&lt;/div&gt;&lt;div&gt;using System.Web.UI.HtmlControls;&lt;/div&gt;&lt;div&gt;using System.Web.UI.WebControls;&lt;/div&gt;&lt;div&gt;using System.Web.UI.WebControls.WebParts;&lt;/div&gt;&lt;div&gt;using System.Xml.Linq;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;public partial class ImageMap : System.Web.UI.Page&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;protected void Page_Load(object sender, EventArgs e)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;if(!Page.IsPostBack)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;Label1.Text = "Click any doll!";&lt;/div&gt;&lt;div&gt;ImageMap1.BorderWidth = 3;&lt;/div&gt;&lt;div&gt;ImageMap1.BorderStyle = BorderStyle.Double;&lt;/div&gt;&lt;div&gt;ImageMap1.BorderColor = System.Drawing.Color.Crimson;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;protected void ImageMap1_Click(object sender, ImageMapEventArgs e)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;Label1.Text = "You ckecked: " + e.PostBackValue;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href="http://1.bp.blogspot.com/_FLcwCs9yNAc/S40cyJ7B-sI/AAAAAAAABBk/I7o8b1V_H3o/s1600-h/ImageMap2.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5444039172543347394" src="http://1.bp.blogspot.com/_FLcwCs9yNAc/S40cyJ7B-sI/AAAAAAAABBk/I7o8b1V_H3o/s320/ImageMap2.png" style="cursor: hand; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 262px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_FLcwCs9yNAc/S40cxj8rcQI/AAAAAAAABBc/wcD6nwYA7q8/s1600-h/ImageMap1.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5444039162349711618" src="http://1.bp.blogspot.com/_FLcwCs9yNAc/S40cxj8rcQI/AAAAAAAABBc/wcD6nwYA7q8/s320/ImageMap1.png" style="cursor: hand; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 266px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_FLcwCs9yNAc/S40cxSSWx4I/AAAAAAAABBU/JD4za7VVU_Q/s1600-h/ImageMap.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5444039157608793986" src="http://3.bp.blogspot.com/_FLcwCs9yNAc/S40cxSSWx4I/AAAAAAAABBU/JD4za7VVU_Q/s320/ImageMap.png" style="cursor: hand; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 265px;" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-370592597858184687?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/370592597858184687/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=370592597858184687' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/370592597858184687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/370592597858184687'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/03/how-to-use-imagemap-control.html' title='How to use ImageMap Control'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_FLcwCs9yNAc/S40cyJ7B-sI/AAAAAAAABBk/I7o8b1V_H3o/s72-c/ImageMap2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-7883494921826616103</id><published>2010-03-02T06:04:00.000-08:00</published><updated>2010-06-29T03:13:42.016-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ImageMap'/><category scheme='http://www.blogger.com/atom/ns#' term='image'/><category scheme='http://www.blogger.com/atom/ns#' term='Control'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>ImageMap control</title><content type='html'>&lt;div&gt;&lt;/div&gt;&lt;div&gt;ImageMap Control is a Standard Toolbox Control. Here i show some basic example of ImageMap server control. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Basic Use &lt;/b&gt;&lt;/div&gt;&lt;div&gt;First create a Images folder in Solution Explorer for storing your images. After this create a Web Form name ImageMap.aspx. The code is here. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/_FLcwCs9yNAc/S40bA3zmLjI/AAAAAAAABBM/SPQ7JJ30B9k/s1600-h/ImagesFolder.jpg"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5444037226355109426" src="http://1.bp.blogspot.com/_FLcwCs9yNAc/S40bA3zmLjI/AAAAAAAABBM/SPQ7JJ30B9k/s320/ImagesFolder.jpg" style="cursor: hand; display: block; height: 291px; margin: 0px auto 10px; text-align: center; width: 285px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&amp;lt;%@ Page Language="C#" %&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&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;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;script runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;protected void ImageMap1_Click(object sender, System.Web.UI.WebControls.ImageMapEventArgs e) {&lt;/div&gt;&lt;div&gt;Response.Write("You selected: " + e.PostBackValue);&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&amp;lt;/script&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;head runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;title&amp;gt;ImageMap Control Example&amp;lt;/title&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/head&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:ImageMap&lt;/div&gt;&lt;div&gt;ID="ImageMap1"&lt;/div&gt;&lt;div&gt;runat="server"&lt;/div&gt;&lt;div&gt;ImageUrl="~/Images/Dolls.jpg"&lt;/div&gt;&lt;div&gt;Width="500"&lt;/div&gt;&lt;div&gt;HotSpotMode="PostBack"&lt;/div&gt;&lt;div&gt;OnClick="ImageMap1_Click"&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:RectangleHotSpot Top="0" Bottom="448" Left="0" Right="250" AlternateText="Sky Doll" PostBackValue="Sky Doll" /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:RectangleHotSpot Top="0" Bottom="448" Left="251" Right="500" AlternateText="Red Doll" PostBackValue="Red Doll" /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:ImageMap&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/form&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://2.bp.blogspot.com/_FLcwCs9yNAc/S40bAYoFF_I/AAAAAAAABBE/p1LomfFftiA/s1600-h/ImageMapNavigate.jpg"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5444037217985304562" src="http://2.bp.blogspot.com/_FLcwCs9yNAc/S40bAYoFF_I/AAAAAAAABBE/p1LomfFftiA/s320/ImageMapNavigate.jpg" style="cursor: hand; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 306px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;HotSpotMode: Navigate &lt;/div&gt;&lt;div&gt;You can easily use your ImageMap for navigation purpose. First create two extra files SkyDoll.aspx and RedDoll.aspx. Then write this code in your ImageMap.aspx. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;%@ Page Language="C#" %&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&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;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;script runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/script&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;head runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;title&amp;gt;ImageMap Control Example&amp;lt;/title&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/head&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:ImageMap&lt;/div&gt;&lt;div&gt;ID="ImageMap1"&lt;/div&gt;&lt;div&gt;runat="server"&lt;/div&gt;&lt;div&gt;ImageUrl="~/Images/Dolls.jpg"&lt;/div&gt;&lt;div&gt;Width="500"&lt;/div&gt;&lt;div&gt;HotSpotMode="Navigate"&lt;/div&gt;&lt;div&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:RectangleHotSpot Top="0" Bottom="448" Left="0" Right="250" AlternateText="Go SkyDoll.aspx" NavigateUrl="~/SkyDoll.aspx" /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:RectangleHotSpot Top="0" Bottom="448" Left="251" Right="500" AlternateText="RedDoll.aspx" NavigateUrl="~/RedDoll.aspx" /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:ImageMap&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/form&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/_FLcwCs9yNAc/S40bAPknlmI/AAAAAAAABA8/fQ4CPNLQY6Y/s1600-h/ImageMap.jpg"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5444037215554868834" src="http://3.bp.blogspot.com/_FLcwCs9yNAc/S40bAPknlmI/AAAAAAAABA8/fQ4CPNLQY6Y/s320/ImageMap.jpg" style="cursor: hand; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 310px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&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/439848007702804277-7883494921826616103?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/7883494921826616103/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=7883494921826616103' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/7883494921826616103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/7883494921826616103'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/03/imagemap-control.html' title='ImageMap control'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_FLcwCs9yNAc/S40bA3zmLjI/AAAAAAAABBM/SPQ7JJ30B9k/s72-c/ImagesFolder.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-2004735969556427999</id><published>2010-02-12T03:23:00.001-08:00</published><updated>2010-06-29T03:13:47.852-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cookie'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Create cookies in asp.net application</title><content type='html'>&lt;div&gt;&lt;div&gt;&amp;lt;%@ Page Language="C#" %&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;%@ Import Namespace="System.Net" %&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&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;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;script runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;protected void Page_Load(object sender, System.EventArgs e) {&lt;/div&gt;&lt;div&gt;HttpCookie userCookie = new HttpCookie("UserInfo");&lt;/div&gt;&lt;div&gt;userCookie["Country"] = "Italy";&lt;/div&gt;&lt;div&gt;userCookie["City"] = "Rome";&lt;/div&gt;&lt;div&gt;userCookie["Name"] = "Jones";&lt;/div&gt;&lt;div&gt;userCookie.Expires = DateTime.Now.AddDays(3);&lt;/div&gt;&lt;div&gt;Response.Cookies.Add(userCookie);&lt;/div&gt;&lt;div&gt;Label1.Text = "Cookie create successful!&amp;lt;br&amp;gt;&amp;lt;br/&amp;gt;";&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;HttpCookie cookie = Request.Cookies["UserInfo"];&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;if (cookie != null) &lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;string country = cookie["Country"];&lt;/div&gt;&lt;div&gt;string city = cookie["City"];&lt;/div&gt;&lt;div&gt;string name = cookie["Name"];&lt;/div&gt;&lt;div&gt;Label2.Text = "Cookie Found and read&amp;lt;br/&amp;gt;";&lt;/div&gt;&lt;div&gt;Label2.Text += "Name: " + name;&lt;/div&gt;&lt;div&gt;Label2.Text += "&amp;lt;br /&amp;gt;Country: " + country;&lt;/div&gt;&lt;div&gt;Label2.Text += "&amp;lt;br /&amp;gt;City: " + city;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&amp;lt;/script&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;head runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;title&amp;gt;asp.net cookie example: how to create a cookie&amp;lt;/title&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/head&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;h2 style="color:Teal"&amp;gt;asp.net Cookie example: Create a cookie&amp;lt;/h2&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label ID="Label1" runat="server" Font-Size="Large" ForeColor="SeaGreen"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label ID="Label2" runat="server" Font-Size="Large" ForeColor="Crimson"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/form&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://4.bp.blogspot.com/_FLcwCs9yNAc/S3U6KcL7osI/AAAAAAAABAg/y85fl-SqUew/s1600-h/Cookie.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5437316076159083202" src="http://4.bp.blogspot.com/_FLcwCs9yNAc/S3U6KcL7osI/AAAAAAAABAg/y85fl-SqUew/s320/Cookie.png" style="cursor: hand; cursor: pointer; display: block; height: 241px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-2004735969556427999?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/2004735969556427999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=2004735969556427999' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/2004735969556427999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/2004735969556427999'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/02/create-cookies-in-aspnet-application.html' title='Create cookies in asp.net application'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_FLcwCs9yNAc/S3U6KcL7osI/AAAAAAAABAg/y85fl-SqUew/s72-c/Cookie.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-5570402677189043955</id><published>2010-02-12T03:21:00.000-08:00</published><updated>2010-06-29T03:13:55.148-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cookie'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Use cookies in asp.net application</title><content type='html'>&lt;div&gt;&lt;div&gt;&amp;lt;%@ Page Language="C#" %&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;%@ Import Namespace="System.Net" %&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&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;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;script runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;protected void page_Load(object sender, System.EventArgs e) {&lt;/div&gt;&lt;div&gt;HttpCookie favoriteColor = Request.Cookies["FavoriteColor"];&lt;/div&gt;&lt;div&gt;if (favoriteColor == null)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;HttpCookie userCookie = new HttpCookie("FavoriteColor");&lt;/div&gt;&lt;div&gt;userCookie["Name"] = "Jones";&lt;/div&gt;&lt;div&gt;userCookie["Color"] = "Crimson";&lt;/div&gt;&lt;div&gt;userCookie.Expires = DateTime.Now.AddDays(1);&lt;/div&gt;&lt;div&gt;Response.Cookies.Add(userCookie);&lt;/div&gt;&lt;div&gt;Label1.Text = "Cookie created at: " + DateTime.Now.ToString()+ "&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;";&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;else &lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;string name = favoriteColor["Name"];&lt;/div&gt;&lt;div&gt;string color = favoriteColor["Color"];&lt;/div&gt;&lt;div&gt;Label1.Text += "Cookie found and read&amp;lt;br /&amp;gt;";&lt;/div&gt;&lt;div&gt;Label1.Text += "Hi " + name + " your favorite Color: " + color;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&amp;lt;/script&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;head runat="server"&amp;gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;title&amp;gt;asp.net cookie example: how to use cookie in asp.net&amp;lt;/title&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/head&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;h2 style="color:Navy"&amp;gt;asp.net cookie: how to use&amp;lt;/h2&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label ID="Label1" runat="server" Font-Size="Large" ForeColor="SeaGreen"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/form&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://2.bp.blogspot.com/_FLcwCs9yNAc/S3U5v0ErqkI/AAAAAAAABAY/7d5_dD2tg9I/s1600-h/CookieHowToUse.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5437315618714659394" src="http://2.bp.blogspot.com/_FLcwCs9yNAc/S3U5v0ErqkI/AAAAAAAABAY/7d5_dD2tg9I/s320/CookieHowToUse.png" style="cursor: hand; cursor: pointer; display: block; height: 199px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_FLcwCs9yNAc/S3U5vj3-HjI/AAAAAAAABAQ/j5uZ4U4jlsg/s1600-h/CookieHowToUse1.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5437315614366375474" src="http://4.bp.blogspot.com/_FLcwCs9yNAc/S3U5vj3-HjI/AAAAAAAABAQ/j5uZ4U4jlsg/s320/CookieHowToUse1.png" style="cursor: hand; cursor: pointer; display: block; height: 182px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-5570402677189043955?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/5570402677189043955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=5570402677189043955' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5570402677189043955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5570402677189043955'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/02/use-cookies-in-aspnet-application.html' title='Use cookies in asp.net application'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_FLcwCs9yNAc/S3U5v0ErqkI/AAAAAAAABAY/7d5_dD2tg9I/s72-c/CookieHowToUse.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-1364263674417295734</id><published>2010-02-12T03:19:00.000-08:00</published><updated>2010-06-29T03:14:01.687-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cookie'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Read cookie values</title><content type='html'>&lt;div&gt;&lt;div&gt;&amp;lt;%@ Page Language="C#" %&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;%@ Import Namespace="System.Net" %&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&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;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;script runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;protected void Page_Load(object sender, System.EventArgs e) {&lt;/div&gt;&lt;div&gt;if (!this.IsPostBack) &lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;HttpCookie infoCookie = new HttpCookie("Info");&lt;/div&gt;&lt;div&gt;infoCookie["Country"] = "USA";&lt;/div&gt;&lt;div&gt;infoCookie["City"] = "NewYork";&lt;/div&gt;&lt;div&gt;infoCookie["Name"] = "Jenny";&lt;/div&gt;&lt;div&gt;infoCookie.Expires = DateTime.Now.AddDays(7);&lt;/div&gt;&lt;div&gt;Response.Cookies.Add(infoCookie);&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;protected void Button1_Click(object sender, System.EventArgs e) {&lt;/div&gt;&lt;div&gt;HttpCookie cookie = Request.Cookies["Info"];&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;if (cookie != null)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;string country = cookie["Country"];&lt;/div&gt;&lt;div&gt;string city = cookie["City"];&lt;/div&gt;&lt;div&gt;string name = cookie["Name"];&lt;/div&gt;&lt;div&gt;Label1.Text = "Cookie[Info] Found and read&amp;lt;br/&amp;gt;";&lt;/div&gt;&lt;div&gt;Label1.Text += "Name: " + name;&lt;/div&gt;&lt;div&gt;Label1.Text += "&amp;lt;br /&amp;gt;Country: " + country;&lt;/div&gt;&lt;div&gt;Label1.Text += "&amp;lt;br /&amp;gt;City: " + city;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&amp;lt;/script&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;head id="Head1" runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;title&amp;gt;asp.net cookie example: how to read a cookie&amp;lt;/title&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/head&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;h2 style="color:Teal"&amp;gt;asp.net Cookie example: Read a cookie&amp;lt;/h2&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label &lt;/div&gt;&lt;div&gt;ID="Label1" &lt;/div&gt;&lt;div&gt;runat="server" &lt;/div&gt;&lt;div&gt;Font-Size="Large" &lt;/div&gt;&lt;div&gt;ForeColor="DarkGreen"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Button &lt;/div&gt;&lt;div&gt;ID="Button1" &lt;/div&gt;&lt;div&gt;runat="server" &lt;/div&gt;&lt;div&gt;Text="Read Cookie" &lt;/div&gt;&lt;div&gt;OnClick="Button1_Click"&lt;/div&gt;&lt;div&gt;Font-Bold="true"&lt;/div&gt;&lt;div&gt;ForeColor="HotPink"&lt;/div&gt;&lt;div&gt;/&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/form&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://3.bp.blogspot.com/_FLcwCs9yNAc/S3U5Tgr9jzI/AAAAAAAABAI/FEEEhkLxhwU/s1600-h/CookieRead.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5437315132474363698" src="http://3.bp.blogspot.com/_FLcwCs9yNAc/S3U5Tgr9jzI/AAAAAAAABAI/FEEEhkLxhwU/s320/CookieRead.png" style="cursor: hand; cursor: pointer; display: block; height: 208px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_FLcwCs9yNAc/S3U5TXDrL3I/AAAAAAAABAA/QeTazmCcxOQ/s1600-h/CookieRead1.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5437315129889468274" src="http://4.bp.blogspot.com/_FLcwCs9yNAc/S3U5TXDrL3I/AAAAAAAABAA/QeTazmCcxOQ/s320/CookieRead1.png" style="cursor: hand; cursor: pointer; display: block; height: 219px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-1364263674417295734?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/1364263674417295734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=1364263674417295734' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/1364263674417295734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/1364263674417295734'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/02/read-cookie-values.html' title='Read cookie values'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_FLcwCs9yNAc/S3U5Tgr9jzI/AAAAAAAABAI/FEEEhkLxhwU/s72-c/CookieRead.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-5637558840624235791</id><published>2010-02-12T03:13:00.000-08:00</published><updated>2010-06-29T03:14:36.987-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cookie'/><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 set expires date and time for cookie</title><content type='html'>&lt;div&gt;&lt;div&gt;&amp;lt;%@ Page Language="C#" %&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;%@ Import Namespace="System.Net" %&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&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;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;script runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;protected void Page_Load(object sender, System.EventArgs e) {&lt;/div&gt;&lt;div&gt;HttpCookie cookie = new HttpCookie("ColorCookie");&lt;/div&gt;&lt;div&gt;cookie["Color"] = "Crimson";&lt;/div&gt;&lt;div&gt;cookie["ColorValue"] = "#DC143C";&lt;/div&gt;&lt;div&gt;cookie.Expires = DateTime.Now.AddYears(1);&lt;/div&gt;&lt;div&gt;Response.Cookies.Add(cookie);&lt;/div&gt;&lt;div&gt;Label1.Text = "Cookie created successfully and set expire after 1 year";&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;HttpCookie myCookie = Request.Cookies["ColorCookie"];&lt;/div&gt;&lt;div&gt;if (myCookie != null)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;string color = myCookie["Color"];&lt;/div&gt;&lt;div&gt;string colorValue = myCookie["ColorValue"];&lt;/div&gt;&lt;div&gt;Label1.Text += "&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;Cookie[ColorCookie] Found and read&amp;lt;br/&amp;gt;";&lt;/div&gt;&lt;div&gt;Label1.Text += "Color: " + color;&lt;/div&gt;&lt;div&gt;Label1.Text += "&amp;lt;br /&amp;gt;Value: " + colorValue;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/script&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;head id="Head1" runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;title&amp;gt;asp.net cookie example: how to set expires date time&amp;lt;/title&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/head&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;h2 style="color:Teal"&amp;gt;asp.net Cookie example: set cookie expires&amp;lt;/h2&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label &lt;/div&gt;&lt;div&gt;ID="Label1" &lt;/div&gt;&lt;div&gt;runat="server" &lt;/div&gt;&lt;div&gt;Font-Size="Large" &lt;/div&gt;&lt;div&gt;ForeColor="Crimson"&lt;/div&gt;&lt;div&gt;Font-Italic="true"&lt;/div&gt;&lt;div&gt;Font-Bold="true"&lt;/div&gt;&lt;div&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/form&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://2.bp.blogspot.com/_FLcwCs9yNAc/S3U4yYGpSZI/AAAAAAAAA_4/Ii06-6cOT7Y/s1600-h/CookieSetExpires.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5437314563234679186" src="http://2.bp.blogspot.com/_FLcwCs9yNAc/S3U4yYGpSZI/AAAAAAAAA_4/Ii06-6cOT7Y/s320/CookieSetExpires.png" style="cursor: hand; cursor: pointer; display: block; height: 207px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-5637558840624235791?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/5637558840624235791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=5637558840624235791' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5637558840624235791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5637558840624235791'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/02/how-to-set-expires-date-and-time-for.html' title='How to set expires date and time for cookie'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_FLcwCs9yNAc/S3U4yYGpSZI/AAAAAAAAA_4/Ii06-6cOT7Y/s72-c/CookieSetExpires.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-5177901833089974574</id><published>2010-02-12T03:03:00.000-08:00</published><updated>2010-06-29T03:14:43.034-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cookie'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Set value in cookie</title><content type='html'>&lt;div&gt;&lt;div&gt;&amp;lt;%@ Page Language="C#" %&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;%@ Import Namespace="System.Net" %&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&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;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;script runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;protected void Page_Load(object sender, System.EventArgs e) {&lt;/div&gt;&lt;div&gt;if (!this.IsPostBack) {&lt;/div&gt;&lt;div&gt;HttpCookie testCokkie = new HttpCookie("ExampleCookie");&lt;/div&gt;&lt;div&gt;testCokkie.Expires = DateTime.Now.AddDays(5);&lt;/div&gt;&lt;div&gt;Response.Cookies.Add(testCokkie);&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;protected void Button1_Click(object sender, System.EventArgs e) {&lt;/div&gt;&lt;div&gt;HttpCookie ExampleCookie = Request.Cookies["ExampleCookie"];&lt;/div&gt;&lt;div&gt;ExampleCookie["Name"] = TextBox1.Text.ToString();&lt;/div&gt;&lt;div&gt;ExampleCookie["City"] = TextBox2.Text.ToString();&lt;/div&gt;&lt;div&gt;Response.Cookies.Add(ExampleCookie);&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;protected void Button2_Click(object sender, System.EventArgs e) {&lt;/div&gt;&lt;div&gt;HttpCookie exampleCookie = Request.Cookies["ExampleCookie"];&lt;/div&gt;&lt;div&gt;if (exampleCookie != null) {&lt;/div&gt;&lt;div&gt;string name = exampleCookie["Name"];&lt;/div&gt;&lt;div&gt;string city = exampleCookie["City"];&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;label1.Text = "Cookie found and read&amp;lt;br /&amp;gt;";&lt;/div&gt;&lt;div&gt;label1.Text += "Name: " + name + "&amp;lt;br /&amp;gt;City: " + city;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&amp;lt;/script&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;head runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;title&amp;gt;asp.net cookie example: how to set value in a cookie&amp;lt;/title&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/head&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;h2 style="color:Red"&amp;gt;asp.net cookie example: set value&amp;lt;/h2&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label &lt;/div&gt;&lt;div&gt;ID="label1" &lt;/div&gt;&lt;div&gt;runat="server" &lt;/div&gt;&lt;div&gt;Font-Size="Large" &lt;/div&gt;&lt;div&gt;ForeColor="SeaGreen"&lt;/div&gt;&lt;div&gt;Font-Italic="true"&lt;/div&gt;&lt;div&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label ID="Label2" runat="server" Text="Name"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:TextBox ID="TextBox1" runat="server" BackColor="LightGreen"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:TextBox&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label ID="Label3" runat="server" Text="City"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:TextBox ID="TextBox2" runat="server" BackColor="LightGreen"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:TextBox&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Button &lt;/div&gt;&lt;div&gt;ID="Button1" &lt;/div&gt;&lt;div&gt;runat="server" &lt;/div&gt;&lt;div&gt;Text="Set cookie value" &lt;/div&gt;&lt;div&gt;OnClick="Button1_Click"&lt;/div&gt;&lt;div&gt;Font-Bold="true"&lt;/div&gt;&lt;div&gt;ForeColor="Crimson"&lt;/div&gt;&lt;div&gt;/&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Button &lt;/div&gt;&lt;div&gt;ID="Button2" &lt;/div&gt;&lt;div&gt;runat="server" &lt;/div&gt;&lt;div&gt;Text="Read cookie" &lt;/div&gt;&lt;div&gt;OnClick="Button2_Click"&lt;/div&gt;&lt;div&gt;Font-Bold="true"&lt;/div&gt;&lt;div&gt;ForeColor="DarkGreen"&lt;/div&gt;&lt;div&gt;/&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/form&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://2.bp.blogspot.com/_FLcwCs9yNAc/S3U26oXUCRI/AAAAAAAAA_o/3sOQTISODz4/s1600-h/CookieSetValue.gif" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5437312506015254802" src="http://2.bp.blogspot.com/_FLcwCs9yNAc/S3U26oXUCRI/AAAAAAAAA_o/3sOQTISODz4/s320/CookieSetValue.gif" style="cursor: hand; cursor: pointer; display: block; height: 206px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_FLcwCs9yNAc/S3U26YmFRdI/AAAAAAAAA_g/NTV1UXyxyNc/s1600-h/CookieSetValue1.gif" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5437312501782234578" src="http://2.bp.blogspot.com/_FLcwCs9yNAc/S3U26YmFRdI/AAAAAAAAA_g/NTV1UXyxyNc/s320/CookieSetValue1.gif" style="cursor: hand; cursor: pointer; display: block; height: 210px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_FLcwCs9yNAc/S3U254yaxPI/AAAAAAAAA_Y/PL2TeJo6Y0I/s1600-h/CookieSetValue2.gif" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5437312493244040434" src="http://1.bp.blogspot.com/_FLcwCs9yNAc/S3U254yaxPI/AAAAAAAAA_Y/PL2TeJo6Y0I/s320/CookieSetValue2.gif" style="cursor: hand; cursor: pointer; display: block; height: 238px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-5177901833089974574?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/5177901833089974574/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=5177901833089974574' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5177901833089974574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5177901833089974574'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/02/set-value-in-cookie.html' title='Set value in cookie'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_FLcwCs9yNAc/S3U26oXUCRI/AAAAAAAAA_o/3sOQTISODz4/s72-c/CookieSetValue.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-2444976572431991024</id><published>2010-02-09T02:51:00.000-08:00</published><updated>2010-06-29T03:14:48.575-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Get name'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='FileUpload Control'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='upload'/><title type='text'>Get full name of posted file after uploading the file</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://2.bp.blogspot.com/_FLcwCs9yNAc/S3E-eiE0yTI/AAAAAAAAA9Y/uH7oUQDFBpM/s1600-h/PostedFileName.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;&amp;lt;%@ Page Language="C#" %&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;%@ Import Namespace="System.IO" %&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&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;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;script runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;protected void Button1_Click(object sender, System.EventArgs e)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;string uploadFolder = Request.PhysicalApplicationPath + "UploadHere\\";&lt;/div&gt;&lt;div&gt;FileUpload1.SaveAs(uploadFolder + FileUpload1.FileName);&lt;/div&gt;&lt;div&gt;Label1.Text = "Your file uploaded successfully!&amp;lt;br /&amp;gt;Posted File Full Name: "&lt;/div&gt;&lt;div&gt;+ FileUpload1.PostedFile.FileName;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&amp;lt;/script&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;head id="Head1" runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;title&amp;gt;asp.net FileUpload example: how to get posted file full name after upload a file&amp;lt;/title&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/head&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;h2 style="color:Fuchsia"&amp;gt;asp.net FileUpload example: Posted File Name&amp;lt;/h2&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label &lt;/div&gt;&lt;div&gt;ID="Label1" &lt;/div&gt;&lt;div&gt;runat="server"&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt; &lt;/div&gt;&lt;div&gt;Font-Size="Larger"&lt;/div&gt;&lt;div&gt;Font-Italic="true"&lt;/div&gt;&lt;div&gt;Font-Bold="true"&lt;/div&gt;&lt;div&gt;ForeColor="SeaGreen"&lt;/div&gt;&lt;div&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label &lt;/div&gt;&lt;div&gt;ID="Label2" &lt;/div&gt;&lt;div&gt;runat="server" &lt;/div&gt;&lt;div&gt;ForeColor="Crimson"&lt;/div&gt;&lt;div&gt;Text="Select a file for upload."&lt;/div&gt;&lt;div&gt;Font-Bold="true"&lt;/div&gt;&lt;div&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:FileUpload &lt;/div&gt;&lt;div&gt;ID="FileUpload1" &lt;/div&gt;&lt;div&gt;runat="server" &lt;/div&gt;&lt;div&gt;BackColor="Crimson" &lt;/div&gt;&lt;div&gt;ForeColor="AliceBlue" &lt;/div&gt;&lt;div&gt;/&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Button &lt;/div&gt;&lt;div&gt;ID="Button1" &lt;/div&gt;&lt;div&gt;runat="server" &lt;/div&gt;&lt;div&gt;Font-Bold="true" &lt;/div&gt;&lt;div&gt;ForeColor="Crimson" &lt;/div&gt;&lt;div&gt;OnClick="Button1_Click"&lt;/div&gt;&lt;div&gt;Text="Upload This"&lt;/div&gt;&lt;div&gt;/&amp;gt;   &lt;/div&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/form&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://2.bp.blogspot.com/_FLcwCs9yNAc/S3E-eiE0yTI/AAAAAAAAA9Y/uH7oUQDFBpM/s1600-h/PostedFileName.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5436194919476939058" src="http://2.bp.blogspot.com/_FLcwCs9yNAc/S3E-eiE0yTI/AAAAAAAAA9Y/uH7oUQDFBpM/s320/PostedFileName.png" style="cursor: pointer; display: block; height: 159px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_FLcwCs9yNAc/S3E-eeTbwpI/AAAAAAAAA9Q/-fKWMPAYEbQ/s1600-h/PostedFileName1.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5436194918464471698" src="http://4.bp.blogspot.com/_FLcwCs9yNAc/S3E-eeTbwpI/AAAAAAAAA9Q/-fKWMPAYEbQ/s320/PostedFileName1.png" style="cursor: pointer; display: block; height: 155px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_FLcwCs9yNAc/S3E-dpYZZOI/AAAAAAAAA9I/ttAOmydWusU/s1600-h/PostedFileName2.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5436194904258208994" src="http://3.bp.blogspot.com/_FLcwCs9yNAc/S3E-dpYZZOI/AAAAAAAAA9I/ttAOmydWusU/s320/PostedFileName2.png" style="cursor: pointer; display: block; height: 177px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&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/439848007702804277-2444976572431991024?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/2444976572431991024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=2444976572431991024' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/2444976572431991024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/2444976572431991024'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/02/get-full-name-of-posted-file-after.html' title='Get full name of posted file after uploading the file'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_FLcwCs9yNAc/S3E-eiE0yTI/AAAAAAAAA9Y/uH7oUQDFBpM/s72-c/PostedFileName.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-2102005582164501343</id><published>2010-02-09T02:44:00.000-08:00</published><updated>2010-06-29T03:14:55.084-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='FileUpload Control'/><category scheme='http://www.blogger.com/atom/ns#' term='error'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='upload'/><title type='text'>Check for error when uploading a file</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="color: #0000ee;"&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&amp;lt;%@ Page Language="C#" %&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;%@ Import Namespace="System.IO" %&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&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;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;script runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;protected void Button1_Click(object sender, System.EventArgs e)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;try&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;string uploadFolder = Request.PhysicalApplicationPath + "Upload\\";&lt;/div&gt;&lt;div&gt;FileUpload1.SaveAs(uploadFolder + FileUpload1.FileName);&lt;/div&gt;&lt;div&gt;Label1.ForeColor = System.Drawing.Color.Green;&lt;/div&gt;&lt;div&gt;Label1.Text = "File uploaded successfully: " + FileUpload1.PostedFile.FileName;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;catch(Exception ex)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;Label1.ForeColor = System.Drawing.Color.Red;&lt;/div&gt;&lt;div&gt;Label1.Text = "an error occured.&amp;lt;br /&amp;gt;";&lt;/div&gt;&lt;div&gt;Label1.Text += ex.Message;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&amp;lt;/script&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;head id="Head1" runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;title&amp;gt;asp.net FileUpload example: how to check (handle) error when upload a file&amp;lt;/title&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/head&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;h2 style="color:Navy"&amp;gt;asp.net FileUpload example: FileUpload Error Check&amp;lt;/h2&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label &lt;/div&gt;&lt;div&gt;ID="Label1" &lt;/div&gt;&lt;div&gt;runat="server" &lt;/div&gt;&lt;div&gt;Font-Size="Larger"&lt;/div&gt;&lt;div&gt;Font-Italic="true"&lt;/div&gt;&lt;div&gt;Font-Bold="true"&lt;/div&gt;&lt;div&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label &lt;/div&gt;&lt;div&gt;ID="Label2" &lt;/div&gt;&lt;div&gt;runat="server" &lt;/div&gt;&lt;div&gt;ForeColor="HotPink"&lt;/div&gt;&lt;div&gt;Text="Choose a file for upload it."&lt;/div&gt;&lt;div&gt;Font-Bold="true"&lt;/div&gt;&lt;div&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:FileUpload &lt;/div&gt;&lt;div&gt;ID="FileUpload1" &lt;/div&gt;&lt;div&gt;runat="server" &lt;/div&gt;&lt;div&gt;BackColor="HotPink" &lt;/div&gt;&lt;div&gt;ForeColor="AliceBlue" &lt;/div&gt;&lt;div&gt;/&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Button &lt;/div&gt;&lt;div&gt;ID="Button1" &lt;/div&gt;&lt;div&gt;runat="server" &lt;/div&gt;&lt;div&gt;Font-Bold="true" &lt;/div&gt;&lt;div&gt;ForeColor="HotPink" &lt;/div&gt;&lt;div&gt;OnClick="Button1_Click"&lt;/div&gt;&lt;div&gt;Text="Upload Now"&lt;/div&gt;&lt;div&gt;/&amp;gt;   &lt;/div&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/form&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://4.bp.blogspot.com/_FLcwCs9yNAc/S3E9hnCqGdI/AAAAAAAAA9A/CG3iPVhBHEY/s1600-h/FileUploadError.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5436193872838007250" src="http://4.bp.blogspot.com/_FLcwCs9yNAc/S3E9hnCqGdI/AAAAAAAAA9A/CG3iPVhBHEY/s320/FileUploadError.png" style="cursor: pointer; display: block; height: 158px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_FLcwCs9yNAc/S3E9hthzb1I/AAAAAAAAA84/zkVVuZn_TU8/s1600-h/FileUploadError1.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5436193874579255122" src="http://1.bp.blogspot.com/_FLcwCs9yNAc/S3E9hthzb1I/AAAAAAAAA84/zkVVuZn_TU8/s320/FileUploadError1.png" style="cursor: pointer; display: block; height: 160px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_FLcwCs9yNAc/S3E9hDAPCPI/AAAAAAAAA8w/BpVEFCJzo64/s1600-h/FileUploadError2.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5436193863164168434" src="http://3.bp.blogspot.com/_FLcwCs9yNAc/S3E9hDAPCPI/AAAAAAAAA8w/BpVEFCJzo64/s320/FileUploadError2.png" style="cursor: pointer; display: block; height: 154px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_FLcwCs9yNAc/S3E9g4vcMCI/AAAAAAAAA8o/3ZgbWQtDJMo/s1600-h/FileUploadError3.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5436193860409372706" src="http://3.bp.blogspot.com/_FLcwCs9yNAc/S3E9g4vcMCI/AAAAAAAAA8o/3ZgbWQtDJMo/s320/FileUploadError3.png" style="cursor: pointer; display: block; height: 153px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&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/439848007702804277-2102005582164501343?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/2102005582164501343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=2102005582164501343' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/2102005582164501343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/2102005582164501343'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/02/check-for-error-when-uploading-file.html' title='Check for error when uploading a file'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_FLcwCs9yNAc/S3E9hnCqGdI/AAAAAAAAA9A/CG3iPVhBHEY/s72-c/FileUploadError.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-2946854714213667793</id><published>2010-02-09T02:42:00.000-08:00</published><updated>2010-06-29T03:15:00.653-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='FileUpload Control'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='upload'/><title type='text'>Check whether file upload control has file</title><content type='html'>&lt;div&gt;FileUploadHasFile.aspx &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;%@ Page Language="C#" %&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;%@ Import Namespace="System.IO" %&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&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;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;script runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;protected void Button1_Click(object sender, System.EventArgs e)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;if (FileUpload1.HasFile)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;string uploadFolder = Request.PhysicalApplicationPath + "Upload\\";&lt;/div&gt;&lt;div&gt;FileUpload1.SaveAs(uploadFolder + FileUpload1.FileName);&lt;/div&gt;&lt;div&gt;Label1.ForeColor = System.Drawing.Color.Green;&lt;/div&gt;&lt;div&gt;Label1.Text = "File uploaded successfully: " + FileUpload1.PostedFile.FileName;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;else&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;Label1.ForeColor = System.Drawing.Color.Red;&lt;/div&gt;&lt;div&gt;Label1.Text = "Please select a file first!";&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&amp;lt;/script&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;head id="Head1" runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;title&amp;gt;asp.net FileUpload example: how to check whether FileUpload control has file&amp;lt;/title&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/head&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;h2 style="color:Maroon"&amp;gt;asp.net FileUpload example: FileUpload HasFile&amp;lt;/h2&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label &lt;/div&gt;&lt;div&gt;ID="Label1" &lt;/div&gt;&lt;div&gt;runat="server" &lt;/div&gt;&lt;div&gt;Font-Size="Larger"&lt;/div&gt;&lt;div&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label &lt;/div&gt;&lt;div&gt;ID="Label2" &lt;/div&gt;&lt;div&gt;runat="server" &lt;/div&gt;&lt;div&gt;ForeColor="DarkGreen"&lt;/div&gt;&lt;div&gt;Text="Choose a file for upload it."&lt;/div&gt;&lt;div&gt;Font-Bold="true"&lt;/div&gt;&lt;div&gt;&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:FileUpload &lt;/div&gt;&lt;div&gt;ID="FileUpload1" &lt;/div&gt;&lt;div&gt;runat="server" &lt;/div&gt;&lt;div&gt;BackColor="DarkGreen" &lt;/div&gt;&lt;div&gt;ForeColor="AliceBlue" &lt;/div&gt;&lt;div&gt;/&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Button &lt;/div&gt;&lt;div&gt;ID="Button1" &lt;/div&gt;&lt;div&gt;runat="server" &lt;/div&gt;&lt;div&gt;Font-Bold="true" &lt;/div&gt;&lt;div&gt;ForeColor="DarkGreen" &lt;/div&gt;&lt;div&gt;OnClick="Button1_Click"&lt;/div&gt;&lt;div&gt;Text="Upload Now"&lt;/div&gt;&lt;div&gt;/&amp;gt;   &lt;/div&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/form&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-2946854714213667793?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/2946854714213667793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=2946854714213667793' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/2946854714213667793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/2946854714213667793'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/02/check-whether-file-upload-control-has.html' title='Check whether file upload control has file'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-2658040579333582502</id><published>2010-02-09T02:31:00.000-08:00</published><updated>2010-06-29T03:15:07.055-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='FileUpload Control'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='basic'/><category scheme='http://www.blogger.com/atom/ns#' term='upload'/><title type='text'>Use File Upload Control in asp.net</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://2.bp.blogspot.com/_FLcwCs9yNAc/S3E6T9d_QwI/AAAAAAAAA8Q/hXPwnb45bNA/s1600-h/FileUploadExample.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;Now we see how to upload a file in asp.net. For this example you need to create a web form as like FileUploadControl.aspx. Put a label, a Button and a FileUpload control in this web form. Then create a folder C:\UploadFolder. When someone selects a file and presses the button, his selected file uploads in UploadFolder. And the Label control show that file’s name, size and type. If any error occurred, the Label also shows it. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;FileUploadControl.aspx &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;%@ Page Language="C#" %&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&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;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;script runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;protected void Button1_Click(object sender, System.EventArgs e) {&lt;/div&gt;&lt;div&gt;if (FileUpload1.HasFile)&lt;/div&gt;&lt;div&gt;try {&lt;/div&gt;&lt;div&gt;FileUpload1.SaveAs("C:\\UploadFolder\\"+FileUpload1.FileName);&lt;/div&gt;&lt;div&gt;Label1.Text = "Uploaded File Name: " +&lt;/div&gt;&lt;div&gt;FileUpload1.PostedFile.FileName +&lt;/div&gt;&lt;div&gt;"&amp;lt;br /&amp;gt;File Size: " +&lt;/div&gt;&lt;div&gt;FileUpload1.PostedFile.ContentLength +&lt;/div&gt;&lt;div&gt;"&amp;lt;br /&amp;gt;File Type: " +&lt;/div&gt;&lt;div&gt;FileUpload1.PostedFile.ContentType;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;catch (Exception ex){&lt;/div&gt;&lt;div&gt;Label1.Text = "Error occured: " + ex.Message.ToString();&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;else{&lt;/div&gt;&lt;div&gt;Label1.Text = "Select a file for upload";&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&amp;lt;/script&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;head runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;title&amp;gt;FileUpload example: how to use FileUpload control in asp.net&amp;lt;/title&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/head&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label ID="Label1" runat="server" Font-Size="Large" ForeColor="CornflowerBlue"&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:FileUpload ID="FileUpload1" runat="server" /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Button ID="Button1" runat="server" Text="Upload this File" OnClick="Button1_Click" /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/form&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://2.bp.blogspot.com/_FLcwCs9yNAc/S3E6T9d_QwI/AAAAAAAAA8Q/hXPwnb45bNA/s1600-h/FileUploadExample.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5436190339805168386" src="http://2.bp.blogspot.com/_FLcwCs9yNAc/S3E6T9d_QwI/AAAAAAAAA8Q/hXPwnb45bNA/s320/FileUploadExample.jpg" style="cursor: pointer; display: block; height: 174px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_FLcwCs9yNAc/S3E5_lPgcRI/AAAAAAAAA8A/Gzx5TgkLk-4/s1600-h/FileUploadExample1.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5436189989704593682" src="http://2.bp.blogspot.com/_FLcwCs9yNAc/S3E5_lPgcRI/AAAAAAAAA8A/Gzx5TgkLk-4/s320/FileUploadExample1.jpg" style="cursor: pointer; display: block; height: 177px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-2658040579333582502?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/2658040579333582502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=2658040579333582502' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/2658040579333582502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/2658040579333582502'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/02/use-file-upload-control-in-aspnet.html' title='Use File Upload Control in asp.net'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_FLcwCs9yNAc/S3E6T9d_QwI/AAAAAAAAA8Q/hXPwnb45bNA/s72-c/FileUploadExample.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-177966537590114665</id><published>2010-02-09T02:23:00.000-08:00</published><updated>2010-06-29T03:15:12.737-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='FileUpload Control'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='basic'/><category scheme='http://www.blogger.com/atom/ns#' term='upload'/><title type='text'>Basic example of FileUpload control</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_FLcwCs9yNAc/S3E4S16MepI/AAAAAAAAA7Y/u9hwt_WIKZU/s1600-h/FileUploadStep1.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;FileUpload control is a Standard ToolBox control. Here I show a simple use of FileUpload control. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First create a folder name UploadFolder in your computer C:\ Drive. Then create a Web Form name FileUpload.aspx. FileUpload.aspx page code is here. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;%@ Page Language="C#" %&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&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;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;script runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;protected void Button1_Click(object sender, System.EventArgs e) {&lt;/div&gt;&lt;div&gt;if (FileUpload1.HasFile)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;try&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;FileUpload1.SaveAs("C:\\UploadFolder\\" + FileUpload1.FileName);&lt;/div&gt;&lt;div&gt;Label1.Text = "Uploaded File: " + FileUpload1.PostedFile.FileName +&lt;/div&gt;&lt;div&gt;"&amp;lt;br /&amp;gt; File Size: " + FileUpload1.PostedFile.ContentLength;&lt;/div&gt;&lt;div&gt;}&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;catch (Exception ex)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;Label1.Text = "An Error occured: "+ ex.Message.ToString();&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;else&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;Label1.Text = "First choose an file then click button";&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&amp;lt;/script&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;head runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;title&amp;gt;FileUpload Control Example&amp;lt;/title&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/head&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Label ID="Label1" runat="server" Font-Size="X-Large" ForeColor="Crimson" &amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;hr /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:FileUpload ID="FileUpload1" runat="server" BackColor="Chocolate" /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Button ID="Button1" runat="server" Text="Upload the selected file" OnClick="Button1_Click" /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/form&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/_FLcwCs9yNAc/S3E4S16MepI/AAAAAAAAA7Y/u9hwt_WIKZU/s1600-h/FileUploadStep1.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5436188121572866706" src="http://3.bp.blogspot.com/_FLcwCs9yNAc/S3E4S16MepI/AAAAAAAAA7Y/u9hwt_WIKZU/s320/FileUploadStep1.jpg" style="cursor: pointer; display: block; height: 129px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 320px;" /&gt;&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: none; color: black;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href="http://3.bp.blogspot.com/_FLcwCs9yNAc/S3E4THzXRJI/AAAAAAAAA7g/NM-MOycU_jY/s1600-h/FileUploadStep2.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5436188126376051858" src="http://3.bp.blogspot.com/_FLcwCs9yNAc/S3E4THzXRJI/AAAAAAAAA7g/NM-MOycU_jY/s320/FileUploadStep2.jpg" style="cursor: pointer; display: block; height: 133px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_FLcwCs9yNAc/S3E4TmgbAsI/AAAAAAAAA7w/AQ_h879MnrI/s1600-h/FileUploadChooseFile.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5436188134618104514" src="http://1.bp.blogspot.com/_FLcwCs9yNAc/S3E4TmgbAsI/AAAAAAAAA7w/AQ_h879MnrI/s320/FileUploadChooseFile.jpg" style="cursor: pointer; display: block; height: 274px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href="http://3.bp.blogspot.com/_FLcwCs9yNAc/S3E4S16MepI/AAAAAAAAA7Y/u9hwt_WIKZU/s1600-h/FileUploadStep1.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: none; color: black;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href="http://3.bp.blogspot.com/_FLcwCs9yNAc/S3E4THzXRJI/AAAAAAAAA7g/NM-MOycU_jY/s1600-h/FileUploadStep2.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;/a&gt;&lt;a href="http://1.bp.blogspot.com/_FLcwCs9yNAc/S3E4T2ouTLI/AAAAAAAAA74/oSoo6G4oYAg/s1600-h/FileUploadFinalStep.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5436188138947890354" src="http://1.bp.blogspot.com/_FLcwCs9yNAc/S3E4T2ouTLI/AAAAAAAAA74/oSoo6G4oYAg/s320/FileUploadFinalStep.jpg" style="cursor: pointer; display: block; height: 169px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&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/439848007702804277-177966537590114665?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/177966537590114665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=177966537590114665' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/177966537590114665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/177966537590114665'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/02/basic-example-of-fileupload-control.html' title='Basic example of FileUpload control'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_FLcwCs9yNAc/S3E4S16MepI/AAAAAAAAA7Y/u9hwt_WIKZU/s72-c/FileUploadStep1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-318557725720913591</id><published>2010-02-03T21:44:00.000-08:00</published><updated>2010-06-29T03:15:31.722-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='image'/><category scheme='http://www.blogger.com/atom/ns#' term='Download'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>retrieve binary images from database</title><content type='html'>&lt;span class="Apple-style-span" style="color: #3d3d3d; font-family: Verdana, Geneva, sans-serif; font-size: 13px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #3d3d3d; font-family: Verdana, Geneva, sans-serif; font-size: 13px;"&gt;&lt;div&gt;&lt;div&gt;This is a sample code to retrieve images from data base in a gridview as to upload images to database.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;use fileupload control to upload images and on upload button click retrieve image from fileupload control(named as fulimage)by writing&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;StreamimgStream = fuImage.PostedFile.InputStream;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;and insert it into database along with other parameters.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;to retrieve image from database in a gridview use generic handler. place a template in gridview and place itemtemplate in it.now add a image here like this.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;and in the ImageHandler.ashx get image id from query string and retrive image from database in a datareader then return that image by this code&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;context.Response.BinaryWrite((Byte[])dr[0]);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;here dr[0] means that image is in first field of the database.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.dotnetspider.com/attachments/Resources/29410-191618-GridviewImage.rar" target="_blank"&gt;Click here for full source code&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-318557725720913591?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/318557725720913591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=318557725720913591' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/318557725720913591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/318557725720913591'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/02/retrieve-binary-images-from-database.html' title='retrieve binary images from database'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-7594502783059999132</id><published>2010-02-03T21:42:00.000-08:00</published><updated>2010-06-29T03:15:37.565-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='image'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='upload'/><title type='text'>Upload images to database in binary formate</title><content type='html'>&lt;div&gt;&lt;div&gt;This is a sample code for uploading images in database.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;protected void Button1_Click(object sender, EventArgs e)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;byte[] image = FileUpload1.FileBytes;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;String name = TextBox1.Text;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;String qryString = "INSERT INTO [Table] VALUES ( '" + name + "' , '" + image + "' )";&lt;/div&gt;&lt;div&gt;using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString))&lt;/div&gt;&lt;div&gt;{&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;using (SqlCommand command = new SqlCommand(qryString, connection))&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;connection.Open();&lt;/div&gt;&lt;div&gt;command.ExecuteNonQuery();&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.dotnetspider.com/attachments/Resources/29213-15050-ImageUploadDemo.rar" target="_blank"&gt;Click here for full source code&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/439848007702804277-7594502783059999132?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/7594502783059999132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=7594502783059999132' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/7594502783059999132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/7594502783059999132'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/02/upload-images-to-database-in-binary.html' title='Upload images to database in binary formate'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-5444089316514891703</id><published>2010-02-03T21:35:00.000-08:00</published><updated>2010-06-29T03:15:43.487-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Drag and Drop'/><title type='text'>Drag and Drop example in javascript</title><content type='html'>&lt;div&gt;This a simple example of drag n drop using javascript.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;!-- TWO STEPS TO INSTALL DRAG-N-DROP:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. Copy the coding into the HEAD of your HTML document&lt;/div&gt;&lt;div&gt;2. Add the last code into the BODY of your HTML document --&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;!-- STEP ONE: Paste this code into the HEAD of your HTML document --&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;HEAD&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;SCRIPT LANGUAGE="JavaScript"&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;!-- Begin&lt;/div&gt;&lt;div&gt;N = (document.all) ? 0 : 1;&lt;/div&gt;&lt;div&gt;var ob;&lt;/div&gt;&lt;div&gt;function MD(e) {&lt;/div&gt;&lt;div&gt;if (N) {&lt;/div&gt;&lt;div&gt;ob = document.layers[e.target.name];&lt;/div&gt;&lt;div&gt;X=e.x;&lt;/div&gt;&lt;div&gt;Y=e.y;&lt;/div&gt;&lt;div&gt;return false;&lt;/div&gt;&lt;div&gt;}&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;else {&lt;/div&gt;&lt;div&gt;ob = event.srcElement.parentElement.style;&lt;/div&gt;&lt;div&gt;X=event.offsetX;&lt;/div&gt;&lt;div&gt;Y=event.offsetY;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;function MM(e) {&lt;/div&gt;&lt;div&gt;if (ob) {&lt;/div&gt;&lt;div&gt;if (N) {&lt;/div&gt;&lt;div&gt;ob.moveTo((e.pageX-X), (e.pageY-Y));&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;else {&lt;/div&gt;&lt;div&gt;ob.pixelLeft = event.clientX-X + document.body.scrollLeft;&lt;/div&gt;&lt;div&gt;ob.pixelTop = event.clientY-Y + document.body.scrollTop;&lt;/div&gt;&lt;div&gt;return false;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;function MU() {&lt;/div&gt;&lt;div&gt;ob = null;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;if (N) {&lt;/div&gt;&lt;div&gt;document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP);&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;document.onmousedown = MD;&lt;/div&gt;&lt;div&gt;document.onmousemove = MM;&lt;/div&gt;&lt;div&gt;document.onmouseup = MU;&lt;/div&gt;&lt;div&gt;// End --&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/script&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/HEAD&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;!-- STEP TWO: Copy this code into the BODY of your HTML document --&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;BODY&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;div id="s" style="position:absolute;left:50;top:300;"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;img src=~/img/cards/spades.gif name="s"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;div id="d" style="position:absolute;left:50;top:350;"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;img src=~/img/cards/diamonds.gif name="d"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;div id="c" style="position:absolute;left:100;top:300;"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;img src=~/img/cards/clubs.gif name="c"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;div id="h" style="position:absolute;left:100;top:350;"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;img src=~/img/cards/hearts.gif name="h"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Just click and hold the 4 suit images to the left and then you can move them around the page!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/body&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a href="http://www.dotnetspider.com/resources/5690-DRAG-N-DROP-Example-using-Javascript.aspx" target="_blank"&gt;click here for original post&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-5444089316514891703?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/5444089316514891703/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=5444089316514891703' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5444089316514891703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5444089316514891703'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/02/drag-and-drop-example-in-javascript.html' title='Drag and Drop example in javascript'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-7937862652301992072</id><published>2010-02-03T21:28:00.000-08:00</published><updated>2010-06-29T03:15:50.548-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='YouTube'/><category scheme='http://www.blogger.com/atom/ns#' term='Video'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><title type='text'>YouTube video player</title><content type='html'>&lt;div&gt;In main window you can search videos according to you proffered keyword.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You are free to drag the YouTube feed items around, providing you are currently in Drag mode. Where the Mode is changable using the right click context menu.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When you toggle out of Drag mode, you will be in Play mode, so will no longer be able to move the video items around. Instead when you move the mouse over an video item you will see a PLAY icon appear.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When you then click this PLAY icon a new video viewer will be shown where you can view the YouTube video. This window is animated into/out of view. You should be able to open the viewer window whenever you are in Play mode and click on a unique video item.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;it is actually just a bit of XLINQ, as follows&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;var xraw = XElement.Load(string.Format(SEARCH,keyWord));&lt;/div&gt;&lt;div&gt;var xroot = XElement.Parse(xraw.ToString());&lt;/div&gt;&lt;div&gt;var links = (from item in xroot.Element("channel").Descendants("item")&lt;/div&gt;&lt;div&gt;select new YouTubeInfo&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;LinkUrl = item.Element("link").Value,&lt;/div&gt;&lt;div&gt;EmbedUrl = GetEmbedUrlFromLink(item.Element("link").Value),&lt;/div&gt;&lt;div&gt;ThumnailUrl =&lt;/div&gt;&lt;div&gt;item.Elements().Where(&lt;/div&gt;&lt;div&gt;child =&amp;gt; child.Name.ToString().Contains("thumbnail")&lt;/div&gt;&lt;div&gt;).Single().Attribute("url").Value&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;}).Take(20);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;return links.ToList();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So this is used within the YouViewerMainWindow to create a bunch of YouTubeResultControl controls, which are then added to a DragCanvas. I can take no credit for the DragCanvas, I stole that straight from Josh Smith, using this code&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There is nothing special to say about the YouTubeResultControl controls, they are fairly simply controls, that simply contain a single YouTubeInfo item which is used within an event that is raised when the user clicks the internal YouTubeResultControl controls play button. The YouViewerMainWindow uses the YouTubeInfo item to pass to the Viewer control, which in turn is resposible for playing the actual video.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So far nothing special right, all very easy stuff.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The only part that's a bit interesting is that we can play the YouTube video in the new WebBrowser control. This is neat.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Normally WPF only lets you play Windows Media Player supported files that are local or MMS prefixed streams.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;YouTube is neither of these, so how does it work. Well luckily the RSS feed contains enough information for us to do some string manipulation to get a new Url, that points to something much more interesting.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Basically from the RSS feed we can get the following string&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;http://youtube.com/?v=FhZ-HsiS8aI&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;but if we mess around with it a bit we can get&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;http://www.youtube.com/v/FhZ-HsiS8aI&amp;amp;hl=en&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Which is a link to a SWF (Flash) file, that will play directly in the new browser if you past this in to a browser address bar. Aha.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So we can use this new Url and use that as the Source property for the new .NET 3.5 SP1 WebBrowser control, and we get the usual YouTube player we are used to, for free. Neato. I also tried this with the .NET 2.0 WinForms WebBrowser (interop so WindowsIntegration Dll required) control, and the WPF Frame control but they didn't work like the new .NET 3.5 SP1 WebBrowser control.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.dotnetspider.com/attachments/Projects/525-25310-YouViewer.zip" target="_blank"&gt;click here for the compete code....&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-7937862652301992072?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/7937862652301992072/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=7937862652301992072' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/7937862652301992072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/7937862652301992072'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/02/youtube-video-player.html' title='YouTube video player'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-5816971082319430327</id><published>2010-02-03T21:24:00.001-08:00</published><updated>2010-06-29T03:16:22.178-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Favorite'/><category scheme='http://www.blogger.com/atom/ns#' term='Bookmark'/><title type='text'>Add to favorite link script</title><content type='html'>&lt;div&gt;Some times we can see a add to favorite link in many sites. When you click on this link, the "Favorites" window pop-ups asking if you would like to add the site to the list.&lt;/div&gt;&lt;div&gt;Let us first see the advantages of adding such a link:&lt;/div&gt;&lt;div&gt;If visitors really like your site, they can easily add it to their favorites list through the normal process - Under Internet Explorer, click on the "Favorites" menu item and then on "Add to Favorites...".&lt;/div&gt;&lt;div&gt;However, they might just forget about this or they just might feel lazy (...you now what I mean). If you have an "Add To Favorites" link, you not only remind the visitors of the favorites folder but also prompt them to add your site and this just takes one click.&lt;/div&gt;&lt;div&gt;Here we use a little JavaScript and tie it up to the HREF tag of the link and here is the JavaScript function code:&lt;/div&gt;&lt;div&gt;function addfav()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;if (document.all)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;window.external.AddFavorite("http://www.addictdotnet.blogspot.com","Dot the Net")&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;Note: The javascript statement "window.external.AddFavorite(..." should be a single line&lt;/div&gt;&lt;div&gt;The part in red color in the above code is the URL and the blue is the Name you want to give to the link.&lt;/div&gt;&lt;div&gt;The function can be placed inside the document head or an external .js file and will be called from the link.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-5816971082319430327?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/5816971082319430327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=5816971082319430327' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5816971082319430327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5816971082319430327'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/02/add-to-favorite-link-script.html' title='Add to favorite link script'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-1325628498597804180</id><published>2010-02-03T21:22:00.000-08:00</published><updated>2010-06-29T03:16:28.597-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='User Details'/><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='User'/><title type='text'>JavaScript for getting user details</title><content type='html'>&lt;div&gt;&lt;div&gt;If you want to get user detail through java script, use this script&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;!-- ONE STEP TO INSTALL IP ADDRESS:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. Copy the coding into the HEAD of your HTML document --&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;!-- STEP ONE: Paste this code into the HEAD of your HTML document --&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;HEAD&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;SCRIPT LANGUAGE="JavaScript"&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;!-- This script and many more are available free online at --&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;!-- The JavaScript Source!! http://javascript.internet.com --&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;!-- Begin&lt;/div&gt;&lt;div&gt;// http://www.kdcgrohl.com&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;// Depending on your server set-up,&lt;/div&gt;&lt;div&gt;// you may need to use the ".shtml"&lt;/div&gt;&lt;div&gt;// extension [instead of the "html"&lt;/div&gt;&lt;div&gt;// or "htm"] as the script uses Server&lt;/div&gt;&lt;div&gt;// Side Includes. To display in the&lt;/div&gt;&lt;div&gt;// title bar, exclude the&lt;/div&gt;&lt;div&gt;//"&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;" code from the page.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;// This part gets the IP&lt;/div&gt;&lt;div&gt;var ip = '&amp;lt;!--#echo var="REMOTE_ADDR"--&amp;gt;';&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;// This part is for an alert box&lt;/div&gt;&lt;div&gt;alert("Your IP address is "+ip);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;// This part is for the status bar&lt;/div&gt;&lt;div&gt;window.defaultStatus = "Your IP address is "+ip;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;// This part is for the title bar&lt;/div&gt;&lt;div&gt;document.write("&amp;lt;title&amp;gt;Your IP address is "+ip+"&amp;lt;/title&amp;gt;");&lt;/div&gt;&lt;div&gt;// End --&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/script&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;p&amp;gt;&amp;lt;center&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;font face="arial, helvetica" size"-2"&amp;gt;Free JavaScripts provided&amp;lt;br&amp;gt;&lt;/div&gt;&lt;div&gt;by &amp;lt;a href="http://javascriptsource.com"&amp;gt;The JavaScript Source&amp;lt;/a&amp;gt;&amp;lt;/font&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/center&amp;gt;&amp;lt;p&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;!-- Script Size: 1.09 KB --&amp;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/439848007702804277-1325628498597804180?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/1325628498597804180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=1325628498597804180' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/1325628498597804180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/1325628498597804180'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2010/02/javascript-for-getting-user-details.html' title='JavaScript for getting user details'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-9183023773542720068</id><published>2009-12-11T12:02:00.000-08:00</published><updated>2010-06-29T03:16:37.817-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='framework 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='form authentication'/><title type='text'>Form authentication in asp.net 2.0</title><content type='html'>&lt;div&gt;&lt;div&gt;Forms authentication has been made easier with a supply of readymade tools for repetitive tasks. ASP.NET 2.0 encapsulates all the best practices and provides built in solutions to virtually all the tasks relating to user databases, roles cached in cookies, controls for capturing user name and passwords, and administration tools for managing users and roles. Additionally ASP.NET 2.0 supports cookie-less semantics.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Cookie-less authentication can be implemented in several ways but ASP.NET prefers to pack the authentication ticket into the URL. It requires the ISAPI filter to intercept the request, extract the ticket and rewrite the correct path to the application. The filter, then exposes the authentication ticket as another request header. In this section of the tutorial we shall see how this can be implemented.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Forms authentication is driven by the contents of section within the section. The syntax of the section reads as follows. The various parts have been commented for ease of understanding.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: verdana, Arial, Tahoma; font-size: 13px;"&gt;&lt;a href="http://www.exforsys.com/images/vbnet/sourecode/aspnet_t11_sample1.html" style="background: inherit; background: inherit; color: #336699; font-family: Tahoma, Arial; font-size: 12px; text-decoration: underline;"&gt;Click here to view sample code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The boxed in section of the code are the new features introduced by ASP.NET 2.0.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The FormsAuthentication class exposes some helper methods which are useful when adding authentication methods to an ASP.NET application. The static methods can be used to manipulate authentication tickets. For instance the user can call the RedirectformLoginPage method to redirect and authenticated user back to the original URL and SignOut can be used to remove the authentication ticket for the current user. There are a number of other methods that can be used to manipulate and renew the ticket and the associated cookie. Most of these deal with cookie naming and usage issues and are initialized with the values read from the applications configuration file when the application starts up.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;CookieDomain is a property that returns the domain set for the authentication ticket. This property equals the domain attribute in the &amp;lt; forms &amp;gt; section.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The CookieMode returns one of the four FormsCookieMode enumeration values.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;CookieSupported returns true if the current request supports cookies. When the AutoDetect mode is set, it checks for the browser’s cookie capability and verifies that cookies have not been disabled on the client.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;DefaultUrl returns the configured or default URL for the page to return after the request has been successfully authenticated.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The EnableCrossAppRedirects as the name suggests, indicates whether redirects can span over different Web applications.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;FormsCookieName returns the configured cookie name used for the current application. By default this name is .ASPXAUTH.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;FormsCookiePath returns the configured cookie path used for the current application. The default path is the root path /.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;LoginUrl returns the configured or default URL for the Login page. This matches the loginUrl configuration attribute.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;RequireSSL gets the value that indicated whether a cookie must be transmitted using only HTTPS.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SlidingExpiration gets the value indicating whether sliding expiration is enabled.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A number of methods are supported by the FormsAuthentication class.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The Authenticate method is called to validate the credentials input by the user against those configured.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Decrypt returns a decrypted authentication ticket, when given a valid encrypted ticket obtained from a HTTP cookie.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Encrypt as the name suggests encrypts the authentication ticket in a form suitable for use in the HTTP cookie.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;GetAuthCode creates an authentication code for a given username.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;HashPasswordForStoringInConfigFile does what the name implies—hashes the password for storage in the web.config file.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Initialize is called when the application is first started and it initializes all the properties set. The method gets the cookie value and encryption keys to be used in the application.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;RedirectToLoginPage is a new method that has been introduced to plug the holes in the programming interface. This method is used when the user signs out and he has to be redirected to the login page. The method identifies the login page and calls Response.Redirect.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;RedirectFromLoginPage redirects the authenticated user back to the originally requested URL.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;RenewticketIfOld conditionally updates the sliding expiration on an authentication ticket.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SetAuthCookie creates the authentication ticket and attaches it to the cookies collection of the outgoing response.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SignOut as stated earlier removes the authentication ticket.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The Form authentication layer is set up on top of a Web application. The web.config file is configured as under:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt; authentication mode="Forms" &amp;gt; &lt;/div&gt;&lt;div&gt;............&amp;lt; forms loginUrl="login.aspx" &lt;/div&gt;&lt;div&gt;........................name=".ASPXFORMSAUTH" &amp;gt; &lt;/div&gt;&lt;div&gt;............&amp;lt; / forms &amp;gt; &lt;/div&gt;&lt;div&gt;&amp;lt; / authentication &amp;gt; &lt;/div&gt;&lt;div&gt;............&lt;/div&gt;&lt;div&gt;&amp;lt; authorization &amp;gt; &lt;/div&gt;&lt;div&gt;............&amp;lt; deny users="?" / &amp;gt; &lt;/div&gt;&lt;div&gt;&amp;lt; / authorization &amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note that the anonymous user is denied access in the authorization section of the code. All users must enter their credentials and be authenticated. A ticket must be obtained and encrypted in default and packed into a cookie with a default name.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;ASP.NET 2.0 provides the developer with many security controls. The Login Control has only one task. It takes input from the user and validates the user name and password entered, confirms authentication or denies it. Let us see how this control works:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Create a web page with one page called login.aspx. Insert a table with two rows. In the First row insert a Label with the text “ExforSys Home Page--Login”. Now drag a Login control onto the page and examine the code that is formed on the page. Note that the task list of the control offers the user the option of Auto formatting the control choosing standard formats.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href="http://www.exforsys.com/images/asp.net2005/t11/t11_1_files/image002.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" src="http://www.exforsys.com/images/asp.net2005/t11/t11_1_files/image002.jpg" style="cursor: hand; cursor: pointer; display: block; height: 432px; margin: 0px auto 10px; text-align: center; width: 575px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;This is a kind of plug and play offer. Click on convert to Template in the tasklist and see the code generated.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: verdana, Arial, Tahoma; font-size: 13px;"&gt;&lt;a href="http://www.exforsys.com/images/vbnet/sourecode/aspnet_t11_sample2.html" style="background: inherit; background: inherit; color: #336699; font-family: Tahoma, Arial; font-size: 12px; text-decoration: underline;"&gt;Click here to view sample code&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note that using the numerous properties built into this control it can be customized. See the sample of a custom control below. Note that the entire control has been created using the properties available for the control. By setting the section in the Web.Config a list of valid user names and passwords can be specified. If the login has to be validated against a database the same can be defined.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://www.exforsys.com/images/asp.net2005/t11/t11_1_files/image003.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" src="http://www.exforsys.com/images/asp.net2005/t11/t11_1_files/image003.jpg" style="cursor: hand; cursor: pointer; display: block; height: 293px; margin: 0px auto 10px; text-align: center; width: 390px;" /&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="color: #0000ee;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: none; color: black; font-family: verdana, Arial, Tahoma; font-size: 13px;"&gt;&lt;a href="http://www.exforsys.com/images/vbnet/sourecode/aspnet_t11_sample3.html" style="background: inherit; background: inherit; color: #336699; font-family: Tahoma, Arial; font-size: 12px; text-decoration: underline;"&gt;Click here to view sample code&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="font-family: verdana, Arial, Tahoma; font-size: 100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;Developers must note that there are four events with which they can interact while customizing the control. BeforeLogin is raised before the authentication process begins. The syntax can be checked and the login can be stopped if required. AfterLogin is raised after authentication is completed successfully. The developer can pass additional routines. Authenticate can be used to provide customized authentication and LoginError can be used to give error messages whenever login fails or user data is incorrect.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The Password Recovery Control helps users determine their forgotten passwords. Users will be prompted to enter their login name, answer the question for validation and the existing password will be mailed to them. If the password has been stored with a hash value in the database this becomes necessary. See the screenshot of the control as it appears when it is placed on the page.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a href="http://www.exforsys.com/images/asp.net2005/t11/t11_1_files/image004.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" src="http://www.exforsys.com/images/asp.net2005/t11/t11_1_files/image004.jpg" style="cursor: hand; cursor: pointer; display: block; height: 432px; margin: 0px auto 10px; text-align: center; width: 575px;" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;The control must be enabled to send emails and the following code must be placed in the machine.config file. If a local SMTP service has been activated the setting can be left untouched.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt; stmpMail &lt;/div&gt;&lt;div&gt;serverName=”localHost” &lt;/div&gt;&lt;div&gt;serverPort=”25”&amp;gt; &lt;/div&gt;&lt;div&gt;/ &amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The data of the password message to be sent will have to be edited. The ‘from’ property of the MailDefinition will have to be set. Using the other definitions of the mailDefinition class other properties can also be defined. The highlight is the option to create a message based completely upon a template. This is a text file that resides in the root directory of the application. The &amp;lt; %UserName% &amp;gt; and &amp;lt; %Password% &amp;gt; can be used as placeholders.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The control offers three templates that can be built from the scratch or used with customization. UserName is the initial view of the control and it asks for the user name to be typed in. Question is used if the user is required to give an answer. Answer is shown if the password has been detected successfully or has been set back and the email has been sent. A few methods also come in handy while customizing the control. BeforeUserLookup is used before the control tries to look for the user. UserLookupError is returned if the user is not found or cannot be validated. BeforeAnswerLookup is used before the answer is checked. AnswerLookupError is used if the answer is found to be incorrect. BeforeSendEmail is raised before the email is sent to the user.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The LoginStatus and LoginName Controls are useful controls. The latter shows the name of the Logged in user while the former shows the status of the user. The LoginLink of the LoginStatus control automatically refers to the page in which it is placed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The LoginView Control gives two different views depending on the authentication process. It helps in conditional display of pages for anonymous and authenticated users. In other words it is possible to create role based templates using this control.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This section of the tutorial was devoted to Authentication. However, ASP.NET 2.0 comes with a lot of features that help developers create roles and membership definitions. We shall be dealing with the Membership Management API in the next section of this tutorial.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: verdana, Arial, Tahoma; font-size: 13px;"&gt;&lt;a href="http://www.exforsys.com/tutorials/asp.net-2.0/forms-authentication-in-asp.net-2.0.html" style="background: inherit; background: inherit; color: #336699; font-family: Tahoma, Arial; font-size: 12px; text-decoration: underline;"&gt;For complete details check the original post here&lt;/a&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/439848007702804277-9183023773542720068?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/9183023773542720068/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=9183023773542720068' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/9183023773542720068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/9183023773542720068'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/12/form-authentication-in-aspnet-20.html' title='Form authentication in asp.net 2.0'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-1757307017148941173</id><published>2009-10-28T00:46:00.000-07:00</published><updated>2010-06-29T03:16:42.774-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='image'/><category scheme='http://www.blogger.com/atom/ns#' term='Resize'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Resize Image in asp.net in C#</title><content type='html'>This is a code in C# to resize an image. it takes two inputs as target image size and the image in byte format and it'll will return target sized image.&lt;br /&gt;&lt;br /&gt;Some terms used in the code:-&lt;br /&gt;Format24bppRgb - It specifies that formate is 24 bit per pixel and for each colour that is red, green and blue 8 bits are used&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using System.Drawing;&lt;br /&gt;using System.Drawing.Drawing2D;&lt;br /&gt;using System.Drawing.Imaging;&lt;br /&gt;using System.IO;&lt;br /&gt;&lt;br /&gt;public class ImageClass&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;private static byte[] ResizeImageFile(byte[] imageFile, int targetSize)&lt;br /&gt;{&lt;br /&gt;using (System.Drawing.Image oldImage = System.Drawing.Image.FromStream(new MemoryStream(imageFile)))&lt;br /&gt;{&lt;br /&gt;Size newSize = CalculateDimensions(oldImage.Size, targetSize);//User defined function to calculate image dimensions&lt;br /&gt;using (Bitmap newImage = new Bitmap(newSize.Width, newSize.Height, PixelFormat.Format24bppRgb))&lt;br /&gt;{&lt;br /&gt;using (Graphics canvas = Graphics.FromImage(newImage))&lt;br /&gt;{&lt;br /&gt;canvas.SmoothingMode = SmoothingMode.AntiAlias;//set rendering quality of canvas&lt;br /&gt;canvas.InterpolationMode = InterpolationMode.HighQualityBicubic;//set interpolation mode to HighQualityBiubic&lt;br /&gt;canvas.PixelOffsetMode = PixelOffsetMode.HighQuality;&lt;br /&gt;canvas.DrawImage(oldImage, new Rectangle(new Point(0, 0), newSize));//drow image in canvas with new size and with specific starting location&lt;br /&gt;MemoryStream m = new MemoryStream();&lt;br /&gt;newImage.Save(m, ImageFormat.Jpeg);//define image formate in which it is to be shown&lt;br /&gt;return m.GetBuffer();//return image as byte array&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private static Size CalculateDimensions(Size oldSize, int targetSize)&lt;br /&gt;{&lt;br /&gt;Size newSize = new Size();&lt;br /&gt;&lt;br /&gt;//change the size according to the widh and height&lt;br /&gt;if (oldSize.Height &amp;gt; oldSize.Width)&lt;br /&gt;{&lt;br /&gt;newSize.Width = (int)(oldSize.Width * ((float)targetSize / (float)oldSize.Height));&lt;br /&gt;newSize.Height = targetSize;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;newSize.Width = targetSize;&lt;br /&gt;newSize.Height = (int)(oldSize.Height * ((float)targetSize / (float)oldSize.Width));&lt;br /&gt;}&lt;br /&gt;return newSize;&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/439848007702804277-1757307017148941173?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/1757307017148941173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=1757307017148941173' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/1757307017148941173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/1757307017148941173'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/10/resize-image-in-aspnet-in-c.html' title='Resize Image in asp.net in C#'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-1334351281712845109</id><published>2009-09-30T23:09:00.001-07:00</published><updated>2010-06-29T03:16:47.813-07:00</updated><title type='text'>Store PDF in sql server database in binary formate</title><content type='html'>Using this code we can upload pdf file to sql database table in binary type field.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using System; &lt;br /&gt;using System.Data; &lt;br /&gt;using System.Data.SqlClient; &lt;br /&gt;using System.IO; &lt;br /&gt;&lt;br /&gt;public class EmployeeData &lt;br /&gt;{ &lt;br /&gt;public static void Main() &lt;br /&gt;{ &lt;br /&gt;DateTime hireDate = DateTime.Parse("5/21/99"); &lt;br /&gt;AddEmployee("Jones", "Mary", "Sales Representative", hireDate, 5, "jones.bmp"); &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;public static void AddEmployee(string lastName, string firstName, string title, DateTime hireDate , int reportsTo, string photoFilePath) &lt;br /&gt;{ &lt;br /&gt;byte[] photo = GetPhoto(photoFilePath); &lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;SqlConnection nwindConn = new SqlConnection("Data Source=localhost;Integrated Security=SSPI;Initial Catalog=Northwind;"); &lt;br /&gt;&lt;br /&gt;SqlCommand addEmp = new SqlCommand("INSERT INTO Employees (LastName, FirstName, Title, HireDate, ReportsTo, Photo) " + &lt;br /&gt;"Values(@LastName, @FirstName, @Title, @HireDate, @ReportsTo, @Photo)", nwindConn); &lt;br /&gt;&lt;br /&gt;addEmp.Parameters.Add("@LastName", SqlDbType.NVarChar, 20).Value = lastName; &lt;br /&gt;addEmp.Parameters.Add("@FirstName", SqlDbType.NVarChar, 10).Value = firstName; &lt;br /&gt;addEmp.Parameters.Add("@Title", SqlDbType.NVarChar, 30).Value = title; &lt;br /&gt;addEmp.Parameters.Add("@HireDate", SqlDbType.DateTime).Value = hireDate; &lt;br /&gt;addEmp.Parameters.Add("@ReportsTo", SqlDbType.Int).Value = reportsTo; &lt;br /&gt;&lt;br /&gt;addEmp.Parameters.Add("@Photo", SqlDbType.Image, photo.Length).Value = photo; &lt;br /&gt;&lt;br /&gt;nwindConn.Open(); &lt;br /&gt;&lt;br /&gt;addEmp.ExecuteNonQuery(); &lt;br /&gt;&lt;br /&gt;nwindConn.Close(); &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;public static byte[] GetPhoto(string filePath) &lt;br /&gt;{ &lt;br /&gt;FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read); &lt;br /&gt;BinaryReader br = new BinaryReader(fs); &lt;br /&gt;&lt;br /&gt;byte[] photo = br.ReadBytes((int)fs.Length); &lt;br /&gt;&lt;br /&gt;br.Close(); &lt;br /&gt;fs.Close(); &lt;br /&gt;&lt;br /&gt;return photo; &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/439848007702804277-1334351281712845109?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/1334351281712845109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=1334351281712845109' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/1334351281712845109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/1334351281712845109'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/09/store-pdf-in-sql-server-database-in.html' title='Store PDF in sql server database in binary formate'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-9174287891607921931</id><published>2009-09-30T23:03:00.000-07:00</published><updated>2010-06-29T03:16:53.268-07:00</updated><title type='text'>Get all IP addresses on LAN</title><content type='html'>this is a simple vb.net code to retrieve all ip addresses on your local network.&lt;br /&gt;remember to import System.Net.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Public Shared Function GetAllIPADDRESSES(Optional ByVal args As String() = Nothing) As Integer&lt;br /&gt;'args in the signature is optional, without it&lt;br /&gt;'the function will simply get the hostname&lt;br /&gt;'of the local machine then go from there&lt;br /&gt;&lt;br /&gt;Dim strHostName As New String("")&lt;br /&gt;If args.Length = 0 Then&lt;br /&gt;' Getting Ip address of local machine...&lt;br /&gt;' First get the host name of local machine.&lt;br /&gt;strHostName = DNS.GetHostName()&lt;br /&gt;Console.WriteLine("Local Machine's Host Name: " + strHostName)&lt;br /&gt;Else&lt;br /&gt;strHostName = args(0)&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;' Then using host name, get the IP address list..&lt;br /&gt;Dim ipEntry As IPHostEntry = DNS.GetHostByName(strHostName)&lt;br /&gt;Dim addr As IPAddress() = ipEntry.AddressList&lt;br /&gt;&lt;br /&gt;Dim i As Integer = 0&lt;br /&gt;While i &amp;lt; addr.Length&lt;br /&gt;Console.WriteLine("IP Address {0}: {1} ", i, addr(i).ToString())&lt;br /&gt;System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)&lt;br /&gt;End While&lt;br /&gt;Return 0&lt;br /&gt;End Function&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-9174287891607921931?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/9174287891607921931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=9174287891607921931' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/9174287891607921931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/9174287891607921931'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/09/get-all-ip-addresses-on-lan.html' title='Get all IP addresses on LAN'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-1914687018898841276</id><published>2009-09-22T14:21:00.000-07:00</published><updated>2010-06-29T03:16:58.008-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='crystal Report'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><title type='text'>Crystal Report Example in asp.net</title><content type='html'>&lt;div&gt;This code shows how to create Reports using ASP.NET Crystal Reports&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Imports System&lt;/div&gt;&lt;div&gt;Imports System.Data&lt;/div&gt;&lt;div&gt;Imports System.Data.OleDb&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Partial Class _Default&lt;/div&gt;&lt;div&gt;Inherits System.Web.UI.Page&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Dim ConnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\vb.net projects\dept_mstr.mdb"&lt;/div&gt;&lt;div&gt;Dim myConnection As OleDbConnection = New OleDbConnection&lt;/div&gt;&lt;div&gt;myConnection.ConnectionString = ConnString&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Dim ds As New DataSet&lt;/div&gt;&lt;div&gt;Dim da As New OleDbDataAdapter&lt;/div&gt;&lt;div&gt;Dim sql As String = "select distinct dept_no,dept_name from DEPARTMENT"&lt;/div&gt;&lt;div&gt;myConnection.Open()&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Dim com As New OleDbCommand&lt;/div&gt;&lt;div&gt;Dim dbread&lt;/div&gt;&lt;div&gt;com = New OleDbCommand(sql, myConnection)&lt;/div&gt;&lt;div&gt;dbread = com.ExecuteReader&lt;/div&gt;&lt;div&gt;While dbread.read&lt;/div&gt;&lt;div&gt;DropDownList1.Items.Add(dbread.getVALUE(0))&lt;/div&gt;&lt;div&gt;DropDownList2.Items.Add(dbread.getstring(1))&lt;/div&gt;&lt;div&gt;End While&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Protected Sub CrystalReportViewer1_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Init&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;/div&gt;&lt;div&gt;Dim Fltr&lt;/div&gt;&lt;div&gt;CrystalReportViewer1.ReportSource = "E:\WebSite2\crystalreport1.rpt"&lt;/div&gt;&lt;div&gt;Fltr = "{DEPARTMENT.dept_no}='" &amp;amp; Me.DropDownList1.Text &amp;amp; "' and '" &amp;amp; Me.DropDownList2.Text &amp;amp; "'"&lt;/div&gt;&lt;div&gt;CrystalReportViewer1.SelectionFormula = (Fltr)&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;End Class&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-1914687018898841276?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/1914687018898841276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=1914687018898841276' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/1914687018898841276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/1914687018898841276'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/09/crystal-report-example-in-aspnet.html' title='Crystal Report Example in asp.net'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-426633850225927781</id><published>2009-09-22T14:19:00.001-07:00</published><updated>2010-06-29T03:17:40.437-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='culture'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><title type='text'>Use of Culture in asp.net</title><content type='html'>&lt;div&gt;This sample code shows use of culture in asp.net&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;Design:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;div&amp;gt;&lt;/div&gt;&lt;div&gt;Cultures: &amp;lt;asp:DropDownList id="ddlCulture" DataTextField="DisplayName"&lt;/div&gt;&lt;div&gt;DataValueField="Name" DataSourceID="GetCultureInfo" Runat="server" /&amp;gt; &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:ObjectDataSource id="GetCultureInfo" TypeName="System.Globalization.CultureInfo"&lt;/div&gt;&lt;div&gt;SelectMethod="GetCultures" Runat="server"&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;SelectParameters&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Parameter Name="types" DefaultValue="SpecificCultures" /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/SelectParameters&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/asp:ObjectDataSource&amp;gt; &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;asp:Button id="btnSelect" Text="Select" Runat="server" onclick="btnSelect_Click"&amp;gt;&amp;lt;/asp:Button&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Date:&amp;lt;asp:Label id="lblDate" Runat="server" /&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Price : &amp;lt;asp:Label id="lblPrice" Runat="server" /&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/form&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;Web.Config:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;&lt;b&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;profile&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;properties&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;add&lt;/div&gt;&lt;div&gt;name="UserCulture"&lt;/div&gt;&lt;div&gt;defaultValue="en-US" /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;add&lt;/div&gt;&lt;div&gt;name="UserUICulture"&lt;/div&gt;&lt;div&gt;defaultValue="en" /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/properties&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/profile&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;&lt;b&gt;Code Behind:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;protected override void InitializeCulture()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;Culture = Profile.UserCulture;&lt;/div&gt;&lt;div&gt;UICulture = Profile.UserUICulture;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;protected void btnSelect_Click(object sender, EventArgs e)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;Profile.UserCulture = ddlCulture.SelectedValue;&lt;/div&gt;&lt;div&gt;Profile.UserUICulture = ddlCulture.SelectedValue;&lt;/div&gt;&lt;div&gt;//Response.Redirect(Request.Path);&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;void Page_PreRender()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;lblDate.Text = DateTime.Now.ToString("D");&lt;/div&gt;&lt;div&gt;lblPrice.Text = (512.33m).ToString("c");&lt;/div&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/439848007702804277-426633850225927781?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/426633850225927781/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=426633850225927781' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/426633850225927781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/426633850225927781'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/09/use-of-culture-in-aspnet.html' title='Use of Culture in asp.net'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-4595759385705730688</id><published>2009-08-29T08:38:00.000-07:00</published><updated>2010-06-29T03:17:45.816-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Connection String'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='basic'/><title type='text'>All Connection Strings Sample</title><content type='html'>You have the .NET Framework on your local computer and you want to connect to a Microsoft Access database called database1.mdb located in the following folder on your hard disk: c:\database1.mdb. Here are the parameters to create this connection string:&lt;br /&gt;&lt;br /&gt;Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\database1.mdb;&lt;br /&gt;&lt;br /&gt;OLE DB Provider for DB2 (from Microsoft)&lt;br /&gt;&lt;br /&gt;For TCP/IP connections&lt;br /&gt;oConn.Open = "Provider=DB2OLEDB;" &amp;amp; _&lt;br /&gt;"Network Transport Library=TCPIP;" &amp;amp;  _&lt;br /&gt;"Network Address=xxx.xxx.xxx.xxx;" &amp;amp; _&lt;br /&gt;"Initial Catalog=MyCatalog;" &amp;amp; _&lt;br /&gt;"Package Collection=MyPackageCollection;" &amp;amp; _&lt;br /&gt;"Default Schema=MySchema;" &amp;amp; _&lt;br /&gt;"User ID=MyUsername;" &amp;amp; _&lt;br /&gt;"Password=MyPassword"&lt;br /&gt;For APPC connections&lt;br /&gt;&lt;br /&gt;oConn.Open = "Provider=DB2OLEDB;" &amp;amp;  _&lt;br /&gt;"APPC Local LU Alias=MyLocalLUAlias;" &amp;amp;  _&lt;br /&gt;"APPC Remote LU Alias=MyRemoteLUAlias;" &amp;amp;  _&lt;br /&gt;"Initial Catalog=MyCatalog;" &amp;amp; _&lt;br /&gt;"Package Collection=MyPackageCollection;" &amp;amp; _&lt;br /&gt;"Default Schema=MySchema;" &amp;amp; _&lt;br /&gt;"User ID=MyUsername;" &amp;amp; _&lt;br /&gt;"Password=MyPassword"&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;ODBC Driver for Excel&lt;br /&gt;&lt;br /&gt;oConn.Open "Driver={Microsoft Excel Driver (*.xls)};" &amp;amp; _&lt;br /&gt;"DriverId=790;" &amp;amp; _&lt;br /&gt;"Dbq=c:\somepath\mySpreadsheet.xls;" &amp;amp; _&lt;br /&gt;"DefaultDir=c:\somepath"&lt;br /&gt;&lt;br /&gt;ODBC Driver for MySQL (via MyODBC)&lt;br /&gt;To connect to a local database (using MyODBC Driver)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;oConn.Open "Driver={mySQL};" &amp;amp; _&lt;br /&gt;"Server=MyServerName;" &amp;amp; _&lt;br /&gt;"Option=16834;" &amp;amp; _&lt;br /&gt;"Database=mydb"&lt;br /&gt;&lt;br /&gt;To connect to a remote database&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;oConn.Open "Driver={mySQL};" &amp;amp; _&lt;br /&gt;"Server=db1.database.com;" &amp;amp; _&lt;br /&gt;"Port=3306;" &amp;amp; _&lt;br /&gt;"Option=131072;" &amp;amp; _&lt;br /&gt;"Stmt=;" &amp;amp; _&lt;br /&gt;"Database=mydb;" &amp;amp; _&lt;br /&gt;"Uid=myUsername;" &amp;amp; _&lt;br /&gt;"Pwd=myPassword"&lt;br /&gt;&lt;br /&gt;To connect to a local database (using MySQL ODBC 3.51 Driver)&lt;br /&gt;&lt;br /&gt;oConn.Open "DRIVER={MySQL ODBC 3.51 Driver};" &amp;amp; _&lt;br /&gt;"Server=myServerName;" &amp;amp; _&lt;br /&gt;"Port=3306;" &amp;amp; _&lt;br /&gt;"Option=16384;" &amp;amp; _&lt;br /&gt;"Stmt=;" &amp;amp; _&lt;br /&gt;"Database=mydatabaseName;" &amp;amp; _&lt;br /&gt;"Uid=myUsername;" &amp;amp; _&lt;br /&gt;"Pwd=myPassword"&lt;br /&gt;Or&lt;br /&gt;oConn.Open "DRIVER={MySQL ODBC 3.51 Driver};" &amp;amp; _&lt;br /&gt;"SERVER=myServerName;" &amp;amp; _&lt;br /&gt;"DATABASE=myDatabaseName;" &amp;amp; _&lt;br /&gt;"USER=myUsername;" &amp;amp; _&lt;br /&gt;"PASSWORD=myPassword;"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-4595759385705730688?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/4595759385705730688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=4595759385705730688' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/4595759385705730688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/4595759385705730688'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/08/all-connection-strings-sample.html' title='All Connection Strings Sample'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-6448217111113726444</id><published>2009-08-29T08:34:00.000-07:00</published><updated>2010-06-29T03:17:51.298-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Count'/><category scheme='http://www.blogger.com/atom/ns#' term='Online'/><category scheme='http://www.blogger.com/atom/ns#' term='User'/><category scheme='http://www.blogger.com/atom/ns#' term='VB'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><title type='text'>Count online users in asp.net (VB)</title><content type='html'>Place the following code in Global.asax file. Here, we track the active Sessions for our web application. There are three subroutines into which we will be looking to do this – Application_OnStart, Session_OnStart, Session_OnEnd.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step-1 :&lt;/b&gt;&lt;br /&gt;In the Application_OnStart subroutine, we have to set the user count to 0, when the server starts the application.&lt;br /&gt;&lt;br /&gt;Sub Application_OnStart (Sender as Object, E as EventArgs)&lt;br /&gt;' Set user count to 0 when start the application&lt;br /&gt;Application("ActiveUsers") = 0&lt;br /&gt;End Sub&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;Step-2 :&lt;/b&gt;&lt;br /&gt;In the Session_OnStart subroutine, we have to increament the Activeuser by 1:&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Sub Session_OnStart (Sender as Object, E as EventArgs)&lt;br /&gt;Application.Lock&lt;br /&gt;Application("ActiveUsers") = Cint(Application("ActiveUsers")) + 1&lt;br /&gt;Application.UnLock&lt;br /&gt;End Sub&lt;br /&gt;In this case you have to set Timeout – you don’t need to put anything here, but the default Timeout is 20 minutes, so you can change it depending on the needs of your particular application.&lt;br /&gt;&lt;br /&gt;To set the session start time, we add (Session(”Start”) = Now). Basically, when the user hits the site and opens a web page (asp.net page), at the time of opening the page, the session starts. Next, we increase the active visitors count when we start the session (Application(”ActiveUsers”) = Cint(Application(”ActiveUsers”)) + 1 ). The Application lock &amp;amp; unlock adds more stability to the counting.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step-3 :&lt;/b&gt;&lt;br /&gt;we must decrement the number of Active Users on the basis of online sessions in the Session_OnEnd subroutine:&lt;br /&gt;&lt;br /&gt;Sub Session_OnEnd(Sender as Object, E as EventArgs)&lt;br /&gt;Application.Lock&lt;br /&gt;Application("ActiveUsers") = Cint(Application("ActiveUsers")) - 1&lt;br /&gt;Application.UnLock&lt;br /&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;Step-4 :&lt;/b&gt;&lt;br /&gt;Then you can place the following code to access the Application(”ActiveUsers”) in .aspx file&lt;br /&gt;&lt;br /&gt;&amp;lt;%&lt;br /&gt;Dim intNumber as Integer&lt;br /&gt;intNumber =Application("ActiveUsers")&lt;br /&gt;response.write (intNumber )&lt;br /&gt;%&amp;gt; Currently Online&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-6448217111113726444?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/6448217111113726444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=6448217111113726444' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/6448217111113726444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/6448217111113726444'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/08/count-online-users-in-aspnet-vb.html' title='Count online users in asp.net (VB)'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-3614215017833234486</id><published>2009-08-28T13:23:00.000-07:00</published><updated>2010-06-29T03:17:56.173-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Auto Refreshing'/><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='html'/><title type='text'>Refreshing a asp.net web form automaticaly</title><content type='html'>This means: forcing a page postback or redirect from a client browser without explicit user input.&lt;br /&gt;&lt;br /&gt;Why would you want to do that? The main reasons are:&lt;br /&gt;&lt;br /&gt;Auto-redirecting to a new URL after a brief time period &lt;br /&gt;Refreshing page information periodically &lt;br /&gt;Maintaining a valid session state indefinitely &lt;br /&gt;Forcing a specific process to run on the server when the client session has expired.&lt;br /&gt;The following methods are the constructs we have used in our web development projects:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;HTML header refresh tag&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The most common and best known way - a tag of the following format is placed in the HTML section of the page:&lt;br /&gt;&lt;br /&gt;&amp;lt;meta http-equiv="refresh" content="8;url=http://dotnet.org.za/"&amp;gt;&lt;br /&gt;&lt;br /&gt;where '8' refers to the number of seconds that will elapse before the page is refreshed; &lt;br /&gt;'url' is the new url redirect to. It can be excluded which means the current page will be reloaded.&lt;br /&gt;This construct is useful if you have one or two pages which have to auto-refresh, and works for any HTML content type forms.  The downside is the refresh interval cannot be set dynamically, and if you are testing for session timeouts on your site, you'll have to embed this construct in every page of the site.&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Response.AppendHeader method&lt;/strong&gt;&lt;br /&gt;ASP.NET provides the AppendHeader method to the Response object. Typically the page refresh can be set as follows in an ASP.NET webform (in C#):&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;this.Response.AppendHeader("Refresh", &lt;br /&gt;Convert.ToString(Session.Timeout * 60 + 5)); &lt;br /&gt;&lt;br /&gt;Here the page refresh is set to 5 seconds after the client session timeout setting specified in the web.config file.&lt;br /&gt;&lt;br /&gt;This construct is useful as it can be placed in a base webform OnLoad() or Page_Load() response method. All derived webforms will then have the same page refresh setting when they are loaded. Obviously, if the timeout value is changed in the web.config file, no modification is required in this code and everything still works fine.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Page OnLoad method script &lt;/strong&gt;&lt;br /&gt;The same thing can be done by setting a script for the client-side HTML using the HtmlGenericControl.Attributes collection:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;string onload = "window.setTimeout( &lt;br /&gt;'window.location.href=window.location.href'," + &lt;br /&gt;Convert.ToString( (Session.Timeout * 60 + 5) * 1000) + ");"; &lt;br /&gt;this.body.Attributes.Add("onload", onload); &lt;br /&gt;&lt;br /&gt;Unfortunately, to get this to work you need to add the following attribute to the tag in the HTML:&lt;br /&gt;&lt;br /&gt;runat="server"&lt;br /&gt;&lt;br /&gt;and the following member in the webform code-behind class:&lt;br /&gt;&lt;br /&gt;protected System.Web.UI.HtmlControls.HtmlGenericControl body;&lt;br /&gt;&lt;br /&gt;Hmmm - so why do this, if it means that we have to fiddle with the HTML?&lt;br /&gt;&lt;br /&gt;In our experience, certain ASP.NET controls in the webform actually kills the working of the previous two constructs - but this method always seems to work....regardless...in Internet Explorer...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-3614215017833234486?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/3614215017833234486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=3614215017833234486' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/3614215017833234486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/3614215017833234486'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/08/refreshing-aspnet-web-form-automaticaly.html' title='Refreshing a asp.net web form automaticaly'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-5106472174367115758</id><published>2009-08-25T01:20:00.000-07:00</published><updated>2010-06-29T03:18:01.099-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='APIs'/><category scheme='http://www.blogger.com/atom/ns#' term='Encryption'/><category scheme='http://www.blogger.com/atom/ns#' term='Decryption'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Encryption and Decryption without .net APIs</title><content type='html'>This code is for encrypting and then decrypting any string. here we use teo strings NORMAL and ENCRYPT. in this method we pick characters from input and and get its index from NORMAL string and character at the same index in ENCRYPT string is replaces by original character. reverse process is used for decryption.&lt;br /&gt;&lt;br /&gt;string NORMAL = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";&lt;br /&gt;string ENCRYPT = "YO17KPLVSU50C8WE64GAI3MB2DFNZQ9JXTRH";&lt;br /&gt;string strInput = "NikhilGaur";&lt;br /&gt;string strEncrypted = string.Empty;&lt;br /&gt;string strDecrypted = string.Empty;&lt;br /&gt;string strNewChar;&lt;br /&gt;string strLtr;&lt;br /&gt;int iIdx;&lt;br /&gt;protected EncryptionDecryptionDemo()&lt;br /&gt;{&lt;br /&gt;Response.Write("Original String : " + strInput);&lt;br /&gt;Response.Write("&lt;br /&gt;");&lt;br /&gt;for (int i = 0; i &amp;lt; strInput.Length; i++)&lt;br /&gt;{&lt;br /&gt;strLtr = strInput.Substring(i, 1).ToUpper();&lt;br /&gt;iIdx = NORMAL.IndexOf(strLtr);&lt;br /&gt;strNewChar = ENCRYPT.Substring(iIdx, 1).ToUpper();&lt;br /&gt;strEncrypted += strNewChar;&lt;br /&gt;}&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;Response.Write("Encrypted string : " + strEncrypted);&lt;br /&gt;Response.Write("&lt;br /&gt;");&lt;br /&gt;&lt;br /&gt;for (int i = 0; i &amp;lt; strInput.Length; i++)&lt;br /&gt;{&lt;br /&gt;strLtr = strEncrypted.Substring(i, 1).ToUpper();&lt;br /&gt;iIdx = ENCRYPT.IndexOf(strLtr);&lt;br /&gt;strNewChar = NORMAL.Substring(iIdx, 1).ToUpper();&lt;br /&gt;strDecrypted += strNewChar;&lt;br /&gt;}&lt;br /&gt;Response.Write("Decrypted string(Original again :" + strDecrypted);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;If you want to use any special characters you can add in variable "NORMAL" and equivalent encrypted value in variable "ENCRYPT".&lt;br /&gt;"ENCRYPT" variable has the reordered letters of "NORMAL" variable.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-5106472174367115758?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/5106472174367115758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=5106472174367115758' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5106472174367115758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5106472174367115758'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/08/encryption-and-decryption-without-net.html' title='Encryption and Decryption without .net APIs'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-5053535086228641773</id><published>2009-08-16T00:14:00.000-07:00</published><updated>2010-06-29T03:18:07.294-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Remotion'/><category scheme='http://www.blogger.com/atom/ns#' term='WebService'/><title type='text'>Difference between web services &amp; remoting?</title><content type='html'>Remoting and Web Services are ways of communication between applications.&lt;br /&gt;&lt;br /&gt;In &lt;b&gt;Remoting&lt;/b&gt;, the applications involved in the communication process may be located on the same computer, different computers in a same or different network. A proxy of an application object is created on the other application.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Web Services&lt;/b&gt; - Communication between applications using web services is platform independent and programming independent. The application that consumes the web service, simply accesses it, without needing to know how this web service has actually been implemented &amp;amp; created.&lt;br /&gt;It allows Distributed Applications to share Business Logic over Internet.&lt;br /&gt;Differences between both:&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;1.Web Service are Stateless, whereas Remoting has support for both stateless and with-state environment, which is achieved using Singleton and Singlecall activation&lt;br /&gt;2.ASP.NET provides good support to create Web Services. They are easy to deploy.Remoting is little complex.&lt;br /&gt;3. In Remoting the applications involved in the communication should be built on .Net.&lt;br /&gt;4.ASP.NET Web Services may be accessed using HTTP only. Remoting objects may be accessed over any protocol like TCP, SMTP, HTTP.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-5053535086228641773?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/5053535086228641773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=5053535086228641773' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5053535086228641773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5053535086228641773'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/08/difference-between-web-services.html' title='Difference between web services &amp; remoting?'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-149655625946602201</id><published>2009-08-16T00:08:00.000-07:00</published><updated>2010-06-29T03:18:11.929-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='window form'/><category scheme='http://www.blogger.com/atom/ns#' term='interview help'/><title type='text'>Interview Questions in Windows Form.</title><content type='html'>• What is the difference between Debug.Write and Trace.Write? When should each be used? &lt;br /&gt;The Debug.Write call won't be compiled when the DEBUGsymbol is not defined (when doing a release build). Trace.Write calls will be compiled. Debug.Write is for information you want only in debug builds, Trace.Write is for when you want it in release build as well.&lt;br /&gt;&lt;br /&gt;• Difference between Anchor and Dock Properties?&lt;br /&gt;Dock Property-&amp;gt;Gets or sets which edge of the parent container a control is docked to. A control can be docked to one edge of its parent container or can be docked to all edges and fill the parent container. For example, if you set this property to DockStyle.Left, the left edge of the&lt;br /&gt;control will be docked to the left edge of its parent control. Additionally, the docked edge of the control is resized to match that of its container&lt;br /&gt;control.&lt;br /&gt;Anchor Property-&amp;gt;Gets or sets which edges of the control are anchored to the edges of its container. A control can be anchored to one or more edges of its parent container. Anchoring a control to its parent ensures that the anchored edges remain in the same position relative to the edges of the parent container when the parent container is resized.&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;• When would you use ErrorProvider control?&lt;br /&gt;ErrorProvider control is used in Windows Forms application. It is like Validation Control for ASP.NET pages. ErrorProvider control is used to provide validations in Windows forms and display user friendly messages to the user if the validation fails.&lt;br /&gt;E.g&lt;br /&gt;If we went to validate the textBox1 should be empty, then we can validate as below&lt;br /&gt;1). You need to place the errorprovide control on the form&lt;br /&gt;private void textBox1_Validating(object sender, System.ComponentModel.CancelEventArgs e)&lt;br /&gt;{&lt;br /&gt;ValidateName();&lt;br /&gt;}&lt;br /&gt;private bool ValidateName()&lt;br /&gt;{&lt;br /&gt;bool bStatus = true;&lt;br /&gt;if (textBox1.Text == "")&lt;br /&gt;{&lt;br /&gt;errorProvider1.SetError (textBox1,"Please enter your Name");&lt;br /&gt;bStatus = false;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;errorProvider1.SetError (textBox1,"");&lt;br /&gt;return bStatus;&lt;br /&gt;}&lt;br /&gt;it check the textBox1 is empty . If it is empty, then a message Please enter your name is displayed.&lt;br /&gt;&lt;br /&gt;• Can you write a class without specifying namespace? Which namespace does it belong to by default??&lt;br /&gt;Yes, you can, then the class belongs to global namespace which has no name. For commercial products, naturally, you wouldn't want global namespace. &lt;br /&gt;&lt;br /&gt;• You are designing a GUI application with a windows and several widgets on it. The user then resizes the app window and sees a lot of grey space, while the widgets stay in place. What's the problem? &lt;br /&gt;One should use anchoring for correct resizing. Otherwise the default property of a widget on a form is top-left, so it stays at the same location when resized. &lt;br /&gt;&lt;br /&gt;• How can you save the desired properties of Windows Forms application? &lt;br /&gt;.config files in .NET are supported through the API to allow storing and retrieving information. They are nothing more than simple XML files, sort of like what .ini files were before for Win32 apps. &lt;br /&gt;&lt;br /&gt;• So how do you retrieve the customized properties of a .NET application from XML .config file? &lt;br /&gt;Initialize an instance of AppSettingsReader class. Call the GetValue method of AppSettingsReader class, passing in the name of the property and the type expected. Assign the result to the appropriate variable. &lt;br /&gt;&lt;br /&gt;• Can you automate this process? &lt;br /&gt;In Visual Studio yes, use Dynamic Properties for automatic .config creation, storage and retrieval. &lt;br /&gt;&lt;br /&gt;• My progress bar freezes up and dialog window shows blank, when an intensive background process takes over. &lt;br /&gt;Yes, you should've multi-threaded your GUI, with taskbar and main form being one thread, and the background process being the other. &lt;br /&gt;&lt;br /&gt;• What's the safest way to deploy a Windows Forms app?&lt;br /&gt;Web deployment: the user always downloads the latest version of the code, the program runs within security sandbox, properly written app will not require additional security privileges. &lt;br /&gt;&lt;br /&gt;• Why is it not a good idea to insert code into InitializeComponent method when working with Visual Studio? &lt;br /&gt;The designer will likely through it away, most of the code inside InitializeComponent is auto-generated. &lt;br /&gt;&lt;br /&gt;• What's the difference between WindowsDefaultLocation and WindowsDefaultBounds?&lt;br /&gt;WindowsDefaultLocation tells the form to start up at a location selected by OS, but with internally specified size. WindowsDefaultBounds delegates both size and starting position choices to the OS. &lt;br /&gt;&lt;br /&gt;• What's the difference between Move and LocationChanged? Resize and SizeChanged? &lt;br /&gt;Both methods do the same, Move and Resize are the names adopted from VB to ease migration to C#. &lt;br /&gt;&lt;br /&gt;• How would you create a non-rectangular window, let's say an ellipse?&lt;br /&gt;Create a rectangular form, set the TransparencyKey property to the same value as BackColor, which will effectively make the background of the form transparent. Then set the FormBorderStyle to FormBorderStyle.None, which will remove the contour and contents of the form. &lt;br /&gt;&lt;br /&gt;• How do you create a separator in the Menu Designer? &lt;br /&gt;A hyphen '-' would do it. Also, an ampersand '&amp;amp;\' would underline the next letter. &lt;br /&gt;&lt;br /&gt;• How's anchoring different from docking? &lt;br /&gt;Anchoring treats the component as having the absolute size and adjusts its location relative to the parent form. Docking treats the component location as absolute and disregards the component size. So if a status bar must always be at the bottom no matter what, use docking. If a button should be on the top right, but change its position with the form being resized, use anchoring. &lt;br /&gt;&lt;br /&gt;• How do you trigger the Paint event in System.Drawing?&lt;br /&gt;Invalidate the current form, the OS will take care of repainting. The Update method forces the repaint. &lt;br /&gt;&lt;br /&gt;• With these events, why wouldn't Microsoft combine Invalidate and Paint, so that you wouldn't have to tell it to repaint, and then to force it to repaint?&lt;br /&gt;Painting is the slowest thing the OS does, so usually telling it to repaint, but not forcing it allows for the process to take place in the background. &lt;br /&gt;&lt;br /&gt;• How can you assign an RGB color to a System.Drawing.Color object?&lt;br /&gt;Call the static method FromArgb of this class and pass it the RGB values. &lt;br /&gt;&lt;br /&gt;• What class does Icon derive from? &lt;br /&gt;Isn't it just a Bitmap with a wrapper name around it? No, Icon lives in System.Drawing namespace. It's not a Bitmap by default, and is treated separately by .NET. However, you can use ToBitmap method to get a valid Bitmap object from a valid Icon object. &lt;br /&gt;&lt;br /&gt;• Before in my VB app I would just load the icons from DLL. How can I load the icons provided by .NET dynamically? &lt;br /&gt;By using System.Drawing.SystemIcons class, for example System.Drawing.SystemIcons.Warning produces an Icon with a warning sign in it. &lt;br /&gt;&lt;br /&gt;• When displaying fonts, what's the difference between pixels, points and ems? &lt;br /&gt;A pixel is the lowest-resolution dot the computer monitor supports. Its size depends on user's settings and monitor size. A point is always 1/72 of an inch. An em is the number of pixels that it takes to display the letter M.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-149655625946602201?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/149655625946602201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=149655625946602201' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/149655625946602201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/149655625946602201'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/08/interview-questions-in-windows-form.html' title='Interview Questions in Windows Form.'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-5049151790470188720</id><published>2009-08-15T23:59:00.000-07:00</published><updated>2010-06-29T03:18:20.241-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='DateTime'/><title type='text'>Check if date and time is between two date and times</title><content type='html'>This javascript code checks whether the checkDate is between beginDate and endDate and generates a MessabeBox &lt;br /&gt;&lt;br /&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(166, 176, 191); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(166, 176, 191); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(166, 176, 191); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(166, 176, 191); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span style="color: #3366ff; font-weight: bold;"&gt;&lt;br /&gt;function dateWithin(beginDate,endDate,checkDate) {&lt;br /&gt;var b,e,c;&lt;br /&gt;b = Date.parse(beginDate);&lt;br /&gt;e = Date.parse(endDate);&lt;br /&gt;c = Date.parse(checkDate);&lt;br /&gt;if((c &amp;lt;= e &amp;amp;&amp;amp; c &amp;gt;= b)) {&lt;br /&gt;return true;&lt;br /&gt;}&lt;br /&gt;return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// This will alert 'false'&lt;br /&gt;alert(dateWithin('12/20/2007 12:00:00 AM','12/20/2007 1:00:00 AM','12/19/2007 12:00:00 AM'));&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks&lt;br /&gt;&lt;br /&gt;Happy Programming.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-5049151790470188720?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/5049151790470188720/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=5049151790470188720' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5049151790470188720'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5049151790470188720'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/08/check-if-date-and-time-is-between-two.html' title='Check if date and time is between two date and times'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-7405364179434098145</id><published>2009-08-15T23:44:00.000-07:00</published><updated>2010-06-29T03:18:31.015-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='GridView'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Move GridView Rows with up and down keys</title><content type='html'>&lt;div&gt;To add client-side script event to the row to handle the event onKeyDown (we can use onKeyUp or Press also if we would like) we hook up to the GridView’s RowDataBoundEvent to make access to the current row that will be data bound. We can use the GridViewRowEventArgs’s Row property to get access to the current row. By using the Attri butes collection of t he Row property we can easy add attributes to our GridView (In this case the &amp;lt;tr&amp;gt; element that the GridView will render for us). We need to add three attributes to the row, id (to unique identify the row on the client-side), onKeyDown (to see if we press t he down or up button, for moving the marker) and the onClick (to make sure we can select a row and start moving from the selected row). The following code will add the “id” attribute to the &amp;lt;tr&amp;gt; element and it will only have the value of a counter (only to make this example simple), it will also add the onKeyDown event and call the method SelectRow when a key is pressed, and to the last the onClick event to make sure to select a start row:&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(166, 176, 191); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(166, 176, 191); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(166, 176, 191); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(166, 176, 191); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span style="color: #3366ff; font-weight: bold;"&gt;private int _i = 0;&lt;br /&gt;&lt;br /&gt;protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)&lt;br /&gt;{&lt;br /&gt;if (e.Row.RowType == DataControlRowType.DataRow &amp;amp;&amp;amp; (e.Row.RowState == DataControlRowState.Alternate || e.Row.RowState == DataControlRowState.Normal))&lt;br /&gt;{&lt;br /&gt;e.Row.Attributes.Add("id", _i.ToString());&lt;br /&gt;e.Row.Attributes.Add("onKeyDown", "SelectRow();");&lt;br /&gt;e.Row.Attributes.Add("onClick", "MarkRow(" + _i.ToString() + ");");&lt;br /&gt;&lt;br /&gt;_i++;&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The code above will make sure the GridView will render something similar to (at runtime):&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(166, 176, 191); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(166, 176, 191); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(166, 176, 191); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(166, 176, 191); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span style="color: #3366ff; font-weight: bold;"&gt;&lt;br /&gt;&amp;lt;table cellspacing="0" rules="all" border="1" id="GridView1" style="border-collapse:collapse;"&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;th scope="col"&amp;gt;CategoryID&amp;lt;/th&amp;gt;&amp;lt;th scope="col"&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr id="0" onKeyDown="SelectRow();" onClick="MarkRow(0);"&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;1&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;.Net 1.1&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr id="1" onKeyDown="SelectRow();" onClick="MarkRow(1);"&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;2&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;.Net Framework 2.0&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&amp;lt;tr id="2" onKeyDown="SelectRow();" onClick="MarkRow(2);"&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;3&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;ADO.Net 2.0&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;As you can see in the code above, the attribute id, onKeyDown and onClick is added to the &amp;lt;tr&amp;gt; element. The onClick event will call the MarkRow method and pass the current row as an argument to make sure the row we click on will be marked and used as a start row.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now when we have done this, we need to add the client-side code that should handle the movement of the marker etc. We can start with the MarkRow method that will be used to mark a row (change its background color):&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(166, 176, 191); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(166, 176, 191); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(166, 176, 191); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(166, 176, 191); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span style="color: #3366ff; font-weight: bold;"&gt;var currentRowId = 0;&lt;br /&gt;&lt;br /&gt;function MarkRow(rowId)&lt;br /&gt;{&lt;br /&gt;if (document.getElementById(rowId) == null)&lt;br /&gt;return;&lt;br /&gt;&lt;br /&gt;if (document.getElementById(currentRowId) != null )&lt;br /&gt;document.getElementById(currentRowId).style.backgroundColor = '#ffffff';&lt;br /&gt;&lt;br /&gt;currentRowId = rowId;&lt;br /&gt;document.getElementById(rowId).style.backgroundColor = '#ff0000';&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div&gt;The MarkRow will make sure a row will be marked and that a previous marked row will be remarked. The MarkRow takes one argument, rowId, which have the value of the row id to mark. The MarkRow will not do anything if the element with the specified rowId can’t be found (this will happen if we try to move out from the GridView when moving the marker with the up or down key). The curretnRowId which is a global variable will be set to the current marked row, to keep track on which row that is selected. To remark a previous selected row we use the doecument.getElementById method to get the &amp;lt;tr&amp;gt; element with the currentRowId and see if it’s not null. If it’s not null a row is already selected and we need to clear its background color (The background color of the row is used to show what row is marked). After we have cleared a selected row, we set the currentRowId to the rowId that is passed as an argument to the MarkRow method. After this is done we set the background color of the selected row to a background color used to display that the row is marked.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The MarkRow will be called when the onClick event is fired and it will make sure to set the currentRowId to the row that we have clicked on to be the start row (from where we can move the marker with the up and down key). It will also be called when we press the key up or down button to mark a new row. The method that handles the up and down keys is the SelectRow:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(166, 176, 191); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(166, 176, 191); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(166, 176, 191); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(166, 176, 191); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span style="color: #3366ff; font-weight: bold;"&gt;function SelectRow()&lt;br /&gt;{&lt;br /&gt;if (event.keyCode == 40)&lt;br /&gt;MarkRow(currentRowId+1);&lt;br /&gt;else if (event.keyCode == 38)&lt;br /&gt;MarkRow(currentRowId-1);&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The SeletRow method will check if the down key is pressed (keyCode = 40) or if the up key is pressed (keyCode = 38). Note: I’m so bad of naming methods so have that in mind, but I use the name SelectRow because when a key is pressed a row should be selected ;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When the down key is pressed, the MarkRow method will be called with the currentRowId as an argument. The currentRowId has the value of the id (which is the value of the “counter” that can also represents the index of a row) and add 1 to the id, so if we start or movement from row with id 1, we will move to row with the id 2. If we press the up key, we will decrease 1 from the current row, so if we start to move up from row with id 2, we will move to row with the id 1.&lt;/div&gt;&lt;div&gt;Here is the whole code:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;Default.aspx.cs :&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(166, 176, 191); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(166, 176, 191); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(166, 176, 191); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(166, 176, 191); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span style="color: #3366ff; font-weight: bold;"&gt;&lt;br /&gt;public partial class _Default : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;private int _i = 0;&lt;br /&gt;&lt;br /&gt;protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)&lt;br /&gt;{&lt;br /&gt;if (e.Row.RowType == DataControlRowType.DataRow &amp;amp;&amp;amp; (e.Row.RowState == DataControlRowState.Alternate || e.Row.RowState == DataControlRowState.Normal))&lt;br /&gt;{&lt;br /&gt;e.Row.Attributes.Add("id", _i.ToString());&lt;br /&gt;e.Row.Attributes.Add("onKeyDown", "SelectRow();");&lt;br /&gt;e.Row.Attributes.Add("onClick", "MarkRow(" + _i.ToString() + ");");&lt;br /&gt;&lt;br /&gt;_i++;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;b&gt;Default.aspx :&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(166, 176, 191); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(166, 176, 191); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(166, 176, 191); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(166, 176, 191); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span style="color: #3366ff; font-weight: bold;"&gt;&lt;br /&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;%@ Register Src="WebUserControl.ascx" TagName="WebUserControl" TagPrefix="uc1" %&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;&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;script type="text/javascript"&amp;gt;&lt;br /&gt;&lt;br /&gt;var currentRowId = 0;       &lt;br /&gt;&lt;br /&gt;function SelectRow()&lt;br /&gt;{&lt;br /&gt;if (event.keyCode == 40)&lt;br /&gt;MarkRow(currentRowId+1);&lt;br /&gt;else if (event.keyCode == 38)&lt;br /&gt;MarkRow(currentRowId-1);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function MarkRow(rowId)&lt;br /&gt;{&lt;br /&gt;if (document.getElementById(rowId) == null)&lt;br /&gt;return;&lt;br /&gt;&lt;br /&gt;if (document.getElementById(currentRowId) != null )&lt;br /&gt;document.getElementById(currentRowId).style.backgroundColor = '#ffffff';&lt;br /&gt;&lt;br /&gt;currentRowId = rowId;&lt;br /&gt;document.getElementById(rowId).style.backgroundColor = '#ff0000';&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;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="CategoryID"&lt;br /&gt;DataSourceID="SqlDataSource1" OnRowDataBound="GridView1_RowDataBound"&amp;gt;&lt;br /&gt;&amp;lt;Columns&amp;gt;&lt;br /&gt;&amp;lt;asp:BoundField DataField="CategoryID" HeaderText="CategoryID" InsertVisible="False"&lt;br /&gt;ReadOnly="True" SortExpression="CategoryID" /&amp;gt;&lt;br /&gt;&amp;lt;asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" /&amp;gt;&lt;br /&gt;&amp;lt;/Columns&amp;gt;&lt;br /&gt;&amp;lt;/asp:GridView&amp;gt;&lt;br /&gt;&amp;lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="&amp;lt;%$ ConnectionStrings:MyBlogConnectionString %&amp;gt;"&lt;br /&gt;SelectCommand="SELECT [CategoryID], [Name] FROM [Categories]"&amp;gt;&amp;lt;/asp:SqlDataSource&amp;gt;&lt;br /&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;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-7405364179434098145?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/7405364179434098145/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=7405364179434098145' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/7405364179434098145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/7405364179434098145'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/08/move-gridview-rows-with-up-and-down.html' title='Move GridView Rows with up and down keys'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-8682132626286087227</id><published>2009-08-15T23:22:00.000-07:00</published><updated>2010-06-29T03:18:36.326-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB'/><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='WebRequest'/><title type='text'>Read a file's content from a remote webserver using the HttpWebRequest class</title><content type='html'>&lt;div&gt;The HttpWebRequest class allows you to programatically make web requests against an HTTP server. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This code shows how to read a file's content from a remote webserver using the HttpWebRequest class.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Visual basic :&lt;/b&gt;&lt;br /&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(166, 176, 191); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(166, 176, 191); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(166, 176, 191); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(166, 176, 191); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span style="color: #3366ff; font-weight: bold;"&gt;If Not (IsPostBack) Then&lt;br /&gt;Try&lt;br /&gt;Dim fr As System.Net.HttpWebRequest&lt;br /&gt;Dim targetURI As New Uri("http://weblogs.asp.net/farazshahkhan")&lt;br /&gt;&lt;br /&gt;fr = DirectCast(System.Net.HttpWebRequest.Create(targetURI), System.Net.HttpWebRequest)&lt;br /&gt;'In the above code http://weblogs.asp.net/farazshahkhan is used as an example&lt;br /&gt;'it can be a different domain with a different filename and extension&lt;br /&gt;If (fr.GetResponse().ContentLength &amp;gt; 0) Then&lt;br /&gt;Dim str As New System.IO.StreamReader(fr.GetResponse().GetResponseStream())&lt;br /&gt;Response.Write(str.ReadToEnd())&lt;br /&gt;str.Close();&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;Catch ex As System.Net.WebException&lt;br /&gt;Response.Write("File does not exist.")&lt;br /&gt;End Try&lt;br /&gt;End If&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;C# :&lt;/b&gt;&lt;br /&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(166, 176, 191); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(166, 176, 191); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(166, 176, 191); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(166, 176, 191); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span style="color: #3366ff; font-weight: bold;"&gt;if (!(IsPostBack))&lt;br /&gt;{&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;System.Net.HttpWebRequest fr;&lt;br /&gt;Uri targetUri = new Uri("http://weblogs.asp.net/farazshahkhan");&lt;br /&gt;fr = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(targetUri);&lt;br /&gt;//In the above code http://weblogs.asp.net/farazshahkhan is used as an example&lt;br /&gt;//it can be a different domain with a different filename and extension&lt;br /&gt;if ((fr.GetResponse().ContentLength &amp;gt; 0))&lt;br /&gt;{&lt;br /&gt;System.IO.StreamReader str = new System.IO.StreamReader(fr.GetResponse().GetResponseStream());&lt;br /&gt;Response.Write(str.ReadToEnd());&lt;br /&gt;if (str != null) str.Close();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;catch (System.Net.WebException ex)&lt;br /&gt;{&lt;br /&gt;Response.Write("File does not exist.");&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-8682132626286087227?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/8682132626286087227/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=8682132626286087227' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/8682132626286087227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/8682132626286087227'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/08/read-files-content-from-remote.html' title='Read a file&apos;s content from a remote webserver using the HttpWebRequest class'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-2311415367767803974</id><published>2009-08-15T05:13:00.000-07:00</published><updated>2010-06-29T03:18:45.066-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Export'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='GridView'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>How to export GridView to Word in asp.ner C#</title><content type='html'>In tutorial, we need "AddHeader" and "ContentType" to do the work.The AddHeader method adds a new HTML header and value to the response sent to the client. It does not replace an existing header of the same name. After a header has been added, it cannot be removed. The ContentType property specifies the HTTP content type for the response. If no ContentType is specified, the default is text/HTML.&lt;br /&gt;&lt;br /&gt;This tutorial will show you how to export GridView to Word using ASP.NET 2.0 and C#.&lt;br /&gt;&lt;br /&gt;First,you need to import the namespace from System.Data.SqlClient.&lt;br /&gt;&lt;br /&gt;using System.Data.SqlClient;&lt;br /&gt;We chose Server Intellect for its dedicated servers, for our web hosting. They have managed to handle virtually everything for us, from start to finish. And their customer service is stellar.&lt;br /&gt;&lt;br /&gt;The System.Data.SqlClient namespace contains The System.Data.SqlClient namespace is the .NET Framework Data Provider for SQL Server.The .NET Framework Data Provider for SQL Server describes a collection of classes used to access a SQL Server database in the managed space. In tutorial, we need "AddHeader" and "ContentType" to do the work.The AddHeader method adds a new HTML header and value to the response sent to the client. It does not replace an existing header of the same name. After a header has been added, it cannot be removed. The ContentType property specifies the HTTP content type for the response. If no ContentType is specified, the default is text/HTML.&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;We use the Button1_Click event to do the work. We then call "Response.AddHeader" to export a file which is named FileName.doc. We then use "Response.ContentType" to denotes the type of the file being exported.&lt;br /&gt;&lt;br /&gt;protected void Button1_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;Response.Clear();&lt;br /&gt;Response.Buffer = true;&lt;br /&gt;&lt;br /&gt;Response.AddHeader("content-disposition", "attachment;filename=FileName.doc");&lt;br /&gt;&lt;br /&gt;Response.ContentEncoding = System.Text.Encoding.UTF7;&lt;br /&gt;Response.ContentType = "application/vnd.word";&lt;br /&gt;System.IO.StringWriter oStringWriter = new System.IO.StringWriter();&lt;br /&gt;System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);&lt;br /&gt;this.GridView1.RenderControl(oHtmlTextWriter);&lt;br /&gt;Response.Output.Write(oStringWriter.ToString());&lt;br /&gt;Response.Flush();&lt;br /&gt;Response.End();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public override void VerifyRenderingInServerForm(Control control)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;We migrated our web sites to Server Intellect over one weekend and the setup was so smooth that we were up and running right away. They assisted us with everything we needed to do for all of our applications. With Server Intellect's help, we were able to avoid any headaches!&lt;br /&gt;&lt;br /&gt;The front end GridViewExportWordVB.aspx page looks something like this:&lt;br /&gt;&lt;br /&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span class="Apple-style-span" style="color: #cc33cc;"&gt;&lt;b&gt;&amp;lt;asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Export to Word" Width="99px" /&amp;gt;&lt;br /&gt;&amp;lt;asp:GridView ID="GridView1" runat="server"&amp;gt; &amp;lt;/asp:GridView&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Need help with Windows Dedicated Hosting? Try Server Intellect. I'm a happy customer!&lt;br /&gt;&lt;br /&gt;The flow for the code behind page is as follows.&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Configuration;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Security;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Web.UI.WebControls.WebParts;&lt;br /&gt;using System.Web.UI.HtmlControls;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Data.SqlClient;&lt;br /&gt;&lt;br /&gt;public partial class _Default : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;string ConnectionString = "Data Source=(local);Initial Catalog=pubs;User Id=sa;Password=sa123";&lt;br /&gt;SqlConnection cn1;&lt;br /&gt;&lt;br /&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;if (!Page.IsPostBack)&lt;br /&gt;{&lt;br /&gt;SqlConnection cn = new SqlConnection(ConnectionString);&lt;br /&gt;cn.Open();&lt;br /&gt;cn1 = new SqlConnection(ConnectionString);&lt;br /&gt;cn1.Open();&lt;br /&gt;SqlCommand cmd = new SqlCommand("select * from [authors]", cn);&lt;br /&gt;SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);&lt;br /&gt;GridView1.DataSource = dr;&lt;br /&gt;GridView1.DataBind();&lt;br /&gt;dr.Close();&lt;br /&gt;cmd.Dispose();&lt;br /&gt;cn.Dispose();&lt;br /&gt;cn1.Dispose();&lt;br /&gt;cn = cn1 = null;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;protected void Button1_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;Response.Clear();&lt;br /&gt;Response.Buffer = true;&lt;br /&gt;&lt;br /&gt;Response.AddHeader("content-disposition", "attachment;filename=FileName.doc");&lt;br /&gt;&lt;br /&gt;Response.ContentEncoding = System.Text.Encoding.UTF7;&lt;br /&gt;Response.ContentType = "application/vnd.word";&lt;br /&gt;System.IO.StringWriter oStringWriter = new System.IO.StringWriter();&lt;br /&gt;System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);&lt;br /&gt;this.GridView1.RenderControl(oHtmlTextWriter);&lt;br /&gt;Response.Output.Write(oStringWriter.ToString());&lt;br /&gt;Response.Flush();&lt;br /&gt;Response.End();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public override void VerifyRenderingInServerForm(Control control)&lt;br /&gt;{&lt;br /&gt;&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/439848007702804277-2311415367767803974?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/2311415367767803974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=2311415367767803974' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/2311415367767803974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/2311415367767803974'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/08/how-to-export-gridview-to-word-in.html' title='How to export GridView to Word in asp.ner C#'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-4750568117802823808</id><published>2009-08-10T22:02:00.000-07:00</published><updated>2010-06-29T03:18:57.418-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Attachment'/><category scheme='http://www.blogger.com/atom/ns#' term='Email'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Embedding the image using image URL</title><content type='html'>&lt;span class="Apple-style-span" style="color: #333333; font-family: Verdana; font-size: 13px; line-height: 19px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: Verdana; font-size: 13px; line-height: 19px;"&gt;Here We have to discuss about , how to embed the image to an email actually , Embedding an image will affect performance so here ,&lt;span style="color: #ff9900; font-style: italic; font-weight: bold;"&gt; i am passing the image URL directly to the body tag&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;so , here the code..&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;try&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;       {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;           MailMessage mail = new MailMessage();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;           mail.To.Add("user@gmail.com");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;           mail.From = new MailAddress("admin@support.com");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;           mail.Subject = "Test with Image";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;    &lt;span style="color: #cc33cc;"&gt;       string &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;Body = "&amp;lt;b&amp;gt;Welcome to Pass Image URL to Email Body!&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&amp;lt;BR&amp;gt;Online resource for .net articles.&amp;lt;BR&amp;gt;&amp;lt;img alt=\"\" hspace=0 src='http://www.idealsd.co.uk/images/addmenu.jpg' align=baseline border=0 &amp;gt;";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;           AlternateView htmlView = AlternateView.CreateAlternateViewFromString(Body, null, "text/html");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;           mail.AlternateViews.Add(htmlView);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;           SmtpClient smtp = new SmtpClient();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;           smtp.Host = "smtp.gmail.com";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;           //specify your smtp server name/ip here&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;           smtp.EnableSsl = true;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;           //enable this if your smtp server needs SSL to communicate&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;           smtp.Credentials = new NetworkCredential("Username", "password");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;          // smtp.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;           smtp.Send(mail);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;       }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;       catch (Exception ex)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;       {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;           Response.Write(ex.Message);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc33cc; font-weight: bold;"&gt;       }&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-4750568117802823808?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/4750568117802823808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=4750568117802823808' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/4750568117802823808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/4750568117802823808'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/08/embedding-image-using-image-url.html' title='Embedding the image using image URL'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-3836606081398275424</id><published>2009-08-10T21:56:00.000-07:00</published><updated>2010-06-29T03:19:06.575-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='image'/><category scheme='http://www.blogger.com/atom/ns#' term='Email'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Embedding the image with an Email</title><content type='html'>&lt;span class="Apple-style-span" style="color: #333333; font-family: Verdana; font-size: 13px; line-height: 19px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: Verdana; font-size: 13px; line-height: 19px;"&gt;We have to discuss about how to Embed an image to Email Previous Article we are discussed passing image URL directly to body tag of Email.&lt;br /&gt;&lt;br /&gt;So , now we Embed a Image directly to Email&lt;br /&gt;&lt;br /&gt;See the example...&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;try&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;            MailMessage mail = new MailMessage();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;            mail.To.Add("user@gmail.com");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;            mail.From = new MailAddress("admin@support.com");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;            mail.Subject = "Test with Image";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;            string Body = "&amp;lt;b&amp;gt; Welcome to Embed image!&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&amp;lt;BR&amp;gt;Online resource for .net articles.&amp;lt;BR&amp;gt;&amp;lt;img alt=\"\" hspace=0 src=\"cid:imageId\" align=baseline border=0 &amp;gt;";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;            &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;            AlternateView htmlView = AlternateView.CreateAlternateViewFromString(Body, null, "text/html");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;            LinkedResource imagelink = new LinkedResource(Server.MapPath(".") + @"\images\sample.jpg", "image/jpg");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;            imagelink.ContentId = "imageId";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;            imagelink.TransferEncoding = System.Net.Mime.TransferEncoding.Base64;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;            htmlView.LinkedResources.Add(imagelink);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;            mail.AlternateViews.Add(htmlView);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;            SmtpClient smtp = new SmtpClient();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;            smtp.Host = "smtp.gmail.com";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;            //specify your smtp server name/ip here&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;            smtp.EnableSsl = true;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;            //enable this if your smtp server needs SSL to communicate&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;            smtp.Credentials = new NetworkCredential("username", "password");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;           // smtp.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;            smtp.Send(mail);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;        catch (Exception ex)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;            Response.Write(ex.Message);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-3836606081398275424?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/3836606081398275424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=3836606081398275424' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/3836606081398275424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/3836606081398275424'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/08/embedding-image-with-email.html' title='Embedding the image with an Email'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-2503407376760168563</id><published>2009-08-10T21:54:00.001-07:00</published><updated>2010-06-29T03:19:50.201-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='DeCompress'/><title type='text'>DeCompress the file using asp.net</title><content type='html'>&lt;span class="Apple-style-span" style="color: #333333; font-family: Verdana; font-size: 13px; line-height: 19px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: Verdana; font-size: 13px; line-height: 19px;"&gt;In previous post we seen how to compress the file this will helpful when the file is large you can&lt;br /&gt;compress the file.&lt;br /&gt;&lt;br /&gt;Now we will see how to Decompress the file&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #330000; font-weight: bold;"&gt;Button_Click event.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(166, 176, 191); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(166, 176, 191); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(166, 176, 191); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(166, 176, 191); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span style="color: #3366ff; font-weight: bold;"&gt;DecompressFile(Server.MapPath("~/Decompressed/FindEmai_onTextfile.zip"),Server.MapPath("~/Decompressed/FindEmai_onTextfile.txt"));&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here i just swap the filename so it may confuse so use some different path(Folder) or filename&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color: #330000; font-weight: bold;"&gt;Decompress Method&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;public static void DecompressFile(string sourceFileName, string destinationFileName)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;        FileStream outStream;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;        FileStream inStream;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;        //Check if the source file exist.          &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;        if (File.Exists(sourceFileName))&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            //Read teh input file&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            inStream = File.OpenRead(sourceFileName);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            //Check if the destination file exist else create once&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            outStream = File.Open(destinationFileName, FileMode.OpenOrCreate);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            //Now create a byte array to hold the contents of the file&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            //Now increase the filecontent size more since the compressed file&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            //size will always be less then the actuak file.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            byte[] fileContents = new byte[(inStream.Length * 100)];&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            //Read the file and decompress&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            GZipStream zipStream = new GZipStream(inStream, CompressionMode.Decompress, false);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            //Read the contents to this byte array&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            int totalBytesRead = zipStream.Read(fileContents, 0, fileContents.Length);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            outStream.Write(fileContents, 0, totalBytesRead);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            //Now close all the streams.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            zipStream.Close();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            inStream.Close();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            outStream.Close();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;    }&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-2503407376760168563?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/2503407376760168563/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=2503407376760168563' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/2503407376760168563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/2503407376760168563'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/08/decompress-file-using-aspnet.html' title='DeCompress the file using asp.net'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-2157342365608400373</id><published>2009-08-10T21:52:00.000-07:00</published><updated>2010-06-29T03:19:55.803-07:00</updated><title type='text'>Compress the file using asp.net application</title><content type='html'>&lt;span class="Apple-style-span" style="color: #333333; font-family: Verdana; font-size: 13px; line-height: 19px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: Verdana; font-size: 13px; line-height: 19px;"&gt;&lt;div style="text-align: justify;"&gt;we are going to discuss about how to compress the file using asp.net application , ie: for compression there are some third party tools like CSharpZip (not sue about the name of the tools..) ,gzip, etc..&lt;/div&gt;&lt;br /&gt;Asp.net has inbuilt with Compression ie: derive from the Class&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;using System.IO.Compression;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #6600cc; font-weight: bold;"&gt;There are two compression derived from this namespace.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #6600cc; font-weight: bold;"&gt;1) Gzipstream&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #6600cc; font-weight: bold;"&gt;2) Deflate stream&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Deflate seems to be must faster than the Gzipstream but Deflate doesn't uncompress other formats , but Gzipstream decompress the other files like winzip, winrar .&lt;br /&gt;&lt;br /&gt;Now we are going to see Gzipstream it has a class which contains filename and compression mode , Compression mode has two values Compress and Decompress.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #330000; font-weight: bold;"&gt;Button_ClickEvent&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(166, 176, 191); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(166, 176, 191); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(166, 176, 191); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(166, 176, 191); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;CompressFile(Server.MapPath("~/Decompressed/FindEmai_onTextfile.txt"),Server.MapPath("~/Decompressed/FindEmai_onTextfile.zip"));&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here you have to give two parameter first one is Sourcefilename to be compressed , second is path where you have to place the compressed file. it will check if the file exists the compressed file has been placed there, else it will create on the fly.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #330000; font-weight: bold;"&gt;Method definition&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;public static void CompressFile(string sourceFileName, string destinationFileName)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;        FileStream outStream;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;        FileStream inStream;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;        //Check if the source file exist.          &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;        if (File.Exists(sourceFileName))&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            //Read teh input file&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;             //Check if the destination file exist else create once&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            outStream = File.Open(destinationFileName, FileMode.OpenOrCreate);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            GZipStream zipStream = new GZipStream(outStream, CompressionMode.Compress);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;             //Now create a byte array to hold the contents of the file&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            byte[] fileContents = new byte[inStream.Length];&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            //Read the contents to this byte array&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            inStream.Read(fileContents, 0, fileContents.Length);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            zipStream.Write(fileContents, 0, fileContents.Length);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;             //Now close all the streams.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            zipStream.Close();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            inStream.Close();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            outStream.Close();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;    }&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-2157342365608400373?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/2157342365608400373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=2157342365608400373' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/2157342365608400373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/2157342365608400373'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/08/compress-file-using-aspnet-application.html' title='Compress the file using asp.net application'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-8109271674402854673</id><published>2009-08-10T21:51:00.001-07:00</published><updated>2010-06-29T03:20:05.865-07:00</updated><title type='text'>Send attachment with email</title><content type='html'>&lt;span class="Apple-style-span" style="color: #333333; font-family: Verdana; font-size: 13px; line-height: 19px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: Verdana; font-size: 13px; line-height: 19px;"&gt;Now we will see , how to send an attachment to the email.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;for the you have to create an instance for Attachment class and pass the filename and specify the media type information for an email message attachements and set the ContentDisposition which specify the file type whether its txt , doc, gif,jpg etc..,&lt;/div&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(166, 176, 191); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(166, 176, 191); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(166, 176, 191); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(166, 176, 191); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span style="color: #660000; font-weight: bold;"&gt;Import NameSpace&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;using System.Net.Mail;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;using System.Net.MIME;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;using System.Net;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color: #660000; font-weight: bold;"&gt;Code&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;try&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            MailMessage mail = new MailMessage();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            mail.To.Add("venkat@gmail.com");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            mail.From = new MailAddress("admin@Support.com");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            mail.Subject = "Testing Email Attachment";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            string file = Server.MapPath("~/files/findemai_ontextfile.txt");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            Attachment attachFile = new Attachment(file, MediaTypeNames.Application.Octet);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            ContentDisposition disposition = attachFile.ContentDisposition;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;           &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            mail.Attachments.Add(attachFile);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            SmtpClient smtp = new SmtpClient();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            smtp.Host = "smtp.gmail.com";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;           &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            smtp.EnableSsl = true;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;           &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            smtp.Credentials = new NetworkCredential("xxxxxxx@gmail.com", "*********");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt; s;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            smtp.Send(mail);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;        catch (Exception ex)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;            Response.Write(ex.Message);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #3333ff; font-weight: bold;"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: Verdana; font-size: 13px; line-height: 19px;"&gt;&lt;br /&gt;This link helps you :&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.net.mail.attachment.aspx" style="color: #467839; text-decoration: none;"&gt;&lt;span style="font-weight: bold;"&gt;http://msdn.microsoft.com/en-us/library/system.net.mail.attachment.aspx&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-8109271674402854673?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/8109271674402854673/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=8109271674402854673' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/8109271674402854673'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/8109271674402854673'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/08/now-we-will-see-how-to-send-attachment.html' title='Send attachment with email'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-8931248069849530163</id><published>2009-08-10T21:44:00.000-07:00</published><updated>2010-06-29T03:20:12.177-07:00</updated><title type='text'>Refresh the parent window by Closing the popup window</title><content type='html'>Here we will discuss How to Refresh the parent window by Closing the popup window&lt;br /&gt;&lt;br /&gt;Passing the function on your button ie: place Close button on you popup If you click the Close Button , it will close the popup and refresh the parent page.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: Verdana; font-weight: normal; line-height: 19px; white-space: normal;"&gt;&lt;br /&gt;&lt;pre size="13px" style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: black; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: Verdana; line-height: 19px; white-space: normal;"&gt;&lt;br /&gt;&lt;div class="cover"&gt;&lt;div class="entry"&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(239, 239, 239); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(239, 239, 239); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(239, 239, 239); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(239, 239, 239); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span style="color: red; font-weight: bold;"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: red; font-weight: bold;"&gt;function refreshParent() {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: red; font-weight: bold;"&gt;  window.opener.location.href = window.opener.location.href;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: red; font-weight: bold;"&gt;  if (window.opener.progressWindow)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: red; font-weight: bold;"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: red; font-weight: bold;"&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: red; font-weight: bold;"&gt;    window.opener.progressWindow.close()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: red; font-weight: bold;"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: red; font-weight: bold;"&gt;  window.close();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: red; font-weight: bold;"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: red; font-weight: bold;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: red; font-weight: bold;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: red; font-family: -webkit-monospace; font-size: 100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 13px; white-space: pre;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="clear: both;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;span style="color: red; font-weight: bold;"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-8931248069849530163?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/8931248069849530163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=8931248069849530163' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/8931248069849530163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/8931248069849530163'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/08/refresh-parent-window-by-closing-popup.html' title='Refresh the parent window by Closing the popup window'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-1900835256721824114</id><published>2009-07-29T05:43:00.000-07:00</published><updated>2010-06-29T03:20:21.115-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CreateUserWizard'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><title type='text'>Storing User Profile in custom table using CreateUserWizard control</title><content type='html'>&lt;div&gt;I discussed how you can add extra controls to CreateUserWizard(CUW) Control in the &lt;a href="http://niksgaur.blogspot.com/2009/07/adding-control-to-createuserwizard.html"&gt;previous blog post&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Assuming you have gone through the post above, what we will do here is store this extra information collected in CUW into a custom database.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Other option is storing in asp.net Profiles. Check References section at the end to see how to store user information in profiles.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Add Extra Fields to CUW Control:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Lets say we want to collect FirstName and LastName of the User while creating a user.With the help of previous post add two textboxes namely FirstName and LastName. Add Validation controls accordinly.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Create a Custom Table to store User Profile(here FirstName and LastName)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Add a new Table to your Membership Database. Here I have named it User_Profile.&lt;/li&gt;&lt;li&gt;Add 3 columns namely UserId - type uniqueidentifier, FirstName - type varchar(50) and LastName - type varchar(50)&lt;/li&gt;&lt;li&gt;Set UserId as Primary Key&lt;/li&gt;&lt;li&gt;Create a Foreign key relationship between UserId of User_Profile table and aspnet_Users table. &lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;So once you have your table ready to store the information lets go ahead and look at the code how to insert values into it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Inserting FirstName and LastName into User_Profile&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We will use the CreatedUser event of CUW control to do this job. In the design Mode, double click the Create User button. In the code behind for CreateUser page you will see an event handler added for CreatedUser event. Here is the code that says the rest:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;// Get the UserId of the just-added user&lt;/div&gt;&lt;div&gt;MembershipUser newUser = Membership.GetUser(CreateUserWizard1.UserName);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Guid newUserId = (Guid)newUser.ProviderUserKey;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;//Get Profile Data Entered by user in CUW control&lt;/div&gt;&lt;div&gt;String FirstName = ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("FirstName")).Text;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;String LastName = ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("LastName")).Text;&lt;/div&gt;&lt;div&gt;// Insert a new record into User_Profile&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;// Get your Connection String from the web.config. MembershipConnectionString is the name I have in my web.config&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;string connectionString = ConfigurationManager.ConnectionStrings["MembershipConnectionString"].ConnectionString;&lt;/div&gt;&lt;div&gt;string insertSql = "INSERT INTO User_Profile(UserId,FirstName, LastName) VALUES(@UserId, @FirstName, @LastName)";&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;using (SqlConnection myConnection = new SqlConnection(connectionString))&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;myConnection.Open();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SqlCommand myCommand = new SqlCommand(insertSql, myConnection);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;myCommand.Parameters.AddWithValue("@UserId", newUserId);&lt;/div&gt;&lt;div&gt;myCommand.Parameters.AddWithValue("@FirstName", FirstName);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;myCommand.Parameters.AddWithValue("@LastName", LastName);&lt;/div&gt;&lt;div&gt;myCommand.ExecuteNonQuery();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;myConnection.Close();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Most of the code is self-explanatory. We get the UserId of the newly created user and the values in FirstName and LastName textboxes.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then its simple sql database insertion code.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-1900835256721824114?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/1900835256721824114/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=1900835256721824114' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/1900835256721824114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/1900835256721824114'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/07/i-discussed-how-you-can-add-extra.html' title='Storing User Profile in custom table using CreateUserWizard control'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-1394971160125945378</id><published>2009-07-29T04:53:00.000-07:00</published><updated>2010-06-29T03:20:32.245-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CreateUserWizard'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><title type='text'>Adding Control to CreateUserWizard Control</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="color: #0000ee;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;CreateUserWizard(CUW) control comes with some default controls for entering UserName,Password, ConfirmPassword, Email, etc. Sometimes you might want to add additional controls eg. for storing Firstname,LastName,CompanyName, etc.&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here is how you can add these additional controls. IDE used is Visual Studio 2005.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Drag and drop a CUW in the designer Panel.&lt;/li&gt;&lt;li&gt;Selet the Control.&lt;/li&gt;&lt;li&gt;Select the small arrow on top right corner of the contol&lt;/li&gt;&lt;li&gt;Select the 'Customize Create User Step'&lt;/li&gt;&lt;div&gt;&lt;/div&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href="http://4.bp.blogspot.com/_FLcwCs9yNAc/SnA6GV24XQI/AAAAAAAAAJo/l0MgdYqEJa0/s1600-h/cuw.bmp" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" style="text-decoration: none;"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5363851036819217666" src="http://4.bp.blogspot.com/_FLcwCs9yNAc/SnA6GV24XQI/AAAAAAAAAJo/l0MgdYqEJa0/s400/cuw.bmp" style="cursor: hand; cursor: pointer; display: block; height: 158px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: 12px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: 12px;"&gt;&lt;div mce_keep="true" style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Now Switch to the &lt;/span&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Source&lt;/span&gt;&lt;/strong&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;  view. You will find the markup for the CreateUserWizard as below:&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;CreateUserWizard&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="CreateUserWizard1"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;WizardSteps&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;CreateUserWizardStep&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="CreateUserWizardStep1"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ContentTemplate&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;table&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;border&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="0"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;align&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="center"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;colspan&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="2"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Sign Up for Your New Account&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;align&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="right"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Label&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="UserNameLabel"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;AssociatedControlID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="UserName"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;User Name:&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Label&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;TextBox&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="UserName"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;TextBox&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;RequiredFieldValidator&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="UserNameRequired"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ControlToValidate&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="UserName"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ErrorMessage&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="User Name is required."&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ToolTip&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="User Name is required."&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ValidationGroup&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="CreateUserWizard1"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;*&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;RequiredFieldValidator&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;align&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="right"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Label&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="PasswordLabel"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;AssociatedControlID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Password"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Password:&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Label&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;TextBox&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Password"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;TextMode&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Password"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;TextBox&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;RequiredFieldValidator&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="PasswordRequired"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ControlToValidate&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Password"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ErrorMessage&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Password is required."&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ToolTip&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Password is required."&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ValidationGroup&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="CreateUserWizard1"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;*&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;RequiredFieldValidator&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;align&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="right"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Label&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="ConfirmPasswordLabel"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;AssociatedControlID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="ConfirmPassword"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Confirm Password:&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Label&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;TextBox&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="ConfirmPassword"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;TextMode&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Password"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;TextBox&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;RequiredFieldValidator&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="ConfirmPasswordRequired"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ControlToValidate&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="ConfirmPassword"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ErrorMessage&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Confirm Password is required."&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ToolTip&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Confirm Password is required."&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ValidationGroup&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="CreateUserWizard1"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;*&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;RequiredFieldValidator&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;align&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="right"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Label&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="EmailLabel"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;AssociatedControlID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Email"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;E-mail:&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Label&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;TextBox&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Email"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;TextBox&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;RequiredFieldValidator&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="EmailRequired"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ControlToValidate&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Email"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ErrorMessage&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="E-mail is required."&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ToolTip&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="E-mail is required."&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ValidationGroup&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="CreateUserWizard1"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;*&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;RequiredFieldValidator&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;align&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="right"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Label&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="QuestionLabel"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;AssociatedControlID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Question"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Security Question:&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Label&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;TextBox&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Question"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;TextBox&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;RequiredFieldValidator&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="QuestionRequired"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ControlToValidate&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Question"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ErrorMessage&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Security question is required."&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ToolTip&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Security question is required."&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ValidationGroup&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="CreateUserWizard1"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;*&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;RequiredFieldValidator&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;align&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="right"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Label&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="AnswerLabel"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;AssociatedControlID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Answer"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Security Answer:&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Label&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;TextBox&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Answer"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;TextBox&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;RequiredFieldValidator&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="AnswerRequired"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ControlToValidate&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Answer"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ErrorMessage&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Security answer is required."&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ToolTip&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Security answer is required."&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ValidationGroup&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="CreateUserWizard1"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;*&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;RequiredFieldValidator&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;align&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="center"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;colspan&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="2"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;CompareValidator&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="PasswordCompare"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ControlToCompare&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Password"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ControlToValidate&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="ConfirmPassword"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Display&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Dynamic"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ErrorMessage&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="The Password and Confirmation Password must match."&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ValidationGroup&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="CreateUserWizard1"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;CompareValidator&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;align&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="center"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;colspan&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="2"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;style&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="color: red"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Literal&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="ErrorMessage"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;EnableViewState&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="False"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Literal&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;table&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ContentTemplate&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;CreateUserWizardStep&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;CompleteWizardStep&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="CompleteWizardStep1"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;CompleteWizardStep&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;WizardSteps&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;CreateUserWizard&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Add a Label and Texbox&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Now you can add new controls or modify the existing controls as per your requirement. For our case we will add a Label and a TextBox contols to allow users to enter their Company name right before they enter their UserName.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;align&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="right"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Label&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="CompanyNameLabel"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;AssociatedControlID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="CompanyName"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Company Name:&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Label&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;TextBox&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="CompanyName"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;TextBox&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;RequiredFieldValidator&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ID&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="CompanyNameValidator"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;runat&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="server"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ControlToValidate&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="CompanyName"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ErrorMessage&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Company Name is required."&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ToolTip&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="Company Name is required."&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;ValidationGroup&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="CreateUserWizard1"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;*&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;asp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;RequiredFieldValidator&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div mce_keep="true" style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;This is how our control will look.&lt;/span&gt;&lt;/div&gt;&lt;div mce_keep="true" style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div mce_keep="true" style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;span class="Apple-style-span" style="font-family: Georgia; font-size: 16px;"&gt;&lt;a href="http://3.bp.blogspot.com/_FLcwCs9yNAc/SnBDCvaSAnI/AAAAAAAAAJw/SqPQduunEJE/s1600-h/CUW2.bmp" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5363860870563758706" src="http://3.bp.blogspot.com/_FLcwCs9yNAc/SnBDCvaSAnI/AAAAAAAAAJw/SqPQduunEJE/s400/CUW2.bmp" style="cursor: pointer; display: block; height: 359px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 348px;" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div mce_keep="true" style="margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-1394971160125945378?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/1394971160125945378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=1394971160125945378' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/1394971160125945378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/1394971160125945378'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/07/adding-control-to-createuserwizard.html' title='Adding Control to CreateUserWizard Control'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_FLcwCs9yNAc/SnA6GV24XQI/AAAAAAAAAJo/l0MgdYqEJa0/s72-c/cuw.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-1256447453743561753</id><published>2009-07-23T11:35:00.000-07:00</published><updated>2010-06-29T03:20:37.837-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Download'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Download files in c#</title><content type='html'>&lt;div&gt;This code shows how to download files of any type from applciation&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;private void DownloadFile( string fname)&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;try&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;string path = MapPath( fname );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;string name = System.IO.Path.GetFileName( path );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;string ext = System.IO.Path.GetExtension( path );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;string type = "";&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;// set known types based on file extension  &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;if ( ext != null )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;switch( ext.ToLower() )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;case ".htm":&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;case ".html":&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;       &lt;/span&gt;type = "text/HTML";&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;       &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;case ".txt":&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;       &lt;/span&gt;type = "text/plain";&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;       &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;case ".doc":&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;case ".rtf":&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;       &lt;/span&gt;type = "Application/msword";&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;       &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;case ".xml":&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;       &lt;/span&gt;type = "Application/xml";&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;       &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;case ".zip":&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;       &lt;/span&gt;type = "application/zip";&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;       &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;Response.AppendHeader( "content-disposition","attachment; filename=" + name );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;if ( type != "" )   &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;Response.ContentType = type;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;Response.WriteFile( path );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;catch(Exception ex)&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;new PowerXEditor.BL.CommonUtility().RegisterError(ex);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;Response.End();    &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-1256447453743561753?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/1256447453743561753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=1256447453743561753' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/1256447453743561753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/1256447453743561753'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/07/download-files-in-c.html' title='Download files in c#'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-4881068687532007241</id><published>2009-07-23T11:32:00.001-07:00</published><updated>2010-06-29T03:20:45.716-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Validation'/><title type='text'>Enter only digits in Textbox</title><content type='html'>The following code snippet allows user to enter only digits.&lt;br /&gt;&lt;br /&gt;function AcceptDigits(e)&lt;br /&gt;{&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;var charCode = (navigator.appName == "Netscape")? e.which : e.keyCode; &lt;br /&gt;if(e.shiftKey)&lt;br /&gt;{&lt;br /&gt;return false;&lt;br /&gt;}&lt;br /&gt;if( (charCode &amp;gt; 47 &amp;amp;&amp;amp; charCode &amp;lt; 59) || charCode==8 || charCode==37 || charCode==39 || charCode==46 || charCode==9 || charCode==36 || charCode==35)&lt;br /&gt;{&lt;br /&gt;return true;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;return 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/439848007702804277-4881068687532007241?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/4881068687532007241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=4881068687532007241' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/4881068687532007241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/4881068687532007241'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/07/enter-only-digits-in-textbox.html' title='Enter only digits in Textbox'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-7570277825375167028</id><published>2009-07-23T11:28:00.000-07:00</published><updated>2010-06-29T03:20:51.275-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB'/><title type='text'>Align the Form in a screen based on screen resolution</title><content type='html'>The following VB.NET Code Snippet is used to dynamically align the form to the center of the window, based on the the end users screen resolution.&lt;br /&gt;&lt;br /&gt;Sub Center_Form()&lt;br /&gt;Dim maxwidth As Integer = Screen.PrimaryScreen.WorkingArea.Size.Width&lt;br /&gt;Dim left As Integer&lt;br /&gt;Dim top As Integer&lt;br /&gt;'Remove 10% top part of window&lt;br /&gt;Dim maxheight As Integer = Screen.PrimaryScreen.WorkingArea.Size.Height - Screen.PrimaryScreen.WorkingArea.Size.Height * 0.1&lt;br /&gt;left = (maxwidth - Me.Width) / 2 &lt;br /&gt;top = ((maxheight - Me.Height) / 2) &lt;br /&gt;Me.Location = New Point(left, top)&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Call the function Center_Form in the Form_Load event of the form.&lt;br /&gt;&lt;br /&gt;Private Sub DataForm1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load&lt;br /&gt;'Center display&lt;br /&gt;Center_Form()&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The following VB.NET Code Snippet is used to maximize the form. &lt;br /&gt;&lt;br /&gt;Private Sub Maximize()&lt;br /&gt;Me.WindowState = FormWindowState.Maximized&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The following VB.NET Code Snippet is used to minimize the form. &lt;br /&gt;&lt;br /&gt;Private Sub Minimize()&lt;br /&gt;Me.WindowState = FormWindowState.Minimized&lt;br /&gt;End Sub&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-7570277825375167028?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/7570277825375167028/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=7570277825375167028' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/7570277825375167028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/7570277825375167028'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/07/align-form-in-screen-based-on-screen.html' title='Align the Form in a screen based on screen resolution'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-3825904115492675145</id><published>2009-07-23T11:24:00.000-07:00</published><updated>2010-06-29T03:20:57.720-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='error'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Write Error message to file ( C#)</title><content type='html'>This code shows how to write error message to file in C#.net&lt;br /&gt;&lt;br /&gt;//Create class for write msg to file&lt;br /&gt;using System;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Configuration;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Security;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Web.UI.WebControls.WebParts;&lt;br /&gt;using System.Web.UI.HtmlControls;&lt;br /&gt;using System.IO;&lt;br /&gt;/// &lt;br /&gt;/// Summary description for clsErrorDisplay&lt;br /&gt;/// &lt;br /&gt;public class clsErrorDisplay&lt;br /&gt;{&lt;br /&gt;public void WriteToFile(string ErrStr,string Page)&lt;br /&gt;{&lt;br /&gt;string FilePath = System.Web.HttpContext.Current.Server.MapPath("~/ZipUnzip/log/error.txt");//Add ur path here&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;if (File.Exists(FilePath))&lt;br /&gt;{&lt;br /&gt;FileStream fs = new FileStream(FilePath, FileMode.OpenOrCreate, FileAccess.Write);&lt;br /&gt;StreamWriter m_streamWriter = new StreamWriter(fs);&lt;br /&gt;// Write to the file using StreamWriter class&lt;br /&gt;m_streamWriter.BaseStream.Seek(0, SeekOrigin.End);&lt;br /&gt;m_streamWriter.WriteLine("{0} {1}", DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());&lt;br /&gt;m_streamWriter.WriteLine("\n"+Page + "\n");&lt;br /&gt;m_streamWriter.WriteLine(ErrStr + "\n");&lt;br /&gt;m_streamWriter.WriteLine("--------------------------------- \n ");&lt;br /&gt;m_streamWriter.Flush();&lt;br /&gt;m_streamWriter.Dispose();&lt;br /&gt;fs.Close();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Call WriteToFile() from your form...&lt;br /&gt;object.WriteToFile(ex.ToString(), Page.ToString());&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-3825904115492675145?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/3825904115492675145/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=3825904115492675145' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/3825904115492675145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/3825904115492675145'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/07/write-error-message-to-file-c.html' title='Write Error message to file ( C#)'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-2086941938662405651</id><published>2009-07-23T11:20:00.000-07:00</published><updated>2010-06-29T03:21:04.005-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='basic'/><title type='text'>Use of basic keywords in c#</title><content type='html'>In C# base keyword is used to call the base class constructor and base class field. &lt;br /&gt;&lt;br /&gt;First the values are received by the derived class constructor and then passed to the base class constructor.&lt;br /&gt;&lt;br /&gt;See The Code&lt;br /&gt;&lt;br /&gt;class A&lt;br /&gt;{&lt;br /&gt;int i;&lt;br /&gt;A(int n, int m)&lt;br /&gt;{&lt;br /&gt;x = n;&lt;br /&gt;y = m&lt;br /&gt;Console.WriteLine("n="+x+"m="+y);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;class B:A&lt;br /&gt;{&lt;br /&gt;int i;&lt;br /&gt;B(int a, int b):base(a,b)//calling base class constructor and passing value&lt;br /&gt;{&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;base.i = a;//passing value to base class field&lt;br /&gt;i = b;&lt;br /&gt;}&lt;br /&gt;public void Show()&lt;br /&gt;{&lt;br /&gt;Console.WriteLine("Derived class i="+i);&lt;br /&gt;Console.WriteLine("Base class i="+base.i);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;class MainClass&lt;br /&gt;{&lt;br /&gt;static void Main(string args[])&lt;br /&gt;{&lt;br /&gt;B b=new B(5,6);//passing value to derive class constructor&lt;br /&gt;b.Show();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OUTPUT&lt;br /&gt;&lt;br /&gt;n=5m=6&lt;br /&gt;Derived class i=6&lt;br /&gt;Base class i=5&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-2086941938662405651?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/2086941938662405651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=2086941938662405651' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/2086941938662405651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/2086941938662405651'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/07/use-of-basic-keywords-in-c.html' title='Use of basic keywords in c#'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-1401948307382113987</id><published>2009-07-23T11:09:00.000-07:00</published><updated>2010-06-29T03:21:09.855-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='voice recorder'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Record voice from micropone in C#</title><content type='html'>Do you want to record your voice from Microphone? If yes, you can use the Microsoft APIs to solve this issue. It's a very simple approach to record your voice from Mic. I provided C#.net code to solve this issue.&lt;br /&gt;&lt;br /&gt;1. Open C#.net web applications. And added the blow namespace.&lt;br /&gt;&lt;br /&gt;using Microsoft.VisualBasic.Devices;&lt;br /&gt;using Microsoft.VisualBasic;&lt;br /&gt;using System.Runtime.InteropServices;&lt;br /&gt;&lt;br /&gt;2. Add the below API.&lt;br /&gt;[DllImport("winmm.dll", EntryPoint = "mciSendStringA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]&lt;br /&gt;private static extern int mciSendString(string lpstrCommand, string lpstrReturnString, int uReturnLength, int hwndCallback);&lt;br /&gt;&lt;br /&gt;3. Create three Buttons and given the below name and text for the buttons.&lt;br /&gt;&lt;br /&gt;1. Record &lt;br /&gt;2. SaveStop&lt;br /&gt;3. Read&lt;br /&gt;&lt;br /&gt;1. Under Record Button Click paste the below Code:&lt;br /&gt;&lt;br /&gt;// record from microphone&lt;br /&gt;mciSendString("open new Type waveaudio Alias recsound", "", 0, 0);&lt;br /&gt;mciSendString("record recsound", "", 0, 0);&lt;br /&gt;&lt;br /&gt;2. Under Save / Stop button Click, &lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// stop and save&lt;br /&gt;mciSendString("save recsound c:\\record.wav", "", 0, 0);&lt;br /&gt;mciSendString("close recsound ", "", 0, 0);&lt;br /&gt;Computer c = new Computer();&lt;br /&gt;c.Audio.Stop();&lt;br /&gt;&lt;br /&gt;3. Under Read Button Click&lt;br /&gt;&lt;br /&gt;Computer computer = new Computer();&lt;br /&gt;computer.Audio.Play("c:\\record.wav", AudioPlayMode.Background);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Save and Execute it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-1401948307382113987?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/1401948307382113987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=1401948307382113987' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/1401948307382113987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/1401948307382113987'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/07/record-voice-from-micropone-in-c.html' title='Record voice from micropone in C#'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-7711557254807185713</id><published>2009-07-19T23:49:00.000-07:00</published><updated>2010-06-29T03:21:55.418-07:00</updated><title type='text'>Write GridData to Excel File using ASP.NET</title><content type='html'>To write GridData to Excel File is very simple. This tutorial will show you how to write GridData to an Excel file using ASP.NET 2.0 and C#.&lt;br /&gt;&lt;br /&gt;We can use ASP.NET 2.0 to write DataGrid data to Excel file. The method is to write the DataGrid data as stream to Html information, then use FileStream and BinaryWriter to create file and write information to the file.&lt;br /&gt;&lt;br /&gt;First, you will need to import the System.IO namespace.&lt;br /&gt;&lt;br /&gt;The System.IO namespace contains the StringWriter ,FileStream and BinaryWriter Classes that we need for the sample .&lt;br /&gt;&lt;br /&gt;Imports System.IO&lt;br /&gt;We migrated our web sites to Server Intellect over one weekend and the setup was so smooth that we were up and running right away. They assisted us with everything we needed to do for all of our applications. With Server Intellect's help, we were able to avoid any headaches!&lt;br /&gt;&lt;br /&gt;We use the Button1_Click event to do the work.&lt;br /&gt;&lt;br /&gt;We use the DataGrid to bind database, then write the DataGrid data as stream to Html information.&lt;br /&gt;After then we use FileStream and BinaryWriter to create file and write information to the file.&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;protected void Button1_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;if (TextBox1.Text == "")&lt;br /&gt;{&lt;br /&gt;Response.Write("&lt;script language="javascript"&gt;window.alert('Please enter filename!');&lt;/script&gt;");&lt;br /&gt;return;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;string filename = TextBox1.Text;&lt;br /&gt;&lt;br /&gt;this.DataGrid1.Page.EnableViewState = false;&lt;br /&gt;StringWriter tw = new StringWriter();&lt;br /&gt;HtmlTextWriter hw = new HtmlTextWriter(tw);&lt;br /&gt;this.DataGrid1.RenderControl(hw);&lt;br /&gt;string HtmlInfo = tw.ToString().Trim();&lt;br /&gt;&lt;br /&gt;string DocFileName = filename+".xls";&lt;br /&gt;string FilePathName = Request.PhysicalPath;&lt;br /&gt;FilePathName = FilePathName.Substring(0, FilePathName.LastIndexOf("\\"));&lt;br /&gt;&lt;br /&gt;FilePathName = FilePathName + "\\" + DocFileName;&lt;br /&gt;File.Delete(FilePathName);&lt;br /&gt;FileStream Fs = new FileStream(FilePathName, FileMode.Create);&lt;br /&gt;BinaryWriter BWriter = new BinaryWriter(Fs, Encoding.GetEncoding("UTF-8"));&lt;br /&gt;&lt;br /&gt;BWriter.Write(HtmlInfo);&lt;br /&gt;BWriter.Close();&lt;br /&gt;Fs.Close();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;We are using Server Intellect and have found that by far, they are the most friendly, responsive, and knowledgeable support team we've ever dealt with!&lt;br /&gt;&lt;br /&gt;The front Default.aspx page looks something like this:&lt;br /&gt;&lt;br /&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(166, 176, 191); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(166, 176, 191); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(166, 176, 191); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(166, 176, 191); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span class="Apple-style-span" style="color: #3366ff;"&gt;&lt;b&gt;&lt;br /&gt;&amp;lt;form id="Form1" method="post" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;fieldset&amp;gt;&lt;br /&gt;&amp;lt;legend&amp;gt;DataToExcel&amp;lt;/legend&amp;gt;&lt;br /&gt;&amp;lt;asp:button id="Button1" runat="server" text="ToExcel" onclick="Button1_Click"&amp;gt;&amp;lt;/asp:button&amp;gt;&lt;br /&gt;Save as filename:&amp;lt;asp:textbox id="TextBox1" runat="server"&amp;gt;&amp;lt;/asp:textbox&amp;gt;&lt;br /&gt;&amp;lt;asp:datagrid id="DataGrid1" runat="server" width="100%" datasourceid="SqlDataSource1"&amp;gt;&lt;br /&gt;&amp;lt;itemstyle horizontalalign="Center"&amp;gt;&amp;lt;/itemstyle&amp;gt;&lt;br /&gt;&amp;lt;headerstyle horizontalalign="Center"&amp;gt;&amp;lt;/headerstyle&amp;gt;&lt;br /&gt;&amp;lt;footerstyle horizontalalign="Center"&amp;gt;&amp;lt;/footerstyle&amp;gt;&lt;br /&gt;&amp;lt;pagerstyle pagebuttoncount="15" mode="NumericPages"&amp;gt;&amp;lt;/pagerstyle&amp;gt;&lt;br /&gt;&amp;lt;/asp:datagrid&amp;gt;&amp;lt;asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring=""&amp;gt;"&amp;gt;&lt;br /&gt;SelectCommand="SELECT [EmployeeID], [LastName], [FirstName], [BirthDate], [City], [Address], [Country], [HomePhone] FROM [Employees]"&amp;gt;&lt;br /&gt;&amp;lt;/asp:sqldatasource&amp;gt;&lt;br /&gt;&amp;lt;/fieldset&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Server Intellect assists companies of all sizes with their hosting needs by offering fully configured server solutions coupled with proactive server management services. Server Intellect specializes in providing complete internet-ready server solutions backed by their expert 24/365 proactive support team.&lt;br /&gt;&lt;br /&gt;Please add the following code to Web.Config, and change to your User ID and Password accordingly.&lt;br /&gt;&lt;br /&gt;&lt;pre style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #efefef; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(166, 176, 191); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(166, 176, 191); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(166, 176, 191); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(166, 176, 191); border-top-style: solid; border-top-width: 1px; color: black; font-size: 13px; line-height: 13px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"&gt;&lt;span class="Apple-style-span" style="color: #3366ff;"&gt;&lt;b&gt;&lt;br /&gt;&amp;lt;connectionstrings&amp;gt;&lt;br /&gt;&amp;lt;add name="NorthwindConnectionString" connectionstring="Data Source=localhost;Initial Catalog=Northwind;User ID=sa" providername="System.Data.SqlClient"&amp;gt;&lt;br /&gt;&amp;lt;/add&amp;gt;&amp;lt;/connectionstrings&amp;gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-7711557254807185713?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/7711557254807185713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=7711557254807185713' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/7711557254807185713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/7711557254807185713'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/07/write-griddata-to-excel-file-using_19.html' title='Write GridData to Excel File using ASP.NET'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-5735125194371780580</id><published>2009-07-02T06:18:00.000-07:00</published><updated>2010-06-29T03:22:00.750-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Encryption'/><category scheme='http://www.blogger.com/atom/ns#' term='Decryption'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Code Encryption and Decryption using a Key in C#</title><content type='html'>Many time we need to encrypt the user name and password for a high level of security..&lt;br /&gt;&lt;br /&gt;here is the code for doing so.. We just need to include the name space System.Security in our application.. IN this code. we can use the Key to encrypt and Decrypt, thus it will provide a higher level of security.. That key we can also save in the Web config file or can provide from front end..&lt;br /&gt;&lt;br /&gt;here is the code.&lt;br /&gt;&lt;br /&gt;#region "Encryption &amp;amp; Decryption"&lt;br /&gt;&lt;br /&gt;public static string Encrypt(stringtoEncrypt, bool useHashing)&lt;br /&gt;{&lt;br /&gt;byte[] keyArray;&lt;br /&gt;byte[] toEncryptArray =UTF8Encoding.UTF8.GetBytes(toEncrypt);&lt;br /&gt;string key = "543z";&lt;br /&gt;&lt;br /&gt;if (useHashing)&lt;br /&gt;{&lt;br /&gt;MD5CryptoServiceProvider hashmd5 = newMD5CryptoServiceProvider();&lt;br /&gt;keyArray =hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(key));&lt;br /&gt;hashmd5.Clear();&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;keyArray =UTF8Encoding.UTF8.GetBytes(key);&lt;br /&gt;&lt;br /&gt;TripleDESCryptoServiceProvider tdes =new TripleDESCryptoServiceProvider();&lt;br /&gt;tdes.Key = keyArray;&lt;br /&gt;tdes.Mode = CipherMode.ECB;&lt;br /&gt;tdes.Padding = PaddingMode.PKCS7;&lt;br /&gt;&lt;br /&gt;ICryptoTransform cTransform =tdes.CreateEncryptor();&lt;br /&gt;byte[] resultArray =cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);&lt;br /&gt;tdes.Clear();&lt;br /&gt;returnConvert.ToBase64String(resultArray, 0, resultArray.Length);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public static string Decrypt(stringcipherString, bool useHashing)&lt;br /&gt;{&lt;br /&gt;byte[] keyArray;&lt;br /&gt;byte[] toEncryptArray =Convert.FromBase64String(cipherString);&lt;br /&gt;string key = "543z";&lt;br /&gt;&lt;br /&gt;if (useHashing)&lt;br /&gt;{&lt;br /&gt;MD5CryptoServiceProvider hashmd5 = newMD5CryptoServiceProvider();&lt;br /&gt;keyArray =hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(key));&lt;br /&gt;hashmd5.Clear();&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;keyArray =UTF8Encoding.UTF8.GetBytes(key);&lt;br /&gt;&lt;br /&gt;TripleDESCryptoServiceProvider tdes =new TripleDESCryptoServiceProvider();&lt;br /&gt;tdes.Key = keyArray;&lt;br /&gt;tdes.Mode = CipherMode.ECB;&lt;br /&gt;tdes.Padding = PaddingMode.PKCS7;&lt;br /&gt;&lt;br /&gt;ICryptoTransform cTransform =tdes.CreateDecryptor();&lt;br /&gt;byte[] resultArray =cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);&lt;br /&gt;&lt;br /&gt;tdes.Clear();&lt;br /&gt;returnUTF8Encoding.UTF8.GetString(resultArray);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#endregion&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-5735125194371780580?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/5735125194371780580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=5735125194371780580' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5735125194371780580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5735125194371780580'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/07/code-encryption-and-decryption-using.html' title='Code Encryption and Decryption using a Key in C#'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-5403943697492342958</id><published>2009-07-02T06:15:00.000-07:00</published><updated>2010-06-29T03:22:07.623-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Email'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><title type='text'>Send emails via google mail server in C#</title><content type='html'>Some time we need to send mails to others from our application, and fro this we need to use some free email server like GMAIL. here is the code using that we can use the gmail mail server to send the mails. I am simply specifying the gmail SMTP server name and the Port number in the code.. take a look…&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;MailMessage mailMessage = new MailMessage();&lt;br /&gt;mailMessage.To.Add(”test@test.com”);&lt;br /&gt;mailMessage.Subject = “Test”;&lt;br /&gt;mailMessage.Body = “This is a test mail”;&lt;br /&gt;mailMessage.IsBodyHtml = true;&lt;br /&gt;&lt;br /&gt;// Create the credentials to login to the gmail account associated with my custom domain&lt;br /&gt;string sendEmailsFrom = “abc@xyz.com”;&lt;br /&gt;string sendEmailsFromPassword = “password”;&lt;br /&gt;&lt;br /&gt;NetworkCredential cred = new NetworkCredential(sendEmailsFrom, sendEmailsFromPassword);&lt;br /&gt;SmtpClient mailClient = new SmtpClient(”smtp.gmail.com”, 587);&lt;br /&gt;mailClient.EnableSsl = true;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;mailClient.DeliveryMethod = SmtpDeliveryMethod.Network;&lt;br /&gt;mailClient.UseDefaultCredentials = false;&lt;br /&gt;mailClient.Timeout = 30000;&lt;br /&gt;mailClient.Credentials = cred;&lt;br /&gt;mailClient.Send(mailMessage);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-5403943697492342958?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/5403943697492342958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=5403943697492342958' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5403943697492342958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/5403943697492342958'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/07/send-emails-via-google-mail-server-in-c.html' title='Send emails via google mail server in C#'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-6078316343907159234</id><published>2009-07-01T04:35:00.000-07:00</published><updated>2010-06-29T03:22:12.652-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='ads'/><category scheme='http://www.blogger.com/atom/ns#' term='jQuery'/><title type='text'>Text Link Ad Rotation using jQuery</title><content type='html'>&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Lucida Grande'; font-size: 13px; line-height: 18px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Lucida Grande'; font-size: 13px; line-height: 18px;"&gt;People who have been monetizing their sites need no introduction to Text Link Ads. In simple words, Text Link Ads are Hyperlinks sponsored by Advertisers. When a user clicks on these hyperlinks, they are sent to the sponsor’s website.&lt;br /&gt;In this post, we will see how to rotate Text Link Ads on the same position. I will use the Cycle Plug-in for this purpose, since it accomplishes this task in just one line of code. &lt;a href="http://malsup.com/download.html" style="color: #1e608e; text-decoration: none;"&gt;Download the Cycle Plugin&lt;/a&gt;.&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;html &lt;/span&gt;&lt;span style="color: red;"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://www.w3.org/1999/xhtml"&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;head&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;title&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;Text Link Ad Rotation&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;title&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;script &lt;/span&gt;&lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="text/javascript"&lt;br /&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;src&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://code.jquery.com/jquery-latest.js"&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;script&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;script &lt;/span&gt;&lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="text/javascript"&lt;br /&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;src&lt;/span&gt;&lt;span style="color: blue;"&gt;="Scripts/jquery.cycle.all.min.js"&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;script&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;script &lt;/span&gt;&lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="text/javascript"&amp;gt;&lt;br /&gt;&lt;/span&gt;$(document).ready(&lt;span style="color: blue;"&gt;function&lt;/span&gt;() {&lt;br /&gt;$(&lt;span style="color: #a31515;"&gt;'#Links'&lt;/span&gt;).cycle(&lt;span style="color: #a31515;"&gt;'fade'&lt;/span&gt;);&lt;br /&gt;});&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;script&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;style &lt;/span&gt;&lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="text/css"&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;body&lt;br /&gt;&lt;/span&gt;{&lt;br /&gt;&lt;span style="color: red;"&gt;font-size&lt;/span&gt;:&lt;span style="color: blue;"&gt;13px&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: red;"&gt;font-family&lt;/span&gt;:&lt;span style="color: blue;"&gt;"Lucida Grande", "Lucida Sans Unicode"&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: red;"&gt;color&lt;/span&gt;:&lt;span style="color: blue;"&gt;#444444&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;style&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;head&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;body&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;div &lt;/span&gt;&lt;span style="color: red;"&gt;id&lt;/span&gt;&lt;span style="color: blue;"&gt;="Links"&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;a &lt;/span&gt;&lt;span style="color: red;"&gt;href&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://www.niksgaur.blogspot.com"&amp;gt;&lt;span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; color: black; line-height: normal; white-space: pre-wrap;"&gt;&amp;gt;My Software and web development Experience&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;a&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;a &lt;/span&gt;&lt;span style="color: red;"&gt;href&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://www.engcolgs.blogspot.com"&amp;gt;&lt;/span&gt;My College Lifr&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;a&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;a &lt;/span&gt;&lt;span style="color: red;"&gt;href&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://authornitin.blogspot.com"&amp;gt;&lt;/span&gt;Canvass&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;a&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;div&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;body&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;html&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;You can use the &lt;a href="http://malsup.com/browser.html" style="color: #1e608e; text-decoration: none;"&gt;Effects Browser&lt;/a&gt; page to preview all the effects that are available with the Cycle Plug-in.&lt;br /&gt;&lt;strong&gt;Note:&lt;/strong&gt; To rotate ASP.NET Hyperlinks, replace the HTML links with the following:&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;asp&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;HyperLink &lt;/span&gt;&lt;span style="color: red;"&gt;ID&lt;/span&gt;&lt;span style="color: blue;"&gt;="HyperLink1" &lt;/span&gt;&lt;span style="color: red;"&gt;runat&lt;/span&gt;&lt;span style="color: blue;"&gt;="server"&lt;br /&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;NavigateUrl&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://jquery.com"&amp;gt;&lt;/span&gt;jQuery&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;asp&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: #a31515;"&gt;HyperLink&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste" style="color: #1e608e; text-decoration: none;"&gt;&lt;/a&gt;There’s no need to change any other code since this asp.net control gets rendered as html A tag&lt;br /&gt;You can see a &lt;a href="http://www.dotnetcurry.com/Demos/jQueryTextRotate/rotate.htm" style="color: #1e608e; text-decoration: none;"&gt;live demo&lt;/a&gt; of the example given in this post over &lt;a href="http://www.dotnetcurry.com/Demos/jQueryTextRotate/rotate.htm" style="color: #1e608e; text-decoration: none;"&gt;here.&lt;/a&gt; The Link Rotates after every few seconds.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/439848007702804277-6078316343907159234?l=niksgaur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://niksgaur.blogspot.com/feeds/6078316343907159234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=439848007702804277&amp;postID=6078316343907159234' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/6078316343907159234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/439848007702804277/posts/default/6078316343907159234'/><link rel='alternate' type='text/html' href='http://niksgaur.blogspot.com/2009/07/text-link-ad-rotation-using-jquery.html' title='Text Link Ad Rotation using jQuery'/><author><name>Nikhil Dinesh Gaur</name><uri>http://www.blogger.com/profile/04073493612242521445</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='15' height='32' src='http://3.bp.blogspot.com/_FLcwCs9yNAc/TTmgkrnxnhI/AAAAAAAABTo/86oSAfZCAps/s220/49949_818578623_4822281_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-439848007702804277.post-4571023857986143890</id><published>2009-07-01T03:58:00.000-07:00</published><updated>2010-06-29T03:22:21.443-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Navigation'/><title type='text'>Navigate to previous page in asp.net</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana; font-size: 12px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana; font-size: 12px;"&gt;&lt;div align="justify" style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 14px;"&gt;There are various ways using which you can navigate back to the previous page. To keep the example short and simple, I will be using two pages and a few buttons to demonstrate the navigation. So let us get started:&lt;/span&gt;&lt;/div&gt;&lt;div align="justify" style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;b&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;"&gt;Step 1:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;"&gt; Create an ASP.NET Project with two pages, Page1.aspx and Page2.aspx.&lt;/span&gt;&lt;/div&gt;&lt;div align="justify" style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;b&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;"&gt;Step 2:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;"&gt; On Page1.aspx, drag and drop a button control. In the click event, use this code:&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;u&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;"&gt;C#&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;protected&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Button1_Click(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af;"&gt;EventArgs&lt;/span&gt; e)&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;Response.Redirect(&lt;span style="color: #a31515;"&gt;"Page2.aspx"&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt; line-height: 14px;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;u&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;"&gt;VB.NET&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;Protected&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt; Button1_Click(&lt;span style="color: blue;"&gt;ByVal&lt;/span&gt; sender &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;Object&lt;/span&gt;, &lt;span style="color: blue;"&gt;ByVal&lt;/span&gt; e &lt;span style="color: blue;"&gt;As&lt;/span&gt; System.EventArgs) &lt;span style="color: blue;"&gt;Handles&lt;/span&gt; Button1.Click&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;Response.Redirect(&lt;span style="color: #a31515;"&gt;"Page2.aspx"&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt; line-height: 14px;"&gt;End&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt; line-height: 14px;"&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify" style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;b&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;"&gt;Step 3:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;"&gt; On Page2.aspx, we will be dragging and dropping 3 buttons. Each button will represent a method to go back to the previous page. Let us explore them one at a time:&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;b&gt;&lt;i&gt;&lt;u&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;"&gt;Method 1&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;u&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;"&gt; – Using a static variable and UrlReferrer&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;&lt;u&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;"&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;&lt;div align="justify" style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;"&gt;URLReferrer gets the URL of the previous page that linked to the current URL. To use this property, declare a static variable called ‘prevPage’ in Page2.aspx. Drag and drop a button, button1 on Page2.aspx. On the Page_Load, use the Request.UrlReferrer to populate the prevPage variable with its value. Then on the button1 click event, use this variable to go back to the previous page as demonstrated below :&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;u&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;"&gt;C#&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: #00b050; font-family: 'Courier New'; font-size: 10pt;"&gt;// static variable&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;static&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; prevPage = &lt;span style="color: #2b91af;"&gt;String&lt;/span&gt;.Empty;&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;protected&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Page_Load(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af;"&gt;EventArgs&lt;/span&gt; e)&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;     &lt;span style="color: blue;"&gt;if&lt;/span&gt;( !IsPostBack )&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;     {&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;         prevPage = Request.UrlReferrer.ToString();&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;     }&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; }&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt; protected&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Button1_Click(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af;"&gt;EventArgs&lt;/span&gt; e)&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;      Response.Redirect(prevPage);&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt; line-height: 14px;"&gt; }&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;u&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;"&gt;VB.NET&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: #00b050; font-family: 'Courier New'; font-size: 10pt;"&gt;'static variable&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;Private&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;Shared&lt;/span&gt; prevPage &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;String&lt;/span&gt; = &lt;span style="color: blue;"&gt;String&lt;/span&gt;.Empty&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;Protected&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt; Page_Load(&lt;span style="color: blue;"&gt;ByVal&lt;/span&gt; sender &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;Object&lt;/span&gt;, &lt;span style="color: blue;"&gt;ByVal&lt;/span&gt; e &lt;span style="color: blue;"&gt;As&lt;/span&gt; EventArgs) &lt;span style="color: blue;"&gt;Handles&lt;/span&gt; &lt;span style="color: blue;"&gt;Me&lt;/span&gt;.Load&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;        &lt;span style="color: blue;"&gt;If&lt;/span&gt; (&lt;span style="color: blue;"&gt;Not&lt;/span&gt; IsPostBack) &lt;span style="color: blue;"&gt;Then&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;            prevPage = Request.UrlReferrer.ToString()&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;        &lt;span style="color: blue;"&gt;End&lt;/span&gt; &lt;span style="color: blue;"&gt;If&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;End&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;Protected&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt; Button1_Click(&lt;span style="color: blue;"&gt;ByVal&lt;/span&gt; sender &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;Object&lt;/span&gt;, &lt;span style="color: blue;"&gt;ByVal&lt;/span&gt; e &lt;span style="color: blue;"&gt;As&lt;/span&gt; System.EventArgs) &lt;span style="color: blue;"&gt;Handles&lt;/span&gt; Button1.Click&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;        Response.Redirect(prevPage)&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt; line-height: 14px;"&gt;End&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt; line-height: 14px;"&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;/div&gt;&lt;div style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;b&gt;&lt;i&gt;&lt;u&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;"&gt;Method 2 – &lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;u&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;"&gt;Using Javascript&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;&lt;div align="justify" style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;"&gt;Drag and drop another button called button2 on the Page2.aspx. In the Page_Load event, add the following lines of code :&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;"&gt;C#&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;protected&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Page_Load(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af;"&gt;EventArgs&lt;/span&gt; e)&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 29.25pt; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;Button2.Attributes.Add(&lt;span style="color: #a31515;"&gt;"onClick"&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;"javascript:history.back(); return false;"&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;protected&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Button2_Click(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af;"&gt;EventArgs&lt;/span&gt; e)&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;      &lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: 10pt;"&gt;VB.NET&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;Protected&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt; Page_Load(&lt;span style="color: blue;"&gt;ByVal&lt;/span&gt; sender &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;Object&lt;/span&gt;, &lt;span style="color: blue;"&gt;ByVal&lt;/span&gt; e &lt;span style="color: blue;"&gt;As&lt;/span&gt; EventArgs) &lt;span style="color: blue;"&gt;Handles&lt;/span&gt; &lt;span style="color: blue;"&gt;Me&lt;/span&gt;.Load&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in; text-indent: 11.25pt;"&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;Button2.Attributes.Add(&lt;span style="color: #a31515;"&gt;"onClick"&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;"javascript:history.back(); return false;"&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;End&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;Protected&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt; Button2_Click(&lt;span style="color: blue;"&gt;ByVal&lt;/span&gt; sender &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;Object&lt;/span&gt;, &lt;span style="color: blue;"&gt;ByVal&lt;/span&gt; e &lt;span style="color: blue;"&gt;As&lt;/span&gt; System.EventArgs) &lt;span style="color: blue;"&gt;Handles&lt;/span&gt; Button2.Click&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;End&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="line-height: normal; margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; marg
