从浏览器获取数据

终于搞好了
ContractedBlock.gif ExpandedBlockStart.gif login.htm
None.gifDOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
None.gif
<html xmlns="http://www.w3.org/1999/xhtml" >
None.gif
<head>
None.gif    
<title>无标题页title>
None.gif
head>
None.gif
<body>
None.gif
<form action ="Default.aspx" method ="post" >
None.gif  姓名:
<input id="Text1" name="Name" type="text" /><br />
None.gif    密码:
&nbsp; &nbsp;<input id="Text2" name="Pwd" type="text" />
None.gif    
<br />
None.gif    
&nbsp; &nbsp;
None.gif    
<input id="Submit1" type="submit" value="submit" />
None.gif    
<input id="Reset1" type="reset" value="reset" />
None.gif
form> 
None.gif
body>
None.gif
html>
ContractedBlock.gif ExpandedBlockStart.gif default.aspx
None.gif<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
None.gif
None.gif
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
None.gif
None.gif
<html xmlns="http://www.w3.org/1999/xhtml" >
None.gif
<head runat="server">
None.gif    
<title>无标题页title>
None.gif
head>
None.gif
<body>
None.gif    
<form id="form1" runat="server">
None.gif    
<div>
None.gif        用户名:
<asp:Label ID="lblName" runat="server" Text =<%#name %>>asp:Label><br />
None.gif        密码:
<asp:Label ID="lblPwd" runat="server" Text =<%#pwd %>>asp:Label>div>form>
None.gif
body>
None.gif
html>
None.gif
ContractedBlock.gif ExpandedBlockStart.gif default.aspx.cs
None.gifpublic partial class _Default : System.Web.UI.Page
ExpandedBlockStart.gifContractedBlock.gif
dot.gif{
InBlock.gif
InBlock.gif    
public string name = "";
InBlock.gif    
public string pwd = "";
InBlock.gif    
protected void Page_Load(object sender, EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif     name 
= Request["Name"];
InBlock.gif     pwd 
= Request["Pwd"];
InBlock.gif     DataBind();
ExpandedSubBlockEnd.gif    }

ExpandedBlockEnd.gif}

None.gif

这里要注意的是,name和pwd的声明

转载于:https://www.cnblogs.com/sliuqin/archive/2007/01/03/610319.html

你可能感兴趣的:(数据库,xhtml,游戏)