<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/" version="2.0">
    <channel>
        <title>Vinz'  Blog (ProudMonkey)</title>
        <link>http://geekswithblogs.net/dotNETvinz/Default.aspx</link>
        <description>"Code, Beer and Music ~ my way of being a programmer"</description>
        <language>en-US</language>
        <copyright>Vincent Maverick Durano</copyright>
        <managingEditor>vmsdurano@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Vinz'  Blog (ProudMonkey)</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/dotNETvinz/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/VinzProudMonkey" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="vinzproudmonkey" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">VinzProudMonkey</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
            <title>What will you be if computers weren't in existence?</title>
            <link>http://geekswithblogs.net/dotNETvinz/archive/2012/02/03/what-will-you-be-if-computers-werent-in-existence.aspx</link>
            <description>&lt;p&gt;Yeah it's a tough question especially since most of us across the globe, both young and old heavily rely on computers and the internet . Today, life would be virtually impossible without it. When I was in elementary school I always dreamed of becoming an artist. I loved to paint and draw because I can express my thoughts and emotions through art. But things changed after I graduated  in high school because my family couldn't afford to send me to university. I earned my BS degree because I got a scholarship from STI to study computer science. So now I work as a web developer. But to answer the question, if computers didn't exist then I would be a carpenter and a farmer then I would create a machine from wood that will compile codes made out of paper that will produce kernels of corn ~ just kidding on that part =D. Seriously I would definitely be an architect or an artist because being an artist is having the freedom to express your personality through art. The picture below is one of my drawings which I’ve drawn a long long time ago. Not pretty cool but it rocks! :D&lt;/p&gt; &lt;center&gt;   &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/Whatwillyoubeifcomputerswerentinexistenc_14640/mydrawing_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="mydrawing" alt="mydrawing" src="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/Whatwillyoubeifcomputerswerentinexistenc_14640/mydrawing_thumb.jpg" border="0" height="432" width="562" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;/center&gt;  &lt;p&gt;How about you? What do you think will you be doing now if computers weren't in existence?&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:81b6a56d-1bfa-4a40-a59a-9d36b6e9fe91" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Computers" rel="tag"&gt;Computers&lt;/a&gt;,&lt;a href="http://technorati.com/tags/General" rel="tag"&gt;General&lt;/a&gt;&lt;/div&gt; &lt;img src="http://geekswithblogs.net/dotNETvinz/aggbug/148578.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Vincent Maverick Durano</dc:creator>
            <guid>http://geekswithblogs.net/dotNETvinz/archive/2012/02/03/what-will-you-be-if-computers-werent-in-existence.aspx</guid>
            <pubDate>Fri, 03 Feb 2012 15:11:59 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/dotNETvinz/comments/148578.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/dotNETvinz/archive/2012/02/03/what-will-you-be-if-computers-werent-in-existence.aspx#feedback</comments>
            <slash:comments>7</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/dotNETvinz/comments/commentRss/148578.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/dotNETvinz/services/trackbacks/148578.aspx</trackback:ping>
        </item>
        <item>
            <title>Finally! ProudMonkey Controls is out on CodePlex!</title>
            <link>http://geekswithblogs.net/dotNETvinz/archive/2012/02/01/finally-proudmonkey-controls-is-out-on-codeplex.aspx</link>
            <description>&lt;p&gt;I've been receiving requests for the source code of my &lt;a href="http://geekswithblogs.net/dotNETvinz/archive/2011/12/28/proudmonkey-controls-for-asp.net-4.0---version-3.aspx" target="_blank"&gt;MessageBox controls&lt;/a&gt; for ASP.NET and so I've decided to upload my project in CodePlex so everyone can use it. You can check and download the controls here: &lt;a title="http://proudmonkeycontrols.codeplex.com/" href="http://proudmonkeycontrols.codeplex.com/"&gt;http://proudmonkeycontrols.codeplex.com/&lt;/a&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://proudmonkeycontrols.codeplex.com/releases/view/81058" target="_blank"&gt;Download&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://proudmonkeycontrols.codeplex.com/documentation" target="_blank"&gt;Documentation&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Feel free to visit my project &lt;a href="http://proudmonkeycontrols.codeplex.com/" target="_blank"&gt;page&lt;/a&gt; and provide your valuable feedback! &lt;/p&gt;  &lt;p&gt;Thanks!&lt;/p&gt; &lt;img src="http://geekswithblogs.net/dotNETvinz/aggbug/148551.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Vincent Maverick Durano</dc:creator>
            <guid>http://geekswithblogs.net/dotNETvinz/archive/2012/02/01/finally-proudmonkey-controls-is-out-on-codeplex.aspx</guid>
            <pubDate>Wed, 01 Feb 2012 14:08:26 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/dotNETvinz/comments/148551.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/dotNETvinz/archive/2012/02/01/finally-proudmonkey-controls-is-out-on-codeplex.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/dotNETvinz/comments/commentRss/148551.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/dotNETvinz/services/trackbacks/148551.aspx</trackback:ping>
        </item>
        <item>
            <title>Using ProudMonkey ConfirmBox Control in GridView</title>
            <link>http://geekswithblogs.net/dotNETvinz/archive/2012/02/01/using-proudmonkey-confirmbox-control-in-gridview.aspx</link>
            <description>&lt;p&gt;There are times that we need to prompt the users when doing certain actions on the page. One practical example is to confirm the user when deleting a certain record just like what I have demonstrated awhile back about &lt;a href="http://geekswithblogs.net/dotNETvinz/archive/2009/02/22/display-confirmation-message-on-gridview-deleting.aspx" target="_blank"&gt;Displaying a Confirmation Message on GridView Deleting&lt;/a&gt;. If you noticed on that demo I simply use plain JavaScript to display the confirmation message. In this post I’m going to demonstrate how to use the ConfirmBox control in delete scenario.&lt;/p&gt;  &lt;p&gt;Note that just for the simplicity of this demo I’m just going to create a dummy data as the DataSource for the GridView. If you are working with live data from database then you may want to check these previous articles about:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://geekswithblogs.net/dotNETvinz/archive/2009/02/22/gridview-insert-edit-update-and-delete--the-ado.net-way.aspx"&gt;GridView Insert, Edit, Update and Delete – The Ado.Net way&lt;/a&gt; - If using BoundField Columns &lt;/li&gt;    &lt;li&gt;&lt;a href="http://geekswithblogs.net/dotNETvinz/archive/2009/06/10/adding-rows-in-gridview-with-edit-update-and-delete-functionality.aspx"&gt;Adding Rows in GridView with Edit, Update and Delete Functionality&lt;/a&gt; - If using TemplateField Columns &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;To get started let’s go ahead and set up the UI (HTML mark-up). For simplicity I set up the mark-up like this:&lt;/p&gt; &lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="asp"&gt;&amp;lt;%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master"
                  AutoEventWireup="true" 
                  CodeBehind="GridView.aspx.cs"
                  Inherits="WebAppDemo.GridView" %&amp;gt;&lt;/span&gt;
&lt;span class="asp"&gt;&amp;lt;%@ Register Assembly="AjaxControlToolkit" 
             Namespace="AjaxControlToolkit" 
             TagPrefix="asp" %&amp;gt;&lt;/span&gt;
&lt;span class="asp"&gt;&amp;lt;%@ Register assembly="ProudMonkey.Common.Controls"
             namespace="ProudMonkey.Common.Controls" 
             tagprefix="cc1" %&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Content&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="Content1"&lt;/span&gt; &lt;span class="attr"&gt;ContentPlaceHolderID&lt;/span&gt;&lt;span class="kwrd"&gt;="HeadContent"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:Content&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Content&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="Content2"&lt;/span&gt; &lt;span class="attr"&gt;ContentPlaceHolderID&lt;/span&gt;&lt;span class="kwrd"&gt;="MainContent"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:ToolkitScriptManager&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="ToolkitScriptManager1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:ToolkitScriptManager&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;cc1:ConfirmBox&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="ConfirmBox1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Label&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="lblMessageDisplay"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;ForeColor&lt;/span&gt;&lt;span class="kwrd"&gt;="Green"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:GridView&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="GridView1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;AutoGenerateColumns&lt;/span&gt;&lt;span class="kwrd"&gt;="False"&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Columns&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:BoundField&lt;/span&gt; &lt;span class="attr"&gt;DataField&lt;/span&gt;&lt;span class="kwrd"&gt;="ID"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:BoundField&lt;/span&gt; &lt;span class="attr"&gt;DataField&lt;/span&gt;&lt;span class="kwrd"&gt;="ProductName"&lt;/span&gt; &lt;span class="attr"&gt;HeaderText&lt;/span&gt;&lt;span class="kwrd"&gt;="Product Name"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:TemplateField&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ItemTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:TextBox&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="txtPrice"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;='&amp;lt;%# Eval("Price") %&amp;gt;'&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ItemTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:TemplateField&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:TemplateField&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ItemTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:TextBox&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="txtAmount"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;='&amp;lt;%# Eval("Amount") %&amp;gt;'&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ItemTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:TemplateField&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:TemplateField&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ItemTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Button&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="btnDelete"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; 
                                &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;="Delete"&lt;/span&gt; 
                                &lt;span class="attr"&gt;OnClientClick&lt;/span&gt;&lt;span class="kwrd"&gt;="ShowConfirmBox(this,'Are you sure?');return false;"&lt;/span&gt; 
                                &lt;span class="attr"&gt;onclick&lt;/span&gt;&lt;span class="kwrd"&gt;="BtnDelete_Click"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt; 
                &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ItemTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:TemplateField&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Columns&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:GridView&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:Content&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Obviously the page above make use of &lt;a href="http://msdn.microsoft.com/en-us/library/ie/wtxbf3hh.aspx" target="_blank"&gt;MasterPage&lt;/a&gt; and basically contains the ToolScriptManager, ConfirmBox, Label and GridView. The ToolScriptManager is necessary since the ConfirmBox control uses the ASP.NET Ajax Modal popup control. The Label is just for displaying the message and the GridView is for displaying the data.&lt;/p&gt;

