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
0
votes
1 answer

Method not found using Web Pages 2

I am trying to use the Microsoft Web Helpers so I can use the @Video helper. My code looks like this: @using Microsoft.Web.Helpers; @{ Layout = "~/_SiteLayout.cshtml"; Page.Title = "Home"; } @Video.Flash(path: "my_flash_video.swf", width:…
Neil Knight
  • 47,437
  • 25
  • 129
  • 188
-1
votes
1 answer

Getting data from ASP.NET Core API

I am working on Market and Financial News app.I took the API from https://www.marketaux.com/. I am trying to display the news from the site into my home page. I have created a model file and controller in ASP.NET Core web app file. In controller…
-1
votes
3 answers

detecting Download file dialog?

is there any way i could detect opening of download file dialog box on web pages like hyperlink click event occurs and download file dialog box appears.... ?? and can i edit the filename in it ...... like attaching some website name along with…
NewbieFreak
  • 325
  • 1
  • 4
  • 13
-1
votes
3 answers

Modal Pop up doesn't work

I inherited an ASP.Net WebPages with Razor project that I need to enhance. On post, I need to check to see if the user has filled out a questionnaire, and if not, pop up a dialog telling them to complete it before redirecting them to the…
Phil N DeBlanc
  • 398
  • 1
  • 13
-1
votes
2 answers

How can I use C# class and share it between 2 cshtml pages

I want to port an ASP.NET Application (.aspx) to ASP.NET Web Site [Razor v3] (.cshtml) and I'm having troubles sharing a class variable between 2 pages. Pretty easy example. If I have: public class CompactDisk { public string name; public…
Jose M Martin
  • 373
  • 1
  • 3
  • 19
-1
votes
1 answer

c# for each progress loop within the loop

I have a situation where I am looping through a c# webpages database recordset using for each record in records. Within that loop I also want to perform another do while loop so that records can be grouped together. Is it possible to increase the…
Rolf Herbert
  • 249
  • 2
  • 13
-1
votes
2 answers

How to create username on master page

I am trying to use a session variable with the username from a login to update lable at top it's master page. However, as I navigate from the login page the lable reset to the default. Can someone explain hot to keep it on the page. And if this…
Kefash
  • 523
  • 2
  • 10
  • 24
-1
votes
2 answers

Tracing a NullReferenceException

This is for a simple web UI. A form that allows the user to create a new marker. It worked with Validation yesterday, but appears to have stopped today. It now throws a NullReferenceException at a certain point. Commenting out the reference…
Hecatonchires
  • 1,009
  • 4
  • 13
  • 42
-1
votes
1 answer

ASP.NET Webforms - ValidationSummary show distinct errors

When I am using ValidationSummary to validate my page if I have duplicate errors my validation will show all this errors. I want to display a distinct list of errors. I think that the best approach is to ovverride an event. But I don't know what…
POIR
  • 3,110
  • 9
  • 32
  • 48
-1
votes
1 answer

Is all the code in one page ? How webpages work?

When using razor syntax in asp.net webpages On top of the index (or the default or what ever is the start) I can put some razor code that start with @{ }. I have 2 or 3 classes in another folder, they have some methods that I will need for my web…
shark6552
  • 101
  • 1
  • 2
  • 12
-1
votes
1 answer

How to get my params value with a & in the URL?

www.myurl.com?param1=123¶m2=456 OK www.myurl.com?param1=123&param2=456 NOT OK In my vb code behind, with the second URL, I get the value of param1 only. Me.Page.Request("param1") : value OK Me.Page.Request("param2") : value 0
Llm
  • 147
  • 4
  • 9
-1
votes
3 answers

Change WebGrid cell into textbox form

I have a dataset and I'm required to display it in a Web Application. Here is what the dataset looks like: Point_ID Project No. Project Manager Comments A007 1304 Oscar Duran Found destroyed A008 1304 …
Oscar Duran
  • 117
  • 2
  • 14
-1
votes
2 answers

What's new in WebPages and Razor 3.1.2

Can't find information about v3.1.2 Look for on https://aspnetwebstack.codeplex.com/ Any known? Thx
-2
votes
2 answers

'Incorrect syntax near '.'.'

TextBox txtStatus = GridView1.Rows[e.RowIndex].FindControl("TextBox6") as TextBox; string strcn = ConfigurationManager.ConnectionStrings["dbconnection"].ConnectionString; SqlConnection con = new SqlConnection( strcn); …
-2
votes
2 answers

How to insert into table asp.net C#

I am trying to insert values from registration page into a table login_tbl: SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["RegistrationConnectionString"].ConnectionString); conn.Open(); string insertQ = "INSERT INTO…
1 2 3
29
30