日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

asp.net頁(yè)面?zhèn)髦禍y(cè)試實(shí)例代碼_.Net教程

編輯Tag賺U幣
教程Tag:暫無(wú)Tag,歡迎添加,賺取U幣!

推薦:DataGridView - DataGridViewCheckBoxCell的使用介紹
Datagridview是.net中最復(fù)雜的控件,由于人們對(duì)表格的格式要求多種多樣,所以編寫(xiě)一個(gè)通用的Datagridview(類(lèi)似JSF中的datatable)非常困難的。 Datagridview中,用戶(hù)可以對(duì)行、列、單元格進(jìn)行編程。如行中可以插入下拉列表、復(fù)選框、編輯框、單選框等多種控件。每種控

WebForm_1.aspx內(nèi)容如下:

復(fù)制代碼 代碼如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm_1.aspx.cs" Inherits="頁(yè)面?zhèn)髦?WebForm_1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Table ID="TableLogin" runat='server'>
<asp:TableRow>
<asp:TableCell><label>用戶(hù)名:</label></asp:TableCell>
<asp:TableCell><asp:TextBox ID="UserName" runat="server" Width="150px"></asp:TextBox></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell><label>密碼:</label></asp:TableCell>
<asp:TableCell><asp:TextBox ID="PassWord" runat="server" Width="150px"></asp:TextBox></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell><label>驗(yàn)證密碼:</label></asp:TableCell>
<asp:TableCell><asp:TextBox ID="ConfimPWD" runat="server" Width="150px"></asp:TextBox></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell><asp:Button ID="Confirm" runat="server" Text="確認(rèn)" Width="50px" OnClick="Confirm_Click" /></asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
</form>
</body>
</html>


WebForm_2.aspx頁(yè)面如下:

復(fù)制代碼 代碼如下:
<%@ Reference Page="~/WebForm_1.aspx" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm_2.aspx.cs" Inherits="頁(yè)面?zhèn)髦?WebForm_2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>


WebForm_1.aspx.cs文件如下:

復(fù)制代碼 代碼如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace 頁(yè)面?zhèn)髦?
{
public partial class WebForm_1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
public string un//得到用戶(hù)名
{
get
{
return UserName.Text;
}
}
public string pwd//得到密碼
{
get
{
return PassWord.Text;
}
}
public string conpwd//得到確認(rèn)密碼
{
get
{
return ConfimPWD.Text;
}
}
/// <summary>
/// 向WebForm_2.aspx頁(yè)面?zhèn)髦?
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Confirm_Click(object sender, EventArgs e)
{
//1:QueryString頁(yè)面?zhèn)髦?
//string url = "WebForm_2.aspx?un=" + UserName.Text + "&userpassword=" + PassWord.Text + "&conPwd=" + ConfimPWD.Text;
//Response.Redirect(url);
//2:Session傳值
//Session["un"] = UserName.Text;
//Session["pwd"] = PassWord.Text;
//Session["conpwd"] = ConfimPWD.Text;
//Server.Transfer("WebForm_2.aspx");
//3:使用cookie對(duì)象傳值
//HttpCookie cookie_name = new HttpCookie("un");
//cookie_name.Value = UserName.Text;
//HttpCookie cookie_pwd = new HttpCookie("pwd");
//cookie_pwd.Value = PassWord.Text;
//HttpCookie cookie_conpwd = new HttpCookie("conpwd");
//cookie_conpwd.Value = ConfimPWD.Text;
//Response.AppendCookie(cookie_name);
//Response.AppendCookie(cookie_pwd);
//Response.AppendCookie(cookie_conpwd);
//Server.Transfer("WebForm_2.aspx");
//4:使用application對(duì)象傳值,類(lèi)似session傳值,作用范圍全局所有用戶(hù)
//Application["un"] = UserName.Text;
//Application["pwd"] = PassWord.Text;
//Application["conpwd"] = ConfimPWD.Text;
//Response.Redirect("WebForm_2.aspx");
Server.Transfer("WebForm_2.aspx");
}
}
}

分享:asp.net中javascript的引用(直接引入和間接引入)
Asp.net 中引入Javascript 的方法有很多。在做牛腩的時(shí)候主要講了兩種。 個(gè)人認(rèn)為可以分為直接引入,和間接引入。 一、直接引入 。在前臺(tái)頁(yè)面調(diào)用自定義的javascript 函數(shù): 1、打開(kāi)前臺(tái)頁(yè)面在 head 元素之間加入 script 元素,將 type 元素設(shè)置為 text/javascript 。然

共2頁(yè)上一頁(yè)12下一頁(yè)
來(lái)源:模板無(wú)憂(yōu)//所屬分類(lèi):.Net教程/更新時(shí)間:2013-07-01
相關(guān).Net教程