400_the_cat
400_the_cat

Reputation: 883

Classic ASP/ASP.NET: How do I retrieve data from classic asp from my .net page?

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?

Upvotes: 2

Views: 748

Answers (1)

Rob
Rob

Reputation: 45771

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:

  1. 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

  2. Change the <form> element in your asp page so that its action attribute 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.

Upvotes: 4

Related Questions