473,387 Members | 1,903 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,387 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 988

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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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: 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
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,...

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.