473,396 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Client (/Script) Callback fails on certain IE6 installlation

Hi,
I've been trying to get a simple client / script callback to work. I
was using IE6 to the ASP Development Server / IIS 5 and it just
didn't work. I ended up using an example straight from an asp 2.0 book
and it still didn't work. However I noticed that it worked on firefox on
the development machine, and also IE6 and firefox from a remote machine.

I set various breakpoints and noticed that the firefox callback ends up
in the correct looking callback in the aspx file on the server, but
the failing IE6 browser ends up in SECOND call to Page_Load. It's as
if that specific browser <-server configuration fails to properly
let IIS know its a special call, not just a standard http request.

I stepped through the failing IE6 code and it goes into a file called
WebResource.axd?blahblah and into an expanded
function WebForm_DoCallback(eventTarget, eventArgument,
eventCallback, context, errorCallback, useAsync)
which create a new ActiveXObject("Microsoft.XMLHTTP")
and calls it. But as I say it ends up in page_load on the server
and the callback fails.

So my question is, why would a simple example fail on a single IE6
installation in such a bizarre manner, and why would firefox locally
and IE6 + firefox remotely all work fine? I checked the settings in
the local IE and it seems ok.
It's generally a well behaved browser, so, I'm actually now scared to
use this functionality as I don't want support issues with a % of
similar browsers once anything is released.

Any ideas? Its a worrying issue, supportwise!

Example follows for reference (from Prof Asp.Net 2.0 by Wrox)

// RandomNumber.Aspx
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="RandomNumber.aspx.cs" Inherits="RandomNumber" %>

<!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 id="Head1" runat="server">
<title>Callback Page</title>

<script type="text/javascript">
function GetNumber(){
UseCallback();
}

function GetRandomNumberFromServer(TextBox1, context){
document.forms[0].TextBox1.value = TextBox1;
}
</script>

</head>
<body>
<form id="form1" runat="server">
<div>
<input id="Button1" type="button" value="Get Random Number"
onclick="GetNumber()" />
<br />
<br />
<asp:TextBox ID="TextBox1" Runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>

--------------------------------
// RandomNumber.aspx.cs

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class RandomNumber : System.Web.UI.Page,
System.Web.UI.ICallbackEventHandler
{
private string _callbackResult = null;

protected void Page_Load(object sender, EventArgs e)
{
string cbReference =
Page.ClientScript.GetCallbackEventReference(this,
"arg", "GetRandomNumberFromServer", "context");
string cbScript = "function UseCallback(arg, context)" +
"{" + cbReference + ";" + "}";

Page.ClientScript.RegisterClientScriptBlock(this.G etType(),
"UseCallback", cbScript, true);
}

public void RaiseCallbackEvent(string eventArg)
{
Random rnd = new Random();
_callbackResult = rnd.Next().ToString();
}

public string GetCallbackResult()
{
return _callbackResult;
}
}
Jan 12 '07 #1
0 1171

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Hardy Wang | last post by:
Hi, I have a page which will call RegisterStartupScript function to register a client script. I also need to remove it under some certain condition, is there a way? -- WWW:...
4
by: Don Parker | last post by:
Does the use of server side controls eg <asp:textbox> preclude the access to that control by client script? If not, how do you reference those elements? *** Sent via Developersdex...
2
by: Flinky Wisty Pomm | last post by:
Okay, I'm pretty baffled by this one. I've got a page in a popup which takes a postcode; looks up a list of addresses for that postcode; then uses a callback to get the details for a specific...
1
by: denappel | last post by:
Hi all, We're currently developping an asp.net 2.0 project, and ran into a problem with the new menu control. At the first load of the page, no errors are generated, but after a first...
2
by: ibiza | last post by:
Hi all, I have a quite big webform that has about ~15 validators. I found, after having looked at the generated HTML source, that the filesize is pretty big : about 65KB. Then, I added to every...
5
by: Bjorn Sagbakken | last post by:
Hello I have just migrated from VS 2003 to VS 2005, and .NET framework 1.1 to 2.0 I am at the end of debugging and fixing stuff. Now there is one error I just cannot find a solution to: On...
1
by: Velvet | last post by:
Does anyone know a way to force the client script to preform a client-side validation for controls in validation groups? What is currently happening is I have two validation groups (Billing,...
0
by: =?Utf-8?B?TG93bGFuZGVy?= | last post by:
Hello, I've built a web application that uses client script callbacks. It is used on a large network with a large variety of user OSes and IE versions. It was tested on IE 6 on different setups...
2
by: Ed Courtenay | last post by:
Reposting here as you can practically see the tumbleweed blow by in microsoft.public.dotnet.framework.aspnet.webcontrols.... I've got a very simple custom control that requires a small section of...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.