473,785 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is there such a thing as strongly typed URLs?

In code, you can type the following:

this.Response.R edirect("~/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.R edirect(URLs.In dex_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 1522
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********@gma il.comwrote in message
news:11******** **************@ n59g2000hsh.goo glegroups.com.. .
In code, you can type the following:

this.Response.R edirect("~/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.R edirect(URLs.In dex_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********@gma il.comwrote in message
news:11******** **************@ n59g2000hsh.goo glegroups.com.. .
In code, you can type the following:

this.Response.R edirect("~/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.R edirect(URLs.In dex_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.R edirect("~/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.R edirect(URLs.In dex_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
5737
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 indexer. There are problems with this however. First the indexer "override" has a different return type. This doesn't cause a compile time error, but using the indexer doesn't seem to produce a properly typed expression. The Add override must...
1
6089
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
2382
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, Int, Float, etc...) 2. VB 6 and VBScript were not strongly typed because both allowed you to ... dim blah .... which creates a variant.
2
4375
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 Enterprise Library seems pretty close to what I am used to in Java but I am not sure how to create strongly-typed DataSets. I see that I can use the LoadDataSet method from a Microsoft.Practices.EnterpriseLibrary.Data.Database but I am not clear on how...
1
2183
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 Web Service it adds another Table to the DataSet that contains the data. I have to access the data using ds.Tables.Rows.ToString(). This defeats the whole purpose of using a strongly typed DataSet. Thanks in advance for the help.
2
3733
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 covered in most of the books I've read. Basically you inherit CollectionBase and then add methods (say Add) that takes your types as a parameter and then calls List.Add from the base class. OK. However CollectionBase exposes the IList interface...
14
1386
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 since every key has the same value, "". Thanks for your advice. - Joe Geretz -
1
3572
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 myTable"; using (SqlConnection conn = new SqlConnection(websqlconn)) { SqlCommand cmd = new SqlCommand(sql, conn);
4
3112
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 comparisions) cleared? Thanks, Rachana
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10162
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4061
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.