473,323 Members | 1,570 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Is there such a thing as strongly typed URLs?

In code, you can type the following:

this.Response.Redirect("~/index.aspx");

Is there anything in ASP.NET that you can use in place of strings when
referring to URLs? It would be nice to refer to URLs in a strongly
typed fashion. Something like:

this.Response.Redirect(URLs.Index_ASPX);

The point of this is that if a URL gets changed to a different
location or even renamed, the URL in a a Redirect (or for any other
object for that matter) would be automatically updated to refer to the
new name / location.

I doubt that this exists but it would be nice if it did.

Thanks
Polaris

Apr 16 '07 #1
3 1509
You need to research the concept of SiteMap. That is what site maps for.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Polaris431" <po********@gmail.comwrote in message
news:11**********************@n59g2000hsh.googlegr oups.com...
In code, you can type the following:

this.Response.Redirect("~/index.aspx");

Is there anything in ASP.NET that you can use in place of strings when
referring to URLs? It would be nice to refer to URLs in a strongly
typed fashion. Something like:

this.Response.Redirect(URLs.Index_ASPX);

The point of this is that if a URL gets changed to a different
location or even renamed, the URL in a a Redirect (or for any other
object for that matter) would be automatically updated to refer to the
new name / location.

I doubt that this exists but it would be nice if it did.

Thanks
Polaris

Apr 16 '07 #2
I've seen a lot of people use constants/enums/structs for that kind of
thing.
They don't automatically update when the URL changes but at least they are
centrally defined so you only have one place to go to update a URL.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Polaris431" <po********@gmail.comwrote in message
news:11**********************@n59g2000hsh.googlegr oups.com...
In code, you can type the following:

this.Response.Redirect("~/index.aspx");

Is there anything in ASP.NET that you can use in place of strings when
referring to URLs? It would be nice to refer to URLs in a strongly
typed fashion. Something like:

this.Response.Redirect(URLs.Index_ASPX);

The point of this is that if a URL gets changed to a different
location or even renamed, the URL in a a Redirect (or for any other
object for that matter) would be automatically updated to refer to the
new name / location.

I doubt that this exists but it would be nice if it did.

Thanks
Polaris
Apr 16 '07 #3
On 15 Apr 2007 23:34:18 -0700, Polaris431 wrote:
In code, you can type the following:

this.Response.Redirect("~/index.aspx");

Is there anything in ASP.NET that you can use in place of strings when
referring to URLs? It would be nice to refer to URLs in a strongly
typed fashion. Something like:

this.Response.Redirect(URLs.Index_ASPX);

The point of this is that if a URL gets changed to a different
location or even renamed, the URL in a a Redirect (or for any other
object for that matter) would be automatically updated to refer to the
new name / location.

I doubt that this exists but it would be nice if it did.

Thanks
Polaris
Take a look at PageMethods, recently moved here
http://www.codeplex.com/PageMethods
--
Bits.Bytes
http://bytes.thinkersroom.com
Apr 16 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bill Cohagan | last post by:
I'm trying to figure out the "best" way to implement a strongly typed ArrayList. Using inheritance is one approach. It has the advantage that I only have to write overrides for the Add method and...
1
by: Job Lot | last post by:
I am confused how strongly typed dataset is different from un-typed dataset. Is there any good link explaining pros and cons of both? Which one should be used preferably?
2
by: Mark | last post by:
Just wanted to confirm that my understanding of a strongly typed language is correct: 1. .NET is a strongly typed language because each variable / field must be declared a specific type (String,...
2
by: David | last post by:
I have been developing applications with Java for quite a while but I am new to .NET development. I am trying to learn the ".NET way" of creating Strongly Typed Objects from a database. The...
1
by: HardBap | last post by:
I've created a strongly typed DataSet (Customers.xsd) using the xsd.exe tool. I want to be able to access fields using ds.Customer.CompanyName. The problem is when I return this DataSet from a...
2
by: Ian Gore | last post by:
Hi, I'm relatively new to VB.NET so I'd be grateful if someone could point out what I don't understand here... 1) Creating a strongly typed collection by inheriting CollectionBase. This is...
14
by: Joseph Geretz | last post by:
Basically, I just need an efficient way to store and retrieve keys from a list. I don't need key/value pairs. I've implemented this with the standard HashTable, but the value column is a waste...
1
by: Code Monkey | last post by:
Silly question maybe, but I've been doing the following for far too long now: public static DataTable myDataTable() { string sql = @"SELECT column1, column2, column3, column4 FROM...
4
by: Rachana | last post by:
Hi, I have understood Data Sets but what is meant by typed/untyped/ strongly typed datasets. Can any one explain me or suggest any site/ article, to get these concepts (and their ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.