Home How do i display a variable in a <p> element after requesting the data from a POST request using razor(C#) and html
Reply: 0

How do i display a variable in a <p> element after requesting the data from a POST request using razor(C#) and html

user676
1#
user676 Published in April 22, 2018, 6:07 pm

This is the razor code

 @{
    string title = "This is the title";

    string name = "";
    if (IsPost)
    {

        name = Request["name"];
        string email = Request["email"];
        string message = Request["message"];
    }
}

so i noticed that this would work if i dont use Request["name"]; But obviously i need to get the information from my form. I want to display the 'name' in a confirmation message. I am using visual studio asp.net empty webapp

<p>@name</p>

let me know if i should include any other code, but i think this is all you need to see.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.311885 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO