Click here to Skip to main content
11,802,636 members (70,582 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# VB VB.NET
I converted this Code [^]
and I have this Problem
in C#

ClientScriptManager cm = Page.ClientScript;
          String cbReference = cm.GetCallbackEventReference(this, "arg","ReceiveServerData", "");
          String callbackScript = "function CallServer(arg, context) {" + cbReference + "; }";
          cm.RegisterClientScriptBlock(this.GetType(), "CallServer", callbackScript, true);
I converted it to in

Dim cm As ClientScriptManager = Page.ClientScript
          Dim cbReference As String
          cbReference = cm.GetCallbackEventReference(Me, "arg", "ReceiveServerData", "")
          Dim callbackScript As String = ""
          callbackScript &= "function CallServer(arg, context)" & "{" & cbReference & "; }"
          cm.RegisterClientScriptBlock(Me.GetType(), "CallServer", callbackScript, True)

I have invalid operation exception in
cbReference = cm.GetCallbackEventReference(Me, "arg", "ReceiveServerData", "")
The target '__Page' for the callback could not be found or did not implement ICallbackEventHandler.
Posted 21-Mar-13 2:10am
Edited 21-Mar-13 2:21am
ryanb31 at 21-Mar-13 8:33am
By the way, in ASP.Net you can have some pages in C# and others in VB.Net. It might be worth leaving C# pages in C# since they work.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Try Solution provided at the below link :-[^]

Implement ICallbackEventHandler interface on the page.
mohammed besher at 21-Mar-13 10:33am
thanks very much you are very helpful

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 KrunalRohit 366
1 OriginalGriff 365
2 F-ES Sitecore 295
3 Afzaal Ahmad Zeeshan 230
4 CPallini 230
0 OriginalGriff 2,950
1 Maciej Los 1,910
2 KrunalRohit 1,862
3 CPallini 1,695
4 Richard MacCutchan 1,157

Advertise | Privacy | Mobile
Web04 | 2.8.151002.1 | Last Updated 21 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100