ASp.net回发URl [英] ASp.net Postback URl

查看:124
本文介绍了ASp.net回发URl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的项目中有aspx页面.在此页面中,我有一个链接按钮,当我单击此链接按钮时,我想重定向到该链接按钮中带有不同文本的同一页面.我也想根据链接按钮中的文本更改网址的地址.但是所有操作的页面相同,我只想更改链接按钮的文本和URL中的地址.

谢谢,
Velkumar

Hi,

I have aspx page in my project. In this page i have a linkbutton, When i click this linkbutton i want to redirect to same page with differnt text in this linkbutton. Also i want to change the address of thr url depends upon the text in the linkbutton. But the page same for all action I just want to change the text for the link button and address in the url.

Thanks,
Velkumar

推荐答案

就URL的更改而言,如果您使用诸如Server.Transfer或Response.Redirect之类的技巧,可能会有所帮助.如果您想要正确的映射URL,则它是URL Rewriting之类的高级概念,您实际上可以在运行时重命名Url.

Linkbutton重命名,您可以使用
进行处理
As far as change in URL is concern if you use some tricks like Server.Transfer or Response.Redirect, it may help you. If you want proper mapping url then its an advance concept like URL Rewriting, where you can actually rename Url at run time.

Linkbutton rename you can handle it by using
if (Page.IsPostBack)
       {
           ;
       }


要在浏览器中显示不同的URL,可以使用URL重写的概念.要更改标签,可以通过编程方式进行处理.


更新:
[SM] :在此处阅读:使用ASP.NET进行URL重写 [ ^ ]
MSDN:URL重写 [
To show different URLs in the browser you can use the concept of URL rewriting. To change the label you can handle it programmetically.


UPDATE:
[SM]: Read here: URL Rewriting with ASP.NET[^]
MSDN: URL Rewriting[^]



检查此链接
使用ASP.NET进行URL重写 [ http://dotnetguts.blogspot.com/2008/07/url-rewriting-with- urlrewriternet.html [ ^ ]
希望对您有帮助
最好的问候
米特瓦里(M.Mitwalli)
Hi ,
Check this links
URL Rewriting with ASP.NET[^]
http://dotnetguts.blogspot.com/2008/07/url-rewriting-with-urlrewriternet.html[^]
Hope it help
Best Regards
M.Mitwalli


这篇关于ASp.net回发URl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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