📄 simple-single-binding.aspx
字号:
<%@Page Language="VB"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<title>Simple Single-Value Data Binding</title>
<style type="text/css">
body, td {font-family:Tahoma,Arial,sans-serif; font-size:10pt}
input {font-family:Tahoma,Arial,sans-serif; font-size:9pt}
.heading {font-family:Tahoma,Arial,sans-serif; font-size:14pt; font-weight:bold}
.subhead {font-family:Tahoma,Arial,sans-serif; font-size:12pt; font-weight:bold; padding-bottom:5px}
.cite {font-family:Tahoma,Arial,sans-serif; font-size:8pt}
</style></head>
<body bgcolor="#ffffff">
<span class="heading">Simple Single-Value Data Binding</span><hr />
<!--------------------------------------------------------------------------->
<form runat="server">
<table border="0">
<tr><td nowrap="nowrap">
<b><ASP:Label></b> control:
<ASP:Label Text="<%# ImageURL %>" runat="server" /><p />
<b><ASP:TextBox></b> control:
<ASP:TextBox Text="<%# ImageURL %>" runat="server" /><p />
<b><ASP:Button></b> control:
<ASP:Button Text="<%# ImageURL %>" runat="server" /><p />
<b><ASP:LinkButton></b> control:
<ASP:LinkButton Text="<%# ImageURL %>" runat="server" /><p />
<b><ASP:Image></b> control:
<ASP:Image Src="<%# ImageURL %>" ImageAlign="middle" runat="server" /><p />
<b><ASP:CheckBox></b> control:
<ASP:CheckBox Text="<%# ImageURL %>" runat="server" /><p />
<b><ASP:RadioButton></b> control:
<ASP:RadioButton Text="<%# ImageURL %>" runat="server" /><p />
<b><ASP:Hyperlink></b> control:
<ASP:Hyperlink Text="<%# ImageURL %>" NavigateUrl="<%# ImageURL %>" runat="server" /><p />
<b><ASP:ImageButton></b> control:
<ASP:ImageButton ImageUrl="<%# ImageURL %>" runat="server" />
</td><td nowrap="nowrap"> </td><td nowrap="nowrap">
HTML <b><span></b> element:
<span><%# ImageURL %></span><p />
HTML <b><input type="text"></b> element:
<input type="text" value="<%# ImageURL %>" /><p />
HTML <b><input type="submit"></b> element:
<input type="submit" value="<%# ImageURL %>" /><p />
HTML <b><button></b> element:
<button><%# ImageURL %></button><p />
HTML <b><img></b> element:
<img src="<%# ImageURL %>" align="middle" /><p />
HTML <b><input type="checkbox"></b> element:
<input type="checkbox" /><%# ImageURL %><p />
HTML <b><input type="radio"></b> element:
<input type="radio" /><%# ImageURL %><p />
HTML <b><a></b> element:
<a href="<%# ImageURL %>"><%# ImageURL %></a><p />
HTML <b><button></b> and <b><img></b> elements:
<button><img src="<%# ImageURL %>"></button>
</td></tr>
</table>
</form>
<!--------------------------------------------------------------------------->
<script language="vb" runat="server">
ReadOnly Property ImageURL() As String
'declare a read-only property for the Page
Get
Return "myimage.gif"
End Get
End Property
Sub Page_Load()
'bind all the controls on the page
Page.DataBind()
End Sub
</script>
<!--------------------------------------------------------------------------->
<!-- #include file="..\global\foot.inc" -->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -