|
I want to clear a session by calling an assembly, How i deduct browser close button in javascript or vb.net. When the user click on the close button of browser i want to call a method in code behind.
Thanks
Mahesh
|
|
|
|
|
Detecting browser unload event.
- Use onunload event of body tag to detect the closing of browser.
Calling Server-side function from client-side script
- Add a server-side hiddenfield to your page.
- Write the code (eg: clearing a session) in the change event of this hiddenfield.
- Grab this field and put some value to this hidden field from Javascript. As soon as the value is changed in this hiddenfield, the server-side event will be fired/invoked so that the code for clearing a session will be run.
Hope it would help.. Let me know if you are not clear.
|
|
|
|
|
Michael,
Thanks for reply. Well i write a function in javascript and call that function like that from inside the body tag onunload ="CloseBrow();" inside the CloseBrow how i detect when user click on Close button of browser, i must have to check that since page is unloaded every time when user move back and forth. I user some script inside that function "if (screenTop > 9999)" but this is working in some browser and not working in another browser.
thanks and regards
mahesh
|
|
|
|
|
Yeah. You are right..
Have you tried this?
|
|
|
|
|
Yes I tried it.
I tried this one also
if (window.event.clientX < 0 || window.event.clientY < 0)
This is working for IE in some machine and not for others.
And I place a html button runat="server" whose display style is none after check this if (window.event.clientX < 0 || window.event.clientY < 0)
i fired the button click from javascript and call a procedure in code behind, like that window.document.hidBut.click();
Pls let me know if there is another way to handle the close button of browser.
regards
mahesh
|
|
|
|
|
hi,
does anyone out there knows any website that offers tutorial on how to include map in a website.
that map could be from google map, yahoo map, msn, or anything.
thanx
|
|
|
|
|
Please Google it.
Here is "Google Maps Control for ASP.NET 2.0 - ScottGu's Blog"
Hope it helps.
|
|
|
|
|
thanx a lot!!! i really, really, really appreciate the link...
another question, if you dont mind...
do you know any other website that has free tutorial and software on creating maps..
i've googled it a lot, and i always get the same websitessss.
i'm trying to find a suitable (easy and basic) tutorials and software but cant find..
its really frustrating...
|
|
|
|
|
Hi,
I am having a dilemma on what to do. Here is my situation.
I have a website which every page will have a tree view on the left and the content on the right.
I do not want to use iFrame or Frame as when I refresh, it will bring the user back to the main page and also some browser might not support frame. Another thing is the page title on the top left corner of the browser does not change when I go to another page with a different title.
I wanted to have something like PHP's includes or something which can solve my above problem, I heard of CSS but CSS will still need me to include the tree view in every page by myself.
I need some advice on this.
Thanks in advance.
J Liang
|
|
|
|
|
If you wanna do with ASP.NET, you can use Masterpage (2.0) or base class (1.1) to achieve.
But with PHP, I would like to suggest you to read how to create Theme for Wordpress. < link >. As this forum is not for PHP, we are not able to give the exact code what you want.
|
|
|
|
|
Hi Michael,
Thanks for the reply.
Yup, I'd search around the web and found out using Masterpage too.
But I'm facing some problem, this is what I do.
I have a master page Main.master and MainPage.aspx which MainPage.aspx suppose to be in Main.master.
In MainPage.aspx, I added this
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MainPage.aspx.cs" Inherits="MainPage" MasterPageFile="~/Main.master"%>
Then I added whatever interface components I want in Main.master.
But when I run it, I received this message
Exception Details: System.Web.HttpException: Content controls have to be top-level controls in a content page or a nested master page that references a master page.
Did I missed something?
Thanks in advance.
J Liang
|
|
|
|
|
Masterpage
==========
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</div>
</form>
</body>
</html>
ChildPage
=========
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
|
|
|
|
|
Hi Michael,
Thanks, it works now. It was my child page's problem.
When I add new item to the project, I should select 'Select Master Page' too.
J Liang
|
|
|
|
|
Okay.. good..
|
|
|
|
|
Hi,
If you are using ASP.Net 2.0 you can use master pages to do this. A master page is a page in which the content stays the same for every page. On the masterpage itself you have a content place holder where all your other pages are comming.
|
|
|
|
|
I have been having issues with remote debugging. I have never had remote debugging working, so I am not entirely sure how it should work. Pleas help.
I run
C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Packages\Debugger\
msvcmon -tcpip
On the remote server that has all the code including code behinds. The dll is a debug and I have the pdb up there too.
I believe I have set all the correct settings in the project configuration properties including:
Enable ASP.NET Debugging = True
Enable Remote Debugging = True
Remote Debug Machine = {the server name}
Then I run the application using a browser.
Finally, I attach the debugger by going to Tools > Debug Process and select the Transport:
TCPIP (native only) for the {server name}
at this point msvcmon says that a debugging session has been attached.
I highlight the worker process and the msvcmon says a debugging session has been attached again
Now I stick a break point on my Visual Studio code and proceed on the browser application, but the breakpoint is never reached. The application continues as if I have no breakpoints.
I get no errors.
Any ideas? HELP!
Thank you very much.
|
|
|
|
|
Anyone who can help me in creating Pop up Calendar in ASP.NET 2.0?
Thank you in advance
kidus
|
|
|
|
|
There are tons of them for download on the web.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Is this calendar to be shown in a different window than the one where your field is ?
If it isn't try using the Calendar that comes in the Ajax Control Toolkit, is really cool and it is actually very easy to use.
You will need the Ajax Extensions installed on the Server
Greets! Joel
|
|
|
|
|
I want it to be shown in the parent form as a child window.
|
|
|
|
|
The AJAX one probably does that, tons of other jscript ones do, too. Just google it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
google it for what you need
|
|
|
|
|
Hi All,
Has anyone got a book they'd recommend on IIS6.0 Configuration/Administration? The guy who's supposed to be doing it at my PoW is (IMO) absolutely useless at it, and I'd like to get a real handle on it myself.
Cheers,
Martin.
|
|
|
|
|
(1) Microsoft Internet Information Services (IIS) 6.0 Resource Kit by Microsoft corporation itself.
(2) Microsoft IIS 6.0 Administrator's Pocket Consultant by William R. Stanek
Hope the above mentioned books will be very much useful.
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|