Link to home
Start Free TrialLog in
Avatar of dpicco
dpiccoFlag for United States of America

asked on

passing values from asp to asp.net through an html form

Hello experts,
I have some code like this
    response.write "<td><form method=post action=/adhoc/aspnet/user_maint.aspx name=frm"&cnt&">"
    response.write "<input type=hidden value="&oRS("network_account")&" name=network_account> "
    response.write "<input type=hidden value="&request.form("lname")&" name=lname> "
    response.write "<input type=hidden value="&oRS("employee_id")&" name=employee_id> "
    response.Write "<a href=javascript:document.frm"&cnt&".submit();><b>"&oRS("fullname")&"</b></a></form></td> "

Open in new window


How do I access those hidden values inside my user_maint.aspx page? This is not working.
    <asp:TextBox ID="TextBox1" runat="server" Text=request.form("employee_id")></asp:TextBox>

Open in new window


Then how do I pass those values back to asp? There is probably a much better way to do this. Thanks.


Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

You need to make sure there is a value (other than blank) for that hidden element.  Elements without values are not sent when the form is submitted.  That's standard HTML procedure.
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dpicco

ASKER

I was able to do this in Page_Load
            Session["employee_id"] = Request.Form["employee_id"];

Is there a way to use the request.form just in the the aspx page without using the code behind?
Thanks.