setting Onclick and setting the ClientID in behind code isn't working in Mozilla

D

davidr

Hi,

I have in my behind code a user control with the following in Page
Load:

this.btn.Attributes.Add("onclick", "SetDivder(" +
this.divContainer.ClientID + ");");

In Internet Explorer I can press the button of the usr control and use
the object that is pass to the javascript function. In Mozilla, when I
click the button nothing happens.
For Mozilla if I remove the "this.divContainer.ClientID" and replace
it with"null" or just pass no parameters to the javascript function I
am then able to do alert('test'), but if I pass in at all
"this.divContainer.ClientID" to the javascript function the
alter('test'); will never fire. Is there a reason why you can't
predefine an object or what is being passed into the javascript
function in Mozilla, but can in Internet Explorere? Also, I have my
javascript function declared one time in the main.aspx page, so
dropping mutliple user controls on the same page will not create
multiple defintions of the javascipt function:

function SetDivder() //doesn't work if you put SetDivider(obj) and
pass in ClientID
{
alert('test')
}

Thanks,

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top