We help IT Professionals succeed at work.

Default page is not loading it is just stuck trying to load. No error the page is just stuck loading

woodje
woodje asked
on
Hello Experts,

I have an asp.net 3.5 appllication that is using three controls. One for the header, one for the menu, and the last is for footer. In the header I am grabbing the users nt id from the html header and filling a session variable. For some of my users this is not having any problems. For others the page just is stuck trying to load. No error gets thrown. In the IIS log I see warnings and expanding them I see the user string is blank. What would be causing these users to not be passing their nt id in the header?

Jeff
Comment
Watch Question

Top Expert 2010

Commented:
Do you have the have try catch blocks inside your code ??? Also in the global.asax file try to put a log in the on error function , so that you can know if there is any errors
can you show the code that how you are getting the user nt id? looks like some security/permission issues in some machines.

Author

Commented:
Here is some of the code.
/// security.cs ////

public string GetUSWIN()
    {
        return HttpContext.Current.User.Identity.Name.ToString().Replace(@"USWIN\", "");
    }

/// page load of header.aspx ///
protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            security secutil = new security();
            db db = new db();
            UserInfo.ui employeeinfo = new UserInfo.ui();

            Session["USWIN"] = secutil.GetUSWIN();
            Session["UserInfo"] = employeeinfo.GetUserInfo(secutil.GetUSWIN());
            string CurrentUser = Session["USWIN"].ToString();
            string UserFName = db.Username(CurrentUser);
            secutil.GetMenuItems(CurrentUser);
            if (UserFName == "Nope")
            {
                Response.Redirect("~/access_denied.aspx");
            }
            lblCurrentUser.Text = "Welcome: " + UserFName;
        }
    }

Open in new window

Can you try to set authentication mode as mentioned in the MSDN here?
http://support.microsoft.com/kb/306359

the following link also suggesting the same
http://forums.asp.net/t/891555.aspx

Author

Commented:
I have the authentication mode set to windows. And in IIS I have the anonymous access is uncheck and I have Authenticated Access set to Integrated windows access.

Author

Commented:
I added a try catch block and exception tracking I am getting an AbortThred on line 31 of the header.ascx.cs file which is the response redirect to the access_denied.aspx page.
Top Expert 2010

Commented:
modify the line 31 to

Response.Redirect("~/access_denied.aspx",false);

and now see if the same exception is there

Author

Commented:
I modified the response redirect and the users are still getting the error.
Commented:
Hello Experts,

The problem was that my menu control was not able to find the user reference from the database and was stuck in a loop. That is why I never got an error or timeout. It just kept trying to render the menu over and over again. I have corrected the code to run only once and to error if what I am expecting doesn't occur.

Jeff