&lt;p&gt;Here’s the whole code behind part of the demo:&lt;/p&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Web.UI.WebControls;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Data;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; WebAppDemo {
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; GridView : System.Web.UI.Page {

        &lt;span class="kwrd"&gt;private&lt;/span&gt; DataTable GetSampleData() {

            &lt;span class="rem"&gt;//NOTE: THIS IS JUST FOR DEMO&lt;/span&gt;
            &lt;span class="rem"&gt;//If you are working with database&lt;/span&gt;
            &lt;span class="rem"&gt;//You can query your actual data and fill it to the DataTable&lt;/span&gt;
            DataTable dt = &lt;span class="kwrd"&gt;new&lt;/span&gt; DataTable();
            DataRow dr = &lt;span class="kwrd"&gt;null&lt;/span&gt;;

            &lt;span class="rem"&gt;//Create DataTable columns&lt;/span&gt;
            dt.Columns.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; DataColumn(&lt;span class="str"&gt;"ID"&lt;/span&gt;, &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(&lt;span class="kwrd"&gt;string&lt;/span&gt;)));
            dt.Columns.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; DataColumn(&lt;span class="str"&gt;"ProductName"&lt;/span&gt;, &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(&lt;span class="kwrd"&gt;string&lt;/span&gt;)));
            dt.Columns.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; DataColumn(&lt;span class="str"&gt;"Price"&lt;/span&gt;, &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(&lt;span class="kwrd"&gt;string&lt;/span&gt;)));
            dt.Columns.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; DataColumn(&lt;span class="str"&gt;"Amount"&lt;/span&gt;, &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(&lt;span class="kwrd"&gt;string&lt;/span&gt;)));

            &lt;span class="rem"&gt;//Create Row for each columns&lt;/span&gt;
            dr = dt.NewRow();
            dr[&lt;span class="str"&gt;"ID"&lt;/span&gt;] = 1;
            dr[&lt;span class="str"&gt;"ProductName"&lt;/span&gt;] = &lt;span class="str"&gt;"Proudct 1"&lt;/span&gt;;
            dr[&lt;span class="str"&gt;"Price"&lt;/span&gt;] = &lt;span class="str"&gt;"100"&lt;/span&gt;;
            dr[&lt;span class="str"&gt;"Amount"&lt;/span&gt;] = &lt;span class="str"&gt;"10"&lt;/span&gt;;

            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[&lt;span class="str"&gt;"ID"&lt;/span&gt;] = 2;
            dr[&lt;span class="str"&gt;"ProductName"&lt;/span&gt;] = &lt;span class="str"&gt;"Product 2"&lt;/span&gt;;
            dr[&lt;span class="str"&gt;"Price"&lt;/span&gt;] = &lt;span class="str"&gt;"200"&lt;/span&gt;;
            dr[&lt;span class="str"&gt;"Amount"&lt;/span&gt;] = &lt;span class="str"&gt;"2"&lt;/span&gt;;

            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[&lt;span class="str"&gt;"ID"&lt;/span&gt;] = 3;
            dr[&lt;span class="str"&gt;"ProductName"&lt;/span&gt;] = &lt;span class="str"&gt;"Product 3"&lt;/span&gt;;
            dr[&lt;span class="str"&gt;"Price"&lt;/span&gt;] = &lt;span class="str"&gt;"50"&lt;/span&gt;;
            dr[&lt;span class="str"&gt;"Amount"&lt;/span&gt;] = &lt;span class="str"&gt;"10"&lt;/span&gt;;

            dt.Rows.Add(dr);
            &lt;span class="kwrd"&gt;return&lt;/span&gt; dt;
        }
        

        &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; BindGrid(DataTable source) {
            GridView1.DataSource = source;
            GridView1.DataBind();
        }

        &lt;span class="kwrd"&gt;private&lt;/span&gt; DataTable UpdateTable(DataTable source, &lt;span class="kwrd"&gt;int&lt;/span&gt; rowIndex) {
            &lt;span class="kwrd"&gt;for&lt;/span&gt; (&lt;span class="kwrd"&gt;int&lt;/span&gt; i = 0; i &amp;lt; GridView1.Rows.Count; i++) {
                TextBox tb1 = (TextBox)GridView1.Rows[i].Cells[2].FindControl(&lt;span class="str"&gt;"txtPrice"&lt;/span&gt;);
                TextBox tb2 = (TextBox)GridView1.Rows[i].Cells[3].FindControl(&lt;span class="str"&gt;"txtAmount"&lt;/span&gt;);
                source.Rows[i][&lt;span class="str"&gt;"Price"&lt;/span&gt;] = tb1.Text;
                source.Rows[i][&lt;span class="str"&gt;"Amount"&lt;/span&gt;] = tb2.Text;
            }
            source.Rows.RemoveAt(rowIndex);
            &lt;span class="kwrd"&gt;return&lt;/span&gt; source;
        }

        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Page_Load(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e) {
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (!IsPostBack) {
                ViewState[&lt;span class="str"&gt;"COPY"&lt;/span&gt;] = GetSampleData();
                BindGrid(GetSampleData());
            }
        }

        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; BtnDelete_Click(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e) {
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (ViewState[&lt;span class="str"&gt;"COPY"&lt;/span&gt;] != &lt;span class="kwrd"&gt;null&lt;/span&gt;) {
                DataTable dt = (DataTable)ViewState[&lt;span class="str"&gt;"COPY"&lt;/span&gt;];
                Button btnDelete = (Button)sender;
                GridViewRow gvRow = (GridViewRow)btnDelete.NamingContainer;
                BindGrid(UpdateTable(dt, gvRow.RowIndex));

                lblMessageDisplay.Text = &lt;span class="str"&gt;"Record deleted!"&lt;/span&gt;;
            }
        }
    }
}&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Since I didn’t use database for storing the data you may notice that I use &lt;a href="http://msdn.microsoft.com/en-us/library/ms972976.aspx" target="_blank"&gt;ViewState&lt;/a&gt; to store the data across postbacks as you see in Page_Load event. The UpdateTable() method is responsible for handling the deletion. You may also notice that before the row is being removed it updates first the data, this is to ensure that the data on the TextBox are retained on postbacks.&lt;/p&gt;

&lt;p&gt;Here’s the page output when you run the code.&lt;/p&gt;

&lt;p&gt;Initial load&lt;/p&gt;

&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/631faf37be76_1092C/pm1_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="pm1" border="0" alt="pm1" src="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/631faf37be76_1092C/pm1_thumb.jpg" width="244" height="149" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;After clicking the Delete button&lt;/p&gt;

&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/631faf37be76_1092C/pm2_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="pm2" border="0" alt="pm2" src="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/631faf37be76_1092C/pm2_thumb.jpg" width="244" height="194" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;After clicking the YES button&lt;/p&gt;

