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 ExtensionsOther Extension...Other Extension...Linking to Multiple Individual Records in Database in aspx / html?  Linking to Multiple Individual Records in Database in aspx / html?
Previous
 
Next
New Post
5/17/2011 5:15 AM
 
Thank you both for your reply.

Wes Tatters wrote:
If you site is running dnn 5.6.2 and asp.net 4.0 ...
That is the case.

Wes Tatters wrote:
... then this sort of thing could be done relatively quickly using the built in Razor Host module.
What I've read sofar, using the Razor Host module is more flexible than creating a 'normal' module. (Only disadvantage seems to be that you have to log in as a host to be able to adjust the content.)

What I was hoping when initially writing this post, was that it would be possible to create some sort of user control that contained the code linking to the database and then using this user control in e.g. the Html module. So a 2 layer approach. But this or something similar can't be done at the moment in DNN, can it? (The thing that comes closest is probably the Razor Host module, but that is not really a 2 layer solution.)
 
New Post
5/17/2011 5:28 AM
 
Effectively, @razor code is native asp.net code embedded into HTML markup.

So in this case a couple of lines of code to connect to the database and select the records you require.
Then a block of HTML markup with some razor code embedded thru it to display the info selected from your database records.

Alternatively - why not create a simple module to do the rendering for you. If you want to go to the effort of creating a user control - then you are already 90% of the way to creating a module.   After all - a module is really just a fancy user control.

Westa
 
New Post
5/17/2011 6:50 AM
 
Wes Tatters wrote:
Alternatively - why not create a simple module to do the rendering for you. If you want to go to the effort of creating a user control - then you are already 90% of the way to creating a module.   After all - a module is really just a fancy user control.

To my knowledge I would have to recompile the module each time I adjust even a single character / word and reupload it to my webhoster. That seems less flexible than the Razor solution. Or am I mistaken?

Or I could implement a similar structure (with native asp.net code embedded into HTML markup) like the Razor Host module already provides. Or am I overlooking something?

 
New Post
5/17/2011 7:05 AM
 
You can setup a module any way you like.  Have a look at some of the different modules used in dnn. Some are totally templated - others are dynamically generated - others have hard coded layout.

But really - its totally dependent on what your end needs are - razor is a great tool for simple functionality - where u are rendering data from a sql source for example - or a simple form. But if you were looking for complex functionality like a blogging engine then a module is a much more sensible choice.

Part of the decision to make is about how you want to utilize a module - if its for your own use alone then razor is not a bad path - but if its something you are distributing to clients then maybe a module is the cleaner path - as it comes with code and sql installers and data provider support - and the code can be compiled and hidden from the end user.

Westa

 
New Post
5/17/2011 7:13 AM
 
On another note - if you build a module using the WSP development style there is actually no need ever to compile the code - since the ascx file and ascx.vb file all live on the server and are compiled at runtime as needed.

Using this model you get all the benefits of module development - without the overheads of razor.

One thing to understand is that every module be it WAP or WSP based are eventually compiled down into CLR p-code - which leads to performance and executing improvements = meaning once a page is visited and executed once during a session it wont need to be recompiled unless the server see a change to the source or in the case of a WAP module needs to be reinterpreted and when a new dll is uploaded to the bin folder.  

Razor code is compiled effectively line by line on the fly every time a page is requested - its not designed for performance but instead for quick functionality.

Westa
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsOther Extension...Other Extension...Linking to Multiple Individual Records in Database in aspx / html?  Linking to Multiple Individual Records in Database in aspx / html?


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