|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
edit attribute values of a web control just before control rendered to the page (control's Load evencontrol'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 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. Show quoteHide quote "TJ" <teejay@newsgroups.nospam> wrote in message news:OUDFuo1VGHA.2040@TK2MSFTNGP15.phx.gbl... >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 > 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-us/cpref/html/frlrfsystemwebuicontrolcl 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.) That's it, that's it. Thanks so much for pointing in the right direction.
; ) -TJ Show quoteHide quote "Steven Cheng[MSFT]" <stch***@online.microsoft.com> wrote in message news:7Twfka5VGHA.1376@TK2MSFTNGXA01.phx.gbl... > 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-us/cpref/html/frlrfsystemwebuicontrolcl > 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.) > 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.)
How to get ListItemValue and ListItemText from a Combo using SendMessage
checkbox bind with 0 = checked? error using .NET CrystalReportViewer (.NET 1.1 VS.NET 2003) Problems with dynamically created GridView/DetailsView Removing columns from Gridview(2.0) databinding on templatefileds dont work? Rendering a Treeview Control Problems Updating GridView when bound to datatable DataGrid item dropdownlist javascript disable InputAttributes in RowCreated (gridview) GridView XmlDataSource |
|||||||||||||||||||||||