I have a user control (the one which is .ascx), it has lots of asp:Panel, asp:Image and asp:Button elements. I need to pass client IDs to javascript and css. Right now the javascript and css are included in the markup of .ascx control. So what is the best way to pass the client IDs?
Share
In your javascript in the .ascx control you can use something like the following:
That will render the panel’s client id as a string into the panelId variable in javascript.
For css, I recommend just using the CssClass property when possible and to avoid inline css.