I'm running a 2.0 .NET app on my local machine; the app uses Global.asax to trigger logic at both Application and Session Start. Up until this week, session management in this application was behaving normally. Now, after no apparent change to my system, it is not. The application has a sign-on screen at startup, in which the user selects a user profile, and proceeds to a main menu. The user info is stored in a Session object, and carried forward to the main menu for the remainder of the application. Normally, a new session is created when the user times out; however, I am finding now that, on my machine, a new session is created on each form change (Response.Redirect, window.open, etc.)
Web.config for the app, when testing locally, uses a <sessionState> setup of 'mode="InProc" cookieless="false"'. My IE7 browser is set up to "Always allow session cookies". When I attempt to run the app 'cookieless="true"', it works up to a point where a popup form is displayed, at which point a new session is created, and the Session_Start logic kicks in, where I lose my user info characteristics. This in turn triggers logic which assumes the user timed out, and a "Session Expired" screen is presented.
I do not have IIS installed locally; ASP.NET is used for session management. I have tried setting the timeout to an extremely high value, without effect.
The problem is that when I submit a blank form back to the controller, I get redirected to the "its valid" page, meaning that the form passed validation.
I have a form action in an ASCX page set to an external URL
<form id="fLoginForm" runat="server" action="http://external.url" method="post" defaultbutton="bSignIn"> Inside there is a standard ASP linkbutton <asp:LinkButton CssClass="btn" ID="bSignIn" runat="server" Text="Sign In" OnClick="bSignIn_Click" />
The event "bSignin_Click" never gets fired when I have ction="http://external.url" set on the form tag. However when I remove the action, it works as expected. I thought for runat='server' forms, the form would always post back? I need to read the URL from the action attrib and then redirect to it with some hidden input values also in the page.
I came across a very strange occurrence with ASP.NET onclick event in IE (other browsers doesn't seem to have this problem). When there is only one textbox field in a form, the onclick event doesn't fire when you enter text and hit Enter/Return. The event does fire when you click on the actual submit button. When there are two or more fields in the form, hitting Enter/Return works just fine.
<asp:RadioButtonList ID="Pending" runat="server" AutoPostBack="True" OnSelectedIndexChanged="Populategrid" Height="16px" RepeatDirection="Horizontal" Width="755px"> <asp:ListItem Value="250">Pending Over 250</asp:ListItem> <asp:ListItem Value="300">Pending Over 300</asp:ListItem> <asp:ListItem Value="350">Pending Over 350</asp:ListItem> <asp:ListItem Value="400">Pending Over 400</asp:ListItem> </asp:RadioButtonList> Â [code]....
Since I am staying on the same page do I need something in pageload?I put this in pageload but it doesn't do anything:
If Page.IsPostBack = True Then GridView1.DataBind() End If  I do have this in pageload too could this be messing it up? 'used for a back button on the page. So when use sort several times you can click on the button to go back to the counts.
If Page.IsPostBack = False Then ViewState.Add("NbrPostbacks", "1") Else ViewState.Item("NbrPostbacks") += 1 End If btnback.PostBackUrl = String.Format("javascript:history.go(-{0});", ViewState.Item("NbrPostbacks"))
I have a gridview where i have a radio button. What i need is to on the selection of the radiobutton i have to find the datakey of the gridview. Also one more issue with that is , i can select more than one radio button, which should not happen.
I am using a datalist with checkbox and datalist is in a panel. I am poping the panel by using ajax modal pop-up. When we check the checkbox the checkedchange event is firing. But, when we uncheck the checkbox the event is not firing. It is user control and it is in update panel.
I am using 2 combobox , In form_load event i am loading the combobox using dataset and In selectedIndexChanged event of the combobx1 we have to load combobox2
I am having a problem that when i load the form, combobox selectedIndexChanged event is firing automatically So how can i avoid this.
I understand that if it's a web application then IsPostBack method will be useful, but what to do as it's a windows (desktop) application.
I have a popup which displays two drop down lists, name it : ddl1 and ddl2 and for both of these i have mandatory validation, so if any of these is not provided, callout message will come on submit click.
ddl2 will get populated once any value from ddl1 is selected(selected change event).
Now problem is, suppose without entering any value, i click submit, it is showing select value for ddl1, and when i select a value, the selected change event for ddl1 is not firing, and so ddl2 is not getting loaded.
Selected change event for ddl1 is firing in normal condition, if the callout message is not there.
but after the callout message, if i try to select a value, the event is not firing.
I have two list boxes and I am using javascript to interchange the items. My problem is, When I press submit button before any changes in the listboxes, it would fire the eventhandler. But when I made any change in these listboxes, a postback happened and the controls became invisible. (There is an html tag and an empty body tag in the source). I know listbox cannot preserve the client side changes to the server. But I could not identify the problem.
I'm running a ASP.NET website on my development box (.NET 2.0 on Vista/IIS7).
The Session_Start method in global.asax.cs logs every call to a file (log4net).
The Session_End method also logs every call.
I'm using InProc session state, and set the session timeout to 5 mins (to avoid waiting for 20 mins).
I hit the website, wait for 5 minutes unit I see the Session_End logging. Then I F5 the website. The browsers still has the session cookie and sends it to the server. Session_Start is called and a new session is created using the same session id (btw: I need this to be the same session id, because it is used to store data in database).
Result:
Every time I hit F5 on a previously ended session, the Session_Start method is called.
When I open a different browser, the Session_Start method is called just once. Then after 5 minutes the Session_End each F5 causes the Session_Start method to execute.
Update:
After the Session timeout, all subsequent requests have a session start & session end. So in the end my question is: why are the sessions on these subsequent request closed immediatly?
I'm using BlogEngine and i'm changing it a little bit. I tried to show the online visitors number. I added some code in global.asax. My approach is like:
I defined the count of visitors in App start like Application["OnlineVisitors"] = 0
then i increased the count with 1 in the session start and decreased it in session end but it's not working. I downloaded the website to debug in my computer but i never comes to the breakpoint in the session start function. Also sessionstate mode is inprog cookieless= false and timeout = 20
I've written an asp.net 3.5 app using a custom Membership provider. Normal auth is working great. I have an older site (asp.net 1.1) and I want to connect the two through a database drive time sensitive security key that is passed from one app to another. By using that I can find the user in the db.
I want to use this information to auto-authenticate the user and fill session objects in the new app. I've looked at the session_start in the global.asax file, and have tried FormsAuthentication.SetAuthCookie(), but he still shows up as unauthenticated.
I have a custom provider for authenticaiton that is HTTP Module-based. IIS authentication and web.config authentication is configure to 'None' and allow anonymous. When I probe for User.Identity.Name in Session_Start, it is empty. However User.Identity.Name works elswhere in the application as expected (returns the current user id). Is it possibly during Session_Start no authentication request has been issued, therefore there is no principal at this moment?
what might be best suited to place in the Application_Start and Session_Start subroutines? I know when each subroutine is called. Application_Start when the first user first accesses the web application. Session_Start when a user opens a session with the application. But what code belongs in each of these subroutines. What should the code in each subroutine do?
This is quite simple. When I press btn1, it sets correctly the Session Key. And this is then the issue arrives: When I press one of these buttons, this is the sequence of what happens:
So, everytime there is a PostBack, even before the Page loads, the session starts and generates a new Id. This way, I loose everything during the PostBack. My Session State configuration:
[Code]....
This is running on VS 2010 + V3.5, on IIS5.1. The Page header configuration is default.
We have an MVC.NET application that encounters fatal errors when it restarts. In our Session_Start event handler, we add the session id to a dictionary. In the Session_End handler, we remove it. Consider the following sequence of requests:
GET home.mvc <application restarts> GET main.css GET banner.jpg GET somedata.mvc ...
Because of the way the application is architected, this sort of sequence happens fairly frequently if you do a rebuild while the application is open in a browser window. That wouldn't be terribly concerning except that I see it in production environments too. For example, it will occur (albeit rarely) when you edit web.config.
The requests following the restart are all due to links in the home page or AJAX calls from JavaScript.
What I observe is that .NET handles the first 5 requests in parallel. Each such request causes it to fire the Session_Start event. After a short time, it fires the Session_End event 3 times. To be clear, each Session_Start corresponds to the exact same session. They all have the same session id and the IsNewSession property is true for all session state objects. Also, the Session_End events do not correspond to the session being killed. The session persists, along with any data stored in session state.
I need to either prevent it from firing Session_Start more than once or figure out how to tell when Session_End doesn't really mean that the session has ended.
Context is Null at this point. I am a noob in ASP.NET with regards to Global.asax.cs. This code was written by another developer. EDIT: This is the code with HttpContext...
Visual Studio 2008/.net 3.5I have a web form with multiple slider in it. I need to show JavaScript alert in following scenarios when user changes vlaues on controls and tries to move away without Saving the information.User can go to different page by clicking on the Tab item or typing the address in address bar.Goes to different slider in same page using mouse click.
I'm sure I'm missing something extremely obvious here, but at this point I can't see it so I need the help.Anyway, I've got a repeater inside of an UpdatePanel. As of right now, I've stripped it down to this, just to try and isolate the problem:
[Code]....
Whether I add the handler during itemdatabound or I add the handler within the repeater itself, it doesn't seem to matter...the event itself doesn't fire. The AutoPostback itself seems to fire, but the event itself doesn't.