I have an asp page with an input/text field and an anchor/href that links to an aspx page. What I want is to populate the label control on my aspx page with the value entered in the input/text field. How would I do that?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s no immediate way, with a hyperlink, to pick up values from form fields and pass them to the target of the hyperlink. You need to either:
Attach a javascript event handler to the hyperlink, rather than setting the
href=""that targets your aspx page and passes the value from the input field in the query string. You can then use Request.QueryString[“NameOfValuePassedIn”] in your aspx page to pick up the value and assign it to your label.or
Change the
<form>element in your asp page so that itsactionattribute points at the aspx page and then either add a submit button, or change your hyperlink so it again uses javascript, but this time to trigger the form to submit. You can then use Request.Form[“NameOfValuePassedIn”] in your aspx page to pick up the value and assign it to your label.