&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/631faf37be76_1092C/pm3_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="pm3" border="0" alt="pm3" src="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/631faf37be76_1092C/pm3_thumb.jpg" width="244" height="179" /&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Enjoy!!!&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:05236a4c-d8b0-4160-b541-dc33b8fa01fa" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/ASP.NET" rel="tag"&gt;ASP.NET&lt;/a&gt;,&lt;a href="http://technorati.com/tags/ProudMonkey+Controls" rel="tag"&gt;ProudMonkey Controls&lt;/a&gt;&lt;/div&gt; &lt;img src="http://geekswithblogs.net/dotNETvinz/aggbug/148537.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Vincent Maverick Durano</dc:creator>
            <guid>http://geekswithblogs.net/dotNETvinz/archive/2012/02/01/using-proudmonkey-confirmbox-control-in-gridview.aspx</guid>
            <pubDate>Tue, 31 Jan 2012 16:42:33 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/dotNETvinz/comments/148537.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/dotNETvinz/archive/2012/02/01/using-proudmonkey-confirmbox-control-in-gridview.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/dotNETvinz/comments/commentRss/148537.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/dotNETvinz/services/trackbacks/148537.aspx</trackback:ping>
        </item>
        <item>
            <title>Closing my Blog at CodeASP.Net</title>
            <link>http://geekswithblogs.net/dotNETvinz/archive/2012/01/25/closing-my-blog-at-codeasp.net.aspx</link>
            <description>&lt;p&gt;I will be closing my blog (&lt;a title="http://codeasp.net/blogs/Vinz" href="http://codeasp.net/blogs/Vinz"&gt;http://codeasp.net/blogs/Vinz&lt;/a&gt;) to avoid cross posting of contents and traffic. This means that I will not be posting there anymore. But please note that by stop blogging there doesn't mean I will stop contributing to the codeasp.net community, of course I will still be moderating posts and participating in the forums and try my best to answer to questions to the best that I can and whenever time permits. See you guys there!!! =}&lt;/p&gt;  &lt;p&gt;I've recently updated the look and feel of this blog and updated each content to make it more readable and clean. I hope you like it. &lt;/p&gt; &lt;img src="http://geekswithblogs.net/dotNETvinz/aggbug/148481.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Vincent Maverick Durano</dc:creator>
            <guid>http://geekswithblogs.net/dotNETvinz/archive/2012/01/25/closing-my-blog-at-codeasp.net.aspx</guid>
            <pubDate>Wed, 25 Jan 2012 13:44:39 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/dotNETvinz/comments/148481.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/dotNETvinz/archive/2012/01/25/closing-my-blog-at-codeasp.net.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/dotNETvinz/comments/commentRss/148481.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/dotNETvinz/services/trackbacks/148481.aspx</trackback:ping>
        </item>
        <item>
            <title>ProudMonkey Controls will be in CodePlex soon</title>
            <link>http://geekswithblogs.net/dotNETvinz/archive/2012/01/24/proudmonkey-controls-will-be-in-codeplex-soon.aspx</link>
            <description>&lt;p&gt;I will be hosting &lt;a href="http://geekswithblogs.net/dotNETvinz/archive/2011/12/28/proudmonkey-controls-for-asp.net-4.0---version-3.aspx" target="_blank"&gt;this project&lt;/a&gt; in &lt;a title="http://www.codeplex.com/" href="http://www.codeplex.com/"&gt;http://www.codeplex.com/&lt;/a&gt; as open source project. I’m working on it so stay tuned! =}&lt;/p&gt; &lt;img src="http://geekswithblogs.net/dotNETvinz/aggbug/148459.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Vincent Maverick Durano</dc:creator>
            <guid>http://geekswithblogs.net/dotNETvinz/archive/2012/01/24/proudmonkey-controls-will-be-in-codeplex-soon.aspx</guid>
            <pubDate>Tue, 24 Jan 2012 14:29:53 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/dotNETvinz/comments/148459.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/dotNETvinz/archive/2012/01/24/proudmonkey-controls-will-be-in-codeplex-soon.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/dotNETvinz/comments/commentRss/148459.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/dotNETvinz/services/trackbacks/148459.aspx</trackback:ping>
        </item>
        <item>
            <title>Using MessageBox Control Outside UpdatePanel Control</title>
            <link>http://geekswithblogs.net/dotNETvinz/archive/2012/01/12/using-messagebox-control-outside-updatepanel-control.aspx</link>
            <description>&lt;p&gt;Few days ago I wrote a simple demo about “&lt;a href="http://geekswithblogs.net/dotNETvinz/archive/2012/01/05/using-proudmonkey-controls-with-asp.net-ajax-update-panel.aspx" target="_blank"&gt;Using ProudMonkey Controls with ASP.NET AJAX Update Panel&lt;/a&gt;”. One small problem is that if for some reasons you will place the MessageBox control outside UpdatePanel then you’ll notice that the MessageBox will not display properly in the page. &lt;/p&gt;  &lt;p&gt;So if you were setting your html mark-up like this:&lt;/p&gt; &lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="asp"&gt;&amp;lt;%@ Register Assembly="AjaxControlToolkit" 
             Namespace="AjaxControlToolkit" 
             TagPrefix="asp" %&amp;gt;&lt;/span&gt;
&lt;span class="asp"&gt;&amp;lt;%@ Register Assembly="ProudMonkey.Common.Controls"
             Namespace="ProudMonkey.Common.Controls"
             Tagprefix="cc1" %&amp;gt;&lt;/span&gt;

&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;html&lt;/span&gt; &lt;span class="attr"&gt;xmlns&lt;/span&gt;&lt;span class="kwrd"&gt;="http://www.w3.org/1999/xhtml"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;head&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;head&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;form&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="form1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:ToolkitScriptManager&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="ToolkitScriptManager1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:ToolkitScriptManager&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;cc1:MessageBox&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="MessageBox1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;  &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:UpdatePanel&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="UpdatePanel1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ContentTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Button&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="Button1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;
                            &lt;span class="attr"&gt;onclick&lt;/span&gt;&lt;span class="kwrd"&gt;="Button1_Click"&lt;/span&gt;
                             &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;="Show Message"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ContentTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:UpdatePanel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;form&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;html&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;And calling the MessageBox at Button click event:&lt;/p&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Button1_Click(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e){
      MessageBox1.ShowError(&lt;span class="str"&gt;"Test ERROR Message!"&lt;/span&gt;);
} &lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;You will end up getting something like this in the page:&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/UsingMessageBoxControlOutsideUpdatePanel_11EE3/m1_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="m1" border="0" alt="m1" src="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/UsingMessageBoxControlOutsideUpdatePanel_11EE3/m1_thumb.jpg" width="402" height="270" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;The reason why it happened because when you do a PostBack some of the attributes defined within MessageBox will not be loaded properly (e.g the src and style). To resolved the issue we can set up Triggers in the UpdatePanel to do postback. Here’s the sample demo below for your reference:&lt;/p&gt;

&lt;p&gt;ASPX:&lt;/p&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="asp"&gt;&amp;lt;%@ Register Assembly="AjaxControlToolkit"
             Namespace="AjaxControlToolkit" 
             TagPrefix="asp" %&amp;gt;&lt;/span&gt;
&lt;span class="asp"&gt;&amp;lt;%@ Register Assembly="ProudMonkey.Common.Controls"
             Namespace="ProudMonkey.Common.Controls"
             Tagprefix="cc1" %&amp;gt;&lt;/span&gt;

&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;html&lt;/span&gt; &lt;span class="attr"&gt;xmlns&lt;/span&gt;&lt;span class="kwrd"&gt;="http://www.w3.org/1999/xhtml"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;head&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;head&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;form&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="form1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:ToolkitScriptManager&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="ToolkitScriptManager1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:ToolkitScriptManager&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;cc1:MessageBox&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="MessageBox1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;  &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:UpdatePanel&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="UpdatePanel1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ContentTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Button&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="Button1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;
                            &lt;span class="attr"&gt;onclick&lt;/span&gt;&lt;span class="kwrd"&gt;="Button1_Click"&lt;/span&gt;
                            &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;="Show Message"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ContentTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
           &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Triggers&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:PostBackTrigger&lt;/span&gt; &lt;span class="attr"&gt;ControlID&lt;/span&gt;&lt;span class="kwrd"&gt;="Button1"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Triggers&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:UpdatePanel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; 
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;form&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;html&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Code Behind:&lt;/p&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Button1_Click(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e){
     MessageBox1.ShowError(&lt;span class="str"&gt;"Test ERROR Message!"&lt;/span&gt;);
}  &lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Running the page will display the MessageBox properly. Here’s a sample screen shot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/UsingMessageBoxControlOutsideUpdatePanel_11EE3/m2_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="m2" border="0" alt="m2" src="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/UsingMessageBoxControlOutsideUpdatePanel_11EE3/m2_thumb.jpg" width="474" height="376" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;That’s it! I hope someone find this post useful.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/dotNETvinz/aggbug/148319.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Vincent Maverick Durano</dc:creator>
            <guid>http://geekswithblogs.net/dotNETvinz/archive/2012/01/12/using-messagebox-control-outside-updatepanel-control.aspx</guid>
            <pubDate>Thu, 12 Jan 2012 12:24:07 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/dotNETvinz/comments/148319.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/dotNETvinz/archive/2012/01/12/using-messagebox-control-outside-updatepanel-control.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/dotNETvinz/comments/commentRss/148319.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/dotNETvinz/services/trackbacks/148319.aspx</trackback:ping>
        </item>
        <item>
            <title>Show Large Image on Mouseover with jQuery</title>
            <link>http://geekswithblogs.net/dotNETvinz/archive/2012/01/11/show-large-image-on-mouseover-with-jquery.aspx</link>
            <description>&lt;p&gt;I’ve been seeing many members in the forums asking how to display a large copy of the image on mouseover. Some of them are displaying the image in a Repeater, GridView or DataList control. I didn’t find any direct solution that shows the scenario they wanted so I thought of writing this post to demonstrate how to go about it. I know there are lot of ways of doing/implementing a solution for this scenario and this is just one them. In this example I’m going to use the DataList control for displaying the data along with the images.&lt;/p&gt;  &lt;p&gt;To get started let’s go a head and set-up the HTML mark-up. Just for the simplicity of this demo, I’ve just set up the mark-up this way:&lt;/p&gt;  &lt;div style="width: 600px; overflow: auto"&gt;   &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Content&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="Content2"&lt;/span&gt; &lt;span class="attr"&gt;ContentPlaceHolderID&lt;/span&gt;&lt;span class="kwrd"&gt;="MainContent"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;

    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:DataList&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="DataList1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;RepeatColumns&lt;/span&gt;&lt;span class="kwrd"&gt;="2"&lt;/span&gt; &lt;span class="attr"&gt;RepeatDirection&lt;/span&gt;&lt;span class="kwrd"&gt;="Vertical"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ItemTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;table&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;tr&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Image&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="imgProduct"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;ImageUrl&lt;/span&gt;&lt;span class="kwrd"&gt;='&amp;lt;%# DataBinder.Eval(Container.DataItem, "ProductImage") %&amp;gt;'&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;="width:100px; height:100px;"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; 
                            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Label&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="lblProduct"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;='&amp;lt;%# DataBinder.Eval(Container.DataItem, "ProductName") %&amp;gt;'&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
                            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
                            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Label&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="lblPrice"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;='&amp;lt;%# DataBinder.Eval(Container.DataItem, "Price") %&amp;gt;'&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
                            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
                            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:TextBox&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="txtQty"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:TextBox&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;tr&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;table&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ItemTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:DataList&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:Content&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;As you can see there’s really no fancy about the mark-up above. It just contain a DataList control with Image, TextBox and Label controls defined within it. You also notice that each control are binded with the fields that we want to display. Now let’s go ahead and populate the DataList with a sample data. Here’s the code behind part below:&lt;/p&gt;

&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;

&lt;div style="width: 600px; overflow: auto"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Data;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; WebAppDemo {
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Repeater : System.Web.UI.Page {

        &lt;span class="kwrd"&gt;private&lt;/span&gt; DataTable GetSampleData() {

            &lt;span class="rem"&gt;//NOTE: THIS IS JUST FOR DEMO&lt;/span&gt;
            &lt;span class="rem"&gt;//If you are working with database&lt;/span&gt;
            &lt;span class="rem"&gt;//You can query your actual data and fill it to the DataTable&lt;/span&gt;

            DataTable dt = &lt;span class="kwrd"&gt;new&lt;/span&gt; DataTable();
            DataRow dr = &lt;span class="kwrd"&gt;null&lt;/span&gt;;

            &lt;span class="rem"&gt;//Create DataTable columns&lt;/span&gt;
            dt.Columns.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; DataColumn(&lt;span class="str"&gt;"ID"&lt;/span&gt;, &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(&lt;span class="kwrd"&gt;string&lt;/span&gt;)));
            dt.Columns.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; DataColumn(&lt;span class="str"&gt;"ProductImage"&lt;/span&gt;, &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(&lt;span class="kwrd"&gt;string&lt;/span&gt;)));
            dt.Columns.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; DataColumn(&lt;span class="str"&gt;"ProductName"&lt;/span&gt;, &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(&lt;span class="kwrd"&gt;string&lt;/span&gt;)));
            dt.Columns.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; DataColumn(&lt;span class="str"&gt;"Price"&lt;/span&gt;, &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(&lt;span class="kwrd"&gt;string&lt;/span&gt;)));

            &lt;span class="rem"&gt;//Create Row for each columns&lt;/span&gt;
            dr = dt.NewRow();
            dr[&lt;span class="str"&gt;"ID"&lt;/span&gt;] = 1;
            dr[&lt;span class="str"&gt;"ProductName"&lt;/span&gt;] = &lt;span class="str"&gt;"Product 1"&lt;/span&gt;;
            dr[&lt;span class="str"&gt;"ProductImage"&lt;/span&gt;] = &lt;span class="str"&gt;"~/Images/Image1.jpg"&lt;/span&gt;;
            dr[&lt;span class="str"&gt;"Price"&lt;/span&gt;] = &lt;span class="str"&gt;"100"&lt;/span&gt;;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[&lt;span class="str"&gt;"ID"&lt;/span&gt;] = 2;
            dr[&lt;span class="str"&gt;"ProductName"&lt;/span&gt;] = &lt;span class="str"&gt;"Product 2"&lt;/span&gt;;
            dr[&lt;span class="str"&gt;"ProductImage"&lt;/span&gt;] = &lt;span class="str"&gt;"~/Images/Image2.jpg"&lt;/span&gt;;
            dr[&lt;span class="str"&gt;"Price"&lt;/span&gt;] = &lt;span class="str"&gt;"200"&lt;/span&gt;;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[&lt;span class="str"&gt;"ID"&lt;/span&gt;] = 3;
            dr[&lt;span class="str"&gt;"ProductName"&lt;/span&gt;] = &lt;span class="str"&gt;"Product 3"&lt;/span&gt;;
            dr[&lt;span class="str"&gt;"ProductImage"&lt;/span&gt;] = &lt;span class="str"&gt;"~/Images/Image3.jpg"&lt;/span&gt;;
            dr[&lt;span class="str"&gt;"Price"&lt;/span&gt;] = &lt;span class="str"&gt;"50"&lt;/span&gt;;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[&lt;span class="str"&gt;"ID"&lt;/span&gt;] = 3;
            dr[&lt;span class="str"&gt;"ProductName"&lt;/span&gt;] = &lt;span class="str"&gt;"Product 4"&lt;/span&gt;;
            dr[&lt;span class="str"&gt;"ProductImage"&lt;/span&gt;] = &lt;span class="str"&gt;"~/Images/Image4.jpg"&lt;/span&gt;;
            dr[&lt;span class="str"&gt;"Price"&lt;/span&gt;] = &lt;span class="str"&gt;"500"&lt;/span&gt;;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[&lt;span class="str"&gt;"ID"&lt;/span&gt;] = 3;
            dr[&lt;span class="str"&gt;"ProductName"&lt;/span&gt;] = &lt;span class="str"&gt;"Product 5"&lt;/span&gt;;
            dr[&lt;span class="str"&gt;"ProductImage"&lt;/span&gt;] = &lt;span class="str"&gt;"~/Images/Image5.jpg"&lt;/span&gt;;
            dr[&lt;span class="str"&gt;"Price"&lt;/span&gt;] = &lt;span class="str"&gt;"70"&lt;/span&gt;;
            dt.Rows.Add(dr);

            &lt;span class="kwrd"&gt;return&lt;/span&gt; dt;
        }

        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Page_Load(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e) {
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (!IsPostBack) {
                DataList1.DataSource = GetSampleData();
                DataList1.DataBind();
            }
        }       
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Running the code will display something like this in the page:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ShowLargeImageonMouseoverwithjQuery_12210/datalist0_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="datalist0" border="0" alt="datalist0" src="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ShowLargeImageonMouseoverwithjQuery_12210/datalist0_thumb.jpg" width="483" height="384" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we already have our data in placed let’s proceed implementing the mouseover functionality with jQuery. To start using jQuery then register the following script at the very top of the &amp;lt;head&amp;gt; section of the page or if you are using master page then add it the very top of  the content head section.&lt;/p&gt;

