Search code examples
content-management-systemdotnetnukednn9

How to add an extra view to my DNN module?


I am totally new to DNN development, I made a module using Christoc Modules, and all my logic is in the view.ascx page, I want to add a new view that basically, would be a button that when the user clicks on it the user would be redirected to the view.ascx page, I have looked everywhere to find tutorial or example that is well explained to do this step by step but I didn't find


Solution

  • First, I suggest you to declare the new view (Edit.ascx for example) in your module definition. To do that, go to Extensions menu, edit your module, select Extension settings tab and edit the module definition which is displayed in the bottom of the page. Then, add a new module control with a key (edit for example).

    Now, you can try to add a button to the default view (View in your case) to display the 2nd view.

    By the past, navigation between views used a combination of response.redirect, NavigateURL and EditURL. For example, you could use Response.Redirect(EditUrl("edit")) to display view which is correspond to the "edit" key.

    Now, you should use NavigateURL from the NavigationManager. Here is some links which could help you:

    I hope that could help you.