Discussion:
Equivalent of Tag on Label
Brady Kelly
2007-07-27 08:11:14 UTC
Permalink
Mike Andrews
2007-07-27 12:52:08 UTC
Permalink
I'm not sure exactly as to what you are referring.
To any custom object you can add a "Tag" object property to utilize such
functionality.
Also, just use the Tag property of the Label to do that or if you're using a
control that doesn't have it and you need it, create an inherited control
and add the property.

Mike

On 7/27/07, Brady Kelly <***@chasesoftware.co.za> wrote:
>
> How could I emulate storing meta data for a Label control in its Tag
> property, as with WinForms Label control? I want to store a lot number
> associated with a label on that label, so when I iterate a data
> collection,
> I can access data for a label by its 'tag' property.
>
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>

===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Brady Kelly
2007-07-27 13:06:01 UTC
Permalink
Mike Andrews
2007-07-27 13:54:17 UTC
Permalink
For that task, I would recommend using either binary or xml serialization of
your specific object(s) and storing them in viewstate for state management
between postbacks.
If you're already using session, that can be used as well, but if this is
going to be a high volume website, I would not recommend using session
unless you're using either a state server or SQL Server.

I have a lot of sucess using XML serialization with objects to store state
between postbacks.

Thanks,
Mike


On 7/27/07, Brady Kelly <***@chasesoftware.co.za> wrote:
>
> I WinForms Label control has a Tag property that can be used to store
> metadata for the Label control. An ASP.NET Label control does not have a
> Tag property. I was asking if there was any way of recreating the
> functionality of the Tag property of a WinForms Label control but with an
> ASP.NET Label control.
>
> It seems there isn't, short of encoding the metadata into the Name
> property
> of the Label control. I specifically asked about the Label control trying
> to avoid a custom, derived control.
>
>
> > -----Original Message-----
> > From: Discussion of building .NET applications targeted for the Web
> > [mailto:DOTNET-***@DISCUSS.DEVELOP.COM] On Behalf Of Mike Andrews
> > Sent: 27 July 2007 14:52 PM
> > To: DOTNET-***@DISCUSS.DEVELOP.COM
> > Subject: Re: [DOTNET-WEB] Equivalent of Tag on Label
> >
> > I'm not sure exactly as to what you are referring.
> > To any custom object you can add a "Tag" object property to utilize such
> > functionality.
> > Also, just use the Tag property of the Label to do that or if you're
> > using a
> > control that doesn't have it and you need it, create an inherited
> > control
> > and add the property.
> >
> > Mike
> >
> > On 7/27/07, Brady Kelly <***@chasesoftware.co.za> wrote:
> > >
> > > How could I emulate storing meta data for a Label control in its Tag
> > > property, as with WinForms Label control? I want to store a lot
> > number
> > > associated with a label on that label, so when I iterate a data
> > > collection,
> > > I can access data for a label by its 'tag' property.
> > >
> > >
> > > ===================================
> > > This list is hosted by DevelopMentor(r) http://www.develop.com
> > >
> > > View archives and manage your subscription(s) at
> > > http://discuss.develop.com
> > >
> >
> > ===================================
> > This list is hosted by DevelopMentorR http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> > http://discuss.develop.com
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>

===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Brady Kelly
2007-07-27 14:01:30 UTC
Permalink
Adrian Martin
2007-07-27 14:04:38 UTC
Permalink
Mike Andrews
2007-07-27 14:15:27 UTC
Permalink
I would recommend if you use the attributes collection of the control to
keep your data small.

On 7/27/07, Adrian Martin <***@ypn.co.uk> wrote:
>
> Add you data via the Attribute collection
>
>
> yourLabel.Attributes["tag"] = "stringdata" ;
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Discussion of building .NET applications targeted for the Web
> [mailto:DOTNET-***@DISCUSS.DEVELOP.COM] On Behalf Of Brady Kelly
> Sent: 27 July 2007 09:11
> To: DOTNET-***@DISCUSS.DEVELOP.COM
> Subject: Equivalent of Tag on Label
>
> How could I emulate storing meta data for a Label control in its Tag
> property, as with WinForms Label control? I want to store a lot number
> associated with a label on that label, so when I iterate a data
> collection,
> I can access data for a label by its 'tag' property.
>
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
>
> Johnston Press plc Registered in Scotland no.
> SC015382 Registered Office: 53 Manor Place, Edinburgh, EH3 7EG
>
> Opinions expressed in this email are those of the writer and not the
> company. E-mail traffic is monitored within Johnston Press and messages may
> be viewed. This e-mail and any files with it are solely for the use of the
> addressee(s). If you are not the intended recipient, you have received this
> e-mail in error. Please delete it or return it to the sender or notify us
> by email at ***@jpress.co.uk
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>

===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Brady Kelly
2007-07-27 14:22:18 UTC
Permalink
Pardee, Roy
2007-07-27 20:44:04 UTC
Permalink
Brady Kelly
2007-07-28 08:35:59 UTC
Permalink
Ryan Heath
2007-07-28 09:39:33 UTC
Permalink
I dont see how this working, with every new request you are losing the
attr.values...

In winforms the label stays alive during the timespan of the app. In
asp.net its created and destroyed for each request.

// Ryan

2007/7/28, Brady Kelly <***@chasesoftware.co.za>:
> That's what's nice about attributes on web controls. Makes me think of
> better using the Tag property on WinForms controls by storing an attributes
> dictionary in it.
>
> > -----Original Message-----
> > From: Discussion of building .NET applications targeted for the Web
> > [mailto:DOTNET-***@DISCUSS.DEVELOP.COM] On Behalf Of Pardee, Roy
> > Sent: 27 July 2007 22:44 PM
> > To: DOTNET-***@DISCUSS.DEVELOP.COM
> > Subject: Re: [DOTNET-WEB] Equivalent of Tag on Label
> >
> > And give your attribute a better name than 'Tag'. ;-)
> >
> > -----Original Message-----
> > From: Discussion of building .NET applications targeted for the Web
> > [mailto:DOTNET-***@DISCUSS.DEVELOP.COM] On Behalf Of Brady Kelly
> > Sent: Friday, July 27, 2007 7:22 AM
> > To: DOTNET-***@DISCUSS.DEVELOP.COM
> > Subject: Re: [DOTNET-WEB] Equivalent of Tag on Label
> >
> > It seems the attributes collection is the way to go. Thanks to all that
> > responded.
> >
> > > -----Original Message-----
> > > From: Discussion of building .NET applications targeted for the Web
> > > [mailto:DOTNET-***@DISCUSS.DEVELOP.COM] On Behalf Of Mike Andrews
> > > Sent: 27 July 2007 16:15 PM
> > > To: DOTNET-***@DISCUSS.DEVELOP.COM
> > > Subject: Re: [DOTNET-WEB] Equivalent of Tag on Label
> > >
> > > I would recommend if you use the attributes collection of the control
> > > to keep your data small.
> > >
> > > On 7/27/07, Adrian Martin <***@ypn.co.uk> wrote:
> > > >
> > > > Add you data via the Attribute collection
> > > >
> > > >
> > > > yourLabel.Attributes["tag"] = "stringdata" ;
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: Discussion of building .NET applications targeted for the Web
> > > > [mailto:DOTNET-***@DISCUSS.DEVELOP.COM] On Behalf Of Brady Kelly
> > > > Sent: 27 July 2007 09:11
> > > > To: DOTNET-***@DISCUSS.DEVELOP.COM
> > > > Subject: Equivalent of Tag on Label
> > > >
> > > > How could I emulate storing meta data for a Label control in its Tag
> >
> > > > property, as with WinForms Label control? I want to store a lot
> > > number
> > > > associated with a label on that label, so when I iterate a data
> > > > collection, I can access data for a label by its 'tag' property.
> > > >
> > > >
> > > > ===================================
> > > > This list is hosted by DevelopMentor(r) http://www.develop.com
> > > >
> > > > View archives and manage your subscription(s) at
> > > > http://discuss.develop.com
> > > >
> > > >
> > > > Johnston Press plc Registered in Scotland no.
> > > > SC015382 Registered Office: 53 Manor Place, Edinburgh, EH3
> > 7EG
> > > >
> > > > Opinions expressed in this email are those of the writer and not the
> >
> > > > company. E-mail traffic is monitored within Johnston Press and
> > > messages may
> > > > be viewed. This e-mail and any files with it are solely for the use
> > > of the
> > > > addressee(s). If you are not the intended recipient, you have
> > > received this
> > > > e-mail in error. Please delete it or return it to the sender or
> > > notify us
> > > > by email at ***@jpress.co.uk
> > > >
> > > > ===================================
> > > > This list is hosted by DevelopMentor(r) http://www.develop.com
> > > >
> > > > View archives and manage your subscription(s) at
> > > > http://discuss.develop.com
> > > >
> > >
> > > ===================================
> > > This list is hosted by DevelopMentorR http://www.develop.com
> > >
> > > View archives and manage your subscription(s) at
> > > http://discuss.develop.com
> >
> > ===================================
> > This list is hosted by DevelopMentor(r) http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> > http://discuss.develop.com
> >
> > ===================================
> > This list is hosted by DevelopMentor. http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> > http://discuss.develop.com
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com
>

