<form action=new.aspx>
即可
即可
解决方案 »
- 麻烦大家帮我解决个思路 我想模仿一个图片列表
- 上传图片!!
- 如何将gridview中的图片导出到word/excel?现在导出了其他数据列就差图片列了了
- 简单简单简单
- 在不使用数据源控件的情况下,如果用ADO.NET创建数据库连接,怎么访问web.config中的连接字符串?
- xp系统下用本机发邮件如何设置SmtpMail.SmtpServer
- 关于连接sql数据库在webconfig中设置的问题
- html内嵌套的aspx页面跳转问题 急!!高手帮忙看看
- 一个javascript的问题
- 关于dropdownlist 用 viewstate 方法 保持ddl2.SelectedIndex 值问题?
- 数据库表的问题?
- 关于对话框类函数的使用
去掉runat=server后,可以提交到其他文件。
要不就只有使用asp原来的方法来使用.net啦!
eg: <form action="new.aspx" method="post">
在要提交的事件中写
Response.Redirect("提交到的页面.aspx?in=" + ls_instation+"&out="+ls_outstation+"&type="+ls_cartype);
in、out、type是要提交的3个参数(假如你有3个参数要提交的话)
ls_instation、ls_outstation、ls_cartype是3个参数的值在提交到的页面的page_load事件获得提交的参数值
TextBox1.Text = Request.Params["type"];
TextBox2.Text = Request.Params["in"];
TextBox3.Text = Request.Params["out"];
这要就实现了所谓的提交到其他页面good luck
1。为该页面声明类的名称;<%@ Page Language="C#" ClassName="FirstPageClass" %>
2。为每一个要传递到另外页面的元素,定义带Get accessor的Property:
3。使用Server.Transfer("Webform2.aspx")把控制权提交给另外一个WebForm class.//////////////////////// WebForm1.aspx ////////////////////////////////////////<%@ Page Language="C#" ClassName="FirstPageClass" %><html>
<head>
<script runat="server">
public string FirstName
{
get
{
return first.Text;
}
} public string LastName
{
get
{
return last.Text;
}
} void ButtonClicked(object sender, EventArgs e)
{
Server.Transfer("secondpage.aspx");
} </script> </head><body> <form runat="server">
First Name: <asp:TextBox id="first" runat="server"/>
<br>
Last Name: <asp:TextBox id="last" runat="server"/>
<br>
<asp:Button OnClick="ButtonClicked" Text="Go to second page" runat=server />
</form>
</body>
</html>
//////////////////////////////////////////////////////////////////////在目的Webform2.aspx中:1。添加Reference指令;<%@ Reference Page="firstpage.aspx" %>
2。声明一个WebForm1.aspx对应的class的实例:FirstPageClass fp;
3。利用HttpContext class, 获得第一个得到 HTTP Request 的页面的实例(Webform1.aspx): fp = (FirstPageClass)Context.Handler;//////////////////// WebForm2.aspx ////////////////////////////////////////////////////////////////////
<%@ Page Language="C#" %>
<%@ Reference Page="firstpage.aspx" %>
<html>
<head>
<script runat="server"> FirstPageClass fp; void Page_Load()
{
if (!IsPostBack)
{
fp = (FirstPageClass)Context.Handler;
}
}
</script>
</head>
<body> <form runat="server">
Hello <%=fp.FirstName%> <%=fp.LastName%>
</form></body>
</html>
/////////////////////////////////////////////////////////////////////////////////////////////////////////关于Code-Behinde方式中的详细信息,请您参阅下面的文章:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconpassingservercontrolvaluesbetweenpages.asp希望上面的信息对您有所帮助。-微软全球技术中心 本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利。具体事项可参见使用条款(http://support.microsoft.com/directory/worldwide/zh-cn/community/terms_chs.asp)。
为了为您创建更好的讨论环境,请参加我们的用户满意度调查(http://support.microsoft.com/directory/worldwide/zh-cn/community/survey.asp?key=(S,49854782))。