<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Web Forms</title><link>http://forums.asp.net/18.aspx</link><description>All about building ASP.NET Pages - server controls, events, validation, etc.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Having a form in logonusercontrol.ascx</title><link>http://forums.asp.net/thread/3280698.aspx</link><pubDate>Wed, 08 Jul 2009 08:23:11 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3280698</guid><dc:creator>Tomorrow</dc:creator><author>Tomorrow</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3280698.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=3280698</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;uniqueumang:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Validation of viewstate MAC failed&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;&lt;font color="#800000" size="2"&gt;pages&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;enableEventValidation&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;false&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;viewStateEncryptionMode&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; =&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Never&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; /&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="http://blogs.msdn.com/tom/archive/2008/03/14/validation-of-viewstate-mac-failed-error.aspx"&gt;http://blogs.msdn.com/tom/archive/2008/03/14/validation-of-viewstate-mac-failed-error.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://aspadvice.com/blogs/joteke/archive/2006/02/02/15011.aspx"&gt;http://aspadvice.com/blogs/joteke/archive/2006/02/02/15011.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Having a form in logonusercontrol.ascx</title><link>http://forums.asp.net/thread/3275058.aspx</link><pubDate>Sun, 05 Jul 2009 02:30:21 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3275058</guid><dc:creator>uniqueumang</dc:creator><author>uniqueumang</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3275058.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=3275058</wfw:commentRss><description>&lt;p&gt;Greeting everyone,&lt;/p&gt;&lt;p&gt;I have recently started working with asp.net , and deceided to jump to asp.net mvc. I am familiar with MVC and I used it to make application alot more robust. &lt;/p&gt;&lt;p&gt;I took time to get familiarise with MVC , and decided to make changes to the system to fit my needs. I donot prefer to have an extra click to login, so i decided to have loginform in LogOnUserControl.ascx . Please note that all the code I am using so far is provided by MVC application itself. I have just make teeny tiny adjustment. Following is my LogOnUserControl.ascx&lt;/p&gt;&lt;pre name="code" class="c-sharp"&gt;&amp;lt;%@ Control Language=&amp;quot;C#&amp;quot; Inherits=&amp;quot;System.Web.Mvc.ViewUserControl&amp;quot; %&amp;gt;
&amp;lt;%
    if (Request.IsAuthenticated)
    {
%&amp;gt;
Welcome &amp;lt;b&amp;gt;
    &amp;lt;%= Html.Encode(Page.User.Identity.Name) %&amp;gt;&amp;lt;/b&amp;gt;! [
&amp;lt;%= Html.ActionLink(&amp;quot;Log Off&amp;quot;, &amp;quot;LogOff&amp;quot;, &amp;quot;Account&amp;quot;) %&amp;gt;
]
&amp;lt;%
    }
    else
    {
%&amp;gt;
&amp;lt;%= Html.ValidationSummary(&amp;quot;Login was unsuccessful. Please correct the errors and try again.&amp;quot;) %&amp;gt;
&amp;lt;% using (Html.BeginForm(&amp;quot;LogOn&amp;quot;, &amp;quot;Account&amp;quot;))
   { %&amp;gt;
&amp;lt;div id=&amp;quot;loginForm&amp;quot;&amp;gt;
    &amp;lt;fieldset&amp;gt;
        &amp;lt;legend&amp;gt;Login&amp;lt;/legend&amp;gt;
        &amp;lt;p&amp;gt;
            &amp;lt;label for=&amp;quot;username&amp;quot;&amp;gt;
                Username:&amp;lt;/label&amp;gt;
            &amp;lt;%= Html.TextBox(&amp;quot;username&amp;quot;)%&amp;gt;
            &amp;lt;%= Html.ValidationMessage(&amp;quot;username&amp;quot;)%&amp;gt;
        &amp;lt;/p&amp;gt;
        &amp;lt;p&amp;gt;
            &amp;lt;label for=&amp;quot;password&amp;quot;&amp;gt;
                Password:&amp;lt;/label&amp;gt;
            &amp;lt;%= Html.Password(&amp;quot;password&amp;quot;)%&amp;gt;
            &amp;lt;%= Html.ValidationMessage(&amp;quot;password&amp;quot;)%&amp;gt;
        &amp;lt;/p&amp;gt;
        &amp;lt;p&amp;gt;
            &amp;lt;%= Html.CheckBox(&amp;quot;rememberMe&amp;quot;)%&amp;gt;
            &amp;lt;label class=&amp;quot;inline&amp;quot; for=&amp;quot;rememberMe&amp;quot;&amp;gt;
                Remember me?&amp;lt;/label&amp;gt;
        &amp;lt;/p&amp;gt;
        &amp;lt;p&amp;gt;
            &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Log On&amp;quot; /&amp;gt;
        &amp;lt;/p&amp;gt;
    &amp;lt;/fieldset&amp;gt;
    
&amp;lt;/div&amp;gt;
&amp;lt;%
   } 
        %&amp;gt;
&amp;lt;div id=&amp;quot;registerHere&amp;quot;&amp;gt;
    &amp;lt;fieldset&amp;gt;
        &amp;lt;legend&amp;gt;Register&amp;lt;/legend&amp;gt;
        &amp;lt;p&amp;gt;
            Please enter your username and password.
            &amp;lt;%= Html.ActionLink(&amp;quot;Register&amp;quot;,&amp;quot;Register&amp;quot;,&amp;quot;Account&amp;quot;) %&amp;gt;
            if you don&amp;#39;t have an account.
        &amp;lt;/p&amp;gt;
    &amp;lt;/fieldset&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;%
    
    }
%&amp;gt;
&lt;/pre&gt;&lt;p&gt;Now the problem is that is the I can&amp;#39;t login from this form. I get following error: &lt;/p&gt;&lt;p&gt;Server Error in &amp;#39;/&amp;#39; Application.

Validation
of viewstate MAC failed. If this application is hosted by a Web Farm or
cluster, ensure that &amp;lt;machineKey&amp;gt; configuration specifies the
same validationKey and validation algorithm. AutoGenerate cannot be
used in a cluster.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I am not sure why I am getting error regarding it. I tried googling but solution provided didn&amp;#39;t help much. Solution including removing form tags from site.master. &lt;/p&gt;&lt;p&gt;Your help is alot appreciated.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Thanks&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;With Regards&lt;/p&gt;&lt;p&gt;-Umang&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt="" /&gt;&lt;img alt="" /&gt;&lt;/p&gt;&lt;p&gt;&lt;img alt="" /&gt;&lt;/p&gt;</description></item></channel></rss>