===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Brady Kelly
2007-07-28 09:55:28 UTC
Permalink
Ryan Heath
2007-07-28 11:17:59 UTC
Permalink
Of course it depends on how you are using the attributes.
I was thinking along setting the values at runtime.
But now you mention "declarative", I wonder how you use them.

Do you look up the attribute value during the page request?
Do you loop your labels and based on their attributes do something?

If so it will work, of course, but, and I don't want to sound like a
purist, attributes aren't supposed to be used for that purpose. The
attributes are rendered on the client. I would rather not have
application specific values rendered on the client...

I would, if I really had no other option, derive a class from Label,
define a public property on it for that very purpose. Then I would be
able to specify its value declaratively and have strong relationship
with it in code, without possibly interfere with the attributes, or
future defined attributes.

// Ryan

===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Dean Cleaver
2007-07-30 02:06:24 UTC
Permalink
Hi,

I've got users complaining about the website timing out too quickly - I've set every timeout I can find to be 30 minutes but they're still complaining.

I've set the Forms Authentication timeout to be 30 minutes sliding - website timeout is 30 minutes - but they seem to get booted in about 5 or 10 minutes - is there another timeout I have missed?

TIA
Dino

===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Shawn Wildermuth (MVP)
2007-07-30 03:04:48 UTC
Permalink
Dean Cleaver
2007-07-30 03:27:11 UTC
Permalink
Session Timeout is 30 minutes according to the ASP.NET Configuration Settings in IIS. Globally it's 20, but for this app it's 30.

Dino

________________________________

From: Discussion of building .NET applications targeted for the Web on behalf of Shawn Wildermuth (MVP)
Sent: Mon 7/30/2007 3:04 PM
To: DOTNET-***@DISCUSS.DEVELOP.COM
Subject: Re: [DOTNET-WEB] Website timeouts



What about Session Timeout. Are you using Session for anything?

Thanks,

