i have a question. Ex : I have student.cs , student.cshtml . I need get data of student.cs or student.cshtml to control.js in MVC. how to do that?
相关问题
- MVC-Routing,Why i can not ignore defaults,The matc
- parameters in routing do not work MVC 3
- There is no ViewData item with the key 'taskTy
- TextBoxFor decimal
- Install ASP.NET 5.0 version of System.ServiceModel
相关文章
- How to get a list of connected clients on SignalR
- How do you redirect to the calling page in ASP.NET
- Change color of bars depending on value in Highcha
- The program '[4432] iisexpress.exe' has ex
- ASP.Net MVC 4 Bundles
- How to get server path of physical path ?
- Cannot implicitly convert Web.Http.Results.JsonRes
- entity type has no key defined - Code first
I believe you're asking how to get data from either the View (student.cshtml) or Controller (student.cs (should be named StudentController.cs)) to a JavaScript file (control.js) to manipulate it in Javascript.
The way I've done this is through the View using a hidden div. Here is a generic example:
View:
Javascript: