This is a migrated thread and some comments may be shown as answers.

[Solved] Changing the Asp.net Syntax To Asp.Net MVC RaZor View Syntax

1 Answer 186 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
M Ali
Top achievements
Rank 2
M Ali asked on 21 Mar 2012, 12:16 PM

Hi,

I have a Site that have views That Are Aspx files I want to convert them Into Razor view syntax,So Please guide me How could I Do It,
How I Have change the Asp.net code  to Razor View Engine syntax,

For Example If I Have the following code ,Particularly First line What should I do to it to convert to razor syntax 


<%@ 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>

1 Answer, 1 is accepted

Sort by
0
Accepted
nachid
Top achievements
Rank 1
answered on 22 Mar 2012, 08:54 AM
Telerik have a free converter you can get here
Tags
General Discussions
Asked by
M Ali
Top achievements
Rank 2
Answers by
nachid
Top achievements
Rank 1
Share this question
or