473,322 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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 10696
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
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
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
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
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
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
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
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
by: Dominique | last post by:
Is it possible to change the size of a Dynamic Panel and fix it? Thanks, -- Dominique
1
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.