如何通过单击网格视图中的链接按钮重定向到另一个页面 [英] how to redirect to another page by click on linkbutton in gridview

查看:141
本文介绍了如何通过单击网格视图中的链接按钮重定向到另一个页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我使用gridview.在gridview我dsplay page_name像首页,Contact_us,Master_Page等.我使用Linkbutton重定向到另一个页面.如果我单击主页链接"按钮,它将转到Home.aspx页,或者如果我单击"Contact_us链接"按钮,它将变为contact.aspx等.我该怎么做.

谢谢与问候
Manohar

解决方案

使用链接按钮的PostBackUrl属性


您好,

请通过下面给出的链接.希望它能解决您的问题.

http://stackoverflow.com/questions/5986260/gridview-按钮以行数据重定向查询 [ http://forums.asp.net/t/1498592.aspx/1 [ ^ ]




试试这个

((LinkLink)e.Row.FindControl(" ) ).Attributes.Add(" "  javascript:window.location ='<%= ResolveUrl(〜/test.aspx)%>'"); 


in my application i m using gridview . in gridview i dsplay page_name like Home,Contact_us,Master_Page etc. I used Linkbutton to redirect to another page. if i am click on Home Page Linkbutton it goes to Home.aspx page,or if i am click on Contact_us Linkbutton it goest to contact.aspx etc. how can i do this .

Thanks and Regards
Manohar

解决方案

use PostBackUrl attribute of link button


Hello,

Please go through links given below. I hope it resolves your issue.

http://stackoverflow.com/questions/5986260/gridview-button-to-redirect-with-query-for-row-data[^]

http://forums.asp.net/t/1498592.aspx/1[^]


Hi,

Try this

((LinkButton)e.Row.FindControl("LinkButton1")).Attributes.Add("onclick", "javascript:window.location = '<%= ResolveUrl(~/test.aspx) %> '" );


这篇关于如何通过单击网格视图中的链接按钮重定向到另一个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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