刚开始折腾asp.net ,发现个奇怪的问题,希望高手帮忙瞧瞧。
例如:
页面URL:http://www.xxxx.com/yyy.aspx?id=1234
退出按钮 <asp:LinkButton id="AUserQuit" runat="server" onserverclick="AUserQuit_Click">退出</asp:LinkButton>点击后page_load里面 request.url 就丢失了参数,返回http://www.xxxx.com/yyy.aspx 很奇怪pageload 部分:protected void Page_Load(object sender, EventArgs e)
{
UserLogin();
if (!Page.IsPostBack)
{
if (Request.QueryString["id"] != null)
{
string id = Request.QueryString["id"].ToString();
//其他 }
else
{
Response.Redirect("index.aspx");
} en.Update_browseCount(Convert.ToInt32(Heid.Value));
Dbini(); }
else
{
//到这里已经没了参数
string curll = Request.Url.ToString();
}
}是不是哪里的细节没有处理好?调试半天都没解决。请高手们帮忙回答一下,谢谢了。
例如:
页面URL:http://www.xxxx.com/yyy.aspx?id=1234
退出按钮 <asp:LinkButton id="AUserQuit" runat="server" onserverclick="AUserQuit_Click">退出</asp:LinkButton>点击后page_load里面 request.url 就丢失了参数,返回http://www.xxxx.com/yyy.aspx 很奇怪pageload 部分:protected void Page_Load(object sender, EventArgs e)
{
UserLogin();
if (!Page.IsPostBack)
{
if (Request.QueryString["id"] != null)
{
string id = Request.QueryString["id"].ToString();
//其他 }
else
{
Response.Redirect("index.aspx");
} en.Update_browseCount(Convert.ToInt32(Heid.Value));
Dbini(); }
else
{
//到这里已经没了参数
string curll = Request.Url.ToString();
}
}是不是哪里的细节没有处理好?调试半天都没解决。请高手们帮忙回答一下,谢谢了。
protected void AUserQuit_Click(object sender, EventArgs e)
{
Session.Remove("thisuser");
HttpCookie aCookie = new HttpCookie("pguser");
aCookie.Expires = DateTime.Now.AddDays(-1);
aCookie.Domain = "ipaigu.com";
aCookie.Secure = false;
Response.Cookies.Add(aCookie);
Response.Redirect(Request.Url.ToString());
}其实是根本没进来就发生了上面的问题,是先进了PAGE_LOAD,然后发现参数丢失的情况
Request.RawUrl: /testweb/default.aspx