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 ForumsClientAPIClientAPIHelloAJAX sample problemsHelloAJAX sample problems
Previous
 
Next
New Post
10/6/2006 4:36 PM
 

DNN 4.3.5 - I'm running into the same error.  I have a placeholder in a module that I am building the content for.  When it does the AJAX call, I get the same type of error.  I have tried various levels of this.Parent, but nothing seems to work.  To further confound me, the ClientID changes depending on what other modules are loaded.

Instance 1:
2 Modules Loaded on Page - both making use of the ClientAPI - both work fine.  The ClientID for the 2nd module on the page is:  dnn.xmlhttp.doCallBack('View dnn_ctr3288_View'...

Instance 2:
1st Module on page is hidden due to security (same applies to removal of 1st Module from page).  The ClientID for the 2nd module on the page is: dnn.xmlhttp.doCallBack('_ctl0 dnn_ctr3288_View__ctl0'....

The first module works great by itself (it is not loading into a placeholder).  The second module throws the cast error when by itself.  Both are implementing ClientAPICallbackEventHandler.  Any suggestions?  Why would the ClientID change?

 
New Post
10/9/2006 9:52 AM
 

The clientID is generated by ASP.NET, which guarantees that the ids assigned are unique.  It sounds like you are dynamically hiding and displaying elements on the page, which would explain why they change.

The issue you are running into is that the ids of the elements need to be the same on a callback, in fact they need to be the same in the early init stages of the page.  A future upgrade to the clientapi will remove this early stage factor (with some perf penalties), but the issue will still be the same.  Meaning you need to guarantee the control is loaded.  The helloajax sample I provide shows a workaround, where a parent control is always loaded, and depending on the callback argument, dynamically loads the control.

Hopefully this clarifies a few things.


 
New Post
10/9/2006 3:34 PM
 

I am dynamically building the content of the parent control (DNN Module) during the Init proceedure, so all controls should be there.  I am not trying to handle the RaiseClientAPICallbackEvent in another control, but in the Module.  If the module is the only one on the page, then its ClientID shouldn't change on post back and thus shouldn't be the cause of the error.

When calling the ClientAPI with ClientAPI.GetCallbackEventReference(this, "payload", ....), "this" should reference the module, correct?

 
New Post
10/9/2006 4:39 PM
 

A Follow Up:
This doesn't appear to be an issue with which other modules are on the page, but one of permissions.  If a role has edit permissions (which previously by virtue of the other module showing up, I did), then the ClientID is in one form (View dnn_ctr3294_View).  If I don't have edit permissions, the ClientID is in the other form (_ctl0 dnn_ctr3294_View__ctl0).  Is there something in the permissions which would affect ClientID and or ClientAPI call backs?

 
New Post
10/10/2006 11:03 AM
 

A little confused here.   When a page is viewed by someone with different permissions I would assume that the page would render differently than if there was no permissions.  By rendering different, I mean different controls are used.  When different controls are shown, the possibility exists that different IDs are assigned by ASP.NET. 

The confusing part is why should this matter?  As long as the permissions are the same between the time the page was first rendered (registered the callback) and the time of the callback, everything should render the same and thus the control should be found.

I am not sure what more I can say, I believe I answered your question, but lack the needed information to discern where your issue is.

 


 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIHelloAJAX sample problemsHelloAJAX sample problems


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