Razor is a template language used by ASP.NET Web Pages and ASP.NET MVC (since version 3). It supports seamless transitions between HTML markup and C# or VB code. Transitions between markup and code are indicated by the "@" sign. For example, to render a simple HTML list, this c# syntax is used: ...
0
votes
0answers
9 views
Returning Partialview items to Controller in a Questionbank razor application
I am trying to develop a small Questionbank application. Here is how I create a new Questionbank razor page:
@using myWebApp.Utilities;
@using myWebApp.Models
@using System.Linq
@model ...
-3
votes
0answers
23 views
Razor syntax @<text> blah blah </text>… what does it produce?
I've looking at Telerik tools for MVC. They have a method of type Func and they are passing the content with this syntax...
Telerik.Factory().Content(@<text> content here </text>);
of ...
1
vote
4answers
34 views
How to share master pages between Razor and Webforms
I asked this question before but the problem is I get one response and that response is not for the question that I asked. So, to make this clear, upfront, what this question is not about:
I DO NOT ...
1
vote
1answer
41 views
C# MVC3 Joining SDF data tables
I've created an MVC 3 Razor application that manages Projects, and should manage Sections within those Projects.
So, I've made a model Projects.cs, controller ProjectsController, and got myself a ...
0
votes
0answers
39 views
Show source of *.cshtml and *.cs in ASP.NET MVC
I develop samples center for some ASP.NET MVC framework. Samples center consist from several samples. For each sample I want show to user on single page:
*.cshtml-source of this samples
rendered ...
3
votes
1answer
35 views
Mvc dropdownlist doesn't select when Select list Dictionary value is decimal
Why is my dropdownlist not binding? Using the DropDownListFor Razor helper function.
View:
@Html.DropDownListFor(m => m.ModelObject.VatRate, Model.VatRatesList)
ViewModel:
public ...
3
votes
1answer
32 views
How do i exit a block of code after error detection
In VB/VB.NET, exiting a block of code anytime and anywhere in the code block is handled using EXIT SUB/EXIT FUNCTION/EXIT LOOP e.t.c. I expected RETURN FALSE should work in razor/c# but its not in a ...
1
vote
1answer
58 views
Many to many relationships in ASP MVC
I'm using MVC 3 with Razor and Entity Framework for an assignment.
So far, I have been using scaffolds to create a basic CRUD page for all my models.
Two of the models I have are Musicians and ...
0
votes
3answers
48 views
ASP.NET MVC 3 (Razor) form submit not working
Using Fiddler I can see that the request is not even being made but I can't see why.
Here's the form:
@using (Html.BeginForm("Index", "FileSystemChannelIndex", FormMethod.Post, new {
channelId = ...
1
vote
2answers
30 views
Getting DisplayFor(m => m.Property) to show line breaks and formatting?
I have a problem with my View in that when I am editing something using TextAreaFor any line breaks or formatting I insert are saved and when I edit the same element, it will still be shown like this:
...
1
vote
3answers
39 views
ASP MVC4 - Pass List to view via view model
I have a model Person (with among other fields the day of Birth)
and I want to pass a list of all persons, together with the calculated age of each person, to the view
Therefor:
The view model
...
0
votes
4answers
50 views
Passing Querystring value into View Model
i have a parent child situation with for example my user class and my userwork child class (Entity framework scaffolded classes). i used the controller wizard to scaffold CRUD methods and views. it ...
2
votes
3answers
27 views
Is it possible to use AJAX to access an html helper?
In asp.net mvc3,
I am using a javascript API to dynamically render a user interface. Part of the input section is going to be dependent on how many items the user wants to enter data for. As a ...
1
vote
1answer
32 views
asp.net mvc3 razor and jquery submit
I have post form with submit button before submit i need to call c# code behind get hash and then change value of hidden input.
Code behind is calling but problem is that while i get result from c# ...
1
vote
1answer
23 views
Currency Formatting MVC
I'm trying to format an Html.EditorFor textbox to have currency formatting, I am trying to base it off of this thread String.Format for currency on a TextBoxFor. However, my text just still shows up ...