Solved

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

Posted on 2011-09-13
3
323 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 49

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses four methods for overlaying images in a container on a web page
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

910 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now