Converting C# Razor To VB?

Feb 28, 2011

I'm following the ASP.NET MVC Tutorial and having started in VB.NET I'm having trouble converting the following razor code:

I have got

<ul>
@For Each g As MvcApplication1.Genre In Model
<li> @g.Name </li>
Next
</ul>

but getting

Attribute Sepcifier is not a complete statement on both the <li> tags. I understand I need to use line continuation but can't figure out where.

View 3 Replies


Similar Messages:

MVC :: 3 RC2 With VB ModelType And Razor

Dec 14, 2010

We tried to add a Entity model using Razor here was the syntax: @ModelType BID.Data.Entities.PlumbingPermit

View 4 Replies

MVC :: How To Access Profile (MVC 3 Razor)

Feb 4, 2011

I'm all new at MVC, so how do I access the users Profile attributes which are defined in the web.config file.With WebForms I would normally do something like this:

[Code]....

[Code]....

I really can't figure out how to do it in MVC 3 Razor.Would really like to see a working example,

View 1 Replies

Razor Reference Documentation

Jan 23, 2011

Now that ASP.NET MVC 3 with the new Razor engine has been officially released, is there any official documentation for it?The question asp.net mvc3 razor documentation? has some good links to introductory texts. But I'm looking for a reference documentation that contains a complete description of all @keywords.

View 2 Replies

C# - Parseable MVC Razor Syntax

Sep 15, 2010

Here is what I would like to express by Razor:

<b>@parameterMapping.Title</b> (Category: @parameterMapping.Category.Title, Regexp: @parameterMapping.Regexp)

But to make it parseable I have to write it this way:

<b>@parameterMapping.Title</b> <text>(Category: </text> @parameterMapping.Category.Title <text>, Regexp:</text> @parameterMapping.Regexp <text>)</text>

Are there better ways to solve this problem?

View 1 Replies

Use Razor Syntax In Web Application (not MVC)?

Feb 27, 2011

How does one create a .cshtml page in an ASP.NET web application? The option to choose Razor is obvious when using MVC - it appears when adding a view. But I can't seem to figure out how to accomplish this in a plain ASP.NET Web Application. Is it even possible?

View 1 Replies

MVC :: Using Namespaces In Razor Views?

Jan 18, 2011

I've recently switched over to using the Razor view engine, and I want to specify a namespace to use in a view. I've tried adding an entry to the Web.config file, ie:

[Code]....

But none of my views recognise any of the classes inside that namespace, so I have to declare the namespace in every view that needs it. why the Web.config approach isn't working?

View 13 Replies

Is It Possible To Use Razor View Engine Outside

Sep 2, 2010

If I look at the Razor View Engine, then I see a very nice and concise syntax that is not particularly tied to generating html. So I wonder, how easy would it be to use the engine outside asp.net in a "normal" .net environment for example to generate text, code,...

View 3 Replies

MVC :: Is T4MVC Compatible With Razor

Jul 10, 2010

Will or is T4MVC compatible with Razor?

[code]....

Does it make sense to use both at same time?

View 6 Replies

MVC :: Where Does The EditorTemplates Go In Razor Viewengine

Nov 24, 2010

I've just installed the new MVC3 RC ,and have no idea about where the *.ascx template stuffs live in?

View 1 Replies

MVC :: Render HTML With Razor?

Mar 11, 2011

I try to generate this HTML code with Razor:

[Code]....

This is my Code in .cshtml, i have to select the "current" Style and insert <span> </span> tags wraping item.Text, but it doesnt work ....

[Code]....

View 2 Replies

C# - MVC 2 Project Migration To MVC 3 Razor?

Feb 10, 2011

what is the best way to migrate MVC2 project to MVC 3.

View 4 Replies

Asp - Razor Dynamic Name Of Class

Apr 4, 2011

<span class="abc">abc</span>

I want to have @postid as well in there so that the name of the class is generated as abc123. How can i do that?

View 1 Replies

UserControl Or PartialView Using .net MVC 3 Razor?

Mar 15, 2011

I would like to display 3 three userControls on a home view

UserControl1 ==> Enterprise Entity partial view

UserControl2 ==> Client Entity partial view

UserControl3 ==> Biling Entity partial view

A submit button to save all values

So my home will display the 3 partial views and enable me; when I click submit button ;
to save Enterprise Data, Client Data and Biling Data.

View 1 Replies

MVC :: How To Use Local Resources With Razor

Feb 19, 2011

It seems that using Local resources is much more complicated when using Razor. I recently converted an MVC 2 app I was working on to MVC 3. The conversion went well but accessing LocalResources doesn't work and I can't get it to work. In MVC 2 I created an App_LocalResources folder in the /Views/Home folder and created an Index.aspx.resx resource file. In the Index View I could access the local resources with

<%: GetLocalResourceObject("FirstName") %>

Simple, out-of-the-box functionality, as it should be. Razor doesn't understand this. It seems that in Razor you have to use @HttpContext.GetLocalResourceObject(<virtual-path>, <resource-name-key>). I've tried everything for virtual-path but nothing seems to work ("~/", "~/Views/Home/App_LocalResources", etc.). I tried to directly access the resource file by providing the complete namespace, like you do with global resources (which works fine in Razor), but then it errors stating that the culture is required. Intellisense allows you to build the reference to the resource property but Razor doesn't understand it.

Of course an alternative could be to simply use the ASPX rendering engine in MVC 3, but I want to use Razor. Does anyone know an out-of-the-box method (not some exotic work-around) for accessing the LocalResources in an MVC 3 app using Razor?

View 2 Replies

C# - VS Crashes With RAZOR VBHTML?

Feb 27, 2011

For some reason, with the Razor view engine, VS is crashing on me. I copied the CSHTML content over to a VBHTML file and begin reformatting it, and VS has crashed on me twice now as I change a helper or function method syntax from:

@helper SomeHelper(string text)

to

@Helper SomeHelper(text As String)

The whole machine must be rebooted to get intellisense/markup highlighing to work.

View 1 Replies

Relationship Between Razor And Aspx?

Feb 26, 2011

There have been several similiar questions but I am still confused. Take the following code as example:

<% Html.RenderAction("partial"); %>

@{Html.RenderAction("partial");}

the aspx page runs well but Razor throw an error: "No route in the route table matches the supplied values." And even this is wrong, too.

Html.RenderAction("partial");

So why? What's the "@" really mean? What's the difference or relationship between aspx and cshtml?

View 1 Replies

MVC :: How To Translate A View To Razor

Nov 15, 2010

I want to change my project to use razor syntax. How do I translate a view to razor syntax?

also, when I add a new view, I don't see an option for the view engine to use. Is there one?

View 4 Replies

MVC :: Get Row Count In Razor View?

Feb 21, 2011

I have a Razor view of type Joke. Here is the relationship between the Entity Joke and the Entity Rating:

I have done eager loading in my HomeController to get the Ratings from the Database. But I seem to be unable to get a count of the ratings that belong to a particular joke. Here is the error I get:

PS. You can ignore that <img> code to the right.

View 14 Replies

MVC :: Razor: Merging Javascript With C#?

Feb 1, 2011

I want to access to the ViewBag from javascript, so I can access to this variable in the future from javascript.Im trying to do this:

var array = new Array();
@for (int i = 0; i < 5; i++)
{
array[i] = @ViewBag.FriendsId[i]);
}

View 5 Replies

Razor Templates Helpers To Work?

Nov 10, 2010

With the release of mvc 3 rc, I've started playing around with the Razor engine. Has anybody gotten razor templated helpers to work? If so, how? I have a single helper in View/Helpers folder and a single layout page. If I move the code to the view page, it works. The error is ' not in context' for the method name. How and where do I correct this?

View 3 Replies

MVC :: Migrate 2 Project To 3 - Razor View

Sep 8, 2010

I have an application which has been built in MVC 2.0. I need to upgrade it to MVC 3.0 and that too by using Razor CSHTML engine. All the information which I got on the net was for MVC 3.0 Webform engine but nothing much for migrating to Razor.

View 37 Replies

MVC :: How To Convert Project Created To Razor

Mar 15, 2011

How convert a project created in asp.net MVC to Asp.Net MVC Razor?

View 2 Replies

How To Use JQuery And CSS In MVC 3 When We Develop Application Through Razor

Jan 17, 2011

when i am working with razor application i found that their is no intellisense work for jQuery even i put the Vsdoc file in Master [layout page]. i find a another probelm that in aspx i can find the classes i define in stylesheet by press CTRL + space after put class attribute for tag or element not they not work too.

are their any good way to use this both feature when we work using Razor

View 1 Replies

WebMatrix :: Writing Xml In Razor Syntax

Sep 21, 2010

i would like to write Rss feed page using the razer syntax in webmatrix and i am facing probem in xml formatting

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved