3

@model Webgrid.Models.Employee

What is the syntax of the above code in ASPX

1 Answer 1

2

The strongly typed views need to derive from System.Web.Mvc.ViewPage<T> where T is your model type:

<%@ Page Language="C#" 
    Inherits="System.Web.Mvc.ViewPage<Webgrid.Models.Employee>" %>

Or if you are having an ascx page then from System.Web.Mvc.ViewUserControl<T>

<%@ Control Language="C#"        
            Inherits="System.Web.Mvc.ViewUserControl<Webgrid.Models.Employee>" %>
Sign up to request clarification or add additional context in comments.

6 Comments

i have used WebGrid using ASPX please check whether the code is right stackoverflow.com/questions/14351486/…
why is razor simple to use and ASPX very difficult
Razor was designed for easy use for MVC. ASPX was the view language and it is designed for ASP.NET WebForms. And ASP.NET MVC just supports both. You can use both of them in the same project side by side.
i have referred your method stackoverflow.com/questions/10801743/…
I have used your method i am getting only the last value in webgrid for the code used in stackoverflow.com/questions/14351486/…
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.