in Education by
I have the following HTML/ASP.NET code: Ny test Name:
<%if (Request.Form["submit"] != null) { Response.Write("<br/>"); Response.Write("Submit button pushed"); } if (Request.Form["navn"] != null && Request.Form["navn"] != "") { Response.Write("
"); Response.Write("Name OK"); } %> When using the "POST" form post method I get the following output: Submit button pushed Name OK When using the "GET" form post method NOTHING is printed out?! JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Request.Form contains information that is sent using POST. When you use GET the information will be in the Request.QueryString collection. In your case this means that Request.Form["submit"] is null. If you want to support both then you would be able to use the Request.Item collection which includes values from: Request.Cookies Request.Form Request.QueryString Request.ServerVariables However, doing this you may get some unexpected results if you use a parameter name that is used in one of the other collections.

Related questions

0 votes
    I am running aspnet_compiler as a post-build event, using the following command: aspnet_compiler.exe -v / - ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    I'm getting started with CQRS, and thought It would make the most sense to use the Command object ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    What's the best way to authenticate and track user authentication state from page to page? Some say session ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 10, 2022 in Education by JackTerrance
0 votes
    The ASP.NET application that I am currently responsible for at my day job has hit its limit in terms ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    The ASP.NET application that I am currently responsible for at my day job has hit its limit in terms ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    I have a problem where a Web Application needs to (after interaction from the user via Javascript) 1) ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 18, 2022 in Education by JackTerrance
0 votes
    I'm fairly new to Razor Components and I would like to change the title and other data inside the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 26, 2022 in Education by JackTerrance
0 votes
    I know how to use the checkboxlist in ASP.NET to display options retrieved from a database. What I ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 21, 2022 in Education by JackTerrance
0 votes
    I'm working with ASP.NET 3.5. I have a list box that users must add items to (I've written ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 12, 2022 in Education by JackTerrance
0 votes
    I write the following code to access the page but this is not working for me if (User.Identity. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    I write the following code to access the page but this is not working for me if (User.Identity. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    My thinking is that people use Docker to be sure that local environment is the same as production and that ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 12, 2022 in Education by JackTerrance
0 votes
    We create new sites in IIS 6 (Windows Server 2003) using IIS Manager. When these sites are created ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 27, 2022 in Education by JackTerrance
0 votes
    I have user control named DateTimeUC which has two textboxes on its markup: I am dynamically creating this ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 13, 2022 in Education by JackTerrance
0 votes
    I have user control named DateTimeUC which has two textboxes on its markup: I am dynamically creating this ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 13, 2022 in Education by JackTerrance
...