|
First of all, this question belong in the ASP.NET forum, but since it's a simple question I'll answer it here anyway.
The red X in IE (or any browser) does nothing on the server. HTTP is a client-request/server-response mechanism and only client-side scripting events would know that your browser is closing.
Also, if you read the documentation for ASP.NET (always a good thing), the Application_End handler executes when your ASP.NET web application is shutting down (as leppie tried to point out with little extra helpful information). Each client does not get a separate instance of a web application - that would be stupid (wouldn't scale well, among many other things). Each additional client gets a separate context (a thread), optionally with a session attached. If you want to store information per-client and clean it up, use the Session property found on many objects (like HttpContext , Page , et. al.) and handle clean-up in the Session_End handler in Global.asax. This still won't fire when a user closes the browser, however. It will fire when the session is destroyed. The default is in 30 minutes.
Please direct future questions to the appropriate forums. This is an ASP.NET related question - it doesn't matter if you wrote it in C# or not; C# is just one many languages that target and use the .NET Framework.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
How can i make a today screen component to my project. i know that it made by microsoft embeded visual c++. but i had no information about this tool. can any one help me with any info. or samples about this.
and how can i handle WM_ERASEBKGND message to make this component has a transparent back ground.
can any one help me,please.
Mohamed Elsaid - Faculty of computers and information - Helwan university - Forth year - Cairo - Egypt
|
|
|
|
|
Create a new form, place a TextBox on it, setting the Multiline property to true . Add some Button s that allow you to scroll through your data which can be stored in any mechanism you wish (XML file, database, etc). This should get you started, any other questions feel free to ask.
- Nick Parker My Blog | My Articles
|
|
|
|
|
A today screen component is the little apps that run on a today screen of a PocketPC device, like the calendar, inbox, and more (I have one that MS Money added).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Damn, I thought he was talking about the Tip of the Day and just misworded it.
- Nick Parker My Blog | My Articles
|
|
|
|
|
If you have questions about Microsoft eMbedded Visual C++, I suggest you post them in the C++ forum. If you look in the Windows Mobile SDK, there's also a sample about writing a today screen component.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I made it using CAB+INF.
Mohamed Elsaid - Faculty of computers and information - Helwan university - Forth year - Cairo - Egypt
|
|
|
|
|
How can i make the uninstallation delete all my application files, the help files and the database asociated with the program. and how can i use uninstall_init() and uninstall_exit() functionality to clean up data files and databases.
can any one help me,please.
Mohamed Elsaid - Faculty of computers and information - Helwan university - Forth year - Cairo - Egypt
|
|
|
|
|
That greatly depends on how your application is installed. You might start by telling us whether your using the CAB+INF way, or some other installer.
By default, every known installer I've worked with (many) does not delete files it doesn't install, like files that applications create at runtime.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
How can i make my help file activated when the user press help in the start->help in pocket pc start menu.use tooltip control in my c# smart device application.
i can put my help file in toc (table of contentes) but i would like to open automatically when the user press start->help and my form was activated.
can any one help me,please.
Mohamed Elsaid - Faculty of computers and information - Helwan university - Forth year - Cairo - Egypt
|
|
|
|
|
This has been posted quite recently and i believe the answer was you can't, it's not supported by the .Net Compact Framework. I'm sure someone will correct me if i'm wrong though
Kev Pearman MCP
|
|
|
|
|
|
Hello,
I'm creating a dialog with a small list of files, where the user can add/remove arbitrary files via an open file dialog.
What I want is for the user to be able to dblclick an item in the list, and bring up that file in internet explorer (assuming there is a plug-in installed for the given file type, otherwise I guess IE would show a warning.
How can this be done? CommandLine argument?
Is there such a thing as an internet explorer control available that I can embed easily? Otherwise just an IE window popping
up would do the job for me equally well..
|
|
|
|
|
Why, don't you just use Process.Start () and open the fil in the default application?
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
yes I could, but the application that will eventually use the files on this list (not the same as mine) might not have the same default applications. And that app will also want to start the files listed here in IE through plug-ins. So I need to supply the same functionality here...
|
|
|
|
|
I really don't get why you need to view the files in a browser.
Why would you, for instance, like to open a pdf in a browser.
If he has a plugin for the browser you can be shure he has a standalone application for that file type.
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
misterbear wrote:
Is there such a thing as an internet explorer control available that I can embed easily?
IE can be embedded as an ActiveX control within your application. If you add the "Microsoft Web Browser Control" COM Component (shdocvw.dll) to your Toolbox, you'll be able to insert that on your form. To visit a website, call the control's Navigate function. The Web Browser control is heavily documented on MSDN, and many examples exist on the 'net for showing some of the advanced things you can do with it.
|
|
|
|
|
In addition to what CWIZO and John said, you can interop shdocvw.dll by using tlbimp.exe or VS.NET (add a COM reference to your project for the Microsoft Web Browser library) and use the InternetExplorer class to load a file. This will create a new instance of IE or use an existing instance (the fore-most instance, IIRC) to display the HTML (or whatever IE-handled file). Using Process.Start with a filename (works like ShellExecute(Ex) ) will use the default browser, but if you want to make sure they use IE (maybe the HTML files are scripted only for IE, for example) use the InternetExplorer object or use Process.Start("iexplore.exe", pathToHtmlFile) .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
just a quick question. How can I make sure that a message box opens over all open windows. For example, the application is testing for a certain event every 10 seconds but the user might be browsing the internet or using word when the event occurs. I need the message box from the app to appear over all windows that are open to let the user know that the event has occurred. I'd imagine its straight forward but I have tried setting focus on the form or bringing it to front in the line before the MessageBox.show line but the message box doesnt pop up over the windows I have open. As I said, its probably simple but its driving me mad!!,
Regards,
John
|
|
|
|
|
First, don't use MessageBox.
Create your own message box form and set it's TopMost property to true. When you want to show the form, set it's message property or call a method to set the message (which you also have to provide) and then just creat a new instance of the form and call .ShowDialog().
myMsgBox msg = new myMsgBox;
myMsgBox.Message = "Some message...";
myMsgBox.TopMost = true;
myMsgBox.ShowDialog();
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Try this.
using System;<br />
using System.Runtime.InteropServices;<br />
using System.Drawing;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Windows.Forms;<br />
using System.Data;<br />
<br />
namespace WindowsApplication1<br />
{<br />
public class Hi : System.Windows.Forms.Form<br />
{<br />
private System.Windows.Forms.Button button1;<br />
private System.ComponentModel.Container components = null;<br />
<br />
public Hi()<br />
{<br />
InitializeComponent();<br />
}<br />
<br />
protected override void Dispose( bool disposing )<br />
{<br />
if( disposing )<br />
{<br />
if (components != null) <br />
{<br />
components.Dispose();<br />
}<br />
}<br />
base.Dispose( disposing );<br />
}<br />
<br />
private void InitializeComponent()<br />
{<br />
this.button1 = new System.Windows.Forms.Button();<br />
this.SuspendLayout();<br />
<br />
this.button1.Location = new System.Drawing.Point(64, 104);<br />
this.button1.Name = "button1";<br />
this.button1.TabIndex = 0;<br />
this.button1.Text = "button1";<br />
this.button1.Click += new System.EventHandler(this.button1_Click);<br />
<br />
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);<br />
this.ClientSize = new System.Drawing.Size(292, 273);<br />
this.Controls.Add(this.button1);<br />
this.Name = "Hi";<br />
this.Text = "Hiiii";<br />
this.Load += new System.EventHandler(this.Form1_Load);<br />
this.ResumeLayout(false);<br />
<br />
}<br />
<br />
[STAThread]<br />
static void Main() <br />
{<br />
Application.Run(new Hi());<br />
}<br />
<br />
[DllImport("user32.dll")]<br />
public static extern bool SetForegroundWindow(IntPtr hWnd);<br />
<br />
[DllImport("user32.dll")]<br />
public static extern IntPtr FindWindow(string lpClassName,<br />
string lpWindowName);<br />
<br />
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
System.Threading.Thread.Sleep(10000);<br />
IntPtr ptr = FindWindow(null, "Hiiii");<br />
SetForegroundWindow(ptr);<br />
MessageBox.Show("In fornt");<br />
}<br />
}<br />
}
|
|
|
|
|
hi,
i need to capture keypress event in datagrid. but i wrote keypress event in datagrid. but the event is not fired. please help any one. i need to change cursor position from cell to another thru program. i need to capture ENTER key.
Thanks in Advance!
Have A Nice Day!
Murali.M
|
|
|
|
|
Please post your code when you have a question, it helps us find out what you're doing wrong. Ive just created a KeyPress event handler in VS2003 and when i press Enter on my DataGrid my MessageBox is shown.
private void dataInvoice_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)<br />
{<br />
MessageBox.Show("Testing");<br />
}
This was done by double clicking the KeyPress event in the properties window for the DataGrid. If this does not help then please post your code and someone should be able to point you in the right direction.
Kev Pearman MCP
|
|
|
|
|
I would be very interested if it is possible to add an item to a context menu (e.g.in Outlook) or in a menu in general (again Outlook).
If it is I would be very interested what the code has to look like to add the item.
So if someone is willing to share this code section it would be very interesting for me to try this out myself!
|
|
|
|
|