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
 
Back
Top