R
Richard \(MrBonus\)
the code is taken from my asp.net page. (written in C#)
Hi, im trying to make my page postback before the it unloads, i've tried a
lot of stuff, and finally I made something that worked, the problem is the
alert in the code -- alert('TittyX'); --. If I remove it, then it doesn't
work, well the method runs fine, but I can't catch the --
theform.submit(); --.
Another weird thing, is I can only catch the event in the Page_Load event on
the server, which is weird, but I can live with that, what I can't live with
is the alert.
Anyone who knows either another solution, or can tell me what I should do to
make it work?
<body MS_POSITIONING="GridLayout" onbeforeunload="__doUnloadPostBack()"
language="javascript">
<script language="javascript">
<!--
function __doUnloadPostBack() {
var theform;
if (window.navigator.appName.toLowerCase().indexOf("netscape")
}
else {
theform = document.Form1;
}
theform.submit();
alert('TittyX');
}
// -->
</script>
<form id="Form1" method="post" runat="server">
<asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 184px; POSITION:
absolute; TOP: 120px" runat="server" Text="Button"></asp:Button>
</form>
</body>
Richard
Hi, im trying to make my page postback before the it unloads, i've tried a
lot of stuff, and finally I made something that worked, the problem is the
alert in the code -- alert('TittyX'); --. If I remove it, then it doesn't
work, well the method runs fine, but I can't catch the --
theform.submit(); --.
Another weird thing, is I can only catch the event in the Page_Load event on
the server, which is weird, but I can live with that, what I can't live with
is the alert.
Anyone who knows either another solution, or can tell me what I should do to
make it work?
<body MS_POSITIONING="GridLayout" onbeforeunload="__doUnloadPostBack()"
language="javascript">
<script language="javascript">
<!--
function __doUnloadPostBack() {
var theform;
if (window.navigator.appName.toLowerCase().indexOf("netscape")
theform = document.forms["Form1"];-1) {
}
else {
theform = document.Form1;
}
theform.submit();
alert('TittyX');
}
// -->
</script>
<form id="Form1" method="post" runat="server">
<asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 184px; POSITION:
absolute; TOP: 120px" runat="server" Text="Button"></asp:Button>
</form>
</body>
Richard