Solved

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

Posted on 2011-09-13
3
322 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 82

Expert Comment

by:Dave Baldwin
Comment Utility
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
Comment Utility
You can always set your TextBox's Text in code behind's Page_Load event instead.
0
 
LVL 3

Author Comment

by:dpicco
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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 demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
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…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

763 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

12 Experts available now in Live!

Get 1:1 Help Now