Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AspDotNetStoreFront
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
The best choice for your web site host, email hosting, and domain registration.
 


  Sponsors  

Meet Our Sponsors

SmarterTools
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  ClientAPI Compo...  dnn.callpostback not firing postback eventhandler in module
Previous Previous
 
Next Next
New Post 8/6/2007 7:20 PM
User is offline Nath P
4 posts
..
10th Ranked


dnn.callpostback not firing postback eventhandler in module 

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 8:24 AM
User is offline Tigris7
165 posts
9th Ranked


Re: dnn.callpostback not firing postback eventhandler in module 

Did you ever resolve this issue?

 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  ClientAPI Compo...  dnn.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.

 


IHostASP.NET Provides the Ideal DNN Hosting
We will help you with the installation, configuration, and troubleshooting of your DNN portal, no task is too big or small for us. Unlike other companies we are not just providing a reliable hosting service, but we are also focused on providing the best DotNetNuke hosting service on the internet.
www.ihostasp.net
$7.16/mo - Powerful DotNetNuke / DNN Hosting
Powerful DotNetNuke / DNN Hosting on Windows 2008 and 2003 servers, starting at under $8/mo with FREE SQL 2008 on certain plans and FREE SQL 2005 on all plans with FREE Installation and expert support.
www.re-invent.com
ASP.NET Web Hosting for $3.95
3 Month FREE ASP.NET Hosting! FREE Setup! DNN Support! FREE Domain Name! FREE Components! Host multiple websites on 1 plan! 30 Days Money Back Guarantee!
www.dailyrazor.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP