<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Custom Modules</title><link>http://www.dotnetnuke.com/tabid/795/Default.aspx</link><description>Developing custom modules for DotNetNuke.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: EditURL in a UserControl</title><link>http://forums.asp.net/thread/1152635.aspx</link><pubDate>Tue, 27 Dec 2005 16:46:44 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1152635</guid><dc:creator>exptrade2000</dc:creator><author>exptrade2000</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1152635.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=98&amp;PostID=1152635</wfw:commentRss><description>&lt;p&gt;I would not recomend inherithing from PortalModuleBase for nested user controls. Convinience inheriting is a bad practice. What you need to do is expose a PortalModuleBase propoerty on a user control and then assign it in Page_Init. like this.&lt;/p&gt;
&lt;p&gt;ctlSomeNestedUserControl.PortalModuleBase = Ctype(me,PortalModuleBase)&lt;/p&gt;
&lt;p&gt;or if you do not need everything that is in portalmodulebase, you can expose on ModuleInfo property and do the same thing. &lt;/p&gt;</description></item><item><title>Re: EditURL in a UserControl</title><link>http://forums.asp.net/thread/1039227.aspx</link><pubDate>Thu, 01 Sep 2005 14:39:21 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1039227</guid><dc:creator>ace</dc:creator><author>ace</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1039227.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=98&amp;PostID=1039227</wfw:commentRss><description>Yes, this is a great solution.&lt;br&gt;</description></item><item><title>Re: EditURL in a UserControl</title><link>http://forums.asp.net/thread/1013283.aspx</link><pubDate>Mon, 08 Aug 2005 11:42:08 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1013283</guid><dc:creator>matchbx27</dc:creator><author>matchbx27</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1013283.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=98&amp;PostID=1013283</wfw:commentRss><description>&lt;P&gt;Yep worked for me too...&lt;/P&gt;</description></item><item><title>Re: EditURL in a UserControl</title><link>http://forums.asp.net/thread/1013252.aspx</link><pubDate>Mon, 08 Aug 2005 10:48:21 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1013252</guid><dc:creator>frankenpeggy</dc:creator><author>frankenpeggy</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1013252.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=98&amp;PostID=1013252</wfw:commentRss><description>Setting the modulecontrol property for each sub-user control in the main page worked for me (&lt;A href="/1011505/ShowPost.aspx"&gt;problem here&lt;/A&gt;).</description></item><item><title>Re: EditURL in a UserControl</title><link>http://forums.asp.net/thread/1012241.aspx</link><pubDate>Sat, 06 Aug 2005 23:26:57 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1012241</guid><dc:creator>matchbx27</dc:creator><author>matchbx27</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1012241.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=98&amp;PostID=1012241</wfw:commentRss><description>&lt;P&gt;uzi,&amp;nbsp; this sounds as though it will work.&amp;nbsp; I am using the PortalModuleBase so using this method I should be able to make it work.&amp;nbsp; I'll post back.&lt;/P&gt;</description></item><item><title>Re: EditURL in a UserControl</title><link>http://forums.asp.net/thread/1012227.aspx</link><pubDate>Sat, 06 Aug 2005 22:42:03 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1012227</guid><dc:creator>uzi</dc:creator><author>uzi</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1012227.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=98&amp;PostID=1012227</wfw:commentRss><description>Actually, What you're missing is the ModuleConfiguration object, which seems to hold the ModuleId value. &lt;BR&gt;&lt;BR&gt;So, on Page_Init you'll need to do something like this...&lt;BR&gt;&lt;BR&gt;&lt;FONT size=2&gt;
&lt;P&gt;cusctrl1.ModuleConfiguration = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.ModuleConfiguration&lt;BR&gt;&lt;BR&gt;&lt;FONT size=3&gt;If that usercontrol already inherits from the PortalModuleBase, that property will already exist. If&amp;nbsp;you're using the plain jane UserControl base class, you'll need to add the ModuleConfiguration property which is of type ModuleInfo.&lt;BR&gt;&lt;BR&gt;I just looked at my modules which do this, and that's how I've gotten the ModuleId to be valid on sub-usercontrols. &lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;</description></item><item><title>Re: EditURL in a UserControl</title><link>http://forums.asp.net/thread/1012213.aspx</link><pubDate>Sat, 06 Aug 2005 22:01:02 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1012213</guid><dc:creator>uzi</dc:creator><author>uzi</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1012213.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=98&amp;PostID=1012213</wfw:commentRss><description>&lt;P&gt;I recommend not using the Late Binding syntax (i.e.. &lt;STRONG&gt;&amp;lt;%= ModuleId %&amp;gt;&lt;/STRONG&gt;) as that can reck some havoc on the module caching and the skinning engine from DNN. &lt;/P&gt;
&lt;P&gt;I would however recommend using either the &lt;STRONG&gt;Page_Load&lt;/STRONG&gt; or &lt;STRONG&gt;Page_Init&lt;/STRONG&gt; events to populate the&amp;nbsp;usercontrol with&amp;nbsp;&lt;STRONG&gt;cusctrl1.ModuleId = ModuleId&lt;/STRONG&gt;. If you use the Page_Load event, make sure it's not inside a &lt;STRONG&gt;If IsPostBack = False Then&lt;/STRONG&gt; line of code.. &lt;/P&gt;</description></item><item><title>Re: EditURL in a UserControl</title><link>http://forums.asp.net/thread/1012203.aspx</link><pubDate>Sat, 06 Aug 2005 21:22:52 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1012203</guid><dc:creator>vmasanas</dc:creator><author>vmasanas</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1012203.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=98&amp;PostID=1012203</wfw:commentRss><description>How about declaring a ModuleId property on the user control and passing the correct moduleid upon instantiating it?&lt;BR&gt;Think of it: you're building a general user control that need a param to work ok, so I suppose the param can be passed uh?&lt;BR&gt;&lt;BR&gt;- in your user control define a moduleid property&lt;BR&gt;- then when you add it to a dnn module use this:&lt;BR&gt;&lt;FONT size=2&gt;&amp;lt;Custom:ctrl id="cusctrl1" runat="server" ModuleId='&amp;lt;%=ModuleID%&amp;gt;'&amp;gt;&amp;lt;/Custom:ctrl&amp;gt;&lt;/FONT&gt;&lt;BR&gt;</description></item><item><title>Re: EditURL in a UserControl</title><link>http://forums.asp.net/thread/1011214.aspx</link><pubDate>Fri, 05 Aug 2005 13:47:25 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1011214</guid><dc:creator>matchbx27</dc:creator><author>matchbx27</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1011214.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=98&amp;PostID=1011214</wfw:commentRss><description>OK.. the EditURL in the custom user control is still giving me&amp;nbsp;-1 for a moduleid.&amp;nbsp; Heres what I have:&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&lt;FONT color=#000000 size=4&gt;User Control.ascx.vb &lt;BR&gt;&lt;BR&gt;&lt;FONT color=#0000ff size=2&gt;Imports&lt;/FONT&gt;&lt;FONT size=2&gt; System&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Imports&lt;/FONT&gt;&lt;FONT size=2&gt; System.Web&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Imports&lt;/FONT&gt;&lt;FONT size=2&gt; System.Web.UI&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;Namespace&lt;/FONT&gt;&lt;FONT size=2&gt; myns.DNN.Modules.MyCusModuleName&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;MustInherit&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Class&lt;/FONT&gt;&lt;FONT size=2&gt; CustomUserControl&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Inherits&lt;/FONT&gt;&lt;FONT size=2&gt; Entities.Modules.PortalModuleBase&lt;BR&gt;&lt;/FONT&gt;...&lt;BR&gt;...&lt;BR&gt;...&lt;BR&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Class&lt;BR&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Namespace&lt;BR&gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;BR&gt;UserControl.ascx&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#ffff00 size=2&gt;&lt;FONT color=#000000&gt;&amp;lt;%@ Control Language="vb" AutoEventWireup="false" Codebehind="UserControl.ascx.vb" Inherits="myns.DNN.Modules.MyCusModuleName.CustomUserControl" %&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;&amp;lt;asp:hyperlink id="hypNavEdit" NavigateUrl='&lt;/FONT&gt;&lt;FONT&gt;&amp;lt;%# EditURL("SomeEditPage") %&amp;gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;' runat="server" &amp;gt; Edit Part Summary&amp;lt;/asp:hyperlink&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&lt;BR&gt;MAINModuleControl.ascx&lt;BR&gt;&lt;FONT size=2&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;lt;%@ Register TagPrefix="Custom" TagName="ctrl" Src="UserControl.ascx" %&amp;gt;&lt;BR&gt;&lt;BR&gt;&amp;lt;Custom:ctrl id="cusctrl1" runat="server"&amp;gt;&amp;lt;/Custom:ctrl&amp;gt;&lt;BR&gt;&lt;BR&gt;&lt;FONT&gt;I then declared the cusctrl in the MainModuleControl.ascx.vb &lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;&lt;FONT&gt;&lt;FONT color=#0000ff&gt;Protected WithEvents&lt;/FONT&gt; cusctrl1 As myns.DNN.Modules.MyCusModuleName.CustomUserControl&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;The custom user control loads, but the ModuleID in the hyperlinks URL&amp;nbsp;is -1 instead of the actual moduleID.&lt;BR&gt;What am I missing??&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;P.S.&amp;nbsp; Both files are in the same directory.&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;/FONT&gt;</description></item><item><title>Re: EditURL in a UserControl</title><link>http://forums.asp.net/thread/1011071.aspx</link><pubDate>Fri, 05 Aug 2005 12:01:36 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1011071</guid><dc:creator>matchbx27</dc:creator><author>matchbx27</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1011071.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=98&amp;PostID=1011071</wfw:commentRss><description>Thanks for the info.&amp;nbsp; I think this is the piece I was missing.&amp;nbsp; I should be able to give it a try today.</description></item><item><title>Re: EditURL in a UserControl</title><link>http://forums.asp.net/thread/1010454.aspx</link><pubDate>Thu, 04 Aug 2005 20:55:49 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1010454</guid><dc:creator>uzi</dc:creator><author>uzi</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1010454.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=98&amp;PostID=1010454</wfw:commentRss><description>Is your UserControl inherit from the PortalModuleBase? In my modules with many sub-controls, I just have to make sure they are Inheriting from the PortalModuleControl and not the UserControl object. This should give you a valid me.ModuleId along with all the other objects DNN creates. &lt;BR&gt;&lt;BR&gt;What I usually do, is create a class that inherits from the PortalModuleBase, and I'll use that in my custom modules. This way if the namespace changes again, I just have 1 file to update.</description></item><item><title>Re: EditURL in a UserControl</title><link>http://forums.asp.net/thread/1010273.aspx</link><pubDate>Thu, 04 Aug 2005 18:13:49 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1010273</guid><dc:creator>matchbx27</dc:creator><author>matchbx27</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1010273.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=98&amp;PostID=1010273</wfw:commentRss><description>Did anyone ever get a chance to look at this?&amp;nbsp;&amp;nbsp; &lt;BR&gt;&lt;BR&gt;I'm really interested in hearing from folks that have developed large modules and how they kept from having a single .ascx page with&amp;nbsp;1000 or more lines of html.</description></item><item><title>Re: EditURL in a UserControl</title><link>http://forums.asp.net/thread/1003866.aspx</link><pubDate>Fri, 29 Jul 2005 13:26:22 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1003866</guid><dc:creator>matchbx27</dc:creator><author>matchbx27</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1003866.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=98&amp;PostID=1003866</wfw:commentRss><description>&lt;P&gt;OK, I found something that works but would this be considered a best pratice.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;In my custom user control I created a public property called EditURLValue like so&lt;/STRONG&gt;&lt;BR&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;
&lt;P&gt;Private&lt;/FONT&gt;&lt;FONT size=2&gt; _EditURLValue &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;String&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Property&lt;/FONT&gt;&lt;FONT size=2&gt; EditURLValue() &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;String&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Get&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Return&lt;/FONT&gt;&lt;FONT size=2&gt; _EditURLValue&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Get&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Set&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT size=2&gt; Value &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&gt;
&lt;P&gt;_EditURLValue = Value&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Set&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Property&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;BR&gt;Then I created the custom user control on my main form like so&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#0000ff&gt;&amp;lt;cus:MyControl&amp;nbsp; id="mcMyCustomControl"&amp;nbsp; runat="server" EditURLValue='&amp;lt;%# EditURL("SomeEditPage") %&amp;gt;'&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;gt;&amp;lt;/cus:MyControl&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;Back at my custom user control (front end form this time)&lt;BR&gt;&lt;BR&gt;I created a Hyperlink control and used this for the NavigateURL Property&lt;BR&gt;&lt;BR&gt;NavigateURL='&amp;lt;% # EditURLValue() %&amp;gt;'&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;Now the Hyperlink in the custom user control will return the module ID,&amp;nbsp; But is there a better way.....&lt;BR&gt;&lt;/P&gt;</description></item><item><title>EditURL in a UserControl</title><link>http://forums.asp.net/thread/1003832.aspx</link><pubDate>Fri, 29 Jul 2005 12:59:46 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1003832</guid><dc:creator>matchbx27</dc:creator><author>matchbx27</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1003832.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=98&amp;PostID=1003832</wfw:commentRss><description>If built a custom user control (like the sectionheadcontrol)&amp;nbsp;that contains the EditURL function, the function will return -1 for the ModuleID.&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;How do I call the EditURL("MyEditControl") in a custom user control that will return the moduleID of the current module instance?</description></item></channel></rss>