c# - Customized theme for every logged in user -
i have dotnet 3.5 webforms application entity framework used. not able figure out how give customized theme every logged in user, twitter users have ui change(logo, color,etc)
please help.
according view creating different-different css/theme
not possible here. because going deal thousand of users.
creating multiple themes
or css
can work if create 4-5 themes/css
.
i have solution you, can create many different css
. have create column in user table like:
usertheme
or userstyle
varchar(max)
and when going register user can create dynamic css
on basis of primary key , change css
attributes below:
body { color: #cc0033; background-color: #996666; }
here can create unique color codes or background color codes below:
color: #cc0033;
breakdown:
#(constant) cc(it can first digit of first name , second name) 00(it can random value) 33(it can user primary key)
now can create unique color codes , background-color codes body
, save table column have create before sec ago.
and when going create logged in user dashboard have render custom css
@ master page code behind below:
c# code:
<style type="text/css" runat="server" id="htmlcss"></style> var css = @" body { background-color:#b0c4de; }"; // server css goes here htmlcss.innerhtml = css;
hope logic helps you.
thanks
Comments
Post a Comment