Can C# Themes Be Used Per User Session
Aug 20, 2010Can ASP.NET themes be used per user session ? Ex : For one user,User theme called "Green" and for another user Use the theme called "Red". Or themes are for the enire web app ?
View 1 RepliesCan ASP.NET themes be used per user session ? Ex : For one user,User theme called "Green" and for another user Use the theme called "Red". Or themes are for the enire web app ?
View 1 RepliesI have a simple ASP.NET web site with membership (using SqlMemberShipProvider). I allow users to select a theme to setup a design of the pages they like.
Now the question is: Where shall I store this selected theme per user?
My initial idea was to use profiles. So I have defined a profile property called "Theme" in the web.config file. All this works so far as long as the user has logged in to the web site.
But there remains one open point:If the user isn't logged in and enters the login page how can I make sure that he sees the login page with the theme he has selected before?
Obviously (at least I think it's obvious) I cannot pull the theme of the login page from the profile of that user as long as he hasn't logged in.
So how can I overcome this issue? Is it perhaps the wrong place to store the theme in the user profile table? Should it be better stored somewhere on the client PC of the user?
I am doing a community website. Assume that I am giving an option to all my users to choose a theme. That we happen see on websites like Orkut , Gmail etc..Actually we can keep only one theme inside the web config right ?. During dynamic change all the other user's themes will also change. How to avoid this?
View 1 RepliesI'm trying to set profiles/themes using a basepage to allow the colour of my site to change for users. I can do this on a single page but I'm trying to do this site wide and am getting an error.
I've been watching http://www.asp.net/general/videos/how-do-i-create-user-selectable-themes-for-a-web-site this tutorial
but I'm getting errors at the final step...
System.NullReferenceException was unhandled by user code Message="Object reference not set to an instance of an object." Source="App_Code.gflsvdcc" StackTrace: at BasePage.OnPreInit(EventArgs e) in D:WebsitesBalticQuarter19.01.11App_CodeBasePage.vb:line
9 at System.Web.UI.Page.PerformPreInit() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) InnerException:
is the error, The error occurs because of the line 9 =
9 - Me.Theme = Request.Form(Me.Master.FindControl("DropDownList1").UniqueID)
If I insert this instead of the text above the colours change on the site.
Me.Theme = Request.Form("ctl00$DropDownList1")[code].....
Let suppose, I am building an asp.net website which has login scenario in it. I want to provide a certain functionality to the website that if the user is already login on computer 1 and now try to login on computer 2, so he will be allowed to remain login on computer 2, while automatically logout him from computer 1. I also know that http is a stateless medium, so whenever user interact with computer 1 and try to interact with the page, it will get noticed at that time.
View 2 RepliesI have a website live in asp.net
now if user closes browser. the session does not get killed.
I spoke with friend and he said that cannot be done as sessions are on server.
but i see banking website who kills session when browser is closed.
I have written a SP which maintains users log in and log out history,it works fine when any user logs in or clicks on log out, problem is that as per need its not to allowed to keep the screen idle for 1 minute or more then in the log out column Null value is passed.
SP
Create proc usp_trackuserlogindetails
@username varchar(50) = null,
@command int = 0
as
BEGIN
if(@command = 0)
begin
insert into userlog (USERNAME,LOGIN,LOGOUT) values (@username,Getdate(),Null)
[Code] ....
Here when user manually clicks the log out button then 1(table above) is the output.
When user leaves the screen idle then after 1 minute the page goes to the Login.aspx page if the user tries to do something on the current page,here 2(table above) is the output can i store some hard core value instead of Null like Session expire or the exact session expires time.
Is it possible to perform user management (store user info, login , logout etc) without using session or cookie?
View 3 RepliesURL.... Still there will be need of url in ajax method if i put javascript in site.master.cs . As what i have understood from that mysite.master.cs will be like this :
protected void Page_Load(object sender, EventArgs e) {
try {
if (Session["Prefix"].ToString().Trim() == "sys_admin") {
UserNameMasterLabel.Text = Session["UserName"].ToString().Trim() + " (ADMIN)";
[code]....
And site.master will be like this :
And I have to put next method in DailyLog.aspx page ? like this
System.Web.Services.WebMethod(EnableSession = true)]
public static int RefreshSession() {
HttpContext.Current.Session["Name"] = "BSD";
Configuration config = WebConfigurationManager.OpenWebConfiguration("~/Web.Config");
SessionStateSection section = (SessionStateSection)config.GetSection("system.web/sessionState");
int timeout = (int)section.Timeout.TotalMinutes * 1000 * 60;
return timeout;
}
But I have several pages in my website , by doing the above story will it work for Builder.aspx ? or any other page rather than dailylog.aspx ?
How to Check whether user is valid and authenticated without using Session in ASP.Net ....
View 1 RepliesI am a little bit new at handling multiple sessions congruently.
Basically i have created a chat application. In which i have a moderator page.
Now the moderator has the privilege to block particular users from the chat. Every user including the moderator has a session variable defined as Session["UserID"].
e.g for the username "moderator" the Session["UserID"]=moderator.
Now as i am logged in as the moderator how do i delete the session of a particular user whom i want to block the chat from commencing.
how to maintain the session that doesn't expire unless and until user logout.
View 1 RepliesHow to automatically log out after 15 mins by using asp.net vb.net ....
View 1 RepliesI have made a web page in which there is login screen when user login it goes next page but my problem is if i directly enter the url of that page it open. I want it should not open unless the user log in...
View 1 RepliesI am a beginner in ASP.Net. I want to know what is CSS, Themes and Skin in ASP.Net? and How to create and use these things in ASP.Net? Please explain with simple example.
View 1 RepliesWhat is the best practice to apply different themes to different customers with asp.net.
View 4 RepliesI am using the UrlRewriter.NET library to perform URL rewriting. I noticed that themes do not work properly as the browser tries to retrieve the CSS file incorrectly.
The link tag generated by ASP.NET automatically is as follows:
<link href="App_Themes/vertebrata/style.css" type="text/css" rel="stylesheet" />
URL typed into browser: localhost:1708/BloggingEngine/aa Displays fine
URL typed into browser: localhost:1708/BloggingEngine/aa/ Browser does not load the CSS file
I can probably fix the problem by prefixing a "/" before the URL in the href attribute, but this is dynamically generated by ASP.net depending on selected theme and I have no control over it.
How do I get ASP.net to load themes properly?
I have a portfolio website I am building for fun, I am graduating about this time next year. I have added ASP.NET themes to this portfolio website, and I have added themes to other ASP.NET sites before. I really love the feature! I have been noticing though that other sites (not asp.net that I've seen) change "Themes" without the page refreshing and I understand its probably just changing which CSS the site is using. Is there a way to do something like this in ASP.NET 4.0?
I am just setting the default theme in the web.config, and then setting a session variable through a couple asp:ImageButton's, then in the Page_PagePrePreInit setting the page.theme to the session variable. This is my first time taking that route, I usually use "profiles" to save the theme info.
I am working on asp.net website and i want to implement themes on my site. If i select any theme then it will change whole UI not only colors. After Change it will show a new User interface. Like change in div size, width and location same for controls and same all html tag that is used in page.
I got lot of example of themes where it it changing only UI color.
Change themes in asp.net 2.0
View 3 RepliesI think i understand the benefit of using themes but I want to be sure I understand correctly. I have previously used css to style my pages. I'm thinking about using themes in my next project. It provides a way to switch between the visual style of web controls and html elements. This could be done by allowing the user to choose a theme that is to their liking.
View 9 RepliesSince Themes in ASP.NET are used to style elements of your site, I was just wondering why would you use Themes rather than CSS, or is it common practice to use both? If so, when would you opt for one versus the other and why?
Just seems to me like Themes are kind of unnecessary, so I am just looking on clarification if there really is a good reason to use them, or it's just a part of the framework as an alternative(unnecessary) step to styling your site.
I'm using the Google CDN to load my JQuery file. However, I'd like to have my master page use a separate theme to my content page. Is this possible when using the CDN? I'm using ASP.NET.
View 2 Replieshow do i implement themes like ask.com to my websites? Should i be using Ajax, according to one of my friend it is done using JQuery? Also it will be a great help if someone can redirect me to a tutorial (asp.net and/or php).
View 2 RepliesI use ASP.NET C# in a Web Application Project (not web site).
I would like use ASP.NET Theme feature for my Web Application.
From the root of my project I am able to create a special folder App_Themes
Root/App_Themes --WORKS
but I need have App_Themes folder in a different level, in my case:
Root/Cms/App_Themes --DOES NOT WOEK
I notice that Visual Studio does not allow insert an App_Themes in a sub folder.