ASP.NET网址导航 [英] ASP.NET Url Navigation

查看:78
本文介绍了ASP.NET网址导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,请帮助我提供示例代码,除了使用属性窗口外,我还可以使用该示例代码导航/链接到asp.net网站的不同页面.我正在开发一个asp.net网站,我想在按钮后面使用自定义代码,以便能够浏览我的不同页面.我知道控件的属性,但我不想使用它,确切地说我很想拥有一个自定义代码.请帮帮我.

忠实的,
马丁
谢谢.

Hi there, please help me with a sample code i can use to navigate/link to different pages of my asp.net website, other than using the property window. i am developing an asp.net website and i would like to use a custom code behind buttons so that i can be able to navigate through my different pages. I know about the property for controls and i don''t want to use that, nut rather i would love to have a custom code. Please help me.

Yours faithfully,
Martin
Thanks.

推荐答案

在按钮的onclick事件下使用它:

Response.Redirect("bla bla");
Use this under the onclick event of your buttons:

Response.Redirect("bla bla");


尝试
Response.Redirect [ Server.Transfer [
Try
Response.Redirect[^]
OR
Server.Transfer[^]


如果在您的.aspx页面上有一组链接:
If on your .aspx page you have a set of links:
<a id="link1" runat="server/><br mode=" hold=" /><a id=" link2=" runat=" server="" />


然后,您可以在代码中的 OnPreRender 中:


Then you can in your code behind in the OnPreRender:

link1.Href = "www.codeproject.com";
link1.InnerText = "The Code Project";

link2.Href = "msdn.microsoft.com";
link2.InnerText = "MSDN";



您可以使用< asp:hyperlink ...>来做同样的事情.标签,除了设置了NavigateUrl和Text属性.



You can do the same thing with a <asp:hyperlink ...> tag except you set the NavigateUrl and Text properties.


这篇关于ASP.NET网址导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