473,414 Members | 1,823 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,414 software developers and data experts.

ICallbackEventHandler synchronous bis ?

Sorry always the same question.

I press a HTML button :
<input name="butGet" type="button" value="Get()" style="width: 147px"
id="butGet" onclick="butGet_onclick()" />

This event call a javascipt function butGet_onclick():
function ToInitialize()
{
var result = Get("");
if ( result != "true" )
{
alert ("Not True");
}
}

In this function, I wait the result of another Get("") :
var _strjReturn = "";
function Get(parameter)
{
strParameters = "Get" + "|" + parameter + "|";
CallServer(strParameters,"");
return _strjReturn;
}

The Callserver is created in the event page_load
protected void Page_Load(object sender, EventArgs e)
{
ClientScriptManager clientscriptMain = Page.ClientScript;

string strClientScript =
clientscriptMain.GetCallbackEventReference(this, "args",
"ReceiveServerData", "", false);
string strCallBackFunction = "function CallServer(args,context){" +
strClientScript + "}";
Page.ClientScript.RegisterClientScriptBlock(this.G etType(),
"CallServer", strCallBackFunction, true);
}

With the client function :
function ReceiveServerData(args, context)
{
_strjReturn = args;
}

You understand that I use an inherit of ICallbackEventHandler with :
private _strReturn = "";
public string GetCallbackResult()
{
return _strReturn;
}

public void RaiseCallbackEvent(string eventArgument)
{
string[] arrArgument = eventArgument.Split('|');
if (arrArgument.Length != 0)
{
switch(arrArgument[0])
{
case "Get":
_strReturn = "true"
break;
default:
_strReturn = "Error"
break;
}
}
}

But, and is my problem, function Get(parameter) always send an empty string
and I show all the time the message "Not True". How can I capture the value
"true" and return this in the function Get(parameter) ? In google, I found
nothing.
Thanks for response ...


Jul 27 '06 #1
0 990

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

Similar topics

1
by: Mike | last post by:
When trying to compile (using Visual Web Developer 2005 Express Beta; frameworkv2.0.50215 ) the source code below I get errors (listed below due to the use of ICallBackEventHandler. Ultimately I...
2
by: Maya Nasri | last post by:
Hello everyone, I have upgraded to ASP.NET 2 and since then i had the code below stopped working after upgrading and modiftying the code: using System; using System.Data; using...
3
by: begemot | last post by:
Hi My question is about javascript function WebForm_DoCallback. This function performs callback request. But the thing is that if I use Mozilla, I can't send anisochronous request....
1
by: JimGreen | last post by:
I recently installed Release Candidate of VS2005 and I am not sure what the hell is the problem but ICallbackEventHandler definition on my machine looks like this: public interface...
3
by: Harvey Triana | last post by:
Hello I try to implement ICallbackEventHandler follow sample in http://msdn2.microsoft.com/en-us/library/ms178208.aspx I add code line: Implements System.Web.UI.ICallbackEventHandler The...
0
by: Slim | last post by:
I made a page today that uses ICallbackEventHandler. I got to work, but with problems. 1. it is slow, it does not seem any faster than reloading the page. 2. the first time I fire the event it...
0
by: KaNos | last post by:
Sorry always the same question. I press a HTML button : <input name="butGet" type="button" value="Get()" style="width: 147px" id="butGet" onclick="butGet_onclick()" /> This event call a...
1
by: Ben Schumacher | last post by:
I have a page that implements ICallbackEventHandler. I'm trying to accomplish auto saving a page everytime the user navigates away from the page. To initialize the callback, I fire the onunload...
1
by: Ian | last post by:
Question: Is there a way to multi-thread ICallbackEventHandler using delegates? Problem: I'm executing client-side calls to my page, which implements ICallbackEventHandler. I need to implement...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.