[英]How to redirect to another page with using a function on that page with asp link
I am new to asp.net. 我是asp.net的新手。 So just learning everything step by step.
因此,请逐步学习所有内容。
I have created a web project with the template. 我用模板创建了一个Web项目。 On Page one, I have a button and a textbox with no action defined yet.
在第一页上,我有一个按钮和一个尚未定义任何操作的文本框。 On Page two I have a button and a textbox and I also have db connections works from the button.
在第二页,我有一个按钮和一个文本框,我也有按钮的数据库连接。
What I want to do is, if user writes something and click button on first page, I want to go page 2 and acts as clicked button. 我想做的是,如果用户写了些东西然后单击第一页上的按钮,我想转到第二页并充当单击按钮。 I want to run some action on page two with parameter from page on.
我想在第二页上使用参数from页面上运行一些操作。 I think this is possible with redireciton mechanism
我认为这可以通过redireciton机制实现
I will post the code here. 我会在这里发布代码。 can anyone help me .
谁能帮我 。 I may be wrong as I am new to this language.
我可能是错的,因为我是这种语言的新手。
I can do it with a button but I want to do it with a asp link 我可以用一个按钮来做,但是我想用一个asp链接来做。
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="BringPage2" />
Right now this is a link but I want to make it a button 现在这是一个链接,但我想将其设置为一个按钮
<p><a href="http://www.asp.net" class="btn btn-primary btn-lg">Bring Page 2 »</a><input id="txtBoxAlan" name="txtBoxAlan" type="text" />
我没有使用重定向,而是将href用作href =“ Default1.aspx”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.