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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0#include in DNN module#include in DNN module
Previous
 
Next
New Post
11/2/2007 12:51 PM
 

Apologies if this is a dumb queston, I have searched the net and this forum but can find nothing that might allude to an answer.

Can an #include to another .aspx page be scripted in a module.  The file would be included on the server, I don't need the module to be portable it would only run on our instance. This would be a simple way of me getting an application up and running as part of the portal (rather than Iframe) without building it as a module.

Thanks for your time.

Oliver

 

 

 

 

 
New Post
11/2/2007 5:27 PM
 

Oliver,

Modules are consisting of controls, which are a combination of other (simple or conpund) controls and some code behind. all parts are .ascx files, that are finally loaded into default.aspx.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
11/2/2007 6:02 PM
 

Sebastian, thanks for such a prompt reply.  I'm not the sharpest tool in the box, is that yes or no?

Basically what I want an answer to is  - If I referenced an include file (written in asp.net) via <!-- #include file="mypath/myfile.aspx" --> in a module, that did not much else other than pull in the include. Would the include run and present the results within the module/container. My thinking being that some applications I have might port more easilly this way, rather than trying to rewrite them as dnn modules, the advantage being I avoid the iframes and the content might render as part of the portal.

Thanks Sebastian, and to anyone else who can help me out.

Cheers

Oliver

 
New Post
11/2/2007 9:28 PM
 

You cant do this sort of thing inside a module using a #include type statement.

However - you could possibly use a HTML scape type function to load  the HTML markup output of your old aspx into a module at runtime.

Doing this sort of thing is however potentially fraught with all sorts of problems.

1. URLs that link around your OLD site would all need to be remapped -
2; Any forms or buttons or buttons wont work - and neither would client site vbscript potentially.
3. SInce the HTML is now being forced to fit inside the constraints of a MODULE label the results would potentially look wrong.

Having said all that - if you want a quick and dirty scraper module try the following:

1. Create a new module

2. Place a label control in the ascx of the module

asp:Label ID="lblPlaceholder" runat="server" Text="Label"></asp:Label>

<

Then in page_load event of  the ascx.vb codebehind of the module you would do something like this:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load, Me.Load

     ' GET THE URL TO LOAD SOMEHOW

     '- Most Likely use a module setting of some type 
     '- or by passing in a URL as part of a query string
     '  for now lets just hard code it

     Dim myUrl as String = "http://mysite.com/somefile.aspx
     Dim myHTML as String =  GetHTML( myUrl )

     ' IF you original HTML contails any URL links you will need to remap these somehow.
     ' a query string would be the most useful way of doing that

     lblPlaceholder.text = myHTML

End Sub

 Private Function GetHTML(url As String) As String 
      Dim wReq As WebRequest = System.Net.HttpWebRequest.Create(url) 
      Dim sr As New StreamReader(wReq.GetResponse().GetResponseStream()) 
      Dim result As String = sr.ReadToEnd() 
      sr.Close() 
      Return result 
 End Function 'GetHTML

>>>>>>>>>>>>

But frankly - me thinks it would be more trouble that its worth - and maybe an IFRAME would really be the much better option.

Westa

 

 
New Post
11/3/2007 8:21 AM
 

Westa

That's a borderline genius solution to my problem that I had not considered. 

What I didn't say is that the apps i want to port mostly generate text content and what I will serve is mostly text, also any links are likely to be absolute links to external resources. I'd need to capture the portalid, moduleid and tabid and pass them to page to scrape, but that'd work in the querystring.

How do I grab those ids in the module code?  If you can help me with that I think I'll have a bash at building the module afterall!!

Thanks very much

Oliver

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0#include in DNN module#include in DNN 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