ASPX to get the HTML form value

  • Thread starter Thread starter leonlien
  • Start date Start date
L

leonlien

I am learning C# now .. so please bear with me if I don't make any sense.

I have a plain HTML form on WEB Server 1

<Form action ="ABC.aspx" method=POST id=fURL name=fURL>
<Input Type="hidden" id=AA name=AA value="TESTA">
<Input Type="hidden" id=BB name=BB value="TESTB">
</Form>

And I need a simple C# ASPX to get the TESTA, TESTB values passed from the
above form.
Can anyone shed some light on this ?
How would you use C# to get teh TESTA, TESTB values from an outside HTML
form ?

If you can provide some code for me to get start learning C#, be very
appreciated here ...

LYL797
 
First of all, you can't use the POST method, you should use the GET
method.

Then, somewhere in your ASP.NET code, usually in the PageLoad event,
you would use the following code:

string AA = Request["AA"];
string BB = Request["BB"];

And that's it basically.
 
Leonlien,

In the way you are doing it, it can when you use a serverside textbox
(instead of a HTML input control) and hide that.

Cor
 
Back
Top