dr_csharp
یک شنبه 29 اردیبهشت 1387, 08:40 صبح
سلام
چطور میتونم در VS2008 با javascript آیتم انتخاب شده ازDropDownList رو تشخیص بدم ؟
تو 2005 با کد زیر براحتی اینکار انجام میشه ولی تو 2008 جواب نمیده :
for (int i = 0; i < DropDownList1.Items.Count; i++)
{
DropDownList1.Items[i].Attributes.Add("id", i.ToString());
DropDownList1.Items[i].Attributes.Add("OnClick", "alert(id);");
}
چطور میتونم در VS2008 با javascript آیتم انتخاب شده ازDropDownList رو تشخیص بدم ؟
تو 2005 با کد زیر براحتی اینکار انجام میشه ولی تو 2008 جواب نمیده :
for (int i = 0; i < DropDownList1.Items.Count; i++)
{
DropDownList1.Items[i].Attributes.Add("id", i.ToString());
DropDownList1.Items[i].Attributes.Add("OnClick", "alert(id);");
}