473,491 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

asp.net dynamic hyperlink

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
2 10701
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2539
by: Dave Williamson | last post by:
When a ASPX page is created with dynamic controls based on what the user is doing the programmer must recreate the dynamic controls again on PostBack in the Page_Load so that it's events are wired...
1
2259
by: Gerald Baeck | last post by:
I want to realize a dynamic hyperlink, which changes onclick it's text and it's navigateurl. Unfortunately there is no event for a hyperlink like onclick for buttons. Is there another way to...
2
2246
by: Jason | last post by:
I have a data grid with a hyperlink column. The hyperlink is created by a class that extracts the link from an XML Document. How can I populate the hyperlink column in the data grid with the...
4
4135
by: EvelynAnd Ethan | last post by:
Hi, ItemCommand event not firing from a dynamic user control ,WHERE A DATAGRID HAS BUTTON,when i click on the linkbutton first time the itemcommand event doesnt fire,second time event fires up ...
2
375
by: Rob Rogers | last post by:
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...
3
12340
by: sloesch | last post by:
I am working with VS.net 2003, framework 1.1, developing with VB.net, and ASP.net, and I would like to know how you can create a dynamic hyperlink on the fly to a document stored in a SQL database?...
1
2612
by: sweetpotatop | last post by:
Hello, I would like to create dynamic hyperlinks in a web page when it is first loaded by using ASP.NET. Basically there will be a list of documents in a folder and I will list them all as a...
2
1668
by: Dominique | last post by:
Is it possible to change the size of a Dynamic Panel and fix it? Thanks, -- Dominique
1
2020
by: mitramay | last post by:
I am creating a dynamic datagrid. The controls in some of the template columns will have to be generated based on the data contained in them (i.e. the data for that respective DataField column)....
0
7115
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6978
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7154
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6858
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5451
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3086
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.