标题:错误,当前上下文中不存在名称“True”
取消只看楼主
t或流痕
Rank: 1
来 自:雷州
等 级:新手上路
帖 子:6
专家分:0
注 册:2010-11-24
结帖率:0
 问题点数:0 回复次数:0 
错误,当前上下文中不存在名称“True”
是有关RequiredFieldValitor控件的使用的,刚自学的,想不出怎么解决,各位帮帮忙拉
<%@ Page Language="C#" %>
<script language="C#" runat="server"></script>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.

<script runat="server">

    protected void ValidateBtn_Click(object sender, EventArgs e)
    {
         if(Page.IsValid ==True)
         {
             Response.Write("ID:"+yourID.Text+"&nbsp;&nbsp;&nbsp;Email:"+yourEmail.Text );
         }

    }
</script>

<html xmlns="http://www. >
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        ID:<asp:TextBox ID="yourID" runat="server"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1"
         runat="server" ControlToValidate="yourID"
            ErrorMessage="RequiredFieldValidator"  Width="100%">请输入ID!</asp:RequiredFieldValidator><br />
        Imail:<asp:TextBox ID="yourEmail" runat="server"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2"
         runat="server" ControlToValidate="yourEmail"
            ErrorMessage="RequiredFieldValidator" Width="100%">请输入Email!</asp:RequiredFieldValidator><br />
        <asp:Button ID="Button1" runat="server" OnClick="ValidateBtn_Click" Text="提交" /></div>
    </form>
</body>
</html>
      
搜索更多相关主题的帖子: True 名称 
2010-11-26 16:49



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-326983-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.366320 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved