在下拉特定项目中选择想要显示Modalpopup Extender [英] in dropdown particular item select want to show Modalpopup Extender

查看:58
本文介绍了在下拉特定项目中选择想要显示Modalpopup Extender的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

设计如下



课程

对于以下3个下拉列表(Exellent\Good\Poor),请参阅下拉列表。

这个课程在多大程度上有用Dropdownlist1(Exellent\Good\Poor)

设备效率在多大程度上是用户友好的Dropdownlist2(Exellent\Good\可怜)

选择我们学院的决定Dropdownlist3(Exellent\Good\Poor)



当我从下拉列表中选择穷人我想展示Modalpopup扩展器。



我的代码如下

  protected   void  Dropdownlist1_SelectedIndexChanged( object  sender,EventArgs e)
{
if (Dropdownlist1.Text.ToString()== 差)
{
ModalPopupExtender1.Show();
Pnlnegativefeedback.Visible = true ;
return ;
}
}





但是当我运行并点击Dropdownlist1时,Modalpopup扩展器已打开。但我希望Modalpopup Extender只在我从Dropdownlist1中选择穷人时打开。



来自我上面的代码有什么问题。



请帮帮我。



问候,

Narasiman P.

解决方案

改变你的状况



 if(Dropdownlist1.Text.ToString()==差)





 if(Dropdownlist1.SelectedItem.Text.ToString()==Poor)


Design as follows

Course
For the below 3 dropdownlist (Exellent\Good\Poor) are there in the dropdownlist.
To What extent was this course useful Dropdownlist1(Exellent\Good\Poor)
To What extent equipment efficiency is user friendly Dropdownlist2(Exellent\Good\Poor)
Decision to have chosen our institute Dropdownlist3(Exellent\Good\Poor)

When i choose the Poor from the dropdownlist i want to show the Modalpopup Extender.

My code as follows

protected void Dropdownlist1_SelectedIndexChanged(object sender, EventArgs e)
{
     if (Dropdownlist1.Text.ToString() == "Poor")
     {
         ModalPopupExtender1.Show();
         Pnlnegativefeedback.Visible = true;
         return;
     }
}



But when i run and click the Dropdownlist1 Modalpopup Extender is open. But i want the Modalpopup Extender to open only when i select the Poor from the Dropdownlist1.

from my above code what is the problem.

please help me.

Regards,
Narasiman P.

解决方案

Change your condition

if (Dropdownlist1.Text.ToString() == "Poor")


To

if (Dropdownlist1.SelectedItem.Text.ToString() == "Poor")


这篇关于在下拉特定项目中选择想要显示Modalpopup Extender的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