Rank: Newbie Groups: Member
Joined: 8/25/2008 Posts: 4
|
If I hardcode ClientSideOnChange="UpdateText1FontColor" in the markup, the call is made and everything works just fine.
When I make it dynamic and add attributes in page_load such as: pickFontColor.Attributes.Add("ClientSideOnChange", "Update" & FontColorTarget & "FontColor" The call is not made part of the control when rendered. I did a search on the source and the call was not there, but it is when hardcoded.
The colorpicker is in a UserControl called "TextData" that is embeded in another UserControl called "DisplayText". The "DisplayText" control is sitting on a webform inside a tab. The "Attributes.Add" code is in the page_load of the "TextData" usercontrol directly housing the colorpicker. The value "FontColorTarget" is a public property on the "TextData" usercontrol.
I put a beakpoint in the page_load and the correct value is there and the "Attributes.Add" method ececutes w/o error.
Any Ideas? Mike
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi Mike,
ClientSideOnChange is a server side property and it does not directly map to any client side DHTML attribute. So you won't be able to do it that way. I am a little bit confused about your UserControl structure, but if pickFontColor is the color picker, you would simply do:
pickFontColor.ClientSideOnChange = "Update" & FontColorTarget & "FontColor"
If the pickFontColor is the user control, you can put similar code inside the user control's Page_Load. The key is, you use colorPicker.ClientSideOnChange = "something" instead of colorPicker.Attributes.Add("ClientSideOnChange", "something).
Please feel free to let us know if you still need any more help.
Thanks
|