473,403 Members | 2,293 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,403 software developers and data experts.

Odd script error when using client script callbacks (ASP.NET 2.0)

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 and IE 5.5 to a lesser degree without
problems.

I know of a least one user who gets an error in WebResource.axd when using
the application. The same error also occurs on a simple reproduction page
with just a button and a div. When the button is pressed, the return value
from the server is stored in the div's .innerHTML.

In WebResource.axd the error "'encodeURIComponent' is undefined". occurs at
the indicated line below.

function WebForm_EncodeCallback(parameter) {
if (encodeURIComponent) { <--------------------------------- here.
return encodeURIComponent(parameter);
}
else {
return escape(parameter);
}
}

I've been able to reproduce the error on a virtual machine running Windows
2000 with IE 5. The user involved however is using Windows 2000 with IE 6
(6.0.2800.1106co). I've tried searching for some text that explains why this
could be happening, but have come up empty. So if anyone is familiar with
this or knows the reason this could be happening I'd be glad to know.

Below I'll add the code for the reproduction page and codebehind.

Webform:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs"
Inherits="Web._Default" %>

<!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>Client callback test pagina</title>
<script language="javascript">
function ProcessReturnValue(response, context)
{
var textArea = document.getElementById("textArea");
textArea.innerHTML = response;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<p>
<input id="callbackButton" type="button" value="Server aanroepen"
runat="server" />
</p>
<div>
<div id="textArea" style="border: solid 1px black; height:
100px;"></div>
</div>
</form>
</body>
</html>

Codebehind:

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;

namespace Web
{
public partial class _Default : System.Web.UI.Page, ICallbackEventHandler
{
private string _result = "";

protected void Page_Load(object sender, EventArgs e)
{
string rpc = ClientScript.GetCallbackEventReference(this, null,
"ProcessReturnValue", "null", "null", false);
string js = String.Format("javascript:{0}", rpc);
callbackButton.Attributes["onclick"] = js;
}

#region ICallbackEventHandler Members

public void RaiseCallbackEvent(string eventArgument)
{
_result = "Text returned from the server.";
}

public string GetCallbackResult()
{
return _result;
}

#endregion
}
}
Mar 27 '07 #1
0 1435

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

Similar topics

0
by: ck388 | last post by:
For some reason when I enable the callback feature of the gridview I still get a page refresh, that is it seems like there is a postback that occurs, not a callback which is just supposed to update...
12
by: tshad | last post by:
I am not sure why I am getting this error: I have the following code I want to run from another include file that holds all my functions. functions.inc...
2
by: Anand | last post by:
Hi Season Greetings, I'm trying to implement client call backs in my page. i'm using user controls (composite controls) and these are placed in my master page. I'm implementing...
1
by: MichaelY | last post by:
While cruising through the script files that help to implement script callbacks in 2.0, I noticed that there is no code path to handle a return string that doesn't match the parsing logic - it just...
3
by: Guy Debord | last post by:
Hello all, I know that this is a long shot, but I have a problem which someone reading this group *may* just be able to shed some light on. We have a new internal personnel planner/attendance...
5
by: Papanii Okai | last post by:
Hi Guys, As we wall know Atlas is a fairly new feature everyone is talking about (atleast at my school). Even though the idea of Ajax has been used in the past i was wondeing if anyone could...
3
by: Martin | last post by:
Hi, I have an aspx page with two dropdownlist controls. I update the options in the second ddl based on selection made in the first. I do this with the ICallbackEventHandler interface, as per...
7
by: kelly | last post by:
Hi I have an app where I have 2 dropdown lists (state and city) and a Save button. When a user selects a value from the state dropdown list, I use script callback to populate the data for the...
1
by: DaveS | last post by:
I am trying to capture the mouse click position in a datagrid but I get the following compilation error: Compiler Error Message: BC30002: Type 'System.Windows.Forms.MouseEventArgs' is not...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.