Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 590077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:29:27+00:00 2026-05-13T15:29:27+00:00

Some background on what I’m doing I usually like to have my pages return

  • 0

Some background on what I’m doing

I usually like to have my pages return the url needed to access it. So i will normally have a method like so

public partial class ProductDetails : Page
{
    public static string GetUrl(Guid productId)
    {
        return "fully qualified url";
    }
}

on my other pages/controls that need to access this page i’ll simply set the link as

hl.NavigateUrl = ProductDetails.GetUrl(id);

I’m toying around with the new UrlRouting stuff in 4.0 and ran into something I’m not sure will work. I’m trying to use the Page.GetRouteUrl in my static method, and obviously it’s blowing up due to Page not being static.

Does anyone know if it’s possible replicate what i’m doing with GetRouteUrl?

thx

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:29:28+00:00Added an answer on May 13, 2026 at 3:29 pm

    You can do something like:

    var url = ((Page)HttpContext.Current.Handler).GetRouteUrl(id);
    

    Note: If you called this method from another page, you may not get the desired result if it’s relative-specific in some way…but it’s as good as you can get with static I believe.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some background... I have a collection of tables, and I would like a
Some background: In Germany (at least) invoice numbers have to follow certain rules: The
Some background: we have a windows application (c#) that locate in the system try.
Some background I have a set of data that represents the alchemy ingredients and
Some background first. I have a .net client agent installed on each of the
Some Background I have noticed that setting the EditTemplate of a DataForm (from the
Some Background: I have a VS 2008 Deployment project I am not using the
Some Background I have been using Git for a while now. The projects that
Some background: We have some entity classes need to be serialized, so we implement
Some background: I am writing a application with several forms, etc. Users have to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.