Click here to Skip to main content
15,889,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi


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

<asp:Content ID="loginTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Log On
</asp:Content>

<asp:Content ID="loginContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Log On</h2>
    <p>
        Please enter your username and password. <%: Html.ActionLink("Register", "Register") %> if you don't have an account.
    </p>

    <% using (Html.BeginForm()) { %>
        <%: Html.ValidationSummary(true, "Login was unsuccessful. Please correct the errors and try again.") %>
        <div>
            <fieldset>
                <legend>Account Information</legend>

                <div class="editor-label">
                    <%: Html.LabelFor(m => m.UserName) %>
                </div>
                <div class="editor-field">
                    <%: Html.TextBoxFor(m => m.UserName) %>
                    <%: Html.ValidationMessageFor(m => m.UserName) %>
                </div>

                <div class="editor-label">
                    <%: Html.LabelFor(m => m.Password) %>
                </div>
                <div class="editor-field">
                    <%: Html.PasswordFor(m => m.Password) %>
                    <%: Html.ValidationMessageFor(m => m.Password) %>
                </div>

                <div class="editor-label">
                    <%: Html.CheckBoxFor(m => m.RememberMe) %>
                    <%: Html.LabelFor(m => m.RememberMe) %>
                </div>

                <p>
                    <input type="submit" value="Log On" />
                </p>
            </fieldset>
        </div>
    <% } %>
</asp:Content>


this is actually predefined project when i try to create new MVC2 application .am MVC beginner
here this coding am not able to understand .there is no text box and also for Button no click event.
can anyone explain how it works ???/
Thanks
Posted

1 solution

there is no text box and also for Button no click event. !
then what is TextBoxFor , input type submit?
Dear friend you need to know about HtmlHelpers and Strongly typed views in MVC.
I suggest you to refer simple tutorials .
have a look at the following :
there is no text box and also for Button no click event.[^]

http://aspalliance.com/1915_ASPNET_MVC_2_Strongly_Typed_Html_Helpers_[^]

http://www.em64t.net/2010/07/mvc-using-strongly-typed-html-helpers-in-helper/[^]
 
Share this answer
 
v3
Comments
kimberly wind 10-May-12 3:31am    
i meant i have used asp:textbox and asp:button controls no i had doubt here.my voted 5 thanks for ur help with this
member60 10-May-12 3:33am    
thank you !

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900