473,320 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

CallJavaScriptFunctionFromEvent

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
Nov 19 '05 #1
1 849
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

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.