Web Forms :: Where Shall I Store User Selected Themes
Jan 23, 2010
I 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'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 =
Can 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 ?
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?
I recently switched computers and now when I attempt to run my web project on my local machine I am receiving:[PolicyException: Required permissions cannot be acquired.]But if I publish it to my website everything seems to work correctly. I have done some research on this and it appears to be a security issue with one of the assemblies but I'm unsure which and how to go about figuring out which it is.Also, when I get on the Web Site Administration Tool and under the security tab I am seeing:"There is a problem with your selected data store. This can be cauesd by an invalid server name or credentials, or by insufficient permission. IT can also be caused by the role manager feature not being enabled.
I must be doing something wrong, but this makes sense to me. I have a Listbox loaded with tons of items from a datasource. A user clicks one of these items it grabs the selectedindex (an integer) and stores it in a HiddenField (works fine).
Now when the page does a complete a refresh (after postback) I want the ListBox to go back to that selectedindex that is in the HiddenField. Problem is, it seems that after postback the HiddenField is empty? Then I thought about storing the value in an Integer variable in code, but that is simply coming up as a zero at all times.
Question 1: What is the best/simplest way to do this?
Question 2: How?
I am currently grabbing it on selectedindex change
I am working in asp.net 3.5 with c# and sqlserver 2005 as database. I my project i have to select some of the checkbox of a gridview and update the database according to that. I want to store all the selected box in a arraylist and update the database according to the selected list . But i am not getting how to proceed.
I have a listbox control data bound to a data source and I want to be able to get the value of each selected item so that I can use that information to form an insert query for another table. In other words be able to select a few items out of the returned list and get the selected value of each. I tried using a for each statement but came up with some strange numbers.
Our application lets the administrator create new users. Since the administrator is logged in, I have set Logincreateduser = false so that the administrator is not logged out even after creating the new user.
The problem is :I need the userid of the newly created user to store additional details of the user in another database table. I see that i can get the username using Createuserwizard1.username; but how do I get the userID?
I have a custom membership user class and custom MembershipProvider working against database. Due to security reasons the user passwords are stored in the database as hashed values. So my procedure
public override bool ValidateUser(string username, string password) is { //select hashed password from db return (EncodePassword(password) == dbpassword) } [code]....
iam creating a customized dashboard using web parts and i am new in web parts..i wanna a way to store user setting in XML file .. how can i achieve that ?
I am have done a basic asp.net application User Module with out using any authentication classes.
Now I need to store last user login details in my asp page when user performs any operation. and need to show to other User who next login that ( the last user has made changes before ).
I am currently trying to implement a small class attendance system, where the student names are taken from a database, stored in a List<Student>, and bound to a Repeater control. Each row of the Repeater contains two columns: The first is the student's name, and the remaining column contains a RadioButtonList with three ListItems (Present, Absent, Sick).Now, once the user presses "Submit", I want to be able to store their attendance status based on the user selection. However, after submission, the SelectedIndex is always 0, no matter what option is selected.
i have read your article on aspsnippets.com. Multilingual Website and i have implemented that i works good .but there is new problem arrising. suppose my default language is english set in internet option so the whenever website reloaded or redirected then all content will show in english language but
when i changed it to hindi then current webpage converted to hindi but after that if i pressed any button on current page or i redirected to any other link of particular website then again hindi is converted to english.
In my pages, the first thing I do when a page is being displayed is query a table called user preferences. I'm doing this for every page and I was wondering what are the options available to avoid repeating this query as the user jumps from page to page on my application.
When the user logs in, I want to store his userID in the session with
HttpContext.Current.Session["UserID"] = 2354; (this is just a hard-coded example)
Then, when I run a page method, if I do
var test = HttpContext.Current.Session["UserID"];
will the variable test hold the value I stored when he logged in?
If this is a correct way of doing it, how do I access the session when I receive a call from a page method? I want to put the test =... line in a page method to identify which user the request is coming from.
Using SQL and C#. I have a gridview with a template field. I need to modify the some items in the gridview when the user selects a given record and store the values back in the database. ProjectID is the unique key in the database.Gridview is done as a table. How can I do it? Here is my grid view implementation.