本文介绍了Asp.net的Response.Redirect的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的项目的启动页面是Default.aspx的。
保护无效ImageButton1_Click1(对象发件人,ImageClickEventArgs E)
{ 的Response.Redirect(Payment.aspx); }
当我点击它返回//localhost/Default.aspx/Payment.aspx而不是//localhost/Payment.aspx按钮。问题出在哪里?
解决方案
的Response.Redirect(〜/ Payment.aspx);
My project's start page is Default.aspx.
protected void ImageButton1_Click1(object sender, ImageClickEventArgs e)
{
Response.Redirect("Payment.aspx);
}
When I click the button it returns //localhost/Default.aspx/Payment.aspx instead of //localhost/Payment.aspx. Where is the problem?
解决方案
Response.Redirect("~/Payment.aspx");
这篇关于Asp.net的Response.Redirect的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!