&lt;p&gt;&amp;lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" &amp;gt;&amp;lt;/script&amp;gt;&lt;/p&gt;

&lt;p&gt;As you can see I'm using Google AJAX API CDN to host the jQuery file for some &lt;a href="http://encosia.com/3-reasons-why-you-should-let-google-host-jquery-for-you/" target="_blank"&gt;reasons&lt;/a&gt;. You can also download the jQuery &lt;a href="http://docs.jquery.com/Downloading_jQuery"&gt;here&lt;/a&gt; and host it in your server if you'd like. Now add the following mark-up at the top your DataList.&lt;/p&gt;

&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;

&lt;pre class="csharpcode"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="coord"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="divImageDisplay"&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;="position:absolute;"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;   
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The divImageDisplay is where we display the large copy of the Image when we hover on each image from the DataList. We will then display the coordinate values in the label to see the top and left value. Okay here's the full script below for the mouseover functionality:&lt;/p&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;div style="width: 600px; overflow: auto"&gt;
  &lt;pre class="csharpcode"&gt;&amp;lt;script type=&lt;span class="str"&gt;"text/javascript"&lt;/span&gt;&amp;gt;
        function getTop(e) {
            &lt;span class="kwrd"&gt;var&lt;/span&gt; offset = e.offsetTop;
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (e.offsetParent != &lt;span class="kwrd"&gt;null&lt;/span&gt;) offset += getTop(e.offsetParent);
            &lt;span class="kwrd"&gt;return&lt;/span&gt; offset;
        }
        function getLeft(e) {
            &lt;span class="kwrd"&gt;var&lt;/span&gt; offset = e.offsetLeft;
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (e.offsetParent != &lt;span class="kwrd"&gt;null&lt;/span&gt;) offset += getLeft(e.offsetParent);
            &lt;span class="kwrd"&gt;return&lt;/span&gt; offset;
        }
        function hideDivImageDisplay() {
            $(&lt;span class="str"&gt;'#divImageDisplay'&lt;/span&gt;).html();
        }

        function showDivImageDisplay(img) {
            &lt;span class="kwrd"&gt;var&lt;/span&gt; grid = $(&lt;span class="str"&gt;'#&amp;lt;%=DataList1.ClientID %&amp;gt;'&lt;/span&gt;);
            &lt;span class="kwrd"&gt;var&lt;/span&gt; leftPos = getLeft(img) + 80;
            &lt;span class="kwrd"&gt;var&lt;/span&gt; topPos = getTop(img) + 20;
            $(&lt;span class="str"&gt;'#divImageDisplay'&lt;/span&gt;).offset({ top: topPos, left: leftPos })
            $(&lt;span class="str"&gt;'#divImageDisplay'&lt;/span&gt;).html(&lt;span class="str"&gt;"&amp;lt;img src='"&lt;/span&gt; + img.src + &lt;span class="str"&gt;"' width='300px' height='300px'/&amp;gt;"&lt;/span&gt;);

            &lt;span class="rem"&gt;//print the coordinates&lt;/span&gt;
            $(&lt;span class="str"&gt;'#coord'&lt;/span&gt;).text(&lt;span class="str"&gt;'Image ID: '&lt;/span&gt; + img.id + &lt;span class="str"&gt;' left: '&lt;/span&gt; + leftPos + &lt;span class="str"&gt;' top: '&lt;/span&gt; + topPos);
        }
  
&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;The getTop() function gets the top position coordinate value of the hovered image. The  getLeft() function gets the left position coordinate value. The hideDivImageDisplay() function will hide the div by clearing out the elements within it using the .html() jQuery function. The showDivImageDisplay() function is where we set the position of the divImageDisplay to display below each image from the DataList.&lt;/p&gt;

&lt;p&gt;Now let’s put it all together. Here’s the full ASPX mark-up below:&lt;/p&gt;

&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;

