HomeHomeDotNetNuke Forg...DotNetNuke Forg...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 8: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 9:24 AM
 

Did you ever resolve this issue?

 
Previous
 
Next
HomeHomeDotNetNuke Forg...DotNetNuke Forg...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIdnn.callpostback not firing postback eventhandler in modulednn.callpostback not firing postback eventhandler in module


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

Attend A Webinar
Free Demo Site
Download DotNetNuke Professional Edition Trial
Have Someone Contact Me

Like Us on Facebook Join our Network on LinkedIn Follow DNN Corporate on Twitter Follow DNN on Twitter

Advertisers

DotNetNuke Scoop!

Sponsors

DotNetNuke Corporation

DotNetNuke Corp. is the steward of the DotNetNuke open source project, the most widely adopted Web Content Management Platform for building web sites and web applications on Microsoft .NET. Organizations use DotNetNuke to quickly develop and deploy interactive and dynamic web sites, intranets, extranets and web applications. The DotNetNuke platform is available in a free Community and subscription-based Professional and Enterprise Editions with an Elite Support option. DotNetNuke Corp. also operates the DotNetNuke Store where users purchase third party apps for the platform.