Server Error in '/' Application.

Index and count must refer to a location within the string.
Parameter name: count

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Index and count must refer to a location within the string.
Parameter name: count

Source Error:


Line 23: 
Line 24: strUsername2 = Request.ServerVariables.Get("AUTH_USER");
Line 25: strUsername = strUsername2.Remove(0,6);
Line 26: 
Line 27: int intUserSubmission = 0;

Source File: f:\WebSites\Med\restricted\bm\yr4\neurology\elearning\default.aspx    Line: 25

Stack Trace:


[ArgumentOutOfRangeException: Index and count must refer to a location within the string.
Parameter name: count]
   System.String.Remove(Int32 startIndex, Int32 count) +0
   ASP.restricted_bm_yr4_neurology_elearning_default_aspx.Page_Load(Object sender, EventArgs e) in f:\WebSites\Med\restricted\bm\yr4\neurology\elearning\default.aspx:25
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


Version Information: Microsoft .NET Framework Version:2.0.50727.9061; ASP.NET Version:2.0.50727.9062