State Management :: Multiple Database In A Application?
Dec 7, 2010
I have a application where login details are in 1 database and user details are in another database.Different cities have different database with common login database.As soon as user logs in i save the connection string name of its associated city database in a Session to access through out the application.Was wondering if this is the best possible way to do this? Will this cause a problem in Web Farms? Please let me know what is the best possible way to save a value which can be accessed through out the website and till what time is the value valid or expires?
I have 2 different applications hosted on an IIS server. I have created a new application pool.Can i run both the applications on the same pool??Will sessions or other values of one application be available to the other application if I do it this way?
I have a web application using window authentication. There are a search page and a edit page in the application. In search page, user can enter some search criterias in the textboxes and the search result will be displayed in the gridview by clicking the "Search" button. User can select any row from the gridview and it will take him to the edit page. In the edit page, there is a "Back" button to take the user back to the search page. I use session variables to remember what the search criterias the user entered in the textboxes and what page number the user was in the gridview. So when the user goes back to the search page, the textboxes are pre-populated with the search criterias and the gridview is displayed in the correct page number.
The problem is: If user1 opened one browser window and did a search using search criterias1, then user1 opened a 2nd browser window and did a search using search criterias2. When the user1 went back to the search page from the edit page using the first browser window, all the textboxes and page numbers are from the 2nd browser window, instead of the 1st one. Can anyone explain this problem to me and how to prevent it? It will be helpful too if you can give me some links about the similar problem. I am thinking if the same user logged on two different machines and did the search on each machine, what is the result?
We got a problem that Sessions got mixed up when open multiple tab in a single application. We could change the code that do not use session variable in a that level, but a tons of page need to be modified. We need to find a quick fix for this problem. Is any thing we can do in code level to prevent user open multiple tab in a single application? O any thing we can do to keep its own session for a single tab?
All we have a global ships position tracking website which runs smoothly until IIS application pool recycles.When there is workerprocess recycling looks like session state expires as a result i loose all session data and when customer clicks refresh button he is redirected to login page.
In web.config Session state mode is set to InProc so i changed it to State Server but to my luck i have MAP object which is not serialiazable which is causing the maps from not appearing on the website.I tried adding serializable attribute to the object class but still not succesfull.Our website is accessed by our customers whose count is more than 1000.
Changing the session state mode from InProc to StateServer can really slow down the response time so Is it good to go further fix the serailizable issues and move to state server?.
Is there any way I can retain my session data when application pool recyles?..
Stopping Application pool from recycling may not be a good idea considering health factor of web server.
I am getting this error while executing my Asp.Net application.i am not able to execute application using Visual Studio Interface and when i am trying to execute application from Local IIS. its executing well but when i am trying to click any button for searching etc it is giving this error. The state information is invalid for this page and might be corrupted. The detailed information is
[Code]....
[FormatException: Invalid character in a Base-64 string.] System.Convert.FromBase64String(String s) +0 System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +72 System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +4 System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) +37 System.Web.UI.HiddenFieldPageStatePersister.Load() +113[ViewStateException: Invalid viewstate. Client IP: 127.0.0.1Port: 1307User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249.1064 Safari/532.5ViewState: /wEPDwULLTIwOTUyMjAzMTgPZBYCZg9kFgICAw9kFgICCw9kFgICAQ9kFhgCAg8QDxYCHgtfIURhdGFCb3VuZGdkDxYFAgECAgIDAgQCBRYFEAUHQ2VudHJhbAUCODBnEAUITm9ydGhlcm4FAjgxZxAFB0Vhc3Rlcm4FAjgyZxAFCFNvdXRoZXJuBQI4M2cQBQdXZXN0ZXJuBQI4NGdkZAIJD2QWAmYPZBYKAgEPEA8WAh8AZ2QPFgUCAQICAgMCBAIFFgUQBQdDZW50cmFsBQI4MGcQBQdFYXN0ZXJuBQI4MmcQBQhOb3J0aGVybgUCODFnEAUIU291dGhlcm4FAjgzZxAFB1dlc3Rlcm4FAjg0ZxYBZmQCBw8QDxYCHwBnZGQWAWZkAgkPD2QPEBYBZhYBFgIeDlBhcmFtZXRlclZhbHVlBQItMRYBZmRkAgsPEA8WAh8AZ2RkFgFmZAINDw9kDxAWAWYWARYCHwEFAi0xFgFmZGQCCg9kFghmDw8WAh4JTWF4TGVuZ3RoZmRkAggPDxYEHgxNYXhpbXVtVmFsdWUFCTUvMjYvMjAxMB4MTWluaW11bVZhbHVlBQk1LzI2LzE5MTBkZAIMDxYQHhlDdWx0dXJlRGVjaW1hbFBsYWNlaG9sZGVyBQEuHgdDdWx0dXJlBQVlbi1VUx4bQ3VsdHVyZVRob3VzYW5kc1BsYWNlaG9sZGVyBQEsHg5DdWx0dXJlRGF0ZUZNVAUDTURZHhZDdWx0dXJlQU1QTVBsYWNlaG9sZGVyBQVBTTtQTR4WQ3VsdHVyZVRpbWVQbGFjZWhvbGRlcgUBOh4WQ3VsdHVyZU...][HttpException (0x80004005): The state information is invalid for this page and might be corrupted.] System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +106 System.Web.UI.ViewStateException.ThrowViewStateError(Exception inner, String persistedState) +14 System.Web.UI.HiddenFieldPageStatePersister.Load() +217 System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +105 System.Web.UI.Page.LoadAllState() +43 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242 System.Web.UI.Page.ProcessRequest() +80 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21 System.Web.UI.Page.ProcessRequest(HttpContext context) +49 ASP.pages__cmtickets_cmtickets_reports_cmtickets_search_aspx.ProcessRequest(HttpContext context) in c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesapp_mobily_alexmare1eddc658e6f2ba5App_Web_b9acfmsy.14.cs:0 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75 Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082
I am very new to asp.net. I developed one application. In that I have two pages. First page contains Application.Get() in page load event, here I read this Application variable, initially it returns NULL. If it is NULL, I make some buttons invisible. Then I jump to second page, in that page contains Application.Set(). Again I jump from second page to first page, this time Application.Get() is not NULL, I make some buttons visible.This is ok, if I execute the program in .net software.
But, when I publish this same program to web server like IIS, it is not working properly. After publishing very first time the first page returns NULL after that it doesnt return NULL even I closed the browser. I dont know why. In program, I used 2.0 framework. IIS also has 2.0 framework. Please clear this issue.
global.asax:-I have defined a struct (my_struct)-I add a List of structs (List<my_struct>) to Application["MyList"] In default.aspx:-I have defined the exact struct (my_struct) and want to cast the Application["MyList"] object to the List of structs.
example: x = (List<my_struct>)Application["MyList"];
I receive this error "Unable to cast object of type 'System.Collections.Generic.List`1ASP.global_asax+my_struct]' to type 'System.Collections.Generic.List`1[_Default+my_struct]'
Requirements: Create a Web Page in ASPx that will do the following:
1)One label will provide a count of how many times Button 1 has been clicked in the current session.
2)One label will provide a count of how many times Button 1 has been clicked by all users of the application. The Application Code for the Button should start at 100 (set this in the Global.asax file). this is what i have so far but i cant seem to get the application state to work properly.
aspx.vb
Partial Class _Default Inherits System.Web.UI.Page Dim clickcount As Integer
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Session("ClickCount") Is Nothing Then clickcount = 0 Else clickcount = CInt(Session("ClickCount")) End If If Not IsPostBack Then If Request.Cookies("UserName") IsNot Nothing Then Label1.Text = "Welcome Back " & Request.Cookies("UserName").Value & "." End If End If Dim clickCounta As Integer = CInt(Application("ClickCount")) End Sub Protected Sub PostBackSession_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles PostBackSession.Click clickcount += 1 lblClkCnt.Text = "Current Click Count is " & clickcount Application.Lock() Dim clickCounta As Integer = CInt(Application("ClickCount")) clickCounta += 1 Application("ClickCount") = clickCounta Application.UnLock() AppClick.Text = clickCounta Dim nameCookie As New HttpCookie("UserName", _ TextBox1.Text) nameCookie.Expires = Now.AddYears(1) Response.Cookies.Add(nameCookie) End Sub Protected Sub PostBackSession_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles PostBackSession.PreRender Session("ClickCount") = clickcount Application("ClickCount") = clickcount End Sub End Class global.asax <script runat="server"> Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) Dim clickCounta As Integer = CInt(Application("ClickCount")) Application.Add("ClickCount", 0) End Sub Sub Application_End(ByVal sender As Object, ByVal e As EventArgs) Dim clickCounta As Integer = CInt(HttpContext.Current.Application("ClickCount")) End Sub Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) ' Code that runs when an unhandled error occurs End Sub Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) End Sub Sub Session_End(ByVal sender As Object, ByVal e As EventArgs) End Sub
I am using a treeview in my master page and every node having link to its container page.That means click on any child node of treeview its redirect to another page by taking some value.
Now every time I click on nodes of treeview, its get collaps when child page loaded...
Now regaring maintain state of treeview across my web application...
Our ASP.NET App uses ASP State Session Management and has been rebuilt about 2 years ago [With .NET Framework 2.0]. We are currently in .NET framework 3.5 and have moved to SQL Server 2008 - but continue to use the same ASPState database. The State database has been upgraded to SQL Server 2008. Since then we have are seeing timouts/locks on ASPStateTempSessions table. I am wondering if we have to rebuild this database from scratch with some newer scripts?
I have upgraded our system from .NET 1.1 to .NET 4.0. I also had to update the ASP Session State database to version 2 by running the following command in the command window.
aspnet_regsql.exe -S localhostSQL2005 -d ASPState -ssadd -sstype c -E
Is there any way that I can configure the MSI setup project to check the ASP.NET Session State and install version 2 if needed?
we are experiencing big difficulties in the configuration of ASP.Net state service and II7. The service seems not working correctly because when the application pools recycles the applicatio loose the session.If we try the same configuration in IIS6 it works correcly.What is the correct way to configure the aspnet session state service in iis7?
How to pass query string from one application to another application, i need to send values through one page of application to another application,I am using inprocess session state. from loging page i need to send sessions to another applicaion but here sending sessions are some what diffcult (after googling).so is it possible through query strings???if yes How pass them please tell me the sample example.will it be possible through coockies?? or query strings. How
I Want To Use A Session Variable From One Application to Another Application. Is That Possible in ASP.NET 3.5 Or Greater To Use Session Variables As i Required. My Both Applications Host In Same IIS Server.
#Newbie alert# Only 8 months experience with school education back in 2002.
I'm using VS 2008, C# 3.5 to develop my own login system for our company website.
Originally we have a "simple" design which only had a login and order page.
That order page needs to be opened for 10-12 hours at the time while our stores are opened without having to relog into the system for each query.
We also have a requirement that some users need to access 2 different compagnies (separate inventories) which require 2 different logins.
I solved that "cross over" session problem by moving all the values into viewstate with my own viewstate manager class right after the login.
Now my problem is that we are adding more and more pages and I don't want to be stuck with the problem to resave the viewstate to session and then back on viewstate for every menu items and buttons.
Is there a way to create some sort of items list of all the sessions opened by the user and only transmit that from pages to pages?
i want to know if i want to use multiple server for my application. what should i do.e.g. if i used session to store some important data so as session get stored on server if my application use one server and server get crashed then my application also get crashed. So to avoid this problem what should i do (if solution is use multiple servers then how can i do that)
I have 2 front end servers and 2 back end servers. There is a registration form in my web application. The registration form uses a Microsoft Wizard control. Lets say the Wizard control has 4 steps. After the fourth step, users click "Finish" and I display the "Thank you Message". The way the request is routed between the 2 servers is round robin. So lets say till the fourth step, the response comes from server A. After the user clicks "Finish", lets say the response now comes from server B. After they click "Finish", I am trying to access some information in the Wizard control (like Name, address and so on). Because the servers are now switched, the data is lost (at least thats what I think is happening). So all entries in the wizard control are now blank and when I try to read those values, they are null.
I am sorry if this is been discussed earlier. I am having a problem maintaining the session when someone uses the same browser with multiple tab, the results gets messed up. A perfect example would be, [URL] if you open IE (or any other browser) and open two tabs and search for two different air travel itinerary and the results will completely overlapped (real mess). I know the cause for this problem (both tabs uses the same session). I would appreciate if somebody have any solution for this. I am using ASP.NET 3.5/VS 2008/VB.NETI will not be able to use Viewstate since I use a master page and pre-init event where view state is not available.
I have a DataTable which holds information on truck routes. When the user click on a route it display another table with details about the stop along that route. When they click a stop it shows what items were picked up at that stop. Three separate pages with 3 distinct DataTables. Currently I am storing them in the session. Normally, I would use the view state since the data only needs to live on that page. The reason I use the session is because each page is part of a Master pagelayout. There is an export button in the master page which gets the data in the session and exports it to an excel file. The issue is that when the user goes to the item level detail and uses a quick navigation link back to the route information the data for route is not reloaded into the session, just the page. If the user clicks export it will export the data set from the item level detail even though it is not displayed on the page