473,952 Members | 16,200 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

best way to do this, list of urls

I have a web app that allows the user to create a list of urls. I am
currently have a textbox the user inputs the URL in one at a time and then a
button that when clicked adds the link to a dropdown list. Then for the
dropdown selected event I set the URL of a link button to the selected value
in the list.
Just wondering if you can have a dropdown list of hyperlinks? thanks!
--
Paul G
Software engineer.
Jun 27 '08 #1
4 857
(no cop-out intended here)
see the AJAX tool kit on asp.net this may give you options with out a lot of
work
--
Share The Knowledge. I need all the help I can get and so do you!
"Paul" wrote:
I have a web app that allows the user to create a list of urls. I am
currently have a textbox the user inputs the URL in one at a time and then a
button that when clicked adds the link to a dropdown list. Then for the
dropdown selected event I set the URL of a link button to the selected value
in the list.
Just wondering if you can have a dropdown list of hyperlinks? thanks!
--
Paul G
Software engineer.
Jun 27 '08 #2
Paul wrote:
Just wondering if you can have a dropdown list of hyperlinks? thanks!
No, you can't, but you can easily make the dropdown go to the selected
url (without even having to do another postback). Just add an onchange
event to the dropdown:

theDropdown.Att ributes.Add("on change",
"window.locatio n=this.options[this.selectedIn dex].value;");

--
Göran Andersson
_____
http://www.guffa.com
Jun 27 '08 #3
thanks for the information. I did not see an onchange event from the event
property box of the dropdown but did find a TextChanged event. I added the
code below and set a break point. It does hit the break point but looks like
it is not going to the page, possibly a bad URL or should this work?

protected void drdn_links_Text Changed(object sender, EventArgs e)
{
this.drdn_links .Attributes.Add ("onchange",
"window.locatio n=this.options[this.selectedIn dex].value;");
}
--
Paul G
Software engineer.
"Göran Andersson" wrote:
Paul wrote:
Just wondering if you can have a dropdown list of hyperlinks? thanks!

No, you can't, but you can easily make the dropdown go to the selected
url (without even having to do another postback). Just add an onchange
event to the dropdown:

theDropdown.Att ributes.Add("on change",
"window.locatio n=this.options[this.selectedIn dex].value;");

--
Göran Andersson
_____
http://www.guffa.com
Jun 27 '08 #4
Paul wrote:
thanks for the information. I did not see an onchange event from the event
property box of the dropdown
That's because it's not a server event. I said that it didn't do a postback.
but did find a TextChanged event. I added the
code below and set a break point. It does hit the break point but looks like
it is not going to the page, possibly a bad URL or should this work?

protected void drdn_links_Text Changed(object sender, EventArgs e)
{
this.drdn_links .Attributes.Add ("onchange",
"window.locatio n=this.options[this.selectedIn dex].value;");
}
You should not put the code in an event handler. The code adds a client
event to the control, so if you do it in an event handler, it will work
the second time that you change the dropdown.

Put the code in Page_Load.

--
Göran Andersson
_____
http://www.guffa.com
Jun 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

136
9543
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their code was littered with document.all and eval, for example, and I wanted to create a practical list of best practices that they could easily put to use. The above URL is version 1.0 (draft) that resulted. IMO, it is not a replacement for the FAQ,...
1
1252
by: Martin Zachs | last post by:
I'm new to ASP.NET, but 5+ years experienced with conventional ASP. We currently use "non-isolated" development using Frontpage Extensions for lots of websites (100+). To move to ASP.NET, I've read the numerous documents on .NET Team development at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/tdlg_ch3.asp, and think that Isolated development is the best solution for us (using VSS for source control).
6
19281
by: sjoshi | last post by:
I have a derived class OraBackup which has a method that calls stored procedure on Oracledb to get status of backup job. Now the base class publishes an event like this: public delegate void PercentEventHandler(object sender, JobCompletedEventArgs e); public event PercentEventHandler PercentCompleted; And fires it:
5
2720
by: GenCode | last post by:
What is the best way to read a "readable" web directory... I know I can do this Client.DownloadFile("http://www.mydomain.com/readabledir/", c:\ \dir.txt"); But that gives me the html and all the other tags...all I want is a directory listing of all the *.gif in this dir and not all the html Now I know I can parse the html to get the gif file names...but I
0
10176
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9999
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11608
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11209
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11381
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10706
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9917
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6363
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4562
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.