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...Building ExtensionsBuilding ExtensionsModulesModulesImplementing "Callback" events within a custom C# moduleImplementing "Callback" events within a custom C# module
Previous
 
Next
New Post
9/20/2011 1:56 PM
 
(New to DNN)
My DNN module has a column of Input fields built dynamically within Page_Load event (based on a XML file content).
When user enters some data within each input field ("onkeyup" event of each input field) a string (concatenation of all input value strings) is to be sent to the server (asynchronously - not a page postback) for processing. The result (String) from the server is then used to render a segment of the page by setting the "innerHTML" value of the target page elements.

Under an ASPX page the following works fine:-
string cbReference = Page.ClientScript.GetCallbackEventReference(this, "arg", "JSCallback", "context", true);
//The next 2 lines register the javascript function that will call back to the server from a javascript function
string cbScript = string.Format("function UseCallBack(arg, context) {{ {0}; }} ", cbReference);
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "UseCallBack", cbScript, true);

The same code fails to Register/invoke the Callback event when used within a dnn module (.ASCX) which gets added to a simple ASPX page that uses a simple skin.

Based on my limited research it looks like I have to use
DotNetNuke.UI.Utilities.ClientAPI.GetCallbackEventReference,
DotNetNuke.UI.Utilities.ClientAPI.RegisterClientScriptBlock..etc instead.

Can someone please show me the correct usage of the these two within a DNN module.
Looks like I am not passing the correct parameters to the new methods.
All I am getting is the [object error] for all my attempts with varying parametr list.
 
New Post
9/21/2011 10:46 AM
 
Selva,

Check out the Page_Load Sub in \Install\InstallWizard.aspx.vb as a reference. Also check out \admin\ControlPanel\UpdatePage.ascx.vb.

Thank you,
James Campbell
MCP,MCSA,MCSE,Sec +
http://jamesecampbell.blogspot.com
 
New Post
9/21/2011 10:58 AM
 

Thank you,
James Campbell
MCP,MCSA,MCSE,Sec +
http://jamesecampbell.blogspot.com
 
New Post
9/21/2011 11:09 AM
 
James,

Thanks a lot for your time. I will look at the two samples. BTW are the steps very similar in C#. Any chance of viewing a C# sample?

Kindest regards,
 
New Post
9/21/2011 11:19 AM
 
James appreciate it very much. Downloading the documentation.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesImplementing "Callback" events within a custom C# moduleImplementing "Callback" events within a custom C# 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