|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Dynamically changing LinkButton propertiesI currently have several LinkButton controls contained inside a placeholder
in my asp.net form. When a user clicks on any one of these, I need to change the clicked LinkButton's CssClass. I am trying to do this inside of the command event handler for the LinkButtons. However, I cant gain access to the LinkButton properties. The only things I have access to are the command arguments and the command name. I have also tried using the Findcontrol method to gain access to it's properties, but to no avail. AND I have also tried to use themes, but apparently these MUST be in place in the page pre- init (I need to change it dynamically). Does anyone have any ideas as to how this can be accomplished? Thank you for the help TR -- Message posted via DotNetMonster.com http://www.dotnetmonster.com/Uwe/Forums.aspx/asp-net-web-controls/200601/1 In message <59f54c1d266f1@uwe>, treilly via DotNetMonster.com
<u15154@uwe.?.invalid> writes >I currently have several LinkButton controls contained inside a placeholder private void LinkButton1_Command(object sender, CommandEventArgs e)>in my asp.net form. When a user clicks on any one of these, I need to change >the clicked LinkButton's CssClass. I am trying to do this inside of the >command event handler for the LinkButtons. However, I cant gain access to >the LinkButton properties. The only things I have access to are the command >arguments and the command name. I have also tried using the Findcontrol >method to gain access to it's properties, but to no avail. AND I have also >tried to use themes, but apparently these MUST be in place in the page pre- >init (I need to change it dynamically). Does anyone have any ideas as to how >this can be accomplished? Thank you for the help { LinkButton l = (LinkButton)sender; l.CssClass = "MyCssClass"; } ? -- Steve Walker Thank you very much Steve. I don't know why I didn't think of that myself.
I had gone about doing that a different (not to mention, stupid) way by creating a new control using the FindControl method, and then trying to access it through there. Thanks again!! -- Message posted via DotNetMonster.com http://www.dotnetmonster.com/Uwe/Forums.aspx/asp-net-web-controls/200601/1
Disable Button after click it
Panel Syntax Dynamically load webcontrol I really need to get this working...... dropdownlists, their items and viewstate WebControl Click Event Not Firing ButtonColumn and EditCommandColumn don't work together as expected in DataGrid Dynamically show different web controls DynamicMenuItemStyle override style (cursor:text) Clearing textbox controls after postback |
|||||||||||||||||||||||