如何将“内容”页面设置为“启动”页面 [英] How to set Content page as Startup page

查看:92
本文介绍了如何将“内容”页面设置为“启动”页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Friends,



我有一个内容页面RespondHome.aspx(使用RespondMaster.Master页面)我将此页面设置为设置为启动页面。但它给出了以下错误。



页面没有正确重定向



Firefox已检测到服务器以永远不会完成的方式重定向此地址的请求。



此问题有时可能是由禁用或拒绝接受cookie引起的。



我的代码是 -



Hello Friends,

I have one content page RespondHome.aspx (Using RespondMaster.Master page) I set this page as Set as Start up page. but its given following error.

The page isn't redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

This problem can sometimes be caused by disabling or refusing to accept cookies.

My Code is -

protected void Page_Load(object sender, EventArgs e)
        {
            if (Session.IsNewSession)
            {
                Response.Redirect("~/RespondHome.aspx");
            }
            if (Session["UserName"] != null)
            {
                //System.Text.StringBuilder sb = new System.Text.StringBuilder();
                //sb.Append("<i class='fa fa-edit'></i>");
                //sb.Append("Welcome");s
                //sb.Append(Session["UserName"].ToString());
                //sb.Append("<i class='fa fa-angle-down'></i>");
                //UserName.InnerText = sb.ToString();
                //UserName.InnerText = "Welcome" +"  "+ Session["UserName"].ToString();
                lblUser.InnerText = "Welcome" + "  " + Session["UserName"].ToString();
                lblUser.InnerText = "Welcome" + "  " + Session["UserName"].ToString();
                lblEnvironment.InnerText = ConnectionInfo.dbname;
            }
        }





请给我适当的解决方案。

谢谢

Ram。



Please give me proper solution.
Thanks
Ram.

推荐答案

再添加一张支票并检查新会话,即检查如果上一页不是RespondHome。
add one more check along with checking the new session, i.e to check if the previous page is not RespondHome.


这篇关于如何将“内容”页面设置为“启动”页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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