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.0Private Assembly module  and ModuleSettingsBasePrivate Assembly module and ModuleSettingsBase
Previous
 
Next
New Post
4/18/2008 8:22 AM
 

Hi.

I am trying to make a private assemby module and I have used the BlankModule guide made by Vladan Strigo. But I can not get a hold of webcontrols inside my user control. Here is an example.

I have a control settings.ascx and settings.ascx.cs, I have added them to my like standard user controls, and then modified them according to the DNN_Startup Kit with the control inheriting from ModuleSettingsBase like this:

namespace PromSys.Modules.ViewPromSysPublishStatic
{
    partial class Settings : ModuleSettingsBase
    {
..............

But then I can not get a reference to my controls on settings.ascx. Like if add a control to mye ascx page like this <asp:TextBox id="myTb"  runa="server" /> then I cannot use this code in my cs page

string myText = myTb.Text;

This vill give me a compile error, saying myTb does not exist.

And if I try

TextBox myNewTb = (TextBox)Page.FindControl("myTb");

It will give me an null Exception.

So how do I use webcontrols at the same time as I use ModuleSettingsBase? Or do I use something else then ModuleSettingsBase?

Best regards
Vidar

 
New Post
4/18/2008 11:00 AM
 

It looks like you're doing it partially correct. If you're creating a PA though, are you using a WAP project in VS2k5? If so, right click on the ASCX file in the project and choose convert to web application (or whatever looks close to that)

That should create a designer file that will store the control information, though sometimes you have to switch to design view and back in the ASCX to get it to update the partial classes.


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
4/18/2008 2:54 PM
 

Well. Yes I use WAP.

If I change the Inherit statement to Page instead of ModuleSetitngsBase, it works fine, so I think the problem lies with ModuleSettingsBase, or with some reference. If I use the same files inside the DotNetNuke main project (not a PA) then I can access the controls. So there has to be a link missing in my web application project, that is present in the dotnetnuke website.

Best regards
Vidar.

 
New Post
4/20/2008 3:00 AM
 

Since there does not seem like anyone have an answer to my question, I will throw in a new one.

How do you guys make a PA project in C#? 
Do you use Web Application Project? 
What do you inherit from in the View, and Settings pages?
Do you include other references than dotnetnuke.dll?
Can someone maybe send me a very simple project of a settings.ascx and view.ascx with the codebehind files. If you can, send them to vidar(dot)markussen (a) gmail(dot)com.

Thanks in advance
-Vidar-

 

 
New Post
4/23/2008 6:35 AM
 

Hello, Vidar,

well, personally I am trying to create module from PA at the moment and I use WAP. My module doesn't need settings page, but it has edit.ascx. View and Edit module classes inherits from DotNetNuke.Entities.Modules.PortalModuleBase. I include only DotNetNuke.dll, but that's because I do not need something in addition.

My module loads and I am able to navigate from View to Edit page, but unfortunately some exception occure somewhere in DAL..

I hope this will be usefull to you.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Private Assembly module  and ModuleSettingsBasePrivate Assembly module and ModuleSettingsBase


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