Questions tagged [asp.net-webpages]

ASP.NET Web Pages is a page-centric lightweight development framework from Microsoft for building dynamic web sites.

ASP.NET Web Pages is the third web development model released by Microsoft after ASP.NET Web Forms and the ASP.NET MVC framework. Web Pages saw the introduction of Razor, a template syntax that enables the embedding of server-side code (C# or VB) within HTML markup. In this respect, the Web Pages framework offers a similar web development experience as that provided by PHP, classic ASP and other scripting technologies. This is deliberate, as the Web Pages framework is designed primarily to attract classic ASP and PHP developers to the ASP.NET stack - offering a "low concept count" introduction to ASP.NET.

Web Pages are developed using .cshtml (C#) or .vbhtml (VB) files. Typically, a file represents a page in a web site and will contain both the server-side code to manage the programming logic, and the HTML, CSS and JavaScript to be rendered to the browser.

Web Pages supports a template system based on layout files and the ability to dynamically include the contents of other files within a parent file at runtime. Web Pages also introduces a simple data access technology - the Database helper - based on the C# 4.0 dynamic type.

Despite the emphasis on simplicity, the Web Pages framework provides developers access to the entire .NET framework, enabling development of complex web sites.

More information at http://www.asp.net/web-pages

441 questions
82
votes
9 answers

InvalidCastException is thrown after installing ASP.NET MVC 4 Beta

I get the following exception after installing ASP.NET MVC 4 Beta on a machine with ASP.NET MVC 3. System.InvalidCastException was unhandled by user code Message=[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast …
Nikos Baxevanis
  • 10,868
  • 2
  • 46
  • 80
68
votes
11 answers

Win32Exception (0x80004005): The wait operation timed out

I'm running an ASP.NET Web Pages page that upon initial load pulls a list of items from a SQL server. This query runs in a second or so and loads the page within 2 seconds. The return is about a 1000 records, give or take. I'm pulling Hostnames from…
Bolson32
  • 793
  • 1
  • 5
  • 7
49
votes
3 answers

Conflicting versions of ASP.NET Web Pages detected: specified version is "1.0.0.0", but the version in bin is "2.0.0.0"

This error appears after updating ASP.NET Web Helpers Library today to version 2.0 which was apparently released today. I updated by mistake, however would like to resolve this now, if possible. Conflicting versions of ASP.NET Web Pages detected:…
mare
  • 13,033
  • 24
  • 102
  • 191
37
votes
9 answers

Razor Host Factory error

I get a MvcWebRazorHostFactory error trying to run my app, but it's not an MVC app at all. I have the following web packages installed via nuget: Microsoft ASP.NET Razor Microsoft ASP.NET Web API 2.1 Microsoft ASP.NET Web Pages My app is angularjs…
Ryan Langton
  • 6,294
  • 15
  • 53
  • 103
33
votes
3 answers

Conflicting versions of ASP.NET Web Pages detected: specified version is "1.0.0.0", but the version in bin is "2.0.0.0" in ASP.MET MVC 3

I am getting the following error after installing microsoft web helper: Conflicting versions of ASP.NET Web Pages detected: specified version is "1.0.0.0", but the version in bin is "2.0.0.0". To continue, remove files from the application's bin…
jpo
  • 3,959
  • 20
  • 59
  • 102
23
votes
5 answers

Build Errors - 'System.Web.Mvc.ModelClientValidationRule' Conflicts

I am trying to 'build' my MVC3 web app in VS2010 however keep getting the following error: Error 2 The type 'System.Web.Mvc.ModelClientValidationRule' exists in both 'c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC…
Paul Brown
  • 4,926
  • 9
  • 32
  • 44
22
votes
3 answers

Using a Razor @functions in several webpages (.cshtml files)

I have the below function that I would like to be available to several .cshtml views in my asp.net web pages 2 application. How can I make this function available to any view in the application (as opposed to just one). @functions { public bool…
Robert
  • 1,638
  • 7
  • 34
  • 45
10
votes
7 answers

"Missing web components" error when opening MVC3 project in Visual Studio 11 Beta

When I open a solution containing an MVC3 project in Visual Studio 11 Beta, I see the following message: The Web project 'Landboss.Web' requires missing web components to run with Visual Studio. Would you like to download and install them using …
10
votes
2 answers

How can I disable/remove the WebPageHttpModule from ASP.NET 4.0 web applications?

I'm trying to get my wildcard http handler to handle *.cshtml pages but the request never reaches my handler as it looks like it's being intercepted by WebPageHttpModule that I discovered exists via this StackTrace: [HttpException (0x80004005):…
mythz
  • 141,670
  • 29
  • 246
  • 390
8
votes
2 answers

Why Is My JQuery Plugin Causing A Cannot Read Property 'length' of Undefined?

I kind of feel bad asking yet another Cannot Read Property 'length' of Undefined question, but no online (SE or otherwise) answers are in any way relating to my problem at hand. I have tried my best to narrow down why this script error is occurring…
VoidKing
  • 6,282
  • 9
  • 49
  • 81
7
votes
1 answer

_PageStart.cshtml vs _AppStart.cshtml in ASP.NET WebPages

What is the difference between _PageStart.cshtml vs _AppStart.cshtml? Can I use them interchangeably?
kazinix
  • 28,987
  • 33
  • 107
  • 157
7
votes
8 answers

Why does my img error function fail?

Some of the img elements that I am dynamically building may (do) fail. For those cases, I have some code I got from here:Is there a way to programmatically determine that an image link is bad? namely this: function getNatlBookCritics() { …
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
7
votes
3 answers

Is there an easy way to store an array into a single column in a SQL Server CE database?

I have reviewed possible answers here (for PHP, I think): http://www.lateralcode.com/store-array-database/ but I am unable to find a C#.net version of serialize/deserialize. Would this be done the same as the way shown in my link, above, or is there…
VoidKing
  • 6,282
  • 9
  • 49
  • 81
6
votes
2 answers

ASP.NET Razor web pages on large project?

I'm on the point of starting a medium scale web application and I'm considering developing using ASP.NET Razor syntax Web Pages framework (not MVC). But as I've seen many people consider "Web Pages" to be tailored towards beginners. I'm developing…
Pasman
  • 445
  • 3
  • 14
6
votes
1 answer

How can I access a single XML element's value using C#.net web-pages with WebMatrix?

I've looked at a lot of resources, done a lot of research, and tried many "best-guesses" to access a single element at a time using WebMatrix with C#, web-pages, however nothing I am trying is getting through. Consider a simple xml document that…
VoidKing
  • 6,282
  • 9
  • 49
  • 81
1
2 3
29 30