473,666 Members | 2,082 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dropdownlist onchange squiggly

hey all,

<asp:DropDownLi st id="DropDownLis t1" runat="server" onchange="Test( );">

can someone please tell me why the onchange has a squiggly and if there is a
better way to access the client-side change event for the drop-down list?

The message is saying it's not a valid attribute of the drop down list
element but yet it still works for me?

thanks,
rodchar
Oct 11 '07 #1
4 2576
Hello rodchar
<asp:DropDownLi st id="DropDownLis t1" runat="server" onchange="Test( );">

can someone please tell me why the onchange has a squiggly and if there is
a
better way to access the client-side change event for the drop-down list?
The message is saying it's not a valid attribute of the drop down list
element but yet it still works for me?
Yes, you catch this message, but looked to the rendered code too?
The point is:
All attributes where not available in the control, throw such a message.
But ASP.NET do render all that attributes AS-IS to the Html Code.
In this point, this is not a fail in any case, but rather a possible
improvement for a future version of Visual Studio :-)

Another way to add "custom" attributes to your control is wrote them in your
codebeside like:
---------
this.dropTest.A ttributes.Add(" onchange", "foo(this.value );");
---------

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET
Oct 11 '07 #2
this.dropTest.A ttributes.Add(" onchange", "foo(this.value );");
what's the best way to find all the possible client-side events for any
control?

"Peter Bucher [MVP]" wrote:
Hello rodchar
<asp:DropDownLi st id="DropDownLis t1" runat="server" onchange="Test( );">

can someone please tell me why the onchange has a squiggly and if there is
a
better way to access the client-side change event for the drop-down list?
The message is saying it's not a valid attribute of the drop down list
element but yet it still works for me?
Yes, you catch this message, but looked to the rendered code too?
The point is:
All attributes where not available in the control, throw such a message.
But ASP.NET do render all that attributes AS-IS to the Html Code.
In this point, this is not a fail in any case, but rather a possible
improvement for a future version of Visual Studio :-)

Another way to add "custom" attributes to your control is wrote them in your
codebeside like:
---------
this.dropTest.A ttributes.Add(" onchange", "foo(this.value );");
---------

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET
Oct 11 '07 #3
Hello rodchar
what's the best way to find all the possible client-side events for any
control?
surfing around :-)
- http://de.selfhtml.org/javascript/sp...r.htm#onchange

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET
Oct 11 '07 #4
Thanks Peter, I appreciate the dialog which helped.
rod.

"Peter Bucher [MVP]" wrote:
Hello rodchar
what's the best way to find all the possible client-side events for any
control?
surfing around :-)
- http://de.selfhtml.org/javascript/sp...r.htm#onchange

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET
Oct 11 '07 #5

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

Similar topics

5
2075
by: Bob N | last post by:
I have an ASP.NET web page -- several auto-post back DropDownLists that perform a query against a relatively large database (3 to 4 seconds delay) that repopulate a couple of datagrids, comboboxes and a chart (using dotnetCharting control) on the same page. This works just fine on its own. However, when I integrated the page into the rest of the site, it is then placed inside a frameset. Again, the page seems to work fine EXCEPT under the...
1
1018
by: chongo | last post by:
Hi, I'm a newbie to asp.net. Actually i'm working on my first page now. I have a drop list <asp:DropDownList id="menu" AutoPostBack="True" OnSelectedIndexChanged="onChange" runat="server"> The problem that I am having is when I call my onChange Method, the dropdown list selects the proper index but overides the selected value to 0.
7
6176
by: Daniel | last post by:
Is there any other way can override this event, like javascript onchange added to the attribute of this dropdownlist? Thanks
6
5527
by: Julius Fenata | last post by:
Dear all, I have created client-side scripting to trigger event onChange from code-behind, like this: DropDownList1.Attributes = "GenerateArticleID()"; At the script on Windows Form, I added this function to have the value of DropDownList1
5
13043
by: robert | last post by:
I have a dropdownlist with the autopostback set to true. I want the user to be confirm whether they do indeed want to change the value, which on post back fires a server side event (selectedindexchanged). I have tried adding an onchange attribute "return confirm('sure u wanna change this?';") but it will not postback regardless of the confirm result and the value in the list does not revert back if cancel selected. Is there a solution?
3
6567
by: =?Utf-8?B?RGVlcGE=?= | last post by:
Hi All, I have a webform in asp.net framework 1.1 where the dropdownlist is populated with list of locations from the database. The depending on the list selected, the user will be able to see functions associated for that location. Ex: Location: Charleston Functions: Add, Delete, Cancel, Edit Location: Los Angeles
3
12247
by: John Kotuby | last post by:
Hi all... I am trying to do a simple thing and maybe am missing something elementary. I have created a Javascript function at the top of a page which is meant to enable editing of an HTML input textbox when the user makes a selection from the DropDownList control. Since there is no OnClick event I have tried using OnSelectedIndexChanged or OnTextChanged such as OnTextChanged ="ckCat()" with ckCat being the javascript function name. I...
11
4460
by: harold.gimenez | last post by:
Hi group, I am trying to change the selection of an ASP Dropdownlist just like "Orange" is selected here: http://www.w3schools.com/js/tryit.asp?filename=try_dom_option_selected The following works fine on IE: document.getElementById('dropdown').options.selected = 0 //
3
3828
by: =?Utf-8?B?Y21lZWsxXzE5OTk=?= | last post by:
Hello, On a webpage, create an UpdatePanel with two DropDownLists. Set AutoPostBack of DropDownList1 to true. In the SelectedIndexChanged method, refill DropDownList2 and set the focus to DropDownList1 using the ScriptManager SetFocus method. Use the Visual Studio debugger. Set a breakpoint on in the (!IsPostBack) part of the PageLoad method. Start the web application and continue after the breakpoint has been reached.
0
8449
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
8876
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
8784
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
8556
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
8642
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
7387
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
5666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2011
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.