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

Forums / Developing with Sitefinity / ICmsUrl on Page Request

ICmsUrl on Page Request

7 posts, 0 answered
  1. Siddesh Kapadi
    Siddesh Kapadi avatar
    239 posts
    Registered:
    09 Oct 2009
    06 Oct 2010
    Link to this post
    hey,
    I have a page created as Index.aspx. I add an additional Url named Index1.aspx.

    How can I get the CmsUrl object, once I request a Index1.aspx page.


    Regards,
    Siddesh Kapadi
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 Oct 2010
    Link to this post
    Hi Siddesh,

    You could get the StaticUrl of the ICmsPage object.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Siddesh Kapadi
    Siddesh Kapadi avatar
    239 posts
    Registered:
    09 Oct 2009
    06 Oct 2010
    Link to this post
    Hey Ivan,
    StaticUrl would return me Index.aspx not Index1.aspx even when I am requesting Index1.aspx
    Please Help!!!!

    Regards,
    Siddesh kapadi
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 Oct 2010
    Link to this post
    Hello Siddesh,

    Each item from page.Urls list is ICmsUrl object. StaticUrl will return you the default url which from you description is Index.aspx. You can get the url you want from page.Urls list

    foreach (ICmsUrl item in page.Urls)
     {
     
     }


    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Siddesh Kapadi
    Siddesh Kapadi avatar
    239 posts
    Registered:
    09 Oct 2009
    06 Oct 2010
    Link to this post
    Hey Ivan,

    The code above is to iterate through the list of ICmsUrl. What I require is how do i programatically understand that the requested Url is Index1.aspx and not Index.aspx

    Regards,
    Siddesh Kapadi
  6. Siddesh Kapadi
    Siddesh Kapadi avatar
    239 posts
    Registered:
    09 Oct 2009
    07 Oct 2010
    Link to this post
    Hey,
    If anyone can reply to this post. Please, its urgent.

    Regards,
    Siddesh Kapadi
  7. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    07 Oct 2010
    Link to this post
    Hi Siddesh Kapadi,

    You can try the bellow code:
    HttpContext context = HttpContext.Current;
    string relativePath = context.Request.AppRelativeCurrentExecutionFilePath;


    Kind regards,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
7 posts, 0 answered