Solved

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

Posted on 2011-09-13
3
325 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 83

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 50

Accepted Solution

by:
Ryan Chong earned 500 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
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…

809 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