Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Attributes to controls

Status
Not open for further replies.

checkai

Programmer
Jan 17, 2003
1,629
US
Where do I find the list of attributes that I can add to a certain type of control...Specifically, I want to add an attribute to a listbox when an item has been selected...


Thanks,
DLC
 
I don't know about other developers but I need more information about what you are trying to do to be able to help you..

Try giving a fuller description of what you are trying to achieve..

Cheers
Greg
 
i think pretty much, when you are adding attributes, you are adding standard html attributes for how that control renders in html, for example, ifyou have a textbox, its renders as <input type=text>, so whatever html attributes apply to that, ie, onchange,onclick, etc, are what you can use.
 
You've got it exactly gagz. Though Javascript and other client side scripts also work. Any attribute that you can add to a regular html tag you can add to the server control's attribute property

That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
And just in case you meant the server side events (which are called events, not attributes...hence you may/may not have been intending this...anyway...)

In visual studio .net, go to the code view. There will be two drop down lists: one containing a list of controls on that page. When you select it, the drop list next to it will repopulate with all the events associated with that control (i.e. indexchanged, click, etc.).

Keep in mind that if you want your list box to execute server side events, you need to set its autopostback property to true.

hth

D'Arcy
 
D
just to note that only works in VB.NET. In C# you click the events button at the top of the properies window(looks like a lightning bolt). This will give you all the events that that paticular control can handle.

That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
I am using javascript and I want to add an attribute to a list box...when it is &quot;onselection&quot; or something like that but I am unaware of what the attribute would be...

thanks,

DLC
 
Not sure myself but has a listing of all javascript properties objects and what not. Very useful.

That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top