Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Invalid JSON primitiveInvalid JSON primitive
Previous
 
Next
New Post
4/6/2009 9:42 AM
 

Hi all,

I have a custom module working on DNN 4.9 that uses client callbacks by implementing the System.Web.UI.ICallbackEventHandler interface (see http://msdn.microsoft.com/en-us/library/ms178209.aspx). All works fine. When  I try to use the same source code on DNN 5.0.1 I get an "Invalid JSON primitive" exception on "System.Web.Extensions". Any ideias? I'm using Visual Studio 2008. Tried targeting solution to framework 2.0 and 3.5. I can't solve it.

Best regards,

mjda 

 

 
New Post
4/7/2009 4:10 AM
 

Instead of implementing System.Web.UI.ICallbackEventHandler as shown in http://msdn.microsoft.com/en-us/library/ms178209.aspx use DNN API. Something like:

Imports DotNetNuke.UI.Utilities

 

Partial Class DesktopModules_MyModule

    Inherits DotNetNuke.Entities.Modules.PortalModuleBase

    Implements DotNetNuke.UI.Utilities.IClientAPICallbackEventHandler

 

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim callBack As String = ClientAPI.GetCallbackEventReference(Me, "arg", "ClientCallback", "context", "ClientCallbackError")

        Dim clientFunction As String = vbCrLf & "<script type=""text/javascript"">" & vbCrLf & _

        "function sendMsgToServer(arg, context){ " & callBack & "}" & vbCrLf & "</script>"

        ClientAPI.RegisterClientScriptBlock(Me.Page, "sendMsgToServer", clientFunction)

    End Sub

 

    Public Function RaiseClientAPICallbackEvent(ByVal EVENT_ARGUMENT As String) As String _

    Implements DotNetNuke.UI.Utilities.IClientAPICallbackEventHandler.RaiseClientAPICallbackEvent

        Return "HELLO: " & EVENT_ARGUMENT

    End Function

 

End Class

More documentatio on DotNetNuke Client API Client Callback http://www.dotnetnuke.com/LinkClick.aspx?fileticket=UBUhCCpW1d0%3D&tabid=478&mid=857 )

Best regards,

Zex

 

 

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Invalid JSON primitiveInvalid JSON primitive


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out