Hi Everybody

I am trying to explore the master page fanctionalities, in which I come across a question.
I am trying to change the CSS of the master page, based on user options
I have tried the below code,in the master page page_load. But it seems it is not working.
Can anyone suggest something other than this? or tel me where have I gone wrong?

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim contactID As Int32 = CType(Session.Item("ContactID"), Int32)

Dim CSSPath As String = CType(Session.Item("CSSName"), String)
CSSPath = "~\CSS\" & CSSPath & ".css"
If Not CSSPath Is Nothing Then
' Page.StyleSheetTheme = CSSPath.ToString()
End If
End If
End Sub
Note:
Here the CSSPath will return the CSS files name.
Hope someone will help me in resolving this
Thanks

Recommended Answers

All 3 Replies

Thanks

I got it worked

no problem

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.