开发者

DotNetNuke 5 open aspx in new window

开发者 https://www.devze.com 2023-03-05 15:41 出处:网络
Another issue I have in DNN5: I\'m currently creating a module that shows a GridView that has a \"Edit\" column.

Another issue I have in DNN5:

I'm currently creating a module that shows a GridView that has a "Edit" column. When user clicks on "Edit" column, it should open an edit form in a new window. This edit form is an ASPX-page inside my module folder and it expects a ModuleId parameter in order to access the module Settings; that part works fine and I'm able to retrieve the Module settings.

However, I still have the following issues:

  1. How can I localize my Labels? I have tried DNN's label control, but no success. I also tried asp:Label with "meta:resourceKey", but it looks like it isn't able to access the local resource file.

  2. It's very annoying to use Aspx-pages in my module since it will operate outside DotNetNuke's context. Does anybody knows an approach that allows me to use PortalModuleBase? I have tought about displaying a DotNetNuke page in the new wi开发者_StackOverflow中文版ndow, just by referencing the Control to load. However when I do that, it will show me the full page (so with navigation bar, footer, and so on) and I actually just want to show the control. Besides, I'm only able to open my Aspx-page by referencing to /DesktopModules/MyModule/Page.aspx instead of DNN's NavigateUrl or so.

Thanks for your replies.


DNN will hide all other modules on the page whenever a control (or ctl=mycontrol) is specified for the page. So,

  1. You should change your code from an ASPX page to an ASCX control.
  2. Add the ascx control to the Module Controls section of your module's Module Definition.
  3. Use DNN's NavigateURL function to generate the link. You'll want to use one of the options where you specify the Control Key (i.e. NavigateURL("edit", "SkinSrc=[G]" + Globals.QueryStringEncode( DotNetNuke.UI.Skins.SkinInfo.RootSkin + "/" + Globals.glbHostSkinFolder + "/" + "No Skin" ))

In the above sample, "edit" is the control key you specified for the control.


Why not load the edit interface in another ASCX file rather than an ASPX page? Check out http://dnnsimplearticle.codeplex.com for some examples in C#. It's a basic article module, but does a lot of useful things from a DNN perspective.


  1. Mate for localization Aspx-pages operating outside DotNetNuke's context i suggest you to do it programatically. It will give you more control and you can debug it if some problem arises.

  2. Like EfficionDave suggest use Control Key (i.e. NavigateURL("edit", "SkinSrc=[G]" + Globals.QueryStringEncode( DotNetNuke.UI.Skins.SkinInfo.RootSkin + "/" + Globals.glbHostSkinFolder + "/" + "No Skin" )) method

/Adnan Zameer

http://www.adnanzameer.com

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号