Scenario
1.To add CSS class dynamically
2.Different CSS for Different Browser
.aspx
<asp:Button ID="Button1" runat="server" Text="Button" CssClass="dynamic" />
Code Behind
Dim classStyle As New System.Web.UI.WebControls.Style()
classStyle.Height = 150 //any property
Page.Header.StyleSheet.CreateStyleRule(classStyle, Me, ".dynamic")
Note
For Browser Specific
If (browser.Browser == "Chrome" ){.......}
More Details
1.To add CSS class dynamically
2.Different CSS for Different Browser
<asp:Button ID="Button1" runat="server" Text="Button" CssClass="dynamic" />
Code Behind
Dim classStyle As New System.Web.UI.WebControls.Style()
classStyle.Height = 150 //any property
Page.Header.StyleSheet.CreateStyleRule(classStyle, Me, ".dynamic")
Note
For Browser Specific
If (browser.Browser == "Chrome" ){.......}
More Details
No comments:
Post a Comment