&lt;div style="width: 600px; overflow: auto"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Content&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="Content1"&lt;/span&gt; &lt;span class="attr"&gt;ContentPlaceHolderID&lt;/span&gt;&lt;span class="kwrd"&gt;="HeadContent"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="text/javascript"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;function&lt;/span&gt; getTop(e) {
            &lt;span class="kwrd"&gt;var&lt;/span&gt; offset = e.offsetTop;
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (e.offsetParent != &lt;span class="kwrd"&gt;null&lt;/span&gt;) offset += getTop(e.offsetParent);
            &lt;span class="kwrd"&gt;return&lt;/span&gt; offset;
        }
        &lt;span class="kwrd"&gt;function&lt;/span&gt; getLeft(e) {
            &lt;span class="kwrd"&gt;var&lt;/span&gt; offset = e.offsetLeft;
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (e.offsetParent != &lt;span class="kwrd"&gt;null&lt;/span&gt;) offset += getLeft(e.offsetParent);
            &lt;span class="kwrd"&gt;return&lt;/span&gt; offset;
        }
        &lt;span class="kwrd"&gt;function&lt;/span&gt; hideDivImageDisplay() {
            $(&lt;span class="str"&gt;'#divImageDisplay'&lt;/span&gt;).html();
        }

        &lt;span class="kwrd"&gt;function&lt;/span&gt; showDivImageDisplay(img) {
            &lt;span class="kwrd"&gt;var&lt;/span&gt; grid = $(&lt;span class="str"&gt;'#&amp;lt;%=DataList1.ClientID %&amp;gt;'&lt;/span&gt;);
            &lt;span class="kwrd"&gt;var&lt;/span&gt; leftPos = getLeft(img) + 80;
            &lt;span class="kwrd"&gt;var&lt;/span&gt; topPos = getTop(img) + 20;
            $(&lt;span class="str"&gt;'#divImageDisplay'&lt;/span&gt;).offset({ top: topPos, left: leftPos })
            $(&lt;span class="str"&gt;'#divImageDisplay'&lt;/span&gt;).html(&lt;span class="str"&gt;"&amp;lt;img src='"&lt;/span&gt; + img.src + &lt;span class="str"&gt;"' width='300px' height='300px'/&amp;gt;"&lt;/span&gt;);

            &lt;span class="rem"&gt;//print the coordinates&lt;/span&gt;
            $(&lt;span class="str"&gt;'#coord'&lt;/span&gt;).text(&lt;span class="str"&gt;'Image ID: '&lt;/span&gt; + img.id + &lt;span class="str"&gt;' left: '&lt;/span&gt; + leftPos + &lt;span class="str"&gt;' top: '&lt;/span&gt; + topPos);
        }
  
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:Content&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Content&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="Content2"&lt;/span&gt; &lt;span class="attr"&gt;ContentPlaceHolderID&lt;/span&gt;&lt;span class="kwrd"&gt;="MainContent"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;

    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="coord"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="divImageDisplay"&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;="position:absolute;"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;   
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;

    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:DataList&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="DataList1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;RepeatColumns&lt;/span&gt;&lt;span class="kwrd"&gt;="2"&lt;/span&gt; &lt;span class="attr"&gt;RepeatDirection&lt;/span&gt;&lt;span class="kwrd"&gt;="Vertical"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ItemTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;table&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;tr&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Image&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="imgProduct"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;ImageUrl&lt;/span&gt;&lt;span class="kwrd"&gt;='&amp;lt;%# DataBinder.Eval(Container.DataItem, "ProductImage") %&amp;gt;'&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;="width:100px; height:100px;"&lt;/span&gt; &lt;span class="attr"&gt;onmouseover&lt;/span&gt;&lt;span class="kwrd"&gt;="showDivImageDisplay(this);"&lt;/span&gt; &lt;span class="attr"&gt;onmouseout&lt;/span&gt;&lt;span class="kwrd"&gt;="hideDivImageDisplay();"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; 
                            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Label&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="lblProduct"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;='&amp;lt;%# DataBinder.Eval(Container.DataItem, "ProductName") %&amp;gt;'&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
                            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
                            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Label&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="lblPrice"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;='&amp;lt;%# DataBinder.Eval(Container.DataItem, "Price") %&amp;gt;'&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
                            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
                            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:TextBox&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="txtQty"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:TextBox&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;tr&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;table&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ItemTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:DataList&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:Content&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Here’s the output below when running the page:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ShowLargeImageonMouseoverwithjQuery_12210/datalist_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="datalist" border="0" alt="datalist" src="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ShowLargeImageonMouseoverwithjQuery_12210/datalist_thumb.jpg" width="502" height="404" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;That’s it! I hope someone find this post useful!&lt;/p&gt; &lt;img src="http://geekswithblogs.net/dotNETvinz/aggbug/148310.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Vincent Maverick Durano</dc:creator>
            <guid>http://geekswithblogs.net/dotNETvinz/archive/2012/01/11/show-large-image-on-mouseover-with-jquery.aspx</guid>
            <pubDate>Wed, 11 Jan 2012 12:39:40 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/dotNETvinz/comments/148310.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/dotNETvinz/archive/2012/01/11/show-large-image-on-mouseover-with-jquery.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/dotNETvinz/comments/commentRss/148310.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/dotNETvinz/services/trackbacks/148310.aspx</trackback:ping>
        </item>
        <item>
            <title>ASP.NET MVC 3 - Editing and Updating the Form</title>
            <link>http://geekswithblogs.net/dotNETvinz/archive/2012/01/09/asp.net-mvc-3---editing-and-updating-the-form.aspx</link>
            <description>&lt;p&gt;This demo is a continuation of my previous article about "&lt;a href="http://geekswithblogs.net/dotNETvinz/archive/2011/12/30/asp.net-mvc-3---creating-a-simple-log-in-form.aspx" target="_blank"&gt;Creating a Simple Log-in Form&lt;/a&gt;". Basically in this post I'm going to demonstrate the basic on how to edit and update the form with ASP.NET MVC 3. &lt;/p&gt;  &lt;p&gt;Before you go any further, I'd suggest you to check out my previous article first about "&lt;a href="http://geekswithblogs.net/dotNETvinz/archive/2011/06/03/asp.net-mvc-3-creating-a-simple-sign-up-form.aspx"&gt;ASP.NET MVC 3: Creating a Simple Sign-Up Form&lt;/a&gt;" and "&lt;a href="http://geekswithblogs.net/dotNETvinz/archive/2011/12/30/asp.net-mvc-3---creating-a-simple-log-in-form.aspx" target="_blank"&gt;Creating a Simple Log-in Form&lt;/a&gt;". &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;STEP 1: Creating the Model class&lt;/strong&gt; &lt;/p&gt;  &lt;p&gt;Just for the simplicity of this demo, I'm just going to display the FirstName, LastName and ContactNumber in the form and have the user edit those information as they like. So first we'll add a new class under ViewModel's folder. To do this just right click on the "ViewModels" folder and then select Add -&amp;gt; then select class. In this example I'm going to name the class as "UserProfile" with the following properties below: &lt;/p&gt;  &lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.ComponentModel.DataAnnotations; 

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; MVCDemo.Models.ViewModels
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; UserProfile
    {
        [Display(Name = &lt;span class="str"&gt;"User Login ID"&lt;/span&gt;)]
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; UserLoginID { &lt;span class="kwrd"&gt;get&lt;/span&gt;; &lt;span class="kwrd"&gt;set&lt;/span&gt;; } 

        [Display(Name = &lt;span class="str"&gt;"First Name"&lt;/span&gt;)]
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; FirstName { &lt;span class="kwrd"&gt;get&lt;/span&gt;; &lt;span class="kwrd"&gt;set&lt;/span&gt;; } 

        [Display(Name = &lt;span class="str"&gt;"Last Name"&lt;/span&gt;)]
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; LastName { &lt;span class="kwrd"&gt;get&lt;/span&gt;; &lt;span class="kwrd"&gt;set&lt;/span&gt;; } 

        [Display(Name = &lt;span class="str"&gt;"Contact Number"&lt;/span&gt;)]
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; ContactNumber { &lt;span class="kwrd"&gt;get&lt;/span&gt;; &lt;span class="kwrd"&gt;set&lt;/span&gt;; }
    }
}&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;As you can see there's nothing really fancy in the code above. It just contains four properties with the Display attribute decorated on each property. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 2: Creating the View&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;The next step is to create a view under "Account" folder. To do this just right click on the folder -&amp;gt; select Add -&amp;gt; and then select View. A popup window should appear wherein you can type in the view name. &lt;/p&gt;

&lt;p&gt;In this demo I'm just going to name the view as "MyProfile". Now select Razor (CSHTML) as the View engine then check the Create a strongly-type view checkbox. Under the model class drop down, select UserProfile class. Then under scaffold template select Edit. Click Add to generate the view and the pre-defined codes for you. Here's the code below with few modifications: &lt;/p&gt;

