This is a migrated thread and some comments may be shown as answers.

external javascript file

1 Answer 85 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
glenn
Top achievements
Rank 1
glenn asked on 22 Jul 2008, 01:03 PM
Hi,

I'm extending the radcombobox. When i add a javascript in my class there is no problem:
public CheckedComboBox() 
    OnClientDropDownClosing = "DropDownClosingEventHandler"
 
protected override void OnPreRender(EventArgs e) 
   string script = @"function DropDownClosingEventHandler(){alert(""test"");}"    
   Page.ClientScript.RegisterClientScriptBlock("DropDownClosingEventHandler", script, true); 
}             
 This way, my script is called.

But when i place the script in an external .js file, the combobox stays closed when clicked.

protected override void OnPreRender(EventArgs e)  
{  
    string path = ResolveClientUrl("CheckedComboBox.js");  
    ScriptManager.RegisterClientScriptInclude(this.Page,  
                getType(),"DropDownClosingEventHandler", path);  
    base.OnPreRender();  
}  
and the CheckedComboBox.js file:

function DropDownClosingEventHandler(sender, args) 
 {   
        alert("test");   
 }   

what am i doing wrong???

thx in advance,
Glenn

1 Answer, 1 is accepted

Sort by
0
glenn
Top achievements
Rank 1
answered on 22 Jul 2008, 04:29 PM
already solved. js was placed in an other library
Tags
ComboBox
Asked by
glenn
Top achievements
Rank 1
Answers by
glenn
Top achievements
Rank 1
Share this question
or