I have written a page with an iFrame that basically cycles through a series of internal pages on our server displaying daily activity for our company. The problem I think is that it sporadically loses its session and redirects back to the login screen to keep losing its session which is the default behavior for anyone on our site trying to access a webpage without being logged in.
I have set the session timeout to 4hrs, the iframe cycles through 6 pages anywhere from 10 seconds to 5 minutes on each, and I have even set the META refresh on the page to refresh every 3 hours. I don't understand what else could possibly stop this page from staying active.
I am using sql server ASPSTate database for storing session. For testing purpose, I want to set the timeout period of 1 min.
In web.config, I have mentioned sessionState mode = "sqlserver" and timeout = "1"
In Global.asax, in Session_End event, I have redirected to error page.
But Session_End is not firing and hence page is not redirected.
As per my knowledge, The Session_End event is raised only when the sessionstate mode is set to InProc in the Web.config file. If session mode is set to StateServer or SQLServer, the event is not raised.
How can I test session timeout when session mode is set to SQLServer?
Is there any Table/column in ASPState database, where I can change session timeout value ?
I used: Update ASPStateTempSessions set Timeout=1
But still, I cant see session is ending.
How can I test my Session Timeout is working fine or not ?
I have this simple code to test that a DB is ready: Function testlocalcon() As Boolean Dim constr As String = _clconstr Try Using t As New SqlConnection() constr = constr & " ; Connect Timeout=1" [Code] ..... I do not want to execute a query, just to check the connection, but no matter what the time out parameter is ignored.
I am trying to pass the datatable of a search query to another page and bind it to a listbox. The problem is the the listbox just displays system.data.datarowview and no results.
I have listed the code below.
First page SQL and session store: Protected Sub btnSearch_Click(sender As Object, e As System.EventArgs) Handles btnSearch.Click
I'm not sure if this is a VB.NET error or SQL Server. But I get the above error with following stack trace:
[SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.] System.Data.SqlClient.SqlConnection.OnError(SqlException
I am storing a session variable that a user types into a textbox. With their valid input, their session gets created and they get a little more functionality than the regular end users of the site.I was wondering if it is possible to find a way to add someone's session variable to the end of a URL. This way we can email a link to one of our clients, they click it, and their session has automatically begun. They already have the textbox to enter their code into, but I was told that it would be much easier for the users to just click a link that will start their session.
On startup of my software which i developed in vb.net, it connects to mssql server. I want to have session id or session number of the connection with mssql. I'm sure it is unique number and i want to use this session in my software for different purposes. My question is
1. is there anything like session id or session unique number when you connection mssql server
I was just wondering if there was a way that I could get the properties of each item in a sub that was linked using AddHandler.
As in, say I have three PictureBoxes that I created and added to a sub using AddHandler. How can I get each of these PictureBox's properties? (I'd imagine it would be using a For Each loop?)
I've written some code to handle an event as follows:
AddHandler myObject.myEvent, AddressOf myFunction
It seemed that everything was working at first, but when I ran the debugger, I discovered that oftentimes, myFunction would run several times each time myObject.myEvent fired. I figured out that I had allowed the code to add the event handler to run more than once, resulting in this behavior.
Is there a way I can do something like this?
If myObject.myEvent is not handled Then AddHandler myObject.myEvent, AddressOf myFunction End If
I have a winforms app and my code works fine.But I want to know if my code is bullet proof or if it only works without load.Let me explain it:I have a windows form where I have overridden the OnKeyDown method:
Protected Overrides Sub OnKeyDown(ByVal e As System.Windows.Forms.KeyEventArgs) dim args as new ActionEventArgs(ActionType.Bark) RaiseEvent Action(me, args)[code].....
Now I have a class that is registered to this event and, if it knows how to handle the ActionType it sets Handled to true.
Public Sub actionHandler(ByVal sender as Object, e as ActionEventArgs) Handles me.Action If e.Handled then return If e.Action = ActionType.Bark[code]....
I tried this code at my developer machine and it seems to work. In the OnKeyDown Method, everytime I query the Handled variable, my actionHandler method did run first.But I asking me if this is only the case because my developer machine is in idle state and the event queue is processed so fast or can I expect the
RaiseEvent(...)
method to wait until every registered EventHandler has finished it's taks?
I'm using a TcpClient to try and connect to a server. I have the following code, which uses valid IP addresses and ports:[code...]
My problem is that the server I'm using is my own, and when I intentionally don't have it running, an exception occurs whenever I try to access any of TCP_SENDER's properties (in the example above,
the "SendTimeout" property throws the exception, but any other property has the same behavior). The exception thrown is "No connection could be made because the target machine actively refused it.
This exception is expected since I don't have the server running (and sometimes in real-world scenarios I won't), but the real issue is that the "Try/Catch" block I have won't catch the exception.
If I run the code above when the server is down, the "Catch ex as Exception" code is never reached; instead the program just throws the above-mentioned exception with its green font at the "Why can't
I catch the exception? Even if I give trash inputs to the system I should still be able to handle any exceptions that might occur, right?
I have a VB.NET application (VS2010, .NET 4.0) that seems to throw an exception under some unknown conditions after a number of hours. In addition to the main thread, there are additional threads running. In reading this link: [URL] it seems like this would be a big help in trapping this exception. I have what are probably some very basic questions:
1. I assume ErrorHandlerForm() in the example refers to the main form of the application, setup.vb in my case. Therefore the last line in the example should be:
[Code]...
I would have expected to to replace ErrorHandlerForm.Form1_UIThreadException with find a setup event such as Setup_UIThreadException but there doesn't appear to be sucn an event.
I am trying to add to items to a combobox by using the "enter" key. It does work when I add the first item, but if I manually clear the box and add another items it does not get added to the list.
(1) I click in the combobox and type "hello" and press the "enter" key
(2) I click on the dropdown arrow and see that "hello" is in the list
(3) I select "hello" in the box and erase it, item is still in the list
(4) I type "goodbye" in the box and press the "enter" key
(5) "hello" is still in the list but "goodbye" is not
Here is the code:
Private Sub CopyrightCombo_Keypress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles CopyrightCombo.KeyPress If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Return) Then
[code].....
if I comment the if/end if line and type "hello" the items added to the combobox list are: "h", "he", "hel", "hell", "hello" wich makes sens since the add items is run on every keypress? I know that my commands for adding items is good, I know that my keypress event is handled properly but not when I specify using the "enter" key.
I have an error with my Login.The Error show "the variable name '@Username' has already been declared.Variable names must be unique within a query batch or stored procedure.": this is my code..
I've developed program w/ VS 2005 .net 2.0.... the program works great on all my customers computers, except for one. Immediatedly whenever opening the program he recieves a clr20r3 error and the process terminates.
I compiled a version of the program that put a simple msgbox that displayed "I'm working right now" first thing in the sub that handles me.startup. The program doesn't even get that far. I've tryed repairing .net 2.0... and completely uninstalling 2.0 and reinstalling it.
I would like some code to execute at the "preload" stage of my usercontrol's lifecycle. However the preload event is only available on the Page object. So, I added the following method to my usercontrol: Private Sub Page_PreLoad(ByVal sender As Object, ByVal e As System.EventArgs) Handles Page.PreLoad
However, I know get the compile error: "Handles clause requires a WithEvents variable defined in the containing type or one of its base types". As the Page property is inherited from UserControl I don't see how this can easily be done.
I have 3 components, a managed .NET diagnostics app, which interfaces with a C++ multithreaded UDP socket messaging DLL, which sends messages to another C++ app.
Sometimes (especially on exiting the managed app) the messages are not getting properly handled by the destination app. The UDP socket DLL is sending everything fine, but they are not being handled on the recieving end. Now, if I put a messagebox in on the managed side, everything goes fine. Thinking it was just a delay thing with the popup, I've put thread sleep, regular sleep, timers, counting loops, etc. These "other" solutions do nothing, only the message box is making the messages be handled.
Since today VisualBasic 2010 express does not work any more: every time i try to run a project i got the following error:
InvalidOperationException was unhandled Error creating the form. For details see Exception.InnerException. Error: Exception thrown by a component outside.
I searched a few threads for TextBox number solution and found that most were using e.Handled and e.KeyChar in TextChanged. But I couldn't find them in VB 2008. What can I find in Vb 2008 for the same meaning?
I have a form, that acts like a drop-down, that I display non-modal. I attach a mouse hook to the form to determine when the mouse is clicked out of it, so that I know to close it - by setting Visible = False.
Because I want the HookProc to handle the last click, I can't dispose the Hook or my Dropdown until I'm sure that my event handler has returned to the HookProc.[code]...
I discovered that an event raised (directly on indirectly) in the constructor cannot be handled outside the very class. To prove if that was the actual problem, I wrote a simple exemplary app. Class with the event: Namespace Utils Public Class A Public Event Test() Public Sub New() CallTest() [Code] ..... The reason of such behavior became quite obvious after writing those pieces, but maybe there is a way to omit it?
I have an issue with usercontrols that has been puzzling me for a while. I think I must be overlooking something and many hours of web searching haven't resulted in increased insight.In my main program I have defined several events, that may be raised at certain times. e.g.: Public Event FlipBackgroundEvent As EventHandler
I am back with a problem again I have a grid and I am trying to implement sort for it.Basically I have binded the data manually to the grid now my problem is I do not know the code to be written for the sorting event:( some how managed to get the code for the page indexing :-/,...doesnot have much idea!! could you !!"experts" help me out by giving me some hint or sample code in VB.Net:icon_exclaim: unable go ahead further:
If I set a .ascx control's visible attribute to true, what event is called? What method can I create in that control's codebehind to act on this event?
Private Sub TextBox4_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox4.KeyPress If (e.KeyChar < "A" OrElse e.KeyChar > "Z") Then e.Handled = True End If End Sub
If e.Handled = True means we can enter a to z and A to Z in textbox.If e.Handled = False then what it means??
I have an assembly containing a number of classes. This is a class library type assembly, not a windows forms application. It's also single threaded.Is there a way to catch all un-handled exceptions so that I can log them?
I'm working on a Form that contains a datagridview and textbox, I need the datagridview detect any letter of the alphabet or numbers, then select the input and send the key pressed to input.