&lt;div style="width: 600px; overflow: auto"&gt;
  &lt;p&gt;@model MVCDemo.Models.ViewModels.UserProfile &lt;/p&gt;

  &lt;p&gt;@{ 
    &lt;br /&gt;    ViewBag.Title = "My Profile"; 

    &lt;br /&gt;} &lt;/p&gt;

  &lt;p&gt;&amp;lt;h2&amp;gt;ViewPage1&amp;lt;/h2&amp;gt; &lt;/p&gt;

  &lt;p&gt;&amp;lt;script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt; 
    &lt;br /&gt;&amp;lt;script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt; &lt;/p&gt;

  &lt;p&gt;@using (Html.BeginForm()) { 
    &lt;br /&gt;    @Html.ValidationSummary(true) 

    &lt;br /&gt;    &amp;lt;fieldset&amp;gt; 

    &lt;br /&gt;        &amp;lt;legend&amp;gt;User Profile&amp;lt;/legend&amp;gt; 

    &lt;br /&gt;        &amp;lt;br /&amp;gt; 

    &lt;br /&gt;        &amp;lt;div style="color:Green"&amp;gt;@ViewData["Status"]&amp;lt;/div&amp;gt; 

    &lt;br /&gt;        &amp;lt;br /&amp;gt; 

    &lt;br /&gt;        &amp;lt;div class="editor-label"&amp;gt; 

    &lt;br /&gt;            @Html.LabelFor(model =&amp;gt; model.FirstName) 

    &lt;br /&gt;        &amp;lt;/div&amp;gt; 

    &lt;br /&gt;        &amp;lt;div class="editor-field"&amp;gt; 

    &lt;br /&gt;            @Html.EditorFor(model =&amp;gt; model.FirstName) 

    &lt;br /&gt;            @Html.ValidationMessageFor(model =&amp;gt; model.FirstName) 

    &lt;br /&gt;        &amp;lt;/div&amp;gt; &lt;/p&gt;

  &lt;p&gt;        &amp;lt;div class="editor-label"&amp;gt; 
    &lt;br /&gt;            @Html.LabelFor(model =&amp;gt; model.LastName) 

    &lt;br /&gt;        &amp;lt;/div&amp;gt; 

    &lt;br /&gt;        &amp;lt;div class="editor-field"&amp;gt; 

    &lt;br /&gt;            @Html.EditorFor(model =&amp;gt; model.LastName) 

    &lt;br /&gt;            @Html.ValidationMessageFor(model =&amp;gt; model.LastName) 

    &lt;br /&gt;        &amp;lt;/div&amp;gt; &lt;/p&gt;

  &lt;p&gt;        &amp;lt;div class="editor-label"&amp;gt; 
    &lt;br /&gt;            @Html.LabelFor(model =&amp;gt; model.ContactNumber) 

    &lt;br /&gt;        &amp;lt;/div&amp;gt; 

    &lt;br /&gt;        &amp;lt;div class="editor-field"&amp;gt; 

    &lt;br /&gt;            @Html.EditorFor(model =&amp;gt; model.ContactNumber) 

    &lt;br /&gt;            @Html.ValidationMessageFor(model =&amp;gt; model.ContactNumber) 

    &lt;br /&gt;        &amp;lt;/div&amp;gt; &lt;/p&gt;

  &lt;p&gt;        &amp;lt;p&amp;gt; 
    &lt;br /&gt;            &amp;lt;input type="submit" value="Save" /&amp;gt; 

    &lt;br /&gt;        &amp;lt;/p&amp;gt; 

    &lt;br /&gt;    &amp;lt;/fieldset&amp;gt; 

    &lt;br /&gt;} &lt;/p&gt;

  &lt;p&gt;&amp;lt;div&amp;gt; 
    &lt;br /&gt;@Html.ActionLink("Logout", "LogOff", "Account") 

    &lt;br /&gt;&amp;lt;/div&amp;gt; &lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;STEP 3: Adding the GetUserDetail() and the UpdateUserProfile() method in the UserManager class&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Here's the code below: &lt;/p&gt;

&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; SysUser GetUserDetail(&lt;span class="kwrd"&gt;string&lt;/span&gt; loginID) { 
    &lt;span class="kwrd"&gt;var&lt;/span&gt; userDetails = &lt;span class="kwrd"&gt;from&lt;/span&gt; p &lt;span class="kwrd"&gt;in&lt;/span&gt; dre.SysUsers 
                      where p.SysUserLoginID == loginID 
                      select p; 

    &lt;span class="kwrd"&gt;return&lt;/span&gt; userDetails.ToList().FirstOrDefault(); 
} &lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The code above gets the details of the user information from the database by passing in the loginID as the parameter to the query using LINQ syntax. &lt;/p&gt;

&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; UpdateUserProfile(UserProfile userProfile) { 
     &lt;span class="kwrd"&gt;var&lt;/span&gt; user = (&lt;span class="kwrd"&gt;from&lt;/span&gt; p &lt;span class="kwrd"&gt;in&lt;/span&gt; dre.SysUsers 
                 where p.SysUserLoginID == userProfile.UserLoginID 
                 select p).FirstOrDefault(); 

        user.FirstName = userProfile.FirstName; 
        user.LastName = userProfile.LastName; 
        user.ContactNumber = userProfile.ContactNumber; 

        dre.SaveChanges(); 
} &lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The method above takes UserProfile object as the parameter. It then query the database to get the specific user details based on the UserLoginID. It will then update the fields by assigning the new values from the UserProfile object and then save the changes. The UserProfile object is the object used in our strongly typed view "MyProfile". &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 4: Adding the MyProfile action methods in the AccountController()&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Here's the block of code below: &lt;/p&gt;

&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;

&lt;pre class="csharpcode"&gt;[Authorize] 
&lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult MyProfile(&lt;span class="kwrd"&gt;string&lt;/span&gt; userLoginID) { 
       UserManager um = &lt;span class="kwrd"&gt;new&lt;/span&gt; UserManager(); 
       &lt;span class="kwrd"&gt;var&lt;/span&gt; userDetail = um.GetUserDetail(userLoginID); 

       UserProfile user = &lt;span class="kwrd"&gt;new&lt;/span&gt; UserProfile(); 
       user.UserLoginID = userDetail.SysUserLoginID; 
       user.FirstName = userDetail.FirstName; 
       user.LastName = userDetail.LastName; 
       user.ContactNumber = userDetail.ContactNumber; 

       &lt;span class="kwrd"&gt;return&lt;/span&gt; View(user); 
} &lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;What it does is it creates an instance of the UserManager class and then get the user details data by calling the GetUserDetail() method with the parameter from the UserManager object. We then populate the properties we defined in the UserProfile class that we have created in STEP 1 so that the View that we have created in STEP 2 will be populated with the result. &lt;/p&gt;

&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;

&lt;pre class="csharpcode"&gt;[HttpPost] 
[Authorize] 
&lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult MyProfile(UserProfile userProfile) { 

       UserManager um = &lt;span class="kwrd"&gt;new&lt;/span&gt; UserManager();9:34 PM 1/9/2012 
       um.UpdateUserProfile(userProfile); 

       ViewData[&lt;span class="str"&gt;"Status"&lt;/span&gt;] = &lt;span class="str"&gt;"Update Sucessful!"&lt;/span&gt;; 

       &lt;span class="kwrd"&gt;return&lt;/span&gt; View(userProfile); 
} &lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The method above is reponsible for saving the information to the database. This method will be called upon clicking the "Save" button. As you can see the method is decorated with [HttpPost] which means that the method can only be invoked during post request. The first line creates an instance of the UserManager object and the call the UpdateUserProfile method by passing the UserProfile object to it. The UserProfile object contains the updated data from the view and ready to be used to perform the update. We then use ViewData to store some status message to let the user know that the record is updated successfully in the database. &lt;/p&gt;

&lt;p&gt;You also noticed that both methods are decorated with the [Authorize] attribute to essure that the method can only be invoked by authenticated users. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 5: Adding a link to Edit Profile&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;In the Welcome page add the following line below. &lt;/p&gt;

&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;

