Sending html page values to ASP page

M

Mark

Hi Gurus,
I am pretty new in ASP.net, so please help me solve a problem.
We have many HTML pages which we do not want to change.

What we want is on a button press it should goto a ASP page with all the
values.

I'll appreciate if I get some source example which I can try.

Please help me.
Mark
 
M

Mark

Thanks for your reply.
I have created an test example to clarify.

On this form I have one input textbox and one Submit button. On submit I
want to process the data(Text1) in Validate.aspx.vb.
<form action ="../Validate.aspx" method ="post" >
<input id="Text1" type="text" /><br />
<br />
<input id="Submit1" type="submit" value="submit" />
</form>
</body>

But when code reaches Validate Page_Load event, then Request.Form.Count
returns 0, when I am expecting Text1 value.

Public Partial Class Validate
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Request.Form.Count > 0 Then
Me.TextBox1.Text = Request.Form("Text1")
End If
End Sub
End Class

Tell me what am I doing wrong.
Thanks, Mark
 
M

Mark

Guys,
It started working when I replaced ID with Name.
<input NAME="Text1" type="text" />

Thanks guys for your help.
Mark


Mark said:
Thanks for your reply.
I have created an test example to clarify.

On this form I have one input textbox and one Submit button. On submit I
want to process the data(Text1) in Validate.aspx.vb.
<form action ="../Validate.aspx" method ="post" >
<input id="Text1" type="text" /><br />
<br />
<input id="Submit1" type="submit" value="submit" />
</form>
</body>

But when code reaches Validate Page_Load event, then Request.Form.Count
returns 0, when I am expecting Text1 value.

Public Partial Class Validate
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Request.Form.Count > 0 Then
Me.TextBox1.Text = Request.Form("Text1")
End If
End Sub
End Class

Tell me what am I doing wrong.
Thanks, Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top