如何使用.net属性验证下拉列表 [英] HOw to validate the dropdown list using the .net properties

查看:108
本文介绍了如何使用.net属性验证下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用.net属性验证下拉列表.

HOw to validate the dropdown list using the .net properties.
on the client side without using c# code?

推荐答案

ASP.Net是服务器端技术

使用如下所示的javascript:
ASP.Net is server side technology

Use javascript as given below:
function functionName()
{
if(document.getElementById(''DropDownListID'').selectedIndex ==checkIndex)
{
    //do something;
    //if the condition is satisfied
    return true;
    //otherwise
    false;
}
}



然后在aspx页面中添加以下代码:



And in the aspx page add the following code:

    <asp:DropDownList ID="DropDownListID" runat="server" onchange="javascript:functionName();>
....
</asp:DropDownList>



希望对您有帮助



Hope this helps


这篇关于如何使用.net属性验证下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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