asp.net dynamic hyperlink

R

Rob Rogers

I am old programmer, but this asp.net stuff throws me for a loop.

I have an asp.net page that I need to create a dynamic hyperlink from
based on the user selection from the drop down list and whatever they
enter in the textbox. I have hardcoded ?St=Ok?City=Tyler but I need
the info to come from the drop down list and textbox.

Here is my code..

<%@Page Explicit="True" Language="VB" Debug="True" %>
<HTML>
<script runat="server">
Sub StartSearch(Sender As Object, E As EventArgs)

End Sub



</script>
<body>
<h1>Jump Page</h1>
<form runat="server">
<P>
Jump To:<br>
<asp:dropdownlist id="JumpTo" runat="server" autopostback="true">
<asp:listitem></asp:listitem>
<asp:listitem>AL</asp:listitem>
<asp:listitem>AK</asp:listitem>
<asp:listitem>AZ</asp:listitem>
<asp:listitem>AR</asp:listitem>
<asp:listitem>CA</asp:listitem>
<asp:listitem>CO</asp:listitem>
<asp:listitem>OK</asp:listitem>
</asp:dropdownlist></P>
<P>
<asp:TextBox id="City" runat="server"></asp:TextBox><br>
<br>
</ASP:IMAGEBUTTON>
<asp:HyperLink id="HyperLink1" runat="server" Target="mainFrame"
NavigateUrl="http://www.natltc.com/search.aspx?St=Ok?City=Tyler">HyperLink</asp:HyperLink></P>
</form>
</body>
</HTML>
************************************************************

Thanks for any help.
I will even pay someone to tell me how to do this.
I can pay with paypal or credit card, or I'll send a check or money
order.
 
C

Cor Ligthert

Rob,

Did you know that there is a newsgroup

microsoft.public.dotnet.framework.aspnet

I am sure that your question is a better place for that than this newsgroup.

Therefore probably you get a quicker answer there,

(And don't offer money, your question is as a see it not a difficult
question in that newsgroup, however I am using the language not in the way
you, as you do is more done in that newsgroup)

Cor

"Rob Rogers"
I am old programmer, but this asp.net stuff throws me for a loop.

I have an asp.net page that I need to create a dynamic hyperlink from
based on the user selection from the drop down list and whatever they
enter in the textbox. I have hardcoded ?St=Ok?City=Tyler but I need
the info to come from the drop down list and textbox.

Here is my code..

<%@Page Explicit="True" Language="VB" Debug="True" %>
<HTML>
<script runat="server">
Sub StartSearch(Sender As Object, E As EventArgs)

End Sub



</script>
<body>
<h1>Jump Page</h1>
<form runat="server">
<P>
Jump To:<br>
<asp:dropdownlist id="JumpTo" runat="server" autopostback="true">
<asp:listitem></asp:listitem>
<asp:listitem>AL</asp:listitem>
<asp:listitem>AK</asp:listitem>
<asp:listitem>AZ</asp:listitem>
<asp:listitem>AR</asp:listitem>
<asp:listitem>CA</asp:listitem>
<asp:listitem>CO</asp:listitem>
<asp:listitem>OK</asp:listitem>
</asp:dropdownlist></P>
<P>
<asp:TextBox id="City" runat="server"></asp:TextBox><br>
<br>
</ASP:IMAGEBUTTON>
<asp:HyperLink id="HyperLink1" runat="server" Target="mainFrame"
NavigateUrl="http://www.natltc.com/search.aspx?St=Ok?City=Tyler">HyperLink</
 
G

Guest

For free:)
<HTML>
<body>
<script>
function geturl()
{
var ddlist=document.getElementById("JumpTo");
var tb=document.getElementById("City");
var index=ddlist.getAttribute("SelectedIndex");
var hyplink=document.getElementById("HyperLink1");
hyplink.href="WebForm1.aspx?St="+ddlist[index].value+"&City="+tb.value;
}
</script>
<h1>Jump Page</h1>
<form runat="server">
<P>Jump To:<br>
<asp:dropdownlist id="JumpTo" runat="server" autopostback="true">
<asp:listitem></asp:listitem>
<asp:listitem Value=AL>AL</asp:listitem>
<asp:listitem Value=AK>AK</asp:listitem>
<asp:listitem Value=AZ>AZ</asp:listitem>
<asp:listitem Value=AR>AR</asp:listitem>
<asp:listitem Value=CA>CA</asp:listitem>
<asp:listitem Value=CO>CO</asp:listitem>
<asp:listitem Value=OK>OK</asp:listitem>
</asp:dropdownlist></P>
<P><asp:textbox id="City" runat="server"></asp:textbox><br>
<br>
<a id="HyperLink1" Target="_blank" onclick="geturl()" href="">HyperLink</a>
</P></form></body>
</HTML>
 

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

Top