|
There is no event on the server that says the user closed the browser. The only thing you can do is wait for the user's session to timeout, which, by default, I think, is 20 minutes. Then your Session_End code gets kicked off, if it's still running under the debugger.
You might even catch the Session_End event being kicked off when you start your app under the debugger again. It might kick off first thing before the new Session_Start event is fired.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks Rage.
The knowledge is helpful.
BTW, 2Bad Rage is gone.
Will-Keep-Listening-Anyway
|
|
|
|
|
Nope. Rage is not gone. Rage shows up everytime I go to work...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
i had used "Microsoft.ApplicationBlocks.UIProcess.dll" in my C# form and i generated type library for that and tried to open it in a VB application.
I'm able to open C# application from VB6 but
when i invoke an event(C# form) which instantiate UIP process, it's throwing error. Any idea y it occurs, i can send the code if u need it
-Sridhar
|
|
|
|
|
Recently, I was programming and my url changed...it has RANDOM characters in it. I don't know how or why it occurred. Has any one see this?
Normally, my url for a project would be http://localhost/MyProject/index.aspx
Now, it looks like this http://localhost/MyProject/(bi4dw4bxvmy2l345vfuixouc)/index.aspx
If I could remember what I had change in my project, I would change it back:<
Will-B-Confused
(help)
Thanks for any suggestions in advance...
|
|
|
|
|
It looks you have changed the web.config file to use cookieless sessions. The extra information is the SessionID. If you want to go back, go into your web.config file and look for sessionState. Change cookieless="true" to cookieless="false". That should get rid of the extra characters.
Happiness is knowing that somewhere out there, there is a bullet with your name on it.
|
|
|
|
|
John,
while I must confess you have a scary outlook on life, I am most appreciative of your excellent answer before your bullet arrived.
Thank you.
Willliam
|
|
|
|
|
Can any one explain when to use abstract class and when to use interface?
Or under which scenario we should use abstract class and interface.....
Zxczc
|
|
|
|
|
Generally, abstract classes are used when you have some implementation in the base class, which calls virtual methods that can be overridden in derived classes. Interfaces can't have implementation, so they can't be used there.
Also, interfaces can be used to express "can also be" kind of relationship. For eg, you can have a concrete class deriving from an abstract class and implementing IDisposable, so your class "can be" disposed.
Also, there are versioning issues. You can add additional virtual methods to abstract classes without breaking existing clients, you can't do that with interfaces.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Awesome answer/explaination!
Paul Lyons, CCPL Certified Code Project Lurker
|
|
|
|
|
Also, to add to the excellent Kumar answer, I'd add that formally, you should use an abstract class when the concrete class you'll implement is an specialization of the abstract one (aka "is a" relationship). When you define an interface, you often model an specific behavior (aka "-able" suffix: IDisposable, IClonable, IMovable, IComparable, IFormattable).
I see dead pixels
Yes, even I am blogging now!
|
|
|
|
|
and INativeWindowable
(ok ok, I do agree with the above, but as always , there are scenarios when interfaces are used in the "is a" kind of way)
//Roger
|
|
|
|
|
|
Hi,
I am trying to fill a datagrid in ASP.NET, but i cant. What i need is to put some values on the datagrid, but the values are not coming from a database, i just need to set a fixed values. For example, i get the names of the columns(Name, Style) and i get the information of both columns:(John, Xtreme),(Paul, Overload). How do i set this information on a datagrid. Thank u very much for ur help
|
|
|
|
|
You can create a datatable in memory, there are plenty of examples on this. You can also databind to an array if you want to.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am trying to find the accurate lastLogon for a user. I know that lastLogon is not replicated, so is possible to loop thru all the domain controllers in the domain without having to explicitly identifying each (by name)? An example in C# would be great.
thanks
rick
|
|
|
|
|
Hi,
I need to insert text and images together in a subitem in a listvew in C#. The images and the text can be in any position and any order in the subitem. The images need not be only at the start position of the subitem.
If any one has this kind of control do let know.
Any help will be great.
Thanx
Saleem
|
|
|
|
|
Hello,
I am doing a small application similar to the Windows Task Manager. In the Windows Task manager the first tab 'Applications' displays all the running applications in the system. I tried two ways to get running applications but each of my method had problems.
No.1
I got All the running processes
Process [] procs = System.Diagnostics.GetProcesses();
foreach(Process p in procs)
{
// I can get Handle and Title of the Main Window
// of each process and can
// display it.
someVariable = p.MainWindowHandle;
someVariable = p.MainWindowTitle;
}
Though the above method works fine for most processes, but for the processes like Explorer.exe or Winword.exe this method fails. Explorer.exe is running as a single process but have multiple Top-level windows associated with them. Similarly Winword.exe is only one process even if you have multiple word documents opened. In these cases
p.MainWindowTitle only gives me title for one window.
No.2
I also tried to Enumerate All thread Windows for each thread in every process through Win32 EnumThreadWindows(), then I checked each returned window using the GetParent() to check that if the application does not have a parent or owner then it is a Top-Level window and should be displayed in Task Manager. But in this case I get too many windows. I even get the Windows TaskBar window and a lot of other windows which are not actually applications (Windows Task Manager do not display them).
I even tried EnumWindows() and EnumDesktopWindows() but with similar results and getting too many extra windows which are Top-Level windows but are not applications.
Now, I guess that the Windows Task Manager gets this information about the running applications directly from the Windows Shell, but I dont know which shell interfaces will give me this information.
Can Anyone tell me how I can Enumerate the Running Applications exactly which are displayed in the Windows task manager. How I can do this in C# or in Win32 or any related Shell Interfaces.
How I can Enumerate All running Applications.
Thanx
|
|
|
|
|
Hello
I have a string, strUrval with the following data:
"tbOppningsDatumFrom=2004-10-10/uccontrol/tbimba=fpkepf/jaha/"
I do a String.Split to put data between the /'s in an array:
string strDelim = "/";
char [] delimiter = strDelim.ToCharArray();
string [] strUrvalSplit = null;
for (int x = 0; x < y; x++)
{
strUrvalSplit = strUrval.Split(delimiter,x);
}
this results in the following:
strUrvalSplit [0] = tbOppningsDatumFrom=2004-10-10
strUrvalSplit [1] = uccontrol
strUrvalSplit [2] = tbimba=fpkepf/jaha/
how come the string.split suddenly stops caring about the /'s ?
|
|
|
|
|
livez wrote:
string strDelim = "/";
char [] delimiter = strDelim.ToCharArray();
string [] strUrvalSplit = null;
for (int x = 0; x < y; x++)
{
strUrvalSplit = strUrval.Split(delimiter,x);
}
What is y?
you can do only
strUrvalSplit = strUrval.Split( delimiter );
David
|
|
|
|
|
dnh wrote:
What is y?
Y is the total number of /'s in the string:
int y = 0;<br />
char [] totAntal = strUrval.ToCharArray(); <br />
foreach( char c in totAntal )<br />
{ <br />
if (c == '/')<br />
{ <br />
y++; <br />
} <br />
}
dnh wrote:
you can do only
strUrvalSplit = strUrval.Split( delimiter );
okay thanks, Ill try it out.
edit: that solved my other problem as well, thanks alot =)
|
|
|
|
|
Hi,
I am trying to use a webservice hosted in a server from my laptop, but I keep getting the following error when adding the web reference:
'The request has exceeded the maximum time' or something like that
However, if I try to add a web reference to the web service 'latest' hosted here at the Code Project, it works fine.
Ideas? Any help would be appreciated
Thanks in advance
|
|
|
|
|
Are you able to invoke the webservice successfully from the browser? If your webservice url is services.asmx, you can try navigating to http://localhost/<your_webservice_dir>/services.asmx. That'll result in a page that'll allow you to invoke the web service's methods from the browser.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
If I Invoke the asmx file from the browser, be it in the server itself or in a client, I can actually see the list of web services provided.
Even from the VS IDE I get the list of web services, the problem is that it times out and the 'add reference' button is disabled, so I can't add it.
|
|
|
|
|
Kindly i want to know how to use window proc from within C# Application
is there any tutorial or somebody can help me in doing this
|
|
|
|