Пример #1
0
        protected void Page_Init( object sender, EventArgs e )
        {
            // get current page
            if ( int.TryParse( PageParameter( "Page" ), out currentPage ) == false )
            {
                currentPage = 1;
            }

            // get post details page
            postDetailsPage = new Rock.Web.UI.PageReference( AttributeValue( "PostDetailPage" ) );

            // get number of posts to display per page
            takeCount = Convert.ToInt32( AttributeValue( "PostsPerPage" ) );

            // get category and tag id
            int.TryParse( PageParameter( "Category" ), out categoryId );
            int.TryParse( PageParameter( "Tag" ), out tagId );

            // calculate the number to skip
            skipCount = (takeCount * currentPage) - takeCount;

            DisplayList();
            this.AttributesUpdated += BlogPosts_AttributesUpdated;
            //this.AddAttributeUpdateTrigger( upPosts );
        }
Пример #2
0
        protected void lbLoginLogout_Click( object sender, EventArgs e )
        {
            if ( action == "Login" )
                FormsAuthentication.RedirectToLoginPage();
            else
            {
                FormsAuthentication.SignOut();

                Rock.Web.UI.PageReference pageRef = new Rock.Web.UI.PageReference (PageInstance.Id, PageInstance.RouteId );
                Response.Redirect( PageInstance.BuildUrl( pageRef, null ) );
            }
        }
Пример #3
0
        protected void lbLoginLogout_Click( object sender, EventArgs e )
        {
            if ( action == "Login" )
                FormsAuthentication.RedirectToLoginPage();
            else
            {
                FormsAuthentication.SignOut();

                Rock.Web.UI.PageReference pageRef = new Rock.Web.UI.PageReference( CurrentPage.Id, CurrentPage.RouteId );
                Response.Redirect( CurrentPage.BuildUrl( pageRef, null ), false );
                Context.ApplicationInstance.CompleteRequest();
            }
        }
Пример #4
0
        protected void lbLoginLogout_Click(object sender, EventArgs e)
        {
            if (action == "Login")
            {
                FormsAuthentication.RedirectToLoginPage();
            }
            else
            {
                FormsAuthentication.SignOut();

                Rock.Web.UI.PageReference pageRef = new Rock.Web.UI.PageReference(CurrentPage.Id, CurrentPage.RouteId);
                Response.Redirect(CurrentPage.BuildUrl(pageRef, null), false);
                Context.ApplicationInstance.CompleteRequest();
            }
        }
Пример #5
0
        protected void lbLoginLogout_Click(object sender, EventArgs e)
        {
            if (action == "Login")
            {
                FormsAuthentication.RedirectToLoginPage();
            }
            else
            {
                FormsAuthentication.SignOut();
                Session.Remove("UserIsAuthenticated");

                Rock.Web.UI.PageReference pageRef = new Rock.Web.UI.PageReference(PageInstance.Id, PageInstance.RouteId);
                Response.Redirect(PageInstance.BuildUrl(pageRef, null));
            }
        }
Пример #6
0
 /// <summary>
 /// Builds a URL from a page and parameters with support for routes
 /// </summary>
 /// <param name="pageRef">PageReference to use for the link</param>
 /// <param name="parms">Dictionary of parameters</param>
 /// <param name="queryString">Querystring to include paramters from</param>
 public string BuildUrl(Rock.Web.UI.PageReference pageRef, Dictionary <string, string> parms, System.Collections.Specialized.NameValueCollection queryString)
 {
     return(Rock.Web.UI.Page.BuildUrl(pageRef, parms, queryString));
 }
Пример #7
0
 /// <summary>
 /// Builds a URL from a page and parameters with support for routes
 /// </summary>
 /// <param name="pageRef">PageReference to use for the link</param>
 /// <param name="parms">Dictionary of parameters</param>
 public string BuildUrl(Rock.Web.UI.PageReference pageRef, Dictionary <string, string> parms)
 {
     return(Rock.Web.UI.Page.BuildUrl(pageRef, parms, null));
 }