Questions tagged [webforms-view-engine]

31 questions
18
votes
5 answers

.NET "code nugget blocks"?

So in .NET we have... <%= <%: (new to .NET 4 - syntactic sugar for HTML encoding) <%# <%@ What exactly are these? And are there more? Is there an exhaustive list of these and what they are anywhere? It's hard to know what to even search for -…
geoid
  • 285
  • 3
  • 8
14
votes
6 answers

Add CSS references to page's from a partial view

Is there a way to add CSS references to a page from a partial view, and have them render in the page's (as required by the HTML 4.01 spec)?
kristian
  • 22,731
  • 8
  • 50
  • 78
11
votes
3 answers

What does <%# "whatever" %> mean in ASP.NET?

Possible Duplicate: Meaning of the various symbols in .aspx page of asp.net I'm familiar with <%= "whatever" %> as a shortcut for <% Response.Write("whatever"); %>. But I've recently come across some code that uses <%# %> instead. In this…
Mark Biek
  • 146,731
  • 54
  • 156
  • 201
6
votes
1 answer

Razor view Type does not inherit from 'System.Web.WebPages.WebPage'

I have a problem with configuring asp.net mvc application: [HttpException (0x80004005): Type 'ASP._Page_Currency_Index_cshtml' does not inherit from…
5
votes
1 answer

How to render an ASP.NET MVC ViewResult to HTML?

In a testing situation, I'd like to be able to use the default viewEngine to render a given ViewResult to HTML. Currently, my views are WebForms-based. But I might have Spark or Razor views at some point. For now, I'd like to focus on WebForms. Can…
Byron Sommardahl
  • 12,743
  • 15
  • 74
  • 131
5
votes
2 answers

Is it possible to reuse partial views on multiple projects in ASP.NET MVC?

I know ASP.NET MVC 3 doesn't support area reuse, which would be very handy for, say, user admin areas of web applications, but how about partial views? Say I have Pager "control" as a Razor (or WebFormViewEngine, it doesn't matter) partial view…
5
votes
4 answers

Is it worth migrating an existing asp.net-mvc project with webform view engine to razor?

I have a large asp.net-mvc web site . I recently upgraded to MVC 4 but one thing i am debating is it worth it to migrate to razor engine. I see there are tools to "auto" upgrade but i am trying to figure out if its worth the migration pain. I…
leora
  • 188,729
  • 360
  • 878
  • 1,366
4
votes
2 answers

In ASP.NET MVC what are the differences between "<%=", "<%:" "<%#"

I've tried to perform a search on the above query but probably due to the angle brackets, I didn't find anything on the matter. Could anyone please explain what the differences are between <%=, <%: <%#? I seem to recall that <%# is preferred over…
DavidS
  • 2,179
  • 4
  • 26
  • 44
3
votes
3 answers

How does <%$ %> and <%# %> work in ASP.NET?

I was using ASP.NET Web Forms and ASP.NET MVC for some period of time. So <%= %> in views mean Response.Write(), <%: %> introduced in MVC adds html escaping. In SqlDataSource control designer generates something like this ConnectionString="<%$…
Oybek
  • 7,016
  • 5
  • 29
  • 49
3
votes
2 answers

foreach GetEnumerator error when converting to Razor syntax

I'm currently in the process of converting the MVC 2 portion of a hybrid Web Forms/MVC 2 application to MVC 3 (I'm not familiar with Web Forms or MVC 2) and have been encountering some problems with some of the foreach statements (which work fine in…
SCS
  • 639
  • 1
  • 8
  • 18
3
votes
3 answers

Choice of View Engines in MVC4?

I am developing a mobile application using ASP.Net MVC4.0, JQuery Mobile, HTML5. As I am new to ASP.Net MVC, I am not sure whether to use Razor(.cshtml) or webForm(.aspx) view engine. Can anyone suggest which view engine I can use to develop a…
2
votes
1 answer

HttpHandler for Asp.NET MVC application

For general ASP.NET WebForms applications, the web page derives from Page class which implements IHttpHandler that servers actual web request. In ASP.NET MVC the webpage base class is System.Web.Mvc.ViewPage that also derives from Page class which…
ram
  • 21
  • 1
  • 2
1
vote
2 answers

ASP.net MVC 3 can i replace all <%= in my views with <%:?

i have an MVC 3 site using asp.net 4 in my views i have used <%= for outputting data. reading this post by phil haack -> http://haacked.com/archive/2009/09/25/html-encoding-code-nuggets.aspx He suggests that <%= should be a distant memory, as long…
JGilmartin
  • 8,683
  • 14
  • 66
  • 85
1
vote
3 answers

Theme support for ASP.NET MVC 1, getting view masters name

currently I'm developing on an older ASP.NET MVC 1 Application, to add theme support. I've looked around the web and was able to build my own ViewEngine which works quit nice so far. Only one problem is banging my had. I've overwritten following…
yan.kun
  • 6,820
  • 2
  • 29
  • 38
1
vote
1 answer

What is the correct syntax to render an HTML img tag in ASP.NET MVC 2?

Upload Profile Pic" /> UPDATE: Also, when we write this syntax, visual studio underlines several elements of our html code with curly red lines just like when we have some syntax errors and it…
1
2 3