日期:2014-05-20 浏览次数:21050 次
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="test_profile.aspx.vb" Inherits="test_profile.test_profile" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat ="server" >
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
labelPostalCode.Text = Profile.PostalCode
End Sub
Sub SetPostalCode_Click(ByVal sender As Object, _
ByVal e As System.EventArgs)
Profile.PostalCode = Server.HtmlEncode(textPostalCode.Text)
labelPostalCode.Text = Profile.PostalCode
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="textPostalCode" runat="server"></asp:TextBox>
<asp:Button ID="SetPostalCode" runat="server" Text="Button" OnClick="SetPostalCode_Click"
/>
<asp:Label ID="labelPostalCode" runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
<?xml version="1.0" encoding="utf-8"?>
<!--
有关如何配置 ASP.NET 应用程序的详细信息,请访问
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionStrings>
<add name="LocalSqlServer"
connectionString="server=PC-20121108IOLX;database=test_profile;Integrated Security=SSPI;"
providerName="System.Data.SqlClient"
/>
</connectionStrings>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
<anonymousIdentification enabled="true" />
<profile>
<properties>
<add name="PostalCode" type="System.String" allowAnonymous="true" />
</properties>
</profile>
<!-- other Web.config settings here -->
</system.web>
</configuration>