Shawn Wildermuth
http://adoguy.com <http://adoguy.com/>
http://wildermuthconsulting.com <http://wildermuthconsulting.com/>
Microsoft MVP (C#), MCSD.NET, Author and Speaker


-----Original Message-----
From: Discussion of building .NET applications targeted for the Web
[mailto:DOTNET-***@DISCUSS.DEVELOP.COM] On Behalf Of Dean Cleaver
Sent: Sunday, July 29, 2007 10:06 PM
To: DOTNET-***@DISCUSS.DEVELOP.COM
Subject: [DOTNET-WEB] Website timeouts

Hi,

I've got users complaining about the website timing out too quickly - I've
set every timeout I can find to be 30 minutes but they're still complaining.

I've set the Forms Authentication timeout to be 30 minutes sliding - website
timeout is 30 minutes - but they seem to get booted in about 5 or 10 minutes
- is there another timeout I have missed?

TIA
Dino

===================================
This list is hosted by DevelopMentorR http://www.develop.com <http://www.develop.com/>

View archives and manage your subscription(s) at http://discuss.develop.com <http://discuss.develop.com/>

===================================
This list is hosted by DevelopMentor® http://www.develop.com <http://www.develop.com/>

View archives and manage your subscription(s) at http://discuss.develop.com <http://discuss.develop.com/>



===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Mark
2007-07-30 08:31:19 UTC
Permalink
Dave Walker
2007-07-30 03:37:37 UTC
Permalink
Shawn Wildermuth (MVP)
2007-07-30 04:17:34 UTC
Permalink
Dean Cleaver
2007-07-30 04:51:29 UTC
Permalink
Yes - is a single web server.

Dino

________________________________

From: Discussion of building .NET applications targeted for the Web on behalf of Shawn Wildermuth (MVP)
Sent: Mon 7/30/2007 4:17 PM
To: DOTNET-***@DISCUSS.DEVELOP.COM
Subject: Re: [DOTNET-WEB] Website timeouts



Single web server?

Thanks,

Shawn Wildermuth
http://adoguy.com <http://adoguy.com/>
http://wildermuthconsulting.com <http://wildermuthconsulting.com/>
Microsoft MVP (C#), MCSD.NET, Author and Speaker


-----Original Message-----
From: Discussion of building .NET applications targeted for the Web
[mailto:DOTNET-***@DISCUSS.DEVELOP.COM] On Behalf Of Dave Walker
Sent: Sunday, July 29, 2007 11:38 PM
To: DOTNET-***@DISCUSS.DEVELOP.COM
Subject: Re: [DOTNET-WEB] Website timeouts

Could the app be recycling early for other reasons?

Try set the machine key in the web.config so that requests are
authenticated after a recycle.

If that's the case then try work out why that is happening.

Does the timeout occur when you test locally (logging in a user and
leaving it for 15 mins and then trying to do something only and
authenticated user can do) ?

Dave

-----Original Message-----
From: Discussion of building .NET applications targeted for the Web
[mailto:DOTNET-***@DISCUSS.DEVELOP.COM] On Behalf Of Dean Cleaver
Sent: Monday, 30 July 2007 2:06 p.m.
To: DOTNET-***@DISCUSS.DEVELOP.COM
Subject: [DOTNET-WEB] Website timeouts

Hi,

I've got users complaining about the website timing out too quickly -
I've set every timeout I can find to be 30 minutes but they're still
complaining.

I've set the Forms Authentication timeout to be 30 minutes sliding -
website timeout is 30 minutes - but they seem to get booted in about 5
or 10 minutes - is there another timeout I have missed?

TIA
Dino

===================================
This list is hosted by DevelopMentor(r) http://www.develop.com <http://www.develop.com/>

View archives and manage your subscription(s) at
http://discuss.develop.com <http://discuss.develop.com/>

===================================
This list is hosted by DevelopMentor. http://www.develop.com <http://www.develop.com/>

View archives and manage your subscription(s) at http://discuss.develop.com <http://discuss.develop.com/>

===================================
This list is hosted by DevelopMentor® http://www.develop.com <http://www.develop.com/>

View archives and manage your subscription(s) at http://discuss.develop.com <http://discuss.develop.com/>



===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Dean Cleaver
2007-07-30 04:48:11 UTC
Permalink
Dave,

I'm not sure - I would have to try to log when (or if) the app shuts down - would it be reliable to try to log events like session ending and application ending from the events in Global.asax?

The website already has a machine key (configuration, system.web, machineKey) if that's the one you mean.

I'll try some timeout testing as you suggest, but I've got people in the office who swear it times out after just 5 or 10 minutes despite all my settings.

Dino


________________________________

From: Discussion of building .NET applications targeted for the Web on behalf of Dave Walker
Sent: Mon 7/30/2007 3:37 PM
To: DOTNET-***@DISCUSS.DEVELOP.COM
Subject: Re: [DOTNET-WEB] Website timeouts



Could the app be recycling early for other reasons?

Try set the machine key in the web.config so that requests are
authenticated after a recycle.

If that's the case then try work out why that is happening.

Does the timeout occur when you test locally (logging in a user and
leaving it for 15 mins and then trying to do something only and
authenticated user can do) ?

Dave

-----Original Message-----
From: Discussion of building .NET applications targeted for the Web
[mailto:DOTNET-***@DISCUSS.DEVELOP.COM] On Behalf Of Dean Cleaver
Sent: Monday, 30 July 2007 2:06 p.m.
To: DOTNET-***@DISCUSS.DEVELOP.COM
Subject: [DOTNET-WEB] Website timeouts

Hi,

I've got users complaining about the website timing out too quickly -
I've set every timeout I can find to be 30 minutes but they're still
complaining.

I've set the Forms Authentication timeout to be 30 minutes sliding -
website timeout is 30 minutes - but they seem to get booted in about 5
or 10 minutes - is there another timeout I have missed?

TIA
Dino

===================================
This list is hosted by DevelopMentor(r) http://www.develop.com <http://www.develop.com/>

View archives and manage your subscription(s) at
http://discuss.develop.com <http://discuss.develop.com/>

===================================
This list is hosted by DevelopMentor® http://www.develop.com <http://www.develop.com/>

View archives and manage your subscription(s) at http://discuss.develop.com <http://discuss.develop.com/>



===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Dave Walker
2007-07-30 05:01:28 UTC
Permalink
Andrew Dunn
2007-07-30 05:14:33 UTC
Permalink
Gyorgy Bozoki
2007-07-30 05:26:29 UTC
Permalink
Andrew Dunn
2007-07-30 05:31:09 UTC
Permalink
Gyorgy Bozoki
2007-07-30 05:44:25 UTC
Permalink
Andrew Dunn
2007-07-30 05:57:26 UTC
Permalink
Gyorgy Bozoki
2007-07-30 06:20:10 UTC
Permalink
Andrew Dunn
2007-07-30 06:24:25 UTC
Permalink
Efran Cobisi, cobisi.com
2007-08-13 12:44:14 UTC
Permalink
Hi Dino,

I experienced this issue while using some 3rd party components, I can't
remember if managed or not, which were the root cause of the corruption
of the ASP.NET worker process, which would actually hang and finally got
recycled; if the worker process got recycled and you are using InProc
session state you will lose your sessions. Please check your registry to
see if the ASP.NET worker process is recycling unexpectedly.
Please also make sure all of the timeouts of your processModel section
[1] of your configuration file are set up correctly; incorrect values
could actually make your ASP.NET worker process recycle, thus yelding to
the aforementioned effect.

[1] http://msdn2.microsoft.com/en-us/library/7w2sway1(vs.71).aspx

Hope this helps.

--
Efran Cobisi
http://www.cobisi.com

Dean Cleaver wrote:
> Hi,
>
> I've got users complaining about the website timing out too quickly - I've set every timeout I can find to be 30 minutes but they're still complaining.
>
> I've set the Forms Authentication timeout to be 30 minutes sliding - website timeout is 30 minutes - but they seem to get booted in about 5 or 10 minutes - is there another timeout I have missed?
>
> TIA
> Dino
>
> ===================================
> This list is hosted by DevelopMentor® http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Chris Anderson
2007-07-30 21:11:25 UTC
Permalink
Loading...