Adding multiple attributes to one control event
-
Does anyone know how to add multiple attributes (e.g. client function names) to one specific event? Im looking for a way to do this:
((HtmlControl)Master.FindControl("masterBody")).Attributes.Add("onload", "function1();");
Then from a different page, add this:((HtmlControl)Master.FindControl("masterBody")).Attributes.Add("onload", "function2();");
Without writing over the existing attribute, because that's what it is doing now :-( Any help is much appreciated!Nila "...for that, I will need a large cup of coffee and a bran muffin!" -Samantha Bea
-
Does anyone know how to add multiple attributes (e.g. client function names) to one specific event? Im looking for a way to do this:
((HtmlControl)Master.FindControl("masterBody")).Attributes.Add("onload", "function1();");
Then from a different page, add this:((HtmlControl)Master.FindControl("masterBody")).Attributes.Add("onload", "function2();");
Without writing over the existing attribute, because that's what it is doing now :-( Any help is much appreciated!Nila "...for that, I will need a large cup of coffee and a bran muffin!" -Samantha Bea
string OnLoadString = ((HtmlControl)Master.FindControl("masterBody")).Attributes["onload"]; ((HtmlControl)Master.FindControl("masterBody")).Attributes.Add("onload", removed + "function2();");
Unless I'm missing something removed is actually OnLoadString but CP changes it
only two letters away from being an asset
-
string OnLoadString = ((HtmlControl)Master.FindControl("masterBody")).Attributes["onload"]; ((HtmlControl)Master.FindControl("masterBody")).Attributes.Add("onload", removed + "function2();");
Unless I'm missing something removed is actually OnLoadString but CP changes it
only two letters away from being an asset
You ARE and asset! Thanks for the tip, I can be clueless sometimes :-O
Nila "...for that, I will need a large cup of coffee and a bran muffin!" -Samantha Bea
-
You ARE and asset! Thanks for the tip, I can be clueless sometimes :-O
Nila "...for that, I will need a large cup of coffee and a bran muffin!" -Samantha Bea
Sometimes I need to be reminded of the simple things also.
only two letters away from being an asset
-
Sometimes I need to be reminded of the simple things also.
only two letters away from being an asset
i hear ya... remember debugging for hours just to find out you are missing that d*mn semicolon?!? ;P
Nila "...for that, I will need a large cup of coffee and a bran muffin!" -Samantha Bea