Hi Kenfine,
Any progress on this issue? Does the suggestions in our former messages
help ? If there're any thing else we can help, please feel free to post
here. Thanks,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| X-Tomcat-ID: 65427049
| References: <uX************ **@tk2msftngp13 .phx.gbl>
<#j************ **@TK2MSFTNGP14 .phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From:
st*****@online. microsoft.com (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Fri, 16 Sep 2005 03:38:03 GMT
| Subject: Re: +Simplest+ way to attributes to all of a particular Web Form
control type?
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| Message-ID: <le************ **@TK2MSFTNGXA0 1.phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| Lines: 67
| Path: TK2MSFTNGXA01.p hx.gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1250 27
| NNTP-Posting-Host: tomcatimport2.p hx.gbl 10.201.218.182
|
| Thanks for Peter's inputs.
|
| Hi Kenfine,
|
| As for your scenario, I think using a custom Control will be a prefered
| approach since dynamically loop through the Page's Controls collection
and
| sub control's collection recursively will be very expensive. Also, if you
| just loop through the top level control(which underneath the HtmlForm ) ,
| that's OK. If some of those controls are nested in other controls or in
| very deep hierarchy, I think use Custom Control to centralize the
operation
| will be more reasonable. Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure!
www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
|
|
| --------------------
| | From: "Peter Rilling" <pe***@nospam.r illing.net>
| | References: <uX************ **@tk2msftngp13 .phx.gbl>
| | Subject: Re: +Simplest+ way to attributes to all of a particular Web
Form
| control type?
| | Date: Thu, 15 Sep 2005 16:40:40 -0700
| | Lines: 27
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
| | X-RFC2646: Format=Flowed; Response
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
| | Message-ID: <#j************ **@TK2MSFTNGP14 .phx.gbl>
| | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| | NNTP-Posting-Host: 70.97.58.2
| | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP14.phx. gbl
| | Xref: TK2MSFTNGXA01.p hx.gbl
| microsoft.publi c.dotnet.framew ork.aspnet:1250 02
| | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| |
| | Well, you mentioned that you could extend a particular type. In that
you
| | could write the attribute out, so instead of using TextBox, you might
use
| | your custom control MyTextBox that inherits from TextBox.
| |
| | You could also in the PreRender event, for instance, cycle through all
| the
| | controls on the page using what is in the Controls collection. Then
you
| can
| | check their type and output the attributes accordingly.
| |
| |
| | <ke*****@nospam .nospam> wrote in message
| | news:uX******** ******@tk2msftn gp13.phx.gbl...
| | > For a given web form, I want to know what the +simplest+ way to add
an
| | > attribute to all of a particular control type on that page. For
| example, I
| | > might want to add an onClick attribute to all TextBoxes on the page,
| e.g.
| | >
| | > [TextBoxName].Attributes.Add ("onKeyUp", "dosomething(ev ent);");
| | >
| | > I know that I can create a custom user control or custom control or
| | > otherwise extend stuff with some work. I'm wondering if there's a
| quicker
| | > and dirtier way to do this on a per-page basis.
| | >
| | > Thanks.
| | >
| | > -KF
| | >
| |
| |
| |
|
|