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

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIdnn.callpostback not firing postback eventhandler in modulednn.callpostback not firing postback eventhandler in module
Previous
 
Next
New Post
8/6/2007 10:20 PM
 

Hi,

I have been working on this issue for the past few days and I appear to be no closer to solving it.

Let me explain my situation, I am working on a project that requires 2 interconnected (but seperate) modules working on the same page.

When I say 'interconnected' they essentially share some session objects and shared controller class objects. 

The problem is that whilst I can get custom postbacks to work in one module on the page, I am unable to get them working on the second module.  I followed the exact same steps (even cut and pasted) the code from one module to the other but the second module will not fire the server side postback event handler function.

I have stepped into the javascript and it appears to go through the motions of dnn.callpostback but the server side event simply does not fire.

I tried RaiseClientAPICallbackEvent and this works without a problem on the second module but I need to pass a simple client side gridview textbox value to the server side event and I canot do this using the RaiseClientAPICallbackEvent.

My server side module code:

 

 

 

 

 

 

Partial Class ViewGlobalCatalogue_BasketInherits Entities.Modules.PortalModuleBaseImplements Entities.Modules.IActionableImplements IClientAPICallbackEventHandlerPrivate BasketItems As New List(Of BasketItemInfo)

 

 

'Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load, Me.LoadTry

InitClientAPI()

 

 

 

 

Me.BasketItems = Session(BasketSessionObject)Me.gvBasket.DataSource = BasketItemsMe.gvBasket.DataBind()Catch exc As Exception 'Module failed to load

ProcessModuleLoadException(

 

Me, exc)End Try

 

 

End Sub

 

 

 

Protected Sub gvBasket_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvBasket.RowDataBoundDim btnEditCartItem As ImageButton = e.Row.FindControl("btnEditCartItem")If (Not IsNothing(btnEditCartItem)) Then

btnEditCartItem.Attributes.Add(

 

"onclick", "return doUpdateCartItemQtyPostback('" & DataBinder.Eval(e.Row.DataItem, "ItemId") & "','" & e.Row.FindControl("txtQty").UniqueID & "," & "','" & DataBinder.Eval(e.Row.DataItem, "Description") & "');")End If 

 

End Sub

 

 

 

Protected Sub InitClientAPI()If ClientAPI.BrowserSupportsFunctionality(ClientAPI.ClientFunctionality.XMLHTTP) _AndAlso ClientAPI.BrowserSupportsFunctionality(ClientAPI.ClientFunctionality.XML) Then

ClientAPI.RegisterClientReference(

ClientAPI.RegisterClientReference(

 

Me.Page, ClientAPI.ClientNamespaceReferences.dnn_xml)Me.Page, ClientAPI.ClientNamespaceReferences.dnn_xmlhttp)'Register External js file

 

If Not ClientAPI.IsClientScriptBlockRegistered(Me.Page, "GlobalCatalogue_Basket.Core.js") Then

ClientAPI.RegisterClientScriptBlock(

 

 

Me.Page, "GlobalCatalogue_Basket.Core.js", _"<script src=""" & Me.ModulePath & "GlobalCatalogue_Basket.Core.js""></script>")End If

 

End If

ClientAPI.RegisterPostBackEventHandler(

 

Me, "EditBasketQty", AddressOf EditBasketQtyPostBack, False)End Sub

 

 

 

 

 

 

BasketController.Refre****em(ItemId, Description, Qty, Context)

 

Private Sub EditBasketQtyPostBack(ByVal args As ClientAPIPostBackEventArgs)Dim ItemId As Integer = CInt(args.EventArguments("itemid"))Dim Qty As Integer = CInt(args.EventArguments("qty"))Dim Description As String = args.EventArguments("description")Dim BasketController As New GlobalCatalogue_BasketControllerEnd Sub

 

 

 

OnChangeBasketQty(

 

 

Public Function RaiseClientAPICallbackEvent(ByVal eventArgument As String) As String _Implements UI.Utilities.IClientAPICallbackEventHandler.RaiseClientAPICallbackEventDim args() As String = Split(eventArgument, ",")New AddToCartEventArgs(args(0), args(1)))Return eventArgumentEnd Function

 

 

 

Public Overridable Sub OnChangeBasketQty(ByVal e As AddToCartEventArgs)RaiseEvent ChangeBasketQty(Me, e)End Sub

 

Public Event ChangeBasketQty(ByVal sender As Object, ByVal e As AddToCartEventArgs)

End Class               

My Javascript code:

// Custom Postback for adjusting basket Qty

function

doUpdateCartItemQtyPostback(itemid,qtycontroluniqueid,description) {

var

dnn.callPostBack(

}

Any assistance would me much appreciated as this is driving me insane.

qty = document.getElementById(qtycontroluniqueid);'EditBasketQty', 'itemid=' + itemid,'qty=' + qty.value, 'description=' + description);

 
New Post
1/29/2008 12:24 PM
 

Did you ever resolve this issue?

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIdnn.callpostback not firing postback eventhandler in modulednn.callpostback not firing postback eventhandler in module


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