1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / How can i create one page with the mode code-behind .

How can i create one page with the mode code-behind .

2 posts, 0 answered
  1. Guobin
    Guobin avatar
    3 posts
    Registered:
    02 Feb 2012
    18 Mar 2013
    Link to this post
    Some page dynamic like  
    http://localhost/pagedetail/2
    http://localhost/pagedetail/3

    so i want to create one page(codebehind) like pagedetail to show querystring?
  2. Matt Licht
    Matt Licht avatar
    5 posts
    Registered:
    01 Aug 2012
    18 Mar 2013
    Link to this post
    There's a need to notify the route handler that the control on the page is expecting URL parameters to be resolved. To achieve this you need to set the UrlParamtersResolvedKey in the
    CurrentHttpContext.Items collection.

    You can use the RouteHelper.SetUrlParametersResolved() implementation exactly for these purposes, however please note that this needs to be done in a early stage of the control lifecycle, as we're checking for the key on PreRender_Complete event.


    protected override void OnInit(EventArgs e)
           {
               base.OnInit(e);
               RouteHelper.SetUrlParametersResolved();
           }
           protected void Page_Load(object sender, EventArgs e)
           {
               var param = this.GetUrlParameterString(true);
               ParamLiteral.Text = param;
           }
2 posts, 0 answered