State Management :: Recompile Website Every Time On Adding New Profile Element
Aug 3, 2010
I've done a bit of searching on this subject and haven't found anything so far. I am successfully using the Profile object and am saving Profile records away into my SQL Server Database. I have checked using the stored procedures and viewed the individual records to know they are there. However, I want to create a WebForm that can enumerate through all of the users in my Membership DB (Same DB as the Profile DB) and list each user in a grid showing what values each user has within their profile. For example:
Username
Profile Element 1
Profile Element 2
Profile Element 3
bob
true
false
true
fred
true
false
true
I want however to replace the 'Profile Element 1' etc etc to display the actual name of the Profile. I would like to do this programmatically so I don't have to recompile the website everytime I add a new Profile element.
I read somewhere the website quits running after sometime if no one pings it. I wanted to know is there any way on IIS 6 that will keep the website up all the time(alive) even if no one accesses it
I work in a multi server , multi webfarm environment (without sessions). We need to be able to identfy if a customer has arrived here for the first or has been before (even though they have not logged in)Not only will we change the text of our salutations depeding on this state but we will also use it in other busness logic. I can check for the existance of a cookie when they fire the Session_onStart event but I would have to write a cookie out to show they had previously visited for the next time the customer came to call.
If I wrote the cookie out in the Session_onStart then somehow I would have to tell the website that this was a first time visit. Also as this is a stateless webfarm - the next server may be different from the previous one which would fire a new Session_onStart event in its own right - which would see the cookie and assume it was not my first visit, even though it was my first visit on a different web page of the web site.
I dont want to write it out and say if its within X minutes of the cookie creation time you are still in your first visit as that x minutes wouldnt work 100% of the time If I dont write the cookie out on Session_onStart then when could I write it out?
I have one website in which there is one page along with one ascx as registered into it. In the ascx where user can add some order details and click on "Make Payment" button, then there are following 2 cases...Case I: If user was not logged in, then a modal popup will open which has login ascx with 2 buttons Register & Login. In this case user either Login or Register and continue with "Make Payment".
I am looking for an elegant (i guess as elegant as it can be) solution to caching a users profile on login (whether it is session, cache, cookie, etc) and keeping it in sync when a users profile is changed. How do you guys handle this? Just simply call a Flush() method in your Save() method that invalidates the cache?
I am learning how to use profiles. My profile properties are defined in web.config and wish to add selected checkboxlist values to user profiles.TextBoxes and RadioButtonLists all seem to work fine, but not my CheckBoxList values.How do I go about making this work?
i've a songs website, where i'm adding items to cart for users who are logged in, but when a song is deleted from the website the users still have the cart info still intact, i'd like the songs in the cart also too be deleted when the song from the website is gone, how may i accomplish this ?
i have defined profile properties in my web config file but unable to access them in code behind. even profile object is not available. i have to writer fully qualified name like System.Web.Profile. below is my web config
I need to implement the following feature for a shopping cart using profile:
1. User opens the site from Computer A and selects items which are added to the shopping cart. Now suppose the User logs in the same items should be displayed in the shopping cart as before he logged in. Now say he adds some more items to the shopping cart and logs out, then the items he added newly should also be displayed in the shopping cart.
2. If the same User as in Step1 opens the site from Computer B and logs in there should be a different profile entry for him and he is not to be shown the items that were selected in the shopping cart in Step1.
I feel I need an implementation of the profile on per user+ computer basis for logged in Users. We have this kind of requirement for a B2B site where companies will have only one common login and it will be used by many Users to order items.
I'm still debugging my application so it's on the local server. As I debug and stop then debug again, eventually lblNoOfUsers.text turns to "0" instead of "1", even as I'm navigating my application. It only turns to "1" again if I log out and sign back in. It's almost as though Membership.GetNumberOfUsersOnline my login are referencing two different session states. How is this possible? Does asp.net create a new session state cookie each time I start debugging?
is my session related tag in web.config file but most of the time if i idle 20 minutes then its automatically timedout and went to my login page, is there any solution ?
I'm having problems with the sessions states on my application.When I run the application off my c drive all the session variables are there. Everything works perfectly, nothing is wrong.However, when I publish the site to a server test environment, the session variables disappear. Why is this? Is there a way around this?Here is my codes.for retrieving it. Note, the session.count actually is 0.
The value of the label1 is "system3=testing" no matter if I run it the first or subsequent times. It should be "1" after the first time. Does anyone know why?
protected void Page_Load(object sender, EventArgs e) { HttpCookie bCookie3 = new HttpCookie("System3"); // Cookie declaration //if (bCookie3["System3"] != null) //{ // Response.Cookies.Remove("System3"); // return; //} int val = 1; System.Diagnostics.Debugger.Break(); if (HttpContext.Current.Request.Cookies["System3"] == null) { bCookie3["System3"] = "testing"; bCookie3.Expires = DateTime.Now.AddYears(2); Response.Cookies.Add(bCookie3); Response.Cookies["System3"].Expires = bCookie3.Expires; //Maximum year of cookie's life } else { bCookie3["System3"] = val.ToString(); } Label1.Text = Request.Cookies["System3"].Value; }
We are developing a website in which we have a gridview where we have added a hyperlink field to navigate to another web form. Here we have to enter a particular value from the gridview to session in order to display it in another web form as a label.As we are bit new using .Net, could any of you guys please help us in finding a solution.
I have Master Page and in master page i have user control, where i want to keep adding value in mention list class and i want to use this list class values in other pages.
How can i adding value in list class without intializing with new??
I have developed application in ASP.NET and placed on UAT server (windows XP IIS) where it worked fine but since I moved on production server (windows 2003 + IIS) after sometime its keep on expiring the session.
Please suggest urgently if possible how i can make it not to expire session at all.
I want to be able to detect from C# code how long ago a user logged into the site. I need to take a particular action if it is their first time logging in. IsNewSession does not work, unfortunately.
I set session timeout is 30 at my webconfig. But when i upload a file and click submit button already session timeout. I uploaded 1kb file. I can submit 1 time.
I am creating a static variable and adding to session.This variable has value that is user specific. Now I am getting a problem with this users are complaining that they are getting values that should be another users. It's like a mix up with session. Could this be because of static variable declaration?