protected void btnEdit_Click(object sender, EventArgs e) { int forumPostID = 0; int.TryParse(lblForumPostID.Text, out forumPostID); ForumPost forumPost = ForumManager.GetPostByID(forumPostID); if (forumPost != null) { if (!ForumManager.IsUserAllowedToEditPost(NopContext.Current.User, forumPost)) { string loginURL = CommonHelper.GetLoginPageURL(true); Response.Redirect(loginURL); } string url = SEOHelper.GetEditForumPostURL(forumPost.ForumPostID); Response.Redirect(url); } }