Jump to content
Sign in to follow this  
Sunix

IsPost does not exist in asp.net Razor

Recommended Posts

Hi!

The tutorial  ASP.NET Web Pages - HTML Forms does not work in Visual Studio 2019.

IsPost gets error and Request[""] too.

How to solve this?

Share this post


Link to post
Share on other sites

Hi there, do you know which version of ASP.NET you're using?

The tutorials use a specific version, details below:

 

On 4/11/2019 at 9:19 AM, Funce said:

I just had a poke around. The tutorials use ASP.NET Web Pages 3.2 apparently.

Instead of ifPost (which looks like its erroring too) try


if (HttpMethods.IsPost(Request.Method))

In terms of the Request stuff, try something like this


var num1 = Request.Form["text1"];
var num2 = Request.Form["text2"];

 

 

Share this post


Link to post
Share on other sites

Ouch, Yeah you'll need to be careful here.

Make sure you check out the documentation surrounding both ASP.NET Web Pages 3.2, and ASP.NET Core 2.1 but otherwise, my quoted answer will work for you, as that was in reference to asp.net core 2.1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...