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.
1
vote
2answers
20 views
Anchor tag as submit button?
I'm in the process of converting an existing website to use MVC and Entity Framework.
The layout / styling is all supposed to stay the same, and in order to follow that guideline I need to submit my ...
0
votes
1answer
21 views
RedirectToAction in MVC3 returns “No route in the route table matches the supplied values”
I use this log in controller :
public ActionResult Index(LoginModel model)
{
if (model.usernam == "usernam" && model.password == "password")
{
return ...
0
votes
1answer
16 views
Populating Variables Declared in Model
I'm currently learning MVC 4 and Razor in Visual Basic.NET using this Lynda.com tutorial.
Right now, I have the main variables I want to be accessed throughout the website in a class called ...
0
votes
3answers
29 views
How to format currency from database
The goal
I want to format correctly the currency from database.
The problem
I'm formatting the currency from database with this:
@String.Format("{0:C}", @Model["MinProductPrice"])
The problem ...
2
votes
2answers
1k views
View not binding dropdownlist selected value back to Model
I am looking for a way to bind an enum in my Model to a dropdownlist. I found this post and used the code from the 2nd answer and it works great in creating the dropdownlist. However, when I submit my ...
0
votes
0answers
28 views
How to use Google Adsense with MVC C# Razor
I am trying to add Google Adsense to my MVC mobile web application. I'd like to implement the Google Adsense Mobile content ad code. The Scripting Language they have is asp 3.0. Is there an MVC helper ...
3
votes
3answers
61 views
How to pluralize words/strings?
The goal
I want to pluralize words with Razor Engine of C#.Net. I'm using MVC 4.
The problem
I have the following:
<button class="button light-blue filled compare float-right"
title="This ...
1
vote
1answer
276 views
How can I write summary for a @helper?
I used to have a HtmlHelper written in C# code. Instead of it, I just created a cool Razor @helper and put it in my App_Code folder! :) My HtmlHelper function had a summary:
/// <summary>Html ...
3
votes
1answer
43 views
Helper to generate “friendly URL” in Razor (C#/MVC 4)
The goal
Create something that converts string to friendly string in Razor (I'm using C#/MVC4)
The problem
I have the following code:
<li>
<img
...
5
votes
4answers
9k views
Localhost not working in chrome and firefox
I am doing a web project using visual studio 2010(MVC3 Razor) and Windows 7.
My default browser is IE. When I run the project, the website working is perfectly with the url
http://localhost:49824/
...
0
votes
1answer
30 views
Can I update a Model from a jQuery event?
This is what I would like to (maybe - I'm still thinking about doing it all client-side, in jQuery) do, but I don't know if it's possible:
Respond to a user action (selecting a tab or an item from a ...
2
votes
1answer
27 views
Templates C#/MVC 4/Razor
The goal
Create Shared UI Templates with C# + MVC 4 + Razor Engine.
The problem
I do not know how to do.
Details
I have the follow template:
<li>
<div class="introduction">
...
0
votes
0answers
9 views
jQuery .load and Google Analytics
I'd like to know if a site visitor clicked on a link leading to a jquery modal window.
The link to this modal window is a standard hyperlink and replaced when the page loads with:
...
0
votes
1answer
14 views
MVC Razor submit data in XML
That's me again with MVC Razor.
In web i see a lot of tutorials by sending data from JQuery to Controller and vice-versa via AJAX using JSON, but I can't find any similar example with XML.
Any ...
0
votes
1answer
22 views
How to display Image type from System.Drawing.Bitmap
I am reading the image from Active Directory the Property["thumbnailPhoto"].
My Model assigns it to this:
public Image thumbnailPhoto { get; set; }
My Service runs this code to put get the image ...