|
Hi,
In asp.net 1.1, it was easy to add this to the properties of a page (class):
Public Shared ReadOnly Property URL(productId as String) As String
Get
Return AppPath & "/ProductDetails.aspx?productId=" & productId
End Get
End Property
Which I could then access from other pages (which stopped me having to
memorze and hardcode a URL in dozens of pages and user controls). However,
in 2.0 this functionality seems to have dissapeard. Is there any way to get
to this, or a reccomended altenate approach?
Thanks
Joe | |
Share:
|
Rather than attaching the method to the page, it might make more sense to
create a Utility class and add the method there.
"WFB" <x@hotmail.com> wrote in message
news:e9**************@TK2MSFTNGP10.phx.gbl... Hi,
In asp.net 1.1, it was easy to add this to the properties of a page (class):
Public Shared ReadOnly Property URL(productId as String) As String Get Return AppPath & "/ProductDetails.aspx?productId=" & productId End Get End Property
Which I could then access from other pages (which stopped me having to memorze and hardcode a URL in dozens of pages and user controls). However, in 2.0 this functionality seems to have dissapeard. Is there any way to get to this, or a reccomended altenate approach?
Thanks Joe | | |
Just add a new class, and mark the property shared.
I just got the kb alert a minute ago, which makes me think this may not be a
good idea. I've been doing this myself for a long time. <eek> http://www.kbalertz.com/Feedback_893666.aspx
Greg
"WFB" <x@hotmail.com> wrote in message
news:e9**************@TK2MSFTNGP10.phx.gbl... Hi,
In asp.net 1.1, it was easy to add this to the properties of a page (class):
Public Shared ReadOnly Property URL(productId as String) As String Get Return AppPath & "/ProductDetails.aspx?productId=" & productId End Get End Property
Which I could then access from other pages (which stopped me having to memorze and hardcode a URL in dozens of pages and user controls). However, in 2.0 this functionality seems to have dissapeard. Is there any way to get to this, or a reccomended altenate approach?
Thanks Joe | | |
not with the ease.
when you run the wizard, it will create new class file in the appcode dir
that has this static method, and then change the page to inherit from it.
this will be great for your old pages, but a pain when you add new ones.
this comes about because in version 1, all the codebehinds went into 1 dll,
so they could reference each other, in 2.0 they go into seperate dlls (1 per
page), and app_code (1 dll for the dir) is where the shared code is.
-- bruce (sqlwork.com)
"WFB" <x@hotmail.com> wrote in message
news:e9**************@TK2MSFTNGP10.phx.gbl... Hi,
In asp.net 1.1, it was easy to add this to the properties of a page (class):
Public Shared ReadOnly Property URL(productId as String) As String Get Return AppPath & "/ProductDetails.aspx?productId=" & productId End Get End Property
Which I could then access from other pages (which stopped me having to memorze and hardcode a URL in dozens of pages and user controls). However, in 2.0 this functionality seems to have dissapeard. Is there any way to get to this, or a reccomended altenate approach?
Thanks Joe | | |
In general, how are other people handling this (in 1.1 and 2.0)? Just
hardcoding the links?
"WFB" <x@hotmail.com> wrote in message
news:e9**************@TK2MSFTNGP10.phx.gbl... Hi,
In asp.net 1.1, it was easy to add this to the properties of a page (class):
Public Shared ReadOnly Property URL(productId as String) As String Get Return AppPath & "/ProductDetails.aspx?productId=" & productId End Get End Property
Which I could then access from other pages (which stopped me having to memorze and hardcode a URL in dozens of pages and user controls). However, in 2.0 this functionality seems to have dissapeard. Is there any way to get to this, or a reccomended altenate approach?
Thanks Joe | | |
> Just add a new class, and mark the property shared.
Sounds like it is not so simply in ASP.NET 2.0 anymore. ?? :(
"Greg Burns" <bl*******@newsgroups.nospam> wrote in message
news:eb*************@TK2MSFTNGP15.phx.gbl... Just add a new class, and mark the property shared.
I just got the kb alert a minute ago, which makes me think this may not be a good idea. I've been doing this myself for a long time. <eek>
http://www.kbalertz.com/Feedback_893666.aspx
Greg
"WFB" <x@hotmail.com> wrote in message news:e9**************@TK2MSFTNGP10.phx.gbl... Hi,
In asp.net 1.1, it was easy to add this to the properties of a page (class):
Public Shared ReadOnly Property URL(productId as String) As String Get Return AppPath & "/ProductDetails.aspx?productId=" & productId End Get End Property
Which I could then access from other pages (which stopped me having to memorze and hardcode a URL in dozens of pages and user controls). However, in 2.0 this functionality seems to have dissapeard. Is there any way to get to this, or a reccomended altenate approach?
Thanks Joe
| | |
Implement a singleton pattern class and add this methods to this class, my
advice is.
But anyway, links are external resources therefore can be stored in Resx
file. This would help you integrate your modules/pages with other
applications.
--
HTH
Thanks,
Yunus Emre ALPÖZEN
BSc, MCSD.NET
"WFB" <x@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... In general, how are other people handling this (in 1.1 and 2.0)? Just hardcoding the links? "WFB" <x@hotmail.com> wrote in message news:e9**************@TK2MSFTNGP10.phx.gbl... Hi,
In asp.net 1.1, it was easy to add this to the properties of a page (class):
Public Shared ReadOnly Property URL(productId as String) As String Get Return AppPath & "/ProductDetails.aspx?productId=" & productId End Get End Property
Which I could then access from other pages (which stopped me having to memorze and hardcode a URL in dozens of pages and user controls). However, in 2.0 this functionality seems to have dissapeard. Is there any way to get to this, or a reccomended altenate approach?
Thanks Joe | | |
Thanks. Do you have an example?
"Yunus Emre ALPÖZEN [MCSD.NET]" <yemre> wrote in message
news:O4**************@TK2MSFTNGP11.phx.gbl... Implement a singleton pattern class and add this methods to this class, my advice is.
But anyway, links are external resources therefore can be stored in Resx file. This would help you integrate your modules/pages with other applications.
-- HTH
Thanks, Yunus Emre ALPÖZEN BSc, MCSD.NET
"WFB" <x@hotmail.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... In general, how are other people handling this (in 1.1 and 2.0)? Just hardcoding the links? "WFB" <x@hotmail.com> wrote in message news:e9**************@TK2MSFTNGP10.phx.gbl... Hi,
In asp.net 1.1, it was easy to add this to the properties of a page (class):
Public Shared ReadOnly Property URL(productId as String) As String Get Return AppPath & "/ProductDetails.aspx?productId=" & productId End Get End Property
Which I could then access from other pages (which stopped me having to memorze and hardcode a URL in dozens of pages and user controls). However, in 2.0 this functionality seems to have dissapeard. Is there any way to get to this, or a reccomended altenate approach?
Thanks Joe
| | |
Sorry - I sent too soon. If possible can you point me to an example of
using the resx file?
"WFB" <x@hotmail.com> wrote in message
news:uY**************@tk2msftngp13.phx.gbl... Thanks. Do you have an example?
"Yunus Emre ALPÖZEN [MCSD.NET]" <yemre> wrote in message news:O4**************@TK2MSFTNGP11.phx.gbl... Implement a singleton pattern class and add this methods to this class, my advice is.
But anyway, links are external resources therefore can be stored in Resx file. This would help you integrate your modules/pages with other applications.
-- HTH
Thanks, Yunus Emre ALPÖZEN BSc, MCSD.NET
"WFB" <x@hotmail.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... In general, how are other people handling this (in 1.1 and 2.0)? Just hardcoding the links? "WFB" <x@hotmail.com> wrote in message news:e9**************@TK2MSFTNGP10.phx.gbl... Hi,
In asp.net 1.1, it was easy to add this to the properties of a page (class):
Public Shared ReadOnly Property URL(productId as String) As String Get Return AppPath & "/ProductDetails.aspx?productId=" & productId End Get End Property
Which I could then access from other pages (which stopped me having to memorze and hardcode a URL in dozens of pages and user controls). However, in 2.0 this functionality seems to have dissapeard. Is there any way to get to this, or a reccomended altenate approach?
Thanks Joe
| | |
There are too much examples on net. Here are some links for sample codes: http://www.dotnetjunkies.com/Article...A8134A4F1.dcik http://www.codeproject.com/csharp/cs...sembly-res.asp
--
HTH
Thanks,
Yunus Emre ALPÖZEN
BSc, MCSD.NET
"WFB" <x@hotmail.com> wrote in message
news:O1*************@TK2MSFTNGP11.phx.gbl... Sorry - I sent too soon. If possible can you point me to an example of using the resx file? "WFB" <x@hotmail.com> wrote in message news:uY**************@tk2msftngp13.phx.gbl... Thanks. Do you have an example?
"Yunus Emre ALPÖZEN [MCSD.NET]" <yemre> wrote in message news:O4**************@TK2MSFTNGP11.phx.gbl... Implement a singleton pattern class and add this methods to this class, my advice is.
But anyway, links are external resources therefore can be stored in Resx file. This would help you integrate your modules/pages with other applications.
-- HTH
Thanks, Yunus Emre ALPÖZEN BSc, MCSD.NET
"WFB" <x@hotmail.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... In general, how are other people handling this (in 1.1 and 2.0)? Just hardcoding the links? "WFB" <x@hotmail.com> wrote in message news:e9**************@TK2MSFTNGP10.phx.gbl... > Hi, > > In asp.net 1.1, it was easy to add this to the properties of a page > (class): > > Public Shared ReadOnly Property URL(productId as String) As String > Get > Return AppPath & "/ProductDetails.aspx?productId=" & productId > End Get > End Property > > Which I could then access from other pages (which stopped me having to > memorze and hardcode a URL in dozens of pages and user controls). > However, in 2.0 this functionality seems to have dissapeard. Is there > any > way to get to this, or a reccomended altenate approach? > > Thanks > Joe >
| | This discussion thread is closed Replies have been disabled for this discussion. Similar topics
10 posts
views
Thread by John Brock |
last post: by
|
1 post
views
Thread by Henri |
last post: by
|
8 posts
views
Thread by Mike Caputo |
last post: by
|
9 posts
views
Thread by Bob Day |
last post: by
|
8 posts
views
Thread by dwok |
last post: by
|
2 posts
views
Thread by baldwin |
last post: by
|
5 posts
views
Thread by Simon |
last post: by
|
2 posts
views
Thread by mgoold2002 |
last post: by
|
6 posts
views
Thread by wingphil |
last post: by
| | | | | | | | | | |