欢迎光临
我们一直在努力

asp.net里怎么提交数据到另外一页去-.NET教程,Asp.Net开发

建站超值云服务器,限时71元/月

可以使用的方法很多,例如象cookies、session、http参数等都可以,现在讲一种:

http参数方法:

<%@ page language="c#" autoeventwireup="true" %>

<html>

<head>

</head>

<body>

<form runat="server">

<asp:button id="button1" text="submit" runat="server"/>

<asp:textbox id="textbox1" runat="server"/>

</form>

<script runat="server">

void page_load(object sender, eventargs e)

{

button1.click += new eventhandler(this.button1_click);

}

void button1_click(object sender, eventargs e)

{

response.redirect( "show.aspx?textbox1="+textbox1.text );

}

</script>

</body>

</html>

<%@ page language="c#" autoeventwireup="true" %>

<html>

<head>

</head>

<body>

<form runat="server" id="form1">

<asp:label id="lbl1" runat="server"></asp:label>

</form>

<script runat="server">

protected void page_load(object src, eventargs e)

{

lbl1.text = request.querystring.get( "textbox1" );

}

</script>

</body>

</html>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » asp.net里怎么提交数据到另外一页去-.NET教程,Asp.Net开发
分享到: 更多 (0)