Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > edit attribute values of a web control just before control rendered to the page (control's Load event?)

Reply
Thread Tools

edit attribute values of a web control just before control rendered to the page (control's Load event?)

 
 
TJ
Guest
Posts: n/a
 
      04-03-2006
I am using a third party web control that doesn't let me access to the
control's attributes. This is a rookie question, but is there way to
essentially look at, find/replace a control's attributes just before it gets
rendered to the page? I thought the control's Load event could be used
here. Can anyone point me in the right direction?

..net 1.0
C#
VisualStudio 2003

p.s. The control is in a TableCell in a DataGrid. I can add to the control
no problem using the grid's ItemDataBound event, I just grab the control
(using FindControl) and then use Attributes.Add() to add more stuff. But
I'm dying to edit an existing attribute's value just before it goes out the
door.

p.p.s. Is it possible to read a control's existing attributes during the
ItemDataBound event in a grid? I have a workaround for the above situation
if I could do this successfully.

Thanks in advance,

TJ


 
Reply With Quote
 
 
 
 
TJ
Guest
Posts: n/a
 
      04-03-2006
Found out how to loop through controls attributes, but they don't exist yet
in the ItemDataBound or ItemCreated event's of the datagrid. That's
probably why I am unable to see/edit the third pary control's existing
attributes..they don't exist yet. So I guess again, I just need to now
when that final collection is available so I can affect change.

Thanks again in advance.



"TJ" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am using a third party web control that doesn't let me access to the
>control's attributes. This is a rookie question, but is there way to
>essentially look at, find/replace a control's attributes just before it
>gets rendered to the page? I thought the control's Load event could be
>used here. Can anyone point me in the right direction?
>
> .net 1.0
> C#
> VisualStudio 2003
>
> p.s. The control is in a TableCell in a DataGrid. I can add to the
> control no problem using the grid's ItemDataBound event, I just grab the
> control (using FindControl) and then use Attributes.Add() to add more
> stuff. But I'm dying to edit an existing attribute's value just before it
> goes out the door.
>
> p.p.s. Is it possible to read a control's existing attributes during the
> ItemDataBound event in a grid? I have a workaround for the above
> situation if I could do this successfully.
>
> Thanks in advance,
>
> TJ
>



 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      04-04-2006
Hi TJ,

Thank you for posting.

Regarding on your condition, you want to do some customization on a 3rd
party developed control before the control being rendered out at runtime.
Since you're not overwriting the control and just use them in your
application, I think it is the correct approach that we use events to do
the customization. And based on my experience, the "PreRender" event of web
server control is the last event we can do some customization on the
control before rendering and the modification on the control in Prerender
will be persisted into ViewState(if that property utilize viewstate):

#Control.PreRender Event
http://msdn.microsoft.com/library/en...webuicontrolcl
assprerendertopic.asp?frame=true

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

 
Reply With Quote
 
TJ
Guest
Posts: n/a
 
      04-06-2006
That's it, that's it. Thanks so much for pointing in the right direction.

; )

-TJ



"Steven Cheng[MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi TJ,
>
> Thank you for posting.
>
> Regarding on your condition, you want to do some customization on a 3rd
> party developed control before the control being rendered out at runtime.
> Since you're not overwriting the control and just use them in your
> application, I think it is the correct approach that we use events to do
> the customization. And based on my experience, the "PreRender" event of
> web
> server control is the last event we can do some customization on the
> control before rendering and the modification on the control in Prerender
> will be persisted into ViewState(if that property utilize viewstate):
>
> #Control.PreRender Event
> http://msdn.microsoft.com/library/en...webuicontrolcl
> assprerendertopic.asp?frame=true
>
> Hope this helps.
>
> Regards,
>
> Steven Cheng
> Microsoft Online Community Support
>
>
> ==================================================
>
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
>
> ==================================================
>
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>



 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      04-07-2006
You're welcome TJ,

Have a nice day!

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
changing rendered page just before it gets to the user david2tm@gmail.com ASP .Net 5 10-09-2006 08:18 PM
Snapshot restraint - edit, edit, edit Alan Browne Digital Photography 24 05-10-2005 10:15 PM
Snapshot restraint - edit, edit, edit Patrick Digital Photography 0 05-06-2005 10:53 PM
Set webcontrol properties before control is rendered? =?Utf-8?B?UG9rZXJKb2tlcg==?= ASP .Net 1 10-02-2004 01:04 AM
half rendered page on first load :-( after refreshing everything is fine Daniel Walzenbach ASP .Net 7 02-10-2004 09:02 AM



Advertisments