Click here to Skip to main content
15,910,661 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have The Following code That I have to convert from Asp.net Syntax to Razor View Engine Syntax,So How could I Can Do It.
XML
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
    <%
        IList<string> errors = ViewData["errors"] as IList<string>;
        if (errors != null) {
            %>
                <ul class="error">
                <% foreach (string error in errors) { %>
                    <li><%= Html.Encode(error) %></li>
                <% } %>
                </ul>
            <%
        }
                string action = "../" + MVC.Account.Name  + "/" + MVC.Account.Actions.Logon;
         %>

    <form method="post" action="<%=action %>">
        <fieldset>
        <legend>Login</legend>
        <div class="explanation">
            <p><label for="username">Username</label> </p>
            <p><label for="password">Password</label> </p>
         </div>
        <div class="explanation">
        <p><%= Html.TextBox("username") %></p>
        <p><%= Html.Password("password") %></p>
        <p><input type="submit" value="Login" class="button"/></p>
        </div>


        </fieldset>
    </form>
Posted
Comments
M Ali Qadir 19-Mar-12 7:13am    
In Fact This The Aspx File Firstly I have to delete It and add New View to My Method And then Write All The logic Of this Page to my .cshtml File.

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