Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ICallbackEventHandler synchronous bis ?

Reply
Thread Tools

ICallbackEventHandler synchronous bis ?

 
 
KaNos
Guest
Posts: n/a
 
      07-27-2006
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 ...





 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between synchronous (proactor pattern) and synchronous model in web server Rickert C++ 0 10-06-2011 04:54 AM
ICallbackEventHandler synchronous bis ? KaNos ASP .Net 0 07-27-2006 05:14 PM
Problem with Accent and Resource File (bis) Fabrice ASP .Net 0 01-21-2006 10:07 AM
Problem of Cast/Datagrid - Code Behind Bis (felix) Fabrice ASP .Net 2 09-02-2005 05:51 AM
new-style class instance check (bis) Richard Gruet Python 0 04-11-2004 12:05 AM



Advertisments