Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 716933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:21:19+00:00 2026-05-14T05:21:19+00:00

i’m new to asp.net mvc.. so basically i just build up a two page

  • 0

i’m new to asp.net mvc..

so basically i just build up a two page app which takes the registration information of the user and post it to the database.

i use a lot of jquery and ajax calls to retrieve data from the database using linq to sql stored proc object.

and currently i’m stuck at one page where after the user submits the form it should redirect him to /Home/ProductAdded.

What i found was the error:

 Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

what used on my form are basically a combination of html controls, asp.net controls and some asp.net mvc type controls.

i submit the form using action=”/Home/ProductAdded”
and after doing some googling i found i was supposed to add in the machine key but after doing so, the index page becomes unviewable. because it couldn’t find the index file now.

removing the action helps, but now it just doesn’t go anywhere.
so what am i missing here?

i feel i’m missing a lot of fundamentals understanding about asp.net mvc and i don’t even know how to submit a form and go to a different page here!!

Edit: included my index.aspx

<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Home Page</asp:Content>

<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">

    <script src="Scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery.jsonSuggest.js" type="text/javascript"></script>
    <script src="Scripts/ProductRegistration.js" type="text/javascript"></script>
    <script src="Scripts/jquery.Guid.js" type="text/javascript"></script>

    <script src="Scripts/jquery.scrollTo-min.js" type="text/javascript"></script>
    <script src="Scripts/jquery.ui.core.min.js" type="text/javascript"></script>

    <script src="Scripts/jquery.ui.datepicker.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery.ui.widget.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery.colorbox-min.js" type="text/javascript"></script>
    <script src="Scripts/jquery.validate.min.js" type="text/javascript"></script>
    <script src="Scripts/date.js" type="text/javascript"></script>

    <form id="frmProductReg" runat="server" class="frmProductReg" action="/Home/ProductAdded">
        <asp:Panel ID="BreadCrumbPanel" runat="server" HorizontalAlign="Left" CssClass="breadcrumbCentered">
            Register Your Product</asp:Panel>
        <asp:Panel ID="MainContentPanel" runat="server"
            HorizontalAlign="Left" CssClass="headerCentered">
            <!-- Grab the country name via the geo locator -->
            <h1>Two-Step Online Product Registration</h1>
            we detect that you&#39;re located in 
            <!-- using span as it can auto resize and keeping the input for form submission later -->
            <span id="geoLocatedCountry" class="selectedCountry" ><%= Html.Encode(ViewData["CountryName"]) %></span>
            To change your country or region, please
            <span id="changeCountryUpper">click here</span>
            .
            <br /><br />
            <h3>Step 1: Enter your product information</h3>
        </asp:Panel>
        <asp:Panel ID="Panel3" runat="server" CssClass="contentCentered" HorizontalAlign="Left">

            <h3 align="left">Method 1</h3>
            Key in the name of your product in the space below. Choose the most appropriate 
            if there are a few similar ones, then click
            <img id="Image1" src="Images/btn_addButtonS.gif" alt="Add Button"/>
            <br />
            You can register multiple products by repeating this step.
            <table id="Table1">
                <tr>
                    <td>
                    <input type="text" id="tboProductCount" class="tboProductCount" value="0" />
                    <input type="text" id="tboAddProductId" class="tboAddProductId" />
                    <input id="tboAddProduct" class="tboAddProduct" />
                    </td>
                    <td>
                    <input type="image" id="btnAddProduct" class="btnAddProduct" src="Images/btn_addButton.gif" />
                    </td>
                </tr>
            </table>
            <br />
            <h3 align="left">
                Method 2</h3>
            Select the product(s) you wish to register and click
            <asp:Image ID="Image2" runat="server" ImageUrl="~/Images/btn_addButtonS.gif" />. 
            You can register multiple products by repeating this step. To remove
            <br />
            any product, click on the Remove button<asp:Image ID="Image3" runat="server" ImageUrl="~/Images/btn_remove.gif" />
            .<br />
            <br />
            <table border="0" cellpadding="2" cellspacing="0" frame="void" 
                style="width: 100%">
                <tr>
                    <td style="width: 238px">
                        <asp:ListBox ID="ListBox1" CssClass="LBox1" runat="server" Width="100%"></asp:ListBox>
                    </td>
                    <td style="width: 239px">
                        <asp:ListBox ID="ListBox2" CssClass="LBox2" runat="server" Width="100%"></asp:ListBox>
                    </td>
                    <td style="width: 290px">
                        <asp:ListBox ID="ListBox3" CssClass="LBox3" runat="server" Width="100%"></asp:ListBox>
                    </td>
                </tr>
                <tr>
                    <td style="width: 238px">
                        &nbsp;</td>
                    <td style="width: 239px">
                        &nbsp;</td>
                    <td style="width: 290px">
                        <asp:ImageButton ID="btnAddProduct2" cssClass="btnAddProduct2" runat="server" Height="26px" 
                            ImageAlign="Right" ImageUrl="~/Images/btn_addButton.gif" />
                    </td>
                </tr>
            </table>
            <br />
       </asp:Panel>
       <asp:Panel ID="PanelProductReg" runat="server" CssClass="PanelProductReg" HorizontalAlign="Left">
            <table id="ProductRegistrationTable" class="ProductRegistrationTable">
                <tr style="font-weight:bold;">
                    <td class="productIdCol">Product Id</td>
                    <td style="width:30%">Product</td>
                    <td style="width:30%">Serial Number<span class="redWarning">*</span> (
                    <a id="anchorSerialNoHelp" href="http://www.yahoo.com">What's this</a>)</td>
                    <td style="width:5%"><!-- used for the serial number help image button--></td>
                    <td style="width:20%">Date of Purchase<span class="redWarning">*</span></td>
                    <td>Remove</td>
                </tr>
            </table>
        </asp:Panel>
        <asp:Panel ID="Panel4" runat="server" HorizontalAlign="Left" CssClass="headerCentered">
            <h3>Step 2: Enter your personal details</h3>          
        </asp:Panel>
        <asp:Panel ID="Panel1" runat="server" CssClass="contentCentered" HorizontalAlign="Left">
            <table style="width: 97%">
                <tr>
                    <td style="width: 243px">
                        First Name<span class="redWarning">*</span>:</td>
                    <td>
                        <%= Html.TextBox("Customer.FirstName") %>
                        <!--asp:TextBox ID="customer.FirstName" ></asp:TextBox-->
                    </td>
                </tr>
                <tr>
                    <td style="width: 243px; height: 18px">
                        Last Name<span class="redWarning">*</span>:</td>
                    <td style="height: 18px">
                        <%= Html.TextBox("Customer.LastName") %>
                        <!-- asp:TextBox ID="customer.LastName" ></asp:TextBox -->
                    </td>
                </tr>
                <tr>
                    <td style="width: 243px">
                        Email Address<span class="redWarning">*</span>:</td>
                    <td>
                        <%= Html.TextBox("Customer.Email") %>
                        <!--asp:TextBox ID="customer.Email" ></asp:TextBox-->
                    </td>
                </tr>
                <tr>
                    <td style="width: 243px">
                        Re-enter Email Address<span class="redWarning">*</span>:</td>
                    <td>
                        <input type="text" id="tboConfirmEmail" />
                    </td>
                </tr>
                <tr>
                    <td style="width: 243px">
                        Country/Region<span class="redWarning">*</span>:</td>
                    <td>
                        <!-- hiding the input as i can't auto resize it and i still need this
                        data when i submit the form -->
                        <span id="selectedCountry" class="selectedCountry" ><%= ViewData["CountryName"] %>
                        </span>
                        <input type="hidden" id="customer.CountryID" value="65"/>
                        <input type="hidden" id="txtSelectedCountry" value="<%= Html.Encode(ViewData["CountryName"]) %>" />
                        <span id="currentCountry"> (Change this?)
                        </span>
                        <span id="changeCountry"> 
                        <%= Html.DropDownList("countries")%>
                        </span>
                    </td>
                </tr>
                <tr id="stateNameRow">
                    <td style="width: 243px">
                        State/Province:</td>
                    <td>
                        <!--%= Html.DropDownList("stateDdl") %-->
                        <asp:DropDownList ID="stateDdl" runat="server" CssClass="stateDdl"></asp:DropDownList>
                        &nbsp;&nbsp;&nbsp;&nbsp; or&nbsp;&nbsp;
                        <%= Html.TextBox("Customer.StateName")%>
                        <!--asp:TextBox ID="customer.StateName"></asp:TextBox-->
                    </td>
                </tr>
                <tr>
                    <td style="width: 243px">
                        Gender:</td>
                    <td>
                        <%= Html.RadioButton("Customer.Male", "Male",true)%> Male
                        <%= Html.RadioButton("Customer.Female", "Female")%> Female
                        <!--asp:RadioButton ID="rbtMale" Text="Male" Checked="True" 
                            GroupName="rboGender" />
                        &nbsp;&nbsp;&nbsp;
                        <asp:RadioButton ID="rbtFemale"  Text="Female" 
                            GroupName="rboGender" /-->
                    </td>
                </tr>
                <tr>
                    <td style="width: 243px">
                        Date of Birth:</td>
                    <td>
                        <input type="text" id="Customer_DOB" name="Customer.DOB" class="dobPicker" />
                    </td>
                </tr>
                <tr>
                    <td style="width: 243px">
                        &nbsp;</td>
                    <td>
                        <%= Html.CheckBox("Customer.Subscribe",true) %>
                        <!--asp:CheckBox ID="cboNewsletter" Checked="True" / -->
                        &nbsp;I would like to receive newsletters for the latest Creative products, special 
                        offers and events.
                    </td>
                </tr>
                <tr>
                    <td style="width: 243px">
                        &nbsp;</td>
                    <td>
                        * Denotes mandatory field.</td>
                </tr>
                <tr>
                    <td style="width: 243px">
                        &nbsp;</td>
                    <td>
                        <!--asp:ImageButton ID="ImageButton1"
                            ImageUrl="~/Images/btn_submit.gif" /-->
                        <input type="image" id="imgbtnSubmit" src="Images/btn_submit.gif"/>    
                        <input type="image" id="imgbtnClear" src="Images/btn_clear.gif"/>
                    </td>
                </tr>
            </table>

        </asp:Panel>
    </form>
</asp:Content>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T05:21:19+00:00Added an answer on May 14, 2026 at 5:21 am

    Post-Redirect-Get pattern is the answer to your question. Search SO or Google and you should find plenty of info on it.

    Also you mention ASP.NET controls? Those should not be present in ASP.NET MVC View pages because they are not compatible with MVC.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I would like to run a str_replace or preg_replace which looks for certain words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.