&lt;div style="width: 600px; overflow: auto"&gt;
  &lt;pre class="csharpcode"&gt;@Html.ActionLink("Edit Profile", "MyProfile", "Account", new { userLoginID = Context.User.Identity.Name }, null) &lt;/pre&gt;

  &lt;p&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;The first parameter sets the text of the link. The second parameter is the Action method (in this case we have the "MyProfile" action method). The third parameter is the controller name in which the action method belongs to (in this case we set the Account for AccountController. The fourth parameter is Route arguments, in this parameter we can pass values to our action method ( in this case we passed in the identity of the user who logged in). The last parameter is the html arguments. We set it to null/nothing so that the correct method will be called. &lt;/p&gt;

&lt;p&gt;Here are some screen shots of the output. &lt;/p&gt;

&lt;p&gt;After log-in&lt;/p&gt;

&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ASP.NETMVC3EditingandUpdatingtheForm_1389C/mvcpart3a_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="mvcpart3a" border="0" alt="mvcpart3a" src="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ASP.NETMVC3EditingandUpdatingtheForm_1389C/mvcpart3a_thumb.jpg" width="379" height="269" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;The MyProfile page&lt;/p&gt;

&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ASP.NETMVC3EditingandUpdatingtheForm_1389C/mvcpart3b_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="mvcpart3b" border="0" alt="mvcpart3b" src="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ASP.NETMVC3EditingandUpdatingtheForm_1389C/mvcpart3b_thumb.jpg" width="386" height="270" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Editing the form&lt;/p&gt;

&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ASP.NETMVC3EditingandUpdatingtheForm_1389C/mvcpart3c_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="mvcpart3c" border="0" alt="mvcpart3c" src="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ASP.NETMVC3EditingandUpdatingtheForm_1389C/mvcpart3c_thumb.jpg" width="386" height="320" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;After updating the form&lt;/p&gt;

&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ASP.NETMVC3EditingandUpdatingtheForm_1389C/mvcpart3d_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="mvcpart3d" border="0" alt="mvcpart3d" src="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ASP.NETMVC3EditingandUpdatingtheForm_1389C/mvcpart3d_thumb.jpg" width="388" height="306" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;That’s it! I hope someone find this post useful!&lt;/p&gt; &lt;img src="http://geekswithblogs.net/dotNETvinz/aggbug/148288.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Vincent Maverick Durano</dc:creator>
            <guid>http://geekswithblogs.net/dotNETvinz/archive/2012/01/09/asp.net-mvc-3---editing-and-updating-the-form.aspx</guid>
            <pubDate>Mon, 09 Jan 2012 14:13:58 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/dotNETvinz/comments/148288.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/dotNETvinz/archive/2012/01/09/asp.net-mvc-3---editing-and-updating-the-form.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/dotNETvinz/comments/commentRss/148288.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/dotNETvinz/services/trackbacks/148288.aspx</trackback:ping>
        </item>
        <item>
            <title>Using ProudMonkey Controls with ASP.NET AJAX Update Panel</title>
            <link>http://geekswithblogs.net/dotNETvinz/archive/2012/01/05/using-proudmonkey-controls-with-asp.net-ajax-update-panel.aspx</link>
            <description>&lt;p&gt;Using the &lt;a href="http://geekswithblogs.net/dotNETvinz/archive/2011/12/28/proudmonkey-controls-for-asp.net-4.0---version-3.aspx" target="_blank"&gt;MessageBox, ConfirmBox and FrameBox&lt;/a&gt; controls within Update Panel control is very easy. Just like other asp standard controls, you can just put the controls that you want to use within Update Panel and your good to go. Here's a simple demo I wrote just for your reference.     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;ASPX:&lt;/strong&gt;&lt;/p&gt;  &lt;div style="width: 600px; overflow: auto"&gt;   &lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;    &lt;pre class="csharpcode"&gt;&lt;span class="asp"&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProudMonkeyControlTEST.aspx.cs" Inherits="WebAppDemo.ProudMonkeyControlTEST" %&amp;gt;&lt;/span&gt;

&lt;span class="kwrd"&gt;&amp;lt;!&lt;/span&gt;&lt;span class="html"&gt;DOCTYPE&lt;/span&gt; &lt;span class="attr"&gt;html&lt;/span&gt; &lt;span class="attr"&gt;PUBLIC&lt;/span&gt; &lt;span class="kwrd"&gt;"-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;/span&gt; &lt;span class="kwrd"&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="asp"&gt;&amp;lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %&amp;gt;&lt;/span&gt;
&lt;span class="asp"&gt;&amp;lt;%@ Register assembly="ProudMonkey.Common.Controls" namespace="ProudMonkey.Common.Controls" tagprefix="cc1" %&amp;gt;&lt;/span&gt;

&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;html&lt;/span&gt; &lt;span class="attr"&gt;xmlns&lt;/span&gt;&lt;span class="kwrd"&gt;="http://www.w3.org/1999/xhtml"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;head&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;head&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;form&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="form1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:ToolkitScriptManager&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="ToolkitScriptManager1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:ToolkitScriptManager&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;

    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:UpdatePanel&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="UpdatePanel1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ContentTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;cc1:MessageBox&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="MessageBox1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;cc1:ConfirmBox&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="ConfirmBox1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;cc1:FrameBox&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="FrameBox1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;

            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Button&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="Button1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;="ConfirmBox"&lt;/span&gt; &lt;span class="attr"&gt;OnClientClick&lt;/span&gt;&lt;span class="kwrd"&gt;="ShowConfirmBox(this,'Are you sure?');return false;"&lt;/span&gt; &lt;span class="attr"&gt;onclick&lt;/span&gt;&lt;span class="kwrd"&gt;="Button1_Click"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt; 
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Button&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="Button2"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;onclick&lt;/span&gt;&lt;span class="kwrd"&gt;="Button2_Click"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;="Show Message"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Button&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="Button3"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;="Show my Blog"&lt;/span&gt; &lt;span class="attr"&gt;OnClientClick&lt;/span&gt;&lt;span class="kwrd"&gt;="ShowFrameBox('Vinz Blog','http://geekswithblogs.net/dotNETvinz/Default.aspx');return false;"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ContentTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:UpdatePanel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
       
        
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;form&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;html&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;p&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CODE BEHIND:&lt;/strong&gt;&lt;/p&gt;

&lt;div style="width: 600px; overflow: auto"&gt;
  &lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;

  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; WebAppDemo
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; ProudMonkeyControlTEST : System.Web.UI.Page
    {
        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Page_Load(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e){

        }

        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Button1_Click(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e) {
            MessageBox1.ShowInfo(&lt;span class="str"&gt;"You've just clicked Yes!"&lt;/span&gt;);
        }

        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Button2_Click(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e){
            MessageBox1.ShowError(&lt;span class="str"&gt;"ERROR"&lt;/span&gt;);
        }   
    }
}&lt;/pre&gt;

  &lt;p&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;
  &lt;br /&gt;That's it! I hope someone find this post useful!&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:bdeb0af6-90c9-4f2f-b3a8-6e30915ec6ac" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/ProudMonkey+Controls" rel="tag"&gt;ProudMonkey Controls&lt;/a&gt;,&lt;a href="http://technorati.com/tags/ASP.NET" rel="tag"&gt;ASP.NET&lt;/a&gt;&lt;/div&gt; &lt;img src="http://geekswithblogs.net/dotNETvinz/aggbug/148250.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Vincent Maverick Durano</dc:creator>
            <guid>http://geekswithblogs.net/dotNETvinz/archive/2012/01/05/using-proudmonkey-controls-with-asp.net-ajax-update-panel.aspx</guid>
            <pubDate>Thu, 05 Jan 2012 14:47:05 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/dotNETvinz/comments/148250.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/dotNETvinz/archive/2012/01/05/using-proudmonkey-controls-with-asp.net-ajax-update-panel.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/dotNETvinz/comments/commentRss/148250.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/dotNETvinz/services/trackbacks/148250.aspx</trackback:ping>
        </item>
        <item>
            <title>ASP.NET MVC 3 - Creating a Simple Log-In Form</title>
            <link>http://geekswithblogs.net/dotNETvinz/archive/2011/12/30/asp.net-mvc-3---creating-a-simple-log-in-form.aspx</link>
            <description>&lt;p&gt;This demo is a continuation of my previous article about "&lt;a href="http://geekswithblogs.net/dotNETvinz/archive/2011/06/03/asp.net-mvc-3-creating-a-simple-sign-up-form.aspx" target="_blank"&gt;ASP.NET MVC 3: Creating a Simple Sign-Up Form&lt;/a&gt;" which I wrote few months ago. Basically in this post I'm going to demonstrate how to create a simple LogOn form in which users can supply their username and password. And how to authenticate and validate users in ASP.NET MVC 3. &lt;/p&gt;  &lt;p&gt;I will not elaborate more in details about the model, view and controllers function so before you go any further, I'd suggest you to check my previous article first about "&lt;a href="http://geekswithblogs.net/dotNETvinz/archive/2011/06/03/asp.net-mvc-3-creating-a-simple-sign-up-form.aspx" target="_blank"&gt;ASP.NET MVC 3: Creating a Simple Sign-Up Form&lt;/a&gt;" especially if you are new to MVC web development approach. &lt;/p&gt;  &lt;p&gt;As a recap, here's the previous project structure below: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ASP.NETMVC3CreatingaSimpleLogInForm_10060/mvcpart2a_4.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="mvcpart2a" border="0" alt="mvcpart2a" src="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ASP.NETMVC3CreatingaSimpleLogInForm_10060/mvcpart2a_thumb_1.jpg" width="233" height="465" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;STEP 1: Creating a Model class&lt;/strong&gt; &lt;/p&gt;  &lt;p&gt;To get started let's go ahead and create a simple model class for our Log-in. To do this just right click on the "ViewModels" folder and then select Add -&amp;gt; then select class. In this example I'm going to name the class as "UserLogon" with the following properties below: &lt;/p&gt;  &lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.ComponentModel.DataAnnotations;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; MVCDemo.Models.ViewModels
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; UserLogon
    {
        [Required]
        [Display(Name = &lt;span class="str"&gt;"User Login"&lt;/span&gt;)]
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; UserName { &lt;span class="kwrd"&gt;get&lt;/span&gt;; &lt;span class="kwrd"&gt;set&lt;/span&gt;; }

        [Required]
        [DataType(DataType.Password)]
        [Display(Name = &lt;span class="str"&gt;"Password"&lt;/span&gt;)]
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Password { &lt;span class="kwrd"&gt;get&lt;/span&gt;; &lt;span class="kwrd"&gt;set&lt;/span&gt;; }
    }
} &lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The fields defined above will be used in our Login form. You may also noticed that the fields are decorated with Required, Display and DataType attributes. These attributes are called &lt;a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.aspx" target="_blank"&gt;Data Annotations&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 2: Creating the View&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Now right click on the "Account" folder and then select Add -&amp;gt; and then select View. A popup window should appear in which you can configure the view for the page. In this demo I'm going to name the view as "LogOn". Now select Razor (CSHTML) as the view engine then check the “Create a strongly-type view” checkbox. Under the model class drop down, select “UserLogOn” class. Then under scaffold template select Create. Take a look at screen shot below for a reference. &lt;/p&gt;

&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ASP.NETMVC3CreatingaSimpleLogInForm_10060/mvcpart2b_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="mvcpart2b" border="0" alt="mvcpart2b" src="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ASP.NETMVC3CreatingaSimpleLogInForm_10060/mvcpart2b_thumb.jpg" width="244" height="285" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Click Add to generate the view and the pre-defined codes for you. Here's the generated markup below with some text modifications: &lt;/p&gt;

&lt;div style="width: 600px; overflow: auto"&gt;
  &lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;

  &lt;pre class="csharpcode"&gt;@model MVCDemo.Models.ViewModels.UserLogon 

@{ 
    ViewBag.Title = &lt;span class="str"&gt;"Log On"&lt;/span&gt;; 
} 

&amp;lt;h2&amp;gt;LogOn&amp;lt;/h2&amp;gt; 

&amp;lt;script src=&lt;span class="str"&gt;"@Url.Content("&lt;/span&gt;~/Scripts/jquery.validate.min.js&lt;span class="str"&gt;")"&lt;/span&gt; type=&lt;span class="str"&gt;"text/javascript"&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt; 
&amp;lt;script src=&lt;span class="str"&gt;"@Url.Content("&lt;/span&gt;~/Scripts/jquery.validate.unobtrusive.min.js&lt;span class="str"&gt;")"&lt;/span&gt; type=&lt;span class="str"&gt;"text/javascript"&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt; 

