Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2011-09-13
3
Medium Priority
?
332 Views
Last Modified: 2012-05-12
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.


0
Comment
Question by:dpicco
3 Comments
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 36533607
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.
0
 
LVL 54

Accepted Solution

by:
Ryan Chong earned 2000 total points
ID: 36535143
You can always set your TextBox's Text in code behind's Page_Load event instead.
0
 
LVL 3

Author Comment

by:dpicco
ID: 36535264
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.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question