Page can't find JavaScript function

G

Guest

I can't for the life of me figure out why my aspx can't find a JS function
that's in the same file. For instance, immediately after the info describing
the page and the registration of some assemblies, I have a function called
populateEntityDropdown used to populate a non-ASP combobox written entirely
in JavaScript, defined as follows:

function populateEntityDropdown() {
debugger
var x = 1; //checking to see if we can reach this spot
}

I've set the OnSelectedIndexChanged attribute of another ASP dropdown equal
to populateEntityDropdown() as
OnSelectedIndexChanged="populateEntityDropdown()". When I try to build the
site, I get an 'populateEntityDropdown' is not a member of
'ASP.CreateLetterTemplate_aspx' error.

Why won't ASP recognize my JavaScript function?
 
G

Guest

Just wanted to state that the attribute I'm using to try to tie into the
JavaScript function is actually like this -->
OnSelectedIndexChanged="populateEntityDropdown();"
 
A

Alexey Smirnov

I can't for the life of me figure out why my aspx can't find a JS function
that's in the same file. For instance, immediately after the info describing
the page and the registration of some assemblies, I have a function called
populateEntityDropdown used to populate a non-ASP combobox written entirely
in JavaScript, defined as follows:

function populateEntityDropdown() {
debugger
var x = 1; //checking to see if we can reach this spot
}

I've set the OnSelectedIndexChanged attribute of another ASP dropdown equal
to populateEntityDropdown() as
OnSelectedIndexChanged="populateEntityDropdown()". When I try to build the
site, I get an 'populateEntityDropdown' is not a member of
'ASP.CreateLetterTemplate_aspx' error.

Why won't ASP recognize my JavaScript function?

It's supposed to have server-side method.
 
A

Alexey Smirnov

Just wanted to state that the attribute I'm using to try to tie into the
JavaScript function is actually like this -->
OnSelectedIndexChanged="populateEntityDropdown();"








- Show quoted text -

It occurs when the selection from the dropdownlist changes between
posts(!) to the server.
http://msdn2.microsoft.com/en-us/li...ontrols.listcontrol.selectedindexchanged.aspx

If you want to have client event fired, use

DropDownList1.Attributes.Add("onchange","populateEntityDropdown()");
 

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

Top