@&lt;span class="kwrd"&gt;using&lt;/span&gt; (Html.BeginForm()) { 
    @Html.ValidationSummary(&lt;span class="kwrd"&gt;true&lt;/span&gt;) 
    &amp;lt;fieldset&amp;gt; 
        &amp;lt;legend&amp;gt;User Logon&amp;lt;/legend&amp;gt; 

        &amp;lt;div &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;"editor-label"&lt;/span&gt;&amp;gt; 
            @Html.LabelFor(model =&amp;gt; model.UserLogIn) 
        &amp;lt;/div&amp;gt; 
        &amp;lt;div &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;"editor-field"&lt;/span&gt;&amp;gt; 
            @Html.EditorFor(model =&amp;gt; model.UserLogIn) 
            @Html.ValidationMessageFor(model =&amp;gt; model.UserLogIn) 
        &amp;lt;/div&amp;gt; 

        &amp;lt;div &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;"editor-label"&lt;/span&gt;&amp;gt; 
            @Html.LabelFor(model =&amp;gt; model.Password) 
        &amp;lt;/div&amp;gt; 
        &amp;lt;div &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;"editor-field"&lt;/span&gt;&amp;gt; 
            @Html.EditorFor(model =&amp;gt; model.Password) 
            @Html.ValidationMessageFor(model =&amp;gt; model.Password) 
        &amp;lt;/div&amp;gt; 

        &amp;lt;p&amp;gt; 
            &amp;lt;input type=&lt;span class="str"&gt;"submit"&lt;/span&gt; value=&lt;span class="str"&gt;"Log On"&lt;/span&gt; /&amp;gt; 
        &amp;lt;/p&amp;gt; 
    &amp;lt;/fieldset&amp;gt; 
} 

&amp;lt;div&amp;gt; 
    @Html.ActionLink(&lt;span class="str"&gt;"Return to Home page"&lt;/span&gt;,&lt;span class="str"&gt;"Index"&lt;/span&gt;, &lt;span class="str"&gt;"Home"&lt;/span&gt;) 
&amp;lt;/div&amp;gt; &lt;/pre&gt;

  &lt;p&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Again as a recap, the mark-up above is a strongly-type view. This enables better compile-time checking of your code and richer IntelliSense in the Visual Studio editor. By including a @model statement at the top of the view template file, you can specify the type of object that the view expects. In this case it uses the MVCDemo.Models.ViewModels.UserLogon . &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 3: Adding the GetuserPassword() method&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Under ObjectManager folder, add this method in UserManager class. &lt;/p&gt;

&lt;div style="width: 600px; overflow: auto"&gt;
  &lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;

  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; GetUserPassword(&lt;span class="kwrd"&gt;string&lt;/span&gt; userLogIn) { 
            &lt;span class="kwrd"&gt;var&lt;/span&gt; user = &lt;span class="kwrd"&gt;from&lt;/span&gt; o &lt;span class="kwrd"&gt;in&lt;/span&gt; dre.SysUsers where o.SysUserLoginID == userLogIn select o; 
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (user.ToList().Count &amp;gt; 0) 
                &lt;span class="kwrd"&gt;return&lt;/span&gt; user.First().SysPassword; 
            &lt;span class="kwrd"&gt;else&lt;/span&gt; 
                &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;.Empty; 
} &lt;/pre&gt;

  &lt;p&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;The method above gets the user password from the database based on the user login provided by the user using LINQ query. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 4: Adding the LogOn ActionResults in the AccountController&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Add the following code below in the AccountController under "Controllers" folder. &lt;/p&gt;

&lt;div style="width: 600px; overflow: auto"&gt;
  &lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;

  &lt;pre class="csharpcode"&gt;        &lt;span class="rem"&gt;// GET: /Account/LogOn&lt;/span&gt;

        &lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult LogOn()
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; View();
        }

        &lt;span class="rem"&gt;//&lt;/span&gt;
        &lt;span class="rem"&gt;// POST: /Account/LogOn&lt;/span&gt;

        [HttpPost]
        &lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult LogOn(UserLogon model, &lt;span class="kwrd"&gt;string&lt;/span&gt; returnUrl)
        {
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (ModelState.IsValid)
            {
                UserManager userManager = &lt;span class="kwrd"&gt;new&lt;/span&gt; UserManager();
                &lt;span class="kwrd"&gt;string&lt;/span&gt; password = userManager.GetUserPassword(model.UserLogIn);

                &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;string&lt;/span&gt;.IsNullOrEmpty(password))
                {

                    ModelState.AddModelError(&lt;span class="str"&gt;""&lt;/span&gt;, &lt;span class="str"&gt;"The user login or password provided is incorrect."&lt;/span&gt;);
                }

                &lt;span class="kwrd"&gt;if&lt;/span&gt; (model.Password == password)
                {
                    FormsAuthentication.SetAuthCookie(model.UserLogIn, &lt;span class="kwrd"&gt;false&lt;/span&gt;);
                    &lt;span class="kwrd"&gt;if&lt;/span&gt; (Url.IsLocalUrl(returnUrl) &amp;amp;&amp;amp; returnUrl.Length &amp;gt; 1 &amp;amp;&amp;amp; returnUrl.StartsWith(&lt;span class="str"&gt;"/"&lt;/span&gt;)
                        &amp;amp;&amp;amp; !returnUrl.StartsWith(&lt;span class="str"&gt;"//"&lt;/span&gt;) &amp;amp;&amp;amp; !returnUrl.StartsWith(&lt;span class="str"&gt;"/\\"))
                    {
                        return Redirect(returnUrl);
                    }
                    else
                    {
                        return RedirectToAction("&lt;/span&gt;Welcome&lt;span class="str"&gt;", "&lt;/span&gt;Home&lt;span class="str"&gt;");
                    }
                }
                else
                {
                    ModelState.AddModelError("&lt;/span&gt;&lt;span class="str"&gt;", "&lt;/span&gt;The password provided &lt;span class="kwrd"&gt;is&lt;/span&gt; incorrect.");
                }
            }

            &lt;span class="rem"&gt;// If we got this far, something failed, redisplay form&lt;/span&gt;
            &lt;span class="kwrd"&gt;return&lt;/span&gt; View(model);
        }&lt;/pre&gt;

  &lt;p&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;As you can see there are two methods above with the same name. The first "LogOn" method will return the LogOn.cshtml that we have just created in STEP 2. The second LogOn method is decorated with the "[HttpPost]" attribute which indicates that the overload of the "LogOn" method can only be invoked for POST requests. &lt;/p&gt;

&lt;p&gt;The second method will be triggered once the Button "Log On" is fired. What it does is first it will check if the required fields are supplied so it checks for ModelState.IsValid condition.It will then create an instance of the UserManager class and call the GetUserPassword() method by passing the userLogIn value supplied by the user to get the password. If the password returns an empty string then it will display an error to the view. If the password supplied is equal to the password retrieved from the database then it will redirect the user the the Welcome page, otherwise display an error stating that the password supplied is invalid. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 5: Implementing Log-Out functionality&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The log-out code is pretty easy. Just add the following method below in the AccountController class.&lt;/p&gt;

&lt;div style="width: 600px; overflow: auto"&gt;
  &lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;

  &lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;// GET: /Account/LogOff &lt;/span&gt;

&lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult LogOff() 
{ 
      FormsAuthentication.SignOut(); 

      &lt;span class="kwrd"&gt;return&lt;/span&gt; RedirectToAction(&lt;span class="str"&gt;"Index"&lt;/span&gt;, &lt;span class="str"&gt;"Home"&lt;/span&gt;); 
}&lt;/pre&gt;

  &lt;p&gt;&lt;/p&gt;

  &lt;p&gt; &lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;You can then add the following Logout ActionLink in the “Welcome” view.&lt;/p&gt;

&lt;div style="width: 600px; overflow: auto"&gt;
  &lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;

  &lt;pre class="csharpcode"&gt;@Html.ActionLink(&lt;span class="str"&gt;"Logout"&lt;/span&gt;, &lt;span class="str"&gt;"LogOff"&lt;/span&gt;, &lt;span class="str"&gt;"Account"&lt;/span&gt;)&lt;/pre&gt;

  &lt;p&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The Output&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;The Log-in page &lt;/p&gt;

&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ASP.NETMVC3CreatingaSimpleLogInForm_10060/mvcpart2c_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="mvcpart2c" border="0" alt="mvcpart2c" src="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ASP.NETMVC3CreatingaSimpleLogInForm_10060/mvcpart2c_thumb.jpg" width="420" height="337" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Screen shot that shows the validation &lt;/p&gt;

&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ASP.NETMVC3CreatingaSimpleLogInForm_10060/mvcpart2d_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="mvcpart2d" border="0" alt="mvcpart2d" src="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ASP.NETMVC3CreatingaSimpleLogInForm_10060/mvcpart2d_thumb.jpg" width="418" height="339" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;After successful Log-on &lt;/p&gt;

&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ASP.NETMVC3CreatingaSimpleLogInForm_10060/mvcpart2e_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="mvcpart2e" border="0" alt="mvcpart2e" src="http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/WindowsLiveWriter/ASP.NETMVC3CreatingaSimpleLogInForm_10060/mvcpart2e_thumb.jpg" width="421" height="316" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;That's it! I hope someone find this post useful! &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:05a6e20e-5f17-472e-befa-81547fe43c6b" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/ASP.NET" rel="tag"&gt;ASP.NET&lt;/a&gt;,&lt;a href="http://technorati.com/tags/ASP.NET+MVC" rel="tag"&gt;ASP.NET MVC&lt;/a&gt;&lt;/div&gt; &lt;img src="http://geekswithblogs.net/dotNETvinz/aggbug/148172.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Vincent Maverick Durano</dc:creator>
            <guid>http://geekswithblogs.net/dotNETvinz/archive/2011/12/30/asp.net-mvc-3---creating-a-simple-log-in-form.aspx</guid>
            <pubDate>Fri, 30 Dec 2011 10:14:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/dotNETvinz/comments/148172.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/dotNETvinz/archive/2011/12/30/asp.net-mvc-3---creating-a-simple-log-in-form.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/dotNETvinz/comments/commentRss/148172.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/dotNETvinz/services/trackbacks/148172.aspx</trackback:ping>
        </item>
    </channel>
</rss>

