Click here to Skip to main content
11,417,390 members (52,975 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# VB.NET
I converted this Code [^]
to vb.net
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 vb.net

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 3:10am
Edited 21-Mar-13 3:21am
v2
Comments
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
good
Please Sign up or sign in to vote.

Solution 1

Try Solution provided at the below link :-

http://forums.asp.net/t/953036.aspx/1[^]


Implement ICallbackEventHandler interface on the page.
  Permalink  
Comments
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 Sascha Lefévre 340
1 Abhinav S 248
2 Sergey Alexandrovich Kryukov 245
3 OriginalGriff 235
4 Richard Deeming 160
0 Sergey Alexandrovich Kryukov 9,295
1 OriginalGriff 7,592
2 Maciej Los 3,718
3 Abhinav S 3,456
4 Peter Leow 3,084


Advertise | Privacy | Mobile
Web02 | 2.8.150427.4 | 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