Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > setting Onclick and setting the ClientID in behind code isn't working in Mozilla

Reply
Thread Tools

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

 
 
davidr@sharpesoft.com
Guest
Posts: n/a
 
      08-21-2006
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Non-code behind to code behind John ASP .Net 2 02-19-2007 07:08 PM
setting Onclick and setting the ClientID in behind code isn't working in Mozilla davidr@sharpesoft.com ASP .Net 2 08-22-2006 09:30 PM
Code behind and onclick on html table row Corno ASP .Net 2 09-05-2004 09:19 AM
[ASP. NET VB .NET] clientID and ClientID Maras ASP .Net 1 10-15-2003 02:04 PM
Re: Code Behind vs. no code behind: error Ben Miller [msft] ASP .Net 1 06-28-2003 01:46 AM



Advertisments