Subject: re use of dnn user controls in WAP model
Prev Next
You are not authorized to post a reply.

AuthorMessages
anaUser is Offline
New Poster
New Poster
Posts:2

10/20/2009 5:14 PM  

Hi all,

trying to include some skin objects namely the dnnLogin and dnnUser controls within a custom module (not at skin level but at user control level)

the problem i am haveing is that the code gen file .designer.vb places a reference that cant be resolved

"Protected WithEvents dnnUSER As Global.DotNetNuke.UI.Skins.Controls.User" not defined.

I would like to be able to manipulate the control in the code behind file ....for example

me.dnnLogin.Text = "jejejejejejeje" 

this seems to be something to do with the set up of my dev envioronment ...standard WAP compiled module in vis studio 2008

 

i would have hoped i could re use objects such as these in the same way as the labelcontrol etc....is this something to do with the scope of the user controls?

Am i missing the point or is this something that should be possible.

Cheers

 

 

Mitchel SellersUser is Offline
Site Admin/Owner
Guru
Guru
Posts:6089

10/21/2009 10:12 AM  
When you want to reference other items from the DNN installation, you need to do a bit of "configuring" in your project properties within Visual Studio.

Open the properties and switch to the "Web" tab.

Ensure that "use IIS" is selected. Then setup the proper virtual directory path for your module, then select the option to "override application root", in there put in the path to the "root" of the DNN installation/ My development environment uses a /dnn install, therefore I would put http://localhost/dnn for the root.

Save the project settings, close all .ascx control files, then open them back up, you can reference anything in your application using the ~/ syntax to reference the portal root.

-Mitchel Sellers
Microsoft C# MVP, MCITP
Director of Development
IowaComputerGurus Inc.

View Mitchel Sellers's profile on LinkedIn

For shared hosting I recommend PowerDNN

This site is hosted on a Dedicated Server from PowerDNN.com

To get Guaranteed DNN Support check out our affordable DNN Technical Support Programs
anaUser is Offline
New Poster
New Poster
Posts:2

10/21/2009 10:46 AM  

thanks for your reply however i am familiar with that procedure and my environment waas set up as you describe.

I have no problem in including the ascx files within my WAP project the problem is that in the designer codegen file the declarations are not correct.

To replicate this if you try and place an instance of the admin user control from ~\control\user.ascx into an ascx in your wap project called say default.ascx when you select "convert to web application" for the default.ascx (to force codegen file creation) then declaration for the user.ascx is not correct....in short it cant find a reference to it.

the control gets shown in design time ok but when you try and build the project the reference to it is "not defined" in the designer codegen file.

I hope i have explained this clearly enough....its confusing enough for me <img src=" border=0>

 

Mitchel SellersUser is Offline
Site Admin/Owner
Guru
Guru
Posts:6089

10/21/2009 10:55 AM  
If you have an option for "convert to web application", you are not configured in the manner that you need to be.

I do not use, and am not familiar with the processes necessary to integrate via WSP style module development.

Also, as a side note, I would typically recommend AGAINST this type of integration, as you expose yourself to major upgrade risks.

-Mitchel Sellers
Microsoft C# MVP, MCITP
Director of Development
IowaComputerGurus Inc.

View Mitchel Sellers's profile on LinkedIn

For shared hosting I recommend PowerDNN

This site is hosted on a Dedicated Server from PowerDNN.com

To get Guaranteed DNN Support check out our affordable DNN Technical Support Programs
MarkUser is Offline
New Poster
New Poster
Posts:4

08/17/2010 5:30 PM  

Hi

I think the problem that this user was having is the same as what I'm having now.

I have created a WAP module and compiled it fine and added to a page.  But now I want to add a change password control to the module and so at the top of the View.ascx file have added:

<%

@RegisterTagPrefix="dnn"TagName="Password"Src="~/DesktopModules/Admin/Security/password.ascx" %>
<dnn:PasswordID="name"runat="server"/>

 

Now what happens is that VS2008 creates a new field declaration in the designer.cs file:

protected

global::ContextDigital.ChangePassword.DotNetNuke.Modules.Admin.Users.Password name;

Its basing this on my project Namespace of ContextDigital.ChangePassword and also on the namespace of the password.ascx control I guess??  However that namespace obviously doesn't exist so I now get a compile error in my module.

So what is the correct namespace to that control?  When I try adding the password control to a normal WSP module and check the full namespace it comes up as ASP.desktopmodules_admin_security_password_ascx but this doesn't exist in my WAP project. 

Note that I have the followed all instructions on http://www.mitchelsellers.com/blogs/articletype/articleview/articleid/314.aspx and got it working fine for LabelControl.ascx.  I think its just different coz this seems to be a different type of control (maybe coz its not compiled into a dll?) 

You are not authorized to post a reply.
Forums >Development Discussion >DotNetNuke > re use of dnn user controls in WAP model



ActiveForums 3.7