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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...direct access to module contentdirect access to module content
Previous
 
Next
New Post
8/9/2007 6:30 PM
 

Hi,

is there a way to get ONLY the content of a module on a page by passing the tabid and a additional parameter over the address bar? I don't need any additional html code around it, because i want use it by a ajax query, where i just need the content of the one specific module, but also want the whole page be accessible by a normal link (i hope this is understandable)?

 
New Post
8/10/2007 12:21 AM
 

You could possibly grab the printerfriendly page for a module to scrape the content. Though it sounds more like you need to setup a webservice to return the data you need.


Chris Hammond
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
New Post
8/10/2007 6:37 AM
 
Thank you for your fast reply, though it's no good news, but it seems that theres no other way to do it

cheers, david
 
New Post
8/12/2007 6:03 PM
 
unfortunately there are some problems with such a web service:
at the end of the webservice i have to call the "RenderControl" method to get the html code but this throws an error:
System.NullReferenceException: Object reference not set to an instance of an object.
at DotNetNuke.UI.Utilities.ClientAPI.IsClientScriptBlockRegistered(Page objPage, String key)
at DotNetNuke.UI.Utilities.ClientAPI.RegisterClientReference(Page objPage, ClientNamespaceReferences eRef)
at DotNetNuke.UI.Utilities.ClientAPI.RegisterClientReference(Page objPage, ClientNamespaceReferences eRef)
at DotNetNuke.UI.Utilities.ClientAPI.GetCallbackEventReference(Control objControl, String strArgument, String strClientCallBack, String strContext, String srtClientErrorCallBack, String strClientStatusCallBack, String strPostChildrenOfId, CallBackTypeCode eCallbackType)
at DotNetNuke.UI.Utilities.ClientAPI.GetCallbackEventReference(Control objControl, String strArgument, String strClientCallBack, String strContext, String srtClientErrorCallBack, String strClientStatusCallBack, CallBackTypeCode eCallbackType)
at DotNetNuke.UI.WebControls.DNNLabelEdit.AddAttributesToRender(HtmlTextWriter writer)
at System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer)
at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer)
at DotNetNuke.UI.WebControls.DNNLabelEdit.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Control.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at ASP.portals__default_containers_dnn_blue_image_header___color_background_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in D:\Downloads\DotNetNuke_04.05.05_Install\Portals\_default\Containers\DNN-Blue\Image Header - Color Background.ascx:line 39
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Control.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at DotNetNuke.ModuleContent.get_module_content(Int32 tabid) in d:\Downloads\DotNetNuke_04.05.05_Install\App_Code\WebServices\ModuleContent.cs:line 56
what am i missing? each object is initialized! the hole code would be a little bit much, but the webmethod itself:
[WebMethod]
public string get_module_content(int tabid)
{
ModuleController modules = new ModuleController();
System.Collections.Generic.Dictionary tab_modules = modules.GetTabModules(tabid);
DotNetNuke.Entities.Portals.PortalSettings portal_settings = DotNetNuke.Common.Globals.GetPortalSettings();

foreach (System.Collections.Generic.KeyValuePair act_module in tab_modules)
{
if ((act_module.Value.PaneName == "ContentPane") && (DotNetNuke.Security.PortalSecurity.IsInRoles(act_module.Value.AuthorizedViewRoles) == true) && (act_module.Value.IsDeleted == false))
{
System.Web.UI.UserControl container = null;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
System.IO.TextWriter sw = new System.IO.StringWriter(sb);
System.Web.UI.HtmlTextWriter test = new System.Web.UI.HtmlTextWriter(sw);

container = this.RenderModules(act_module.Value, portal_settings); //implementation of the "InjectModule" Method of DotNetNuke.UI.Skins.Skin but less functionable
container.RenderControl(test);
return sw.ToString();
}

}

return "No module found!";
}
The "RenderModules" Method is a small implementation of the DotNetNuke.UI.Skins.Skin.InjectModule Method, but without some features

cheers, david
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...direct access to module contentdirect access to module content


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