469,307 Members | 2,075 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,307 developers. It's quick & easy.

accessing server control properties from client

Hi,

I have a databound dropdown filled with data.
The text value is a file path that I want to use to open that file in
a new browser window.

I can do this with a html dropdown because I can access
the properties of that control from javascript.

document.form.mydd.value

put that in a variable and open a new window
How to do this with a server control type drop down?? It's properties
don't seem to be available in clientside js.

Help.
Nov 18 '05 #1
2 1118
Run your page. Then, got into View Source in the browser. You'll see specifically how that control was rendered, ie. exactly how it appears in the HTML document. From that, you should be able to figure out how to address it from script. As you may know, this involves the DHTML:

http://msdn.microsoft.com/library/de...de/list/ie.asp
Nov 18 '05 #2
Hi,
I would suggest an another approach: define a global JavaScript variable and
assign the value from the server side code. If you're using an object that
for instance resides in some user control, you'll get the full Client-side
id of the object with OBJECT.ClientID property. To assign value to
javascript variable I'd do something like RegisterScriptBlock and run
document.getElementById on the .ClientID property. A bit messy, but works
100%, and doesn't metter if you have UC or you don't.

--
With the best wishes,
Shaul Feldman
"Rich" <an*******@discussions.microsoft.com> wrote in message
news:DD**********************************@microsof t.com...
Run your page. Then, got into View Source in the browser. You'll see specifically how that control was rendered, ie. exactly how it appears in
the HTML document. From that, you should be able to figure out how to
address it from script. As you may know, this involves the DHTML:
http://msdn.microsoft.com/library/de...de/list/ie.asp

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Daniel Corbett | last post: by
5 posts views Thread by serge calderara | last post: by
6 posts views Thread by evandelagrammaticas | last post: by
3 posts views Thread by Nathan Sokalski | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.