473,387 Members | 1,897 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

using $find with mater pages

kpg
Hi all,

I am using the ajax.net slider control an I added a client side value
changed handler like this:

function pageLoad() {
$find('My_SliderExtender').add_valueChanged(OnValu eChange);
}

Works great.

Then I moved my slider into a content placeholder and now the $find
return null - makes sense, becuase the client id has changed.

So I tried multiple techniques to get it to work - all failed.

I tried passing the parent (the content palceholder) to the $find

$find('My_SliderExtender','Content1')
$find('My_SliderExtender',$get('Content1'))
I tried using the client id:

$find('<%= My_SliderExtender.ClientID%>')

I treid using the name observed in the generated html:

$find('ctl001$Content1$My_SliderExtender')
How do I find a control behaviour that is in a content placeholder?

Thanks,
kpg
Oct 16 '08 #1
1 1205
kpg
The answer is to use the (real) clientid of the control.

I had tried this but I did it wrong.

so if the clinetid is of the form:

ctl00_<ContentPlaceholderID>_<ControlID>

(note: replace<ContentPlaceholderIDand <ControlID>)

then this works:

var c=$find('ctl00_<ContentPlaceholderID>_<ControlID>' );

and so does this:

var c = $find(<%= myControl.ClientID%>);

Which brings up a different question.

My javascript is in an external file, so I can't use the
<%= myControl.ClientID%directive.

So I created a global javascript var in my master page body
that sets the name of the contentplaceholder prefix
like this:

var cph = 'ctl00_<ContentPlaceholderID>_<ControlID>';

I had tried this:

var cph = '<%= Content.ClientID %>';

but this gave me a syntax error.

Why can't I use the <%= %for in-line javascript
included in the <boby>?

Thanks,
kpg
Oct 16 '08 #2

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

Similar topics

12
by: Brian Henry | last post by:
I made a header control in asp.net and it references images in the /images/ folder in the virtural path's root folder... How can I get the header control to show the images at any level of the web...
2
by: Ed | last post by:
I recently added a Master page to my test site. The site was working until I did this and that stopped my pages from posting forms data to each other. Any ideas? Thanks in advance..
9
by: RBM007 | last post by:
Hello, I have created some pages in the (old) Atlas pages and migrated to AJAX version. After the update I noticed that any page containing ASP.NET AJAX won't compile anymore. Even if the same...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...

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.