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 9 1055
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 thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: John Brock |
last post by:
I have a base class with several derived classes (I'm writing in
VB.NET). I want each derived class to have a unique class ID (a
String), and I want the derived classes to inherit from the base...
|
by: Henri |
last post by:
Hi,
I'm using a custom class in my ASP.NET which has a Shared property.
I don't want this Shared property to be shared between users because of
thread concurrent accesses problems.
I just want it...
|
by: Mike Caputo |
last post by:
In VB.NET, need to be able to access certain properties on my main form from
other forms. These are properties that may be changed by the user, so I
have to be able to get to them throughout the...
|
by: Bob Day |
last post by:
VS 2003, vb.net , sql msde...
I have an application with multiple threads running. Its a telephony
application where each thread represents a telephone line. For code that
would be the same...
|
by: dwok |
last post by:
I have been wondering this for a while now. Suppose I have a class
that contains some private member variables. How should I access the
variables throughout the class? Should I use properties that...
|
by: baldwin |
last post by:
Hello,
We are going to have a web application that will be load balanced.
Uploading documents into the same server is not an option. So we need
to create a shared folder in a different machine...
|
by: Simon |
last post by:
Hi all,
We have an ASP.NET 1.1 application running on IIS6 on Server 2003.
Most of the base objects we are using in this application are taken from a
windows application also written by us. We...
|
by: mgoold2002 |
last post by:
Hello. I've just begun programming in VB .NET, and I'm trying to turn
all my modules into classes. In order to retrieve/exchange values from
one class to another, I initiated New instances of the...
|
by: wingphil |
last post by:
Hi there,
I have a shared method in a base class, and I need to know which
subclass it has been called from. So for example
Public Mustinherit Class BaseClass
Public Shared Sub SharedMethod...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: isladogs |
last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, Mike...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
| |