ASP.NET Interface Controls - Knowledge Base

« Back to Knowledge Base list

Access controls on the client-side

Q:

I have a few OboutDropDownList controls inside a Grid template.
I'm trying to access these controls on the client-side, to retrieve the selected values.
The code that I'm using (which works fine with a standard DropDownList), doesn't work with the
OboutDropDownList:
var ddl = document.getElementById('ctl00_grid1_Template1_ctl00_ddl1');

What am I doing wrong?

A:

The Obout Interface controls should be accessed on the client-side based on their IDs
(which were set on the server-side). You don't need to use the document.getElementById method.
So simply use "ddl1", instead of "document.getElementById('ctl00_grid1_Template1_ctl00_ddl1');".

See more information here:
http://www.obout.com/Interface/aspnet_ddl_client_api.aspx
http://www.obout.com/Interface/aspnet_txt_client_api.aspx

"I am absolutelly impressed with your suite that’s what makes ASP .net development really effective and fun even for an ASP .net rookie like me."

Szabolcs Apro
Software Consultant

obout.com
obout.com Home
News
Interface Controls Home 
Interface Controls Home
Download
Site Map
Examples - 55
Appearance - 1
Live Styles
Common Features - 4
Width
Enable / Disable
Different Styles New
Reset Values New
Button - 6
Default Button
PostBackUrl
Client-Side Events
Server-Side Events
Server-Side Commands
Client-Side Manipulation
Checkbox - 6 New
AutoPostBack
Linked CheckBoxes with Tri-States
Client-Side Events
Server-Side Events
Client-Side Manipulation
Linked Fields New
Dropdown List - 8
Height
MenuWidth
Multiple Rows and Columns New
AutoPostBack
Linked Fields New
Client-Side Events
Server-Side Events
Client-Side Manipulation
Image Button - 7
Enable specific states
Default Button
PostBackUrl
Client-Side Events
Server-Side Events
Server-Side Commands
Client-Side Manipulation
Radio Button - 5 New
AutoPostBack
GroupName
Client-Side Events
Server-Side Events
Client-Side Manipulation
Textbox - 11
Auto Complete
AutoPostBack New
MaxLength
MaxLength with Counter New
MaxLength with Auto Focus New
TextMode
WatermarkText
Linked Fields New
Client-Side Events
Server-Side Events
Client-Side Manipulation
Integration - 7
Cascading Dropdown Lists
With ASP.NET Validators
Inside Grid
Textbox with DatePicker
Inside User Controls New
Using ASP.NET Themes/Skins New
Create User Wizard New
Knowledge Base - 1
Knowledge Base
Documentation - 22
Server-Side
OboutButton
OboutButtonCssSettings
OboutCheckBox
OboutCheckBoxClientSideEvents
OboutCheckBoxCssSettings
OboutDropDownList
OboutDropDownListClientSideEvents
OboutDropDownListCssSettings
OboutImageButton
OboutRadioButton
OboutRadioButtonClientSideEvents
OboutRadioButtonCssSettings
OboutTextBox
OboutTextBoxClientSideEvents
OboutTextBoxCssSettings
Client-Side
OboutButton
OboutCheckBox
OboutDropDownList
OboutImageButton
OboutRadioButton
OboutTextBox
ChangeLog
Tutorials - 2
Configuration
Using the correct path
Appearance
Changing the font-size / height