CallJavaScriptFunctionFromEvent

  • Thread starter Thread starter gh
  • Start date Start date
G

gh

I have a js function that open a new window
function addVendor()
{

window.open('TVendor.aspx','new','height=300, width=300, status=
no,resizable= yes, scrollbars=yes, toolbar=no, menubar=no');


}

I have a webcontroldropdownlistbox that has a selection for adding
vendors. In the selectedindexchanged event of the dropdownlist I check
to see if the index = 1 and if it is I want to call addVendor(); I am
not sure how to do this. How do I call the js function from the event?


TIA
 
Hi,
Use htmlSelect control instead of webcontrol drop downlist. In the code
behind file add attribute to this HtmlSelect control that calls this
function.

For e.g.:
HtmlSelect temp = new HtmlSelect();
temp.Attributes.Add("onchange","addVendor()");

HTH,
Regards,
Angrez
 

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

Back
Top