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

[Solved] I want to know razor Equivalent code of following aspx syntex

1 Answer 27 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.
Hasibul
Top achievements
Rank 1
Hasibul asked on 26 Jun 2011, 06:35 PM
<% Html.Telerik()
       .Grid(Model)
       .Name("customers")
       .PrefixUrlParameters(false)
       .Columns(columns =>
                {
                    columns.Add(c =>
                                {
                                    %>
                                        <%= Html.ActionLink("Edit", "Edit", new { id = c.CustomerID })%>
                                        <%= Html.ActionLink("Delete", "Delete", new { id = c.CustomerID })%>
                                    <%
                                }).Title("Action");
 
                    columns.Add(c => c.CompanyName).Width(200);
                    columns.Add(c => c.ContactName);
                    columns.Add(c => c.Address);
                    columns.Add(c => c.City);
                    columns.Add(c => c.PostalCode);
                    columns.Add(c => c.Country);
                    columns.Add(c => c.Phone);
                    columns.Add(c => c.Fax);
                })
        .Filterable()
        .Sortable(sort => sort.SortMode(GridSortMode.MultipleColumn))
        .Pageable()
        .Scrollable(scrolling => scrolling.Height(250))
        .Render(); %>

I am unable to convert Bold and Italic code in razor


@{Html.Telerik().Grid(Model).Name("Categories").Columns(columns => {
    
    columns.Add(c => c.CategoryID);
    columns.Add(c=>c.CategoryName);
    columns.Add(c => c.Description);
    columns.Add(c =>
    {
     
%> 
    <%= Html.ActionLink("Edit", "Edit", new { id = c.CustomerID })%>
    <%= Html.ActionLink("Delete", "Delete", new { id = c.CustomerID })%>
<%

        
    }).Title("Action");  
})}

Please help me.


1 Answer, 1 is accepted

Sort by
0
Hasibul
Top achievements
Rank 1
answered on 26 Jun 2011, 08:13 PM
 @{ Html.Telerik()
           .Grid(Model)
           .Name("customers")
           .PrefixUrlParameters(false)
           .Columns(columns =>
                    {
                        columns.Add(c =>
                                    {
                                        
                                            @Html.ActionLink("Edit", "Edit", new { id = c.CustomerID })
                                            @Html.ActionLink("Delete", "Delete", new { id = c.CustomerID })
                                        
                                    }).Title("Action");

                        columns.Add(c => c.CompanyName).Width(200);
                        columns.Add(c => c.ContactName);
                        columns.Add(c => c.Address);
                        columns.Add(c => c.City);
                        columns.Add(c => c.PostalCode);
                        columns.Add(c => c.Country);
                        columns.Add(c => c.Phone);
                        columns.Add(c => c.Fax);
                    })
            .Filterable()
            .Sortable(sort => sort.SortMode(GridSortMode.MultipleColumn))
            .Pageable()
            .Scrollable(scrolling => scrolling.Height(250))
            .Render(); }
Tags
General Discussions
Asked by
Hasibul
Top achievements
Rank 1
Answers by
Hasibul
Top achievements
Rank 1
Share this question
or