More in this section
Forums / General Discussions / How do I construct a dynamic page url in Sitefinity?

How do I construct a dynamic page url in Sitefinity?

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
4 posts, 1 answered
  1. Dan Sorensen
    Dan Sorensen avatar
    256 posts
    13 Aug 2010
    18 Feb 2011
    Link to this post
    We have a main landing page:

    And from there, we have different pages for each customer category, in our case by state.

    Each of those customer category pages are exactly the same, except that they pull data from the database for their category/region based on the url string. Washington customers get a washington version of their page because of the /wa/ in the address. Therefore they can bookmark their territory page.

    My question: can this be done in Sitefinity? Is there any way to build a page that uses a url param to load data for a common template? All widgets on the page should load data filtered by that same url param.

    I know how to build the widgets that will filter the data based on that url param, but I'm not sure how to get a base page in Sitefinity with different urls like that.

    Any hints, help or direction helps!
  2. Bob
    Bob avatar
    330 posts
    30 Dec 2016
    03 Mar 2011
    Link to this post
    Hi Dan,

    Sitefinity will load the last valid page in the path of the requested URL and the rest of the URL will be treated as URL parameters. In your example, no matter what you place after ~/home, the home page will be loaded and you can access the rest in the URL as parameters.

    To test this, do the following test:

    1.       Create a user control, let’s say MyControl.ascx in the root of the site.

    2.       Add a Label to the User Control.

    3.       Add the following code in the code behind file:


    public partial class MyControl : System.Web.UI.UserControl
        protected void Page_Load(object sender, EventArgs e)
            this.Label1.Text = String.Empty;
            var parms = (string[])this.Request.RequestContext.RouteData.Values["Params"];
            if (parms != null)
                foreach (var param in parms)
                    this.Label1.Text += param + "</br>";



    4.       Add the user control to the Page Toolbox. See this instructions how to add user control to the toolbox:

    5.       Drop that control to your home page

    NOTE: this behavior is subject to change in the near future because a lot of people perceive it as bug, since we don’t throw HTTP 404 exception. Nevertheless the current behavior will also be supported (configurable) and you also will be able to specify matching patterns.

    I hope this answers your question. Let me know you need further clarification.  

    Kind regards,
    the Telerik team
  3. Anju
    Anju avatar
    19 posts
    22 Jul 2014
    16 May 2015
    Link to this post


    This was what i was exactly looking for. But its still giving me the same error  :

     HTTP Error 404.0 - Not Found
    The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

     Is dynamic url possible in sitefinity. What is going wrong. I have been trying long for this. Even though i have added the code mentioned above, my user control is not getting triggered. Its throwing the error mentioned above.

    Please help. 



  4. Dave
    Dave avatar
    2 posts
    01 Oct 2012
    16 May 2015 in reply to Anju
    Link to this post

    You need to tell Sitefinity you are handling the dynamic URL otherwise it will throw a 404 (from 7.2 upwards)

     Just use RouteHelper.SetUrlParametersResolved(); somewhere in your widget and it won't 404.

4 posts, 1 answered