All the examples I can find are in Visual Basic, but I am using C#.
I want to get the data that is in a textbox in a form.
My code so far:
<form action="login.aspx" method="get">
<p>Username: <input type="text" name="username" /></p>
<p>Password: <input type="text" name="password" /></p>
<input type="submit" value="Submit" />
</form>
So what could I do? Because I keep getting told to do this:
Dim UserName
UserName = Request.Form("UserName")
But it doesn’t work in C#.
The sample code you posted is vb.net. C# has it’s own syntax and keywords.
to get the value you can use the following (not an optimal solution for webforms)
I would suggest going through some c# tutorials to get a handle on the language. Here’s the first one i found http://www.csharp-station.com/Tutorial.aspx