3.2Page.IsValid

Page.IsValid

设置Display属性
Static
Dynamic
None

<span id="reqProductName" style="color:Red;Visibility:hidden;">(Required) </span>
<span id="reqProductName" style="color:Red;display:none;">(Required) </span>
Visibility和display都能隐藏文本但是visibility属性隐藏文本仍然会占用屏幕空间,display不占屏幕空间。

通常情况下,应当将验证控件的Display属性设置为Dynamic,不会将内容推到右边。

突出显示验证错误
<asp:RequiredFieldValidator ID="reqProductQuantity" ControlToValidate="txtProductQuantity"
Text="<img src='error.gif' alt='Fist name is required.'/>" Display="Dynamic" runat="server" />

SetFocusOnError="true"
<asp:RequiredFieldValidator ID="reqProductQuantity" ControlToValidate="txtProductQuantity"
Text="<img src='error.gif' alt='Fist name is required.'/>"
setFocusOnError="true"
Display="Dynamic" runat="server" />


<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

protected void btnLogin_Click(object sender, EventArgs e)
{
if (Page.IsValid)
lblLoginResult.Text = "Log in sucessful!";

}

protected void btnRegister_Click(object sender, EventArgs e)
{
if (Page.IsValid)
lblRegisterResult.Text = "Registration sucessful!";
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<style type="text/css">
html
{
background-color:Silver;
}
.column
{
float:left;
width:300px;
margin-left:10px;
background-color:White;
border:solid 1px black;
padding:10px;

}
</style>
<title>Show Validation Groups</title>
</head>
<body>
<form id="form1" runat="server">
<div class="column">
<fieldset>
<legend>Login</legend>
<p>
Please log in to our Website.
</p>
<asp:Label ID="lblUserName"
Text="User Name:"
AssociatedControlID="txtUserName" runat="server"></asp:Label>
<br />
<asp:TextBox ID="txtUserName" runat="server" />
<asp:RequiredFieldValidator ID="reqUserName"
ControlToValidate="txtUserName" Text="(Required)" ValidationGroup="LoginGroup" runat="server" />
<br /><br />
<asp:Label ID="lblPassword" Text="Password:" AssociatedControlID="txtPassword" runat="server" />
<br />
<asp:TextBox ID="txtPassword" TextMode="Password" runat="server" />
<asp:RequiredFieldValidator ID="reqPassword" ControlToValidate="txtPassword" Text="(Required)"
ValidationGroup="LoginGroup" Runat="server"/>
<br /><br />
<asp:Button ID="btnLogin" Text="Login" ValidationGroup="LoginGroup" runat="server" OnClick="btnLogin_Click" />

</fieldset>
<asp:Label ID="lblLoginResult" runat="server" />
</div>
<div class="column">
<fieldset>
<legend>Register</legend>
<p>If you do not have a User Name,please register at our WebSite.</p>
<asp:Label ID="lblFirstName" Text="First Name:"
AssociatedControlID="txtFirstName" runat="server" />
<br />
<asp:TextBox ID="txtFirstName" runat="server" />
<asp:RequiredFieldValidator ID="reqFirstName" ControlToValidate="txtFirstName"
Text="(Required)" ValidationGroup="RigsterGroup" runat="server" />
<br /><br />
<asp:Label ID="lblLastName" Text="Last Name:"
AssociatedControlID="txtLastName" runat="server" />
<br />
<asp:TextBox ID="txtLastName" runat="server" />
<asp:RequiredFieldValidator ID="reqLastName" ControlToValidate="txtLastName"
Text="(Required)" ValidationGroup="RigsterGroup" runat="server" />
<br /><br />
<asp:Button ID="btnRegister" Text="Register" ValidationGroup="RigsterGroup" runat="server" OnClick="btnRegister_Click" />
</fieldset>
<asp:Label ID="lblRegisterResult" runat="server" />
</div>
</form>
</body>
</html>

2011-4-26 11:32 danny
Standard SPI Mode Standard SPI mode is selected when the Mode option in the Vivado IDE is set to Standard. The relevant parameters in this mode are: • Mode • Enable STARTUPE2 Primitive • Transaction Width • No. of Slaves • Frequency Ratio Send Feedback AXI Quad SPI v3.2 7 PG153 April 4, 2018 www.xilinx.com Chapter 1: Overview • Enable FIFO The properties of the core in standard SPI mode, including or excluding a FIFO, are described as: • The choice of inclusion of FIFO is based on the Enable FIFO parameter. FIFO Depth parameter is linked to Enable FIFO parameter. FIFO Depth limits the transmit and receive FIFO depth to 16 or 256 when FIFO is enabled. When FIFO is not enabled, the value of FIFO depth parameter is considered to be 0. A FIFO depth of 256 should be used because this is the most suitable depth in relation to the flash memory page size. • The valid values for the FIFO Depth option in this mode are 16 or 256 when FIFO is enabled through Enable FIFO parameter. When Enable FIFO is 0 and no FIFO is included in the core. Data transmission occurs through the single transmit and receive register. When FIFO Depth is 16 or 256, the transmit or receive FIFO is included in the design with a depth of 16 or 256 elements. The width of the transmit and receive FIFO is configured with the Transaction Width option. The AXI Quad SPI core supports continuous transfer mode. When configured as master, the transfer continues until the data is available in the transmit register/FIFO. This capability is provided in both manual and automatic slave select modes. As an example, during the page read command, the command, address, and number of data beats in the DTR must be set equal to the same number of data bytes intended to be read by the SPI memory. When the core is configured as a slave, if the slave select line (SPISEL) goes High (inactive state) during the data element transfer, the current transfer is aborted. If the slave select line goes Low, the aborted data element is transmitted again. The slave mode of the core is allowed only in the standard SPI mode.
07-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值