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.0Creating custom Controls besides View, Edit & Settings.Creating custom Controls besides View, Edit & Settings.
Previous
 
Next
New Post
3/10/2007 8:03 PM
 

I am having trouble creating a custom control. I am using VWD, SQL 2000, IIS on WinXP. I've got a working DNN application and have already customized the View and Edit controls. I used the DNN starter kit to add a new module to my DNN project. I renamed the folders and since it is csharp I added the code file reference in the web.config. All the default files and folders are intact and functional. I've added some .net controls to the Edit and View ascx controls and run a couple simple queries against my DB. Everything works just fine. I want to move what I've created on the Edit control to a custom control that a user can access it with out needed/having edit privledges. (I hope all that makes sense.)

So, I followed some instructions from adefwebserver.com and created a new ascx page alongside the View, Edit and Settings ascx files, threw a label and button on it where the button redirects to the default View Control. I also put a link on my default View control to direct to my custom control. (all of this so far to simply test the functionality) I am using:

Response.Redirect(Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "mytest", "mid=" + ModuleId.ToString()));

...to get to a new web user control called TEST.ascx. I added the control definition to the module alongside the existing controls with a key of "mytest", a title of "TEST TITLE", I coose the page correctly and I gave it type "View". All other fields were left blank as they are optional. Here is my code for the new TEST.ascx:

using

using System.Data;using System.Data.SqlClient;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls; DotNetNuke;using DotNetNuke.Common;using DotNetNuke.Common.Utilities;using DotNetNuke.Entities.Modules;using DotNetNuke.Entities.Modules.Actions;using DotNetNuke.Security;using DotNetNuke.Services.Exceptions;using DotNetNuke.Services.Localization; partial class DesktopModules_TEST : DotNetNuke.Entities.Modules.PortalModuleBaseprotected void Page_Load(object sender, EventArgs e)Globals.NavigateURL(), false);

 

 

 

 

 

 

 

 

 

using

 

 

 

 

 

 

 

 

public

 

{

 

{

Response.Redirect(

}

}

....so...now for the problem (many thanks to anyone that has even got this far!!!). I load up my DNN site, login, go to my page with my custom module. I click the link to go to my custom control and my View control appears to go away and all I am left with is a blank area where my module used to be. No container etc...nothing. I've looked over documentation (skimmed 4 of the PDFs from 4.4.1 release) and Google'd countless websites (many times coming back to Mr. Washington's website [kudos Mr. W. Xcelent resources BTW]). I don't know what to do. Any thoughts? Clearly I've forgotten / not done something, I'm a newb and too inexperieced to know what. Please help!

System;
 
New Post
3/11/2007 1:30 AM
 

I believe I "figured" this out. I am using the same NavigateURL method as above to get to the custom control, but I had to close my session and re-open / login to get it to work. Once I got to the custom control page I used:

Response.Redirect(

Globals.NavigateURL());

In an OnClick button event to jump back to the default View control. Sheesh...and I put off posting anything to a forum this long...only to figure it out an hour or two later.

I also had anoter problem with it. I drug a button control on to my page from Visual Web Designer. When I clicked it in design mode to create the onclick event handler in the code behind it jumped in to the code but at first I didn't notice it did not create the event handler code, it just threw me in to the Page_Load event handler. That was 30 seconds of confusion I didn't need. Anywho...hope all this helps someone else!

 

 
New Post
3/11/2007 9:32 AM
 

I think you can use the Dynamic Control option in this tutorial;

Dynamically Loaded Controls



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
3/12/2007 8:49 AM
 
Absolutley! In fact I think it is a better solution. One of the things I've found that is a problem with DotNetNuke is documentation for Jr developers like myself. I've only been developing for less than 2 years. I just "learned" C# a year ago along with ASP.NET. Kind of jumped in with both feet. I had only learned vbscript before that after spending a few years using VBA building Excel solutions. The documentation you've provided helps bridge that gap. Dotnetnuke it lucky to have you Mr. Washington! (I bet your website hits reflect that.) Thanks again.
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Creating custom Controls besides View, Edit & Settings.Creating custom Controls besides View, Edit & Settings.


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