By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 1,012 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

asp.net dynamic hyperlink

P: n/a
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.
Jul 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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</
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.

Jul 21 '05 #2

P: n/a
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>

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.