⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mysingeldatabind.aspx

📁 ASP C#代码实例 适合初学人士学习使用
💻 ASPX
字号:
<%@ Page language="c#" Codebehind="MySingelDataBind.aspx.cs" AutoEventWireup="false" Inherits="Example_9_1.MySingelDataBind" %>
<%@ Import namespace="Example_9_1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>Example_9_1:绑定控件的单个数据值</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<form id="Form1" method="post" runat="server">
			<table>
				<tr>
					<td colspan="2">绑定Label控件的数据:</td>
				</tr>
				<tr>
					<td><asp:Label ID="MyLabelString" Runat="server" Text='<%=LabelValueString%>'></asp:Label></td>
				</tr>
				<tr>
					<td><asp:Label ID="MyLabelExpr" Runat="server"><%=LabelValueString%></asp:Label></td>
				</tr>
				<tr>
					<td colspan="2">绑定TextBox控件的数据:</td>
				</tr>
				<tr>
					<td><asp:TextBox ID="MyTextBoxString" Runat="server" Text='<%=TextBoxValueString%>'></asp:TextBox>
					</td>
				</tr>
				<tr>
					<td><asp:TextBox ID="MyTextboxExpr" Runat="server" Visible='<%#SetTextBoxVisible()%>'></asp:TextBox>
						<asp:Button id="ChangeBtn" runat="server" Text="改变控件的可见性"></asp:Button>
					</td>
				</tr>
				<tr>
					<td colspan="2">绑定Button控件的数据:</td>
				</tr>
				<tr>
					<td>
						<asp:Button id="MyButtonString" runat="server" Text='<%=ButtonValueString%>'>
						</asp:Button>
					</td>
				</tr>
				<tr>
					<td colspan="2">绑定DataList控件的数据:</td>
				</tr>
				<tr>
					<td>
						<asp:datalist id="TabList" runat="server" RepeatColumns="10" SelectedIndex="0" cssclass="OtherTabsBg"
							repeatdirection="Horizontal" ItemStyle-Height="25" SelectedItemStyle-CssClass="TabBg" ItemStyle-BorderWidth="1"
							HeaderStyle-HorizontalAlign="Center" EnableViewState="False">
							<SelectedItemStyle CssClass="TabBg" BackColor="MistyRose"></SelectedItemStyle>
							<ItemStyle HorizontalAlign="Center" Height="25px" BorderWidth="0px" Width="100px"></ItemStyle>
							<ItemTemplate>
								&nbsp;<a href='<%= Request.ApplicationPath %>/MySingelDataBind.aspx'><%# ((TabDetails)Container.DataItem).TabName %></a>
							</ItemTemplate>
							<SelectedItemTemplate>
								&nbsp;<span class="SelectedTab"><%# ((TabDetails)Container.DataItem).TabName %></span>&nbsp;
							</SelectedItemTemplate>
							<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
						</asp:datalist>
					</td>
				</tr>
				<tr>
					<td><asp:Button id="SetControlValue" runat="server" Text="绑定各个控件的数据"></asp:Button>
					</td>
				</tr>
			</table>
		</form>
	</body>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -