passing Hyperlink parameter

S

susie

I need to pass user entered information from textbox in
order to retrive id.
The following is the code I used to pass the information
to commercial.aspx page.

<asp:hyperlink
navigationurl="http://myserver/commericial.aspx?id=<%
=textbox.text%>" runat=server/>

When I retrieve id information from commercial.aspx,I got
a blank screen, which means that the user input was not
passed.

What is the correct syntex for
<asp:hyperlink
navigationurl="http://myserver/commericial.aspx?id=<%
=textbox.text%>" runat=server/>?

Thank you very much!
 
B

Bin Song

<asp:hyperlink id="hyperlink1"
navigationurl="http://myserver/commericial.aspx?id=<%
=textbox.text%>" runat=server/>
is rendered before any user interaction.
You could try getting around this either by client side or
server side:
Client side(Javascript) in onblur event of textbox:
hyperlink1.href = "http://myserver/commericial.aspx?id=" +
textbox.value;
Server Side(VB) in textchange event of textbox:
hyperlink1.NavigateUrl = "http://myserver/commericial.aspx?
id=" & textbox.Text

Bin Song, MCP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,162
Latest member
GertrudeMa
Top