WebMatrix and Html.BeginForm() [Answered]RSS

2 replies

Last post Jul 12, 2010 02:40 PM by HumanCompiler

  • WebMatrix and Html.BeginForm()

    Jul 10, 2010 04:37 AM|gpan|LINK

    Good morning,

    I have a simple ContentPage with a Layout Page like this

    @{
        LayoutPage="/Shared/_Layout.cshtml";
        PageData["Title"]="WebMatrix-About";
    }

            <h1>About the current site</h1>
            @using(Html.BeginForm()) {
                <fieldset>
                @Html.Label("LastName")<br/>
                @Html.TextBox("LastName")<br/>

                @Html.Label("Age")<br/>
                @Html.TextBox("Age")<br/>
                </fieldset>
                <input type="submit" value="TestMe" />
            }

    The rendered HTML puts the form tag at the top :

    <form action="/About" method="post"></form><!DOCTYPE html >
    <html>
    It seems like a bug or am I doing something wrong? 

     

    Html.BeginForm WebMatrix

  • Re: WebMatrix and Html.BeginForm()

    Jul 12, 2010 02:02 PM|HumanCompiler|LINK

    Seems like a bug to me.  I will verify with the team.  Thanks!
    Erik Porter
    ASP.NET PM
    http://about.me/erikporter
  • Re: WebMatrix and Html.BeginForm()

    Jul 12, 2010 02:40 PM|HumanCompiler|LINK

    Ok, as it turns out, this isn't really a bug but more of a "whoops, watch out, they probably won't work" sort of thing.  We're in the middle of removing MVC as a dependency so the Html Helpers are not in a good state to use right now.  In the next release some of them will be back (like TextBox and others).  Methods like BeginForm will not come back since they're not needed in ASP.NET Web Pages and do specific things in MVC.

    You can always make the form yourself.  ;)

    Erik Porter
    ASP.NET PM
    http://about.me/erikporter