App_Code.Controls.PostPager.PageIndex C# (CSharp) Method

PageIndex() private static method

Pages the index.
private static PageIndex ( ) : int
return int
        private static int PageIndex()
        {
            var retValue = 1;
            var url = HttpContext.Current.Request.RawUrl;
            if (url.Contains("page="))
            {
                url = url.Replace(url.Substring(0, url.IndexOf("page=") + 5), string.Empty);
                try
                {
                    retValue = int.Parse(url);
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex);
                }
            }

            return retValue;
        }