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 ExtensionsModulesModuleswhere is the preinit event of the page?where is the preinit event of the page?
Previous
 
Next
New Post
6/6/2011 3:08 PM
 
I have been attempting to get the MS Report Viewer control to work within my website so I can display reports. The initial problem I have is dragging a MS Script control to the page so the report viewer works correctly  causes a conflict with the DNN Script Control object. Working with MSDN forum I have received instructions to declare the MS Script Control on the page.OnPreInit but I cannot find an OnPreInit event on my ASPX code and when I attempt to add the event I get compile errors.

Can someone shed some light here for me, please?
 
New Post
6/7/2011 12:01 PM
 
Hi... I gave I look..



If you're building a DNN module, I suppose you're inheriting from PortalModuleBase

Partial Class YourModule

    Inherits Entities.Modules.PortalModuleBase



PortalModuleBase doesn't seem to provide an handler for the PreInit event. I think that the "First" page event you can access by inheriting from POrtalModuleBase is page.init (try to decalre MS Scripr Control here).



Instead, if you create an aspx page, where you can inherit in your codebehind from System.Web.UI.Page you have access to a broader list of page events, including page.preinit



Partial Class Test

    Inherits System.Web.UI.Page

    Private Sub page_preinit (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.PreInit

        'do things

    End Sub

 


Unfortunately, I'm not capable of giving you specific instructions fot MS Report Viewer or Script Control.



Hope this helps,

Alberto

 
New Post
6/7/2011 12:17 PM
 
In this spost William Severance explains why you cannot override page.preinit from a dnn module



Instead, if you're working on a "private" project, you could do that by altering the default.aspx codebehind.



Obvusly, this can't be done if you're going to release the module.

 
New Post
6/7/2011 12:51 PM
 
IF I understand you correctly your saying I could alter the default.ASPX page for my website? Then when I updated the newer versions of DNN I owuld have to modify the page for my settings that add the page.preinit and code?

This is a little frustrating that DNN is not playing nice with the MS ScriptControl in the first place :(
 
New Post
6/8/2011 3:09 AM
 
That's exactly what I'm saing.. If you alter the default.aspx page and then update the installation, you'll have to modify again default.aspx page ("acceptable" in a private environment, but not for a "release module"). In addition, by doing this you'll add the reference to ALL the sites and ALL pages in that installation, instead of just when you need it.



Obvusly this was just a "quick" possible solution (and a way to see if other problems will bother you once reference is added), far from pretending to be a "good" solution



Have you tried adding reference on Page.Init? it' just the next step in the page lifecycle, and maybe it'll work. for example, looking at the msdn refernce for the asp.net page life cycle, I just noticed that I usally perform some actions during page.init, that "technically" should be performed during PreInit, but everything is working fine. If you haven't already, give it a try..



In any case, I didn't say that you can't use SriptControl with a dotnetnuke (as I said, I have no specific knowledge about MS ScriptControl), I just noticed that the PreInit event is not overridable from PortalModuleBase, and found that post in the forums with the explanation.



However, when programming It is very likely to be "always" another way to do what you need, even if it may or not be an easy thing to do.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModuleswhere is the preinit event of the page?where is the preinit event of the page?


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