重定向到页面问题 [英] Redirect to Page Problem

查看:82
本文介绍了重定向到页面问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个Admin文件夹,在Admin文件夹中有一页Section.aspx页面.

在主根目录中,我只有一页customer.aspx页.

在customer.aspx页面中,当我单击要重定向到管理文件夹中的Section.aspx页面时,我有一个按钮.

Hi,

I have one folder Admin, In Admin folder i have one page Section.aspx page.

In the main root directory, i have one page customer.aspx page.

In customer.aspx page, i have one button, when i clcked that i want to redirected to Section.aspx page that is in Admin Folder.

Protected void Button1_Click(object sender,EventArgs e)

{

Response.Redirect("Admin/Section.aspx?SelectedValue=Admin");

}



当我单击按钮"时,它将重定向到Home.aspx页...在浏览"中,我得到的网址是这样的:

本地主机/Home.aspx?ReturnUrl=%2fAdmin%2fSection.aspx%3fSelectedValue%3dAdmin&SelectedValue=Admin

但是当我重定向到其他页面时,在Same Button中它会重定向,但是在上面的页面即Section.aspx中,它不是重定向.

在section.aspx页中:

我们正在网格中显示一些值.

谢谢,



When i click the Button it is redirecting to Home.aspx page...and in the Browse i am getting the url like this:

localhost/Home.aspx?ReturnUrl=%2fAdmin%2fSection.aspx%3fSelectedValue%3dAdmin&SelectedValue=Admin

But in the Same Button when i redirected to some other page it redirecting,but in the above page i.e Section.aspx it is not redirecting.

In section.aspx page:

we are displaying some values in the Grid.

Thanks,

推荐答案

您的代码没有错误.但是我认为您已经在Section.aspx LOAD事件中写了一些东西.该代码会将您重定向到您的主页.
请检查您的版面代码,该错误将以这种形式出现.
There is no error in you code. but i think you have write something in your Section.aspx LOAD event. that code will re redirect you to your home page.
please check your section page code,the fault will in that form.


尝试一下

try this

Protected void Button1_Click(object sender,EventArgs e)

{

Response.Redirect("~/Admin/Section.aspx?SelectedValue=Admin");

}


这篇关于重定向到页面问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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