开发者

How do I redirect from one DotNetNuke module to another?

开发者 https://www.devze.com 2023-03-27 11:25 出处:网络
I am new to dotnetnuke. I developed three modules in desktopmodules folder. like desktopmodules(folder)

I am new to dotnetnuke.

I developed three modules in desktopmodules folder. like

desktopmodules(folder)

     |
     --  EnterpriseSearch(folder)
           Enterpris开发者_运维知识库eSearch.ascx

     |
     -- document search(folder)
           docsearch.ascx

     |
     --result(folder)
           result.ascx

result page is common to enterprice search and document search i want to redirect to result page from EnterpriseSearch and docsearch with parameter.

I tried with placing result module "type" as "view" and method of DotNetNuke.Common.Globals.NavigateURL

I tried with placing result module "type" as "edit"

editurl()

but i am not able to redirect it.

I dont want place theree pages in one folder (according to my requirements)

please give me the solutions to my question


  1. Drop the EnterpriseSearch module onto a Content Page named EnterpriseSearch in your root DNN installation. Users will see "domain/EnterpriseSearch.aspx" in their address bar when visiting this page.

  2. Drop the DocumentSearch module onto a Content Page named DocSearch in your root DNN installation. Users will see "domain/DocSearch.aspx" in their address bar when visiting this page.

  3. Drop the Results module onto a Content Page named SearchResults in your root DNN installation. Users will see "domain/SearchResults.aspx" in their address bar when visiting this page.

  4. In the codebehind of each search module, input the following code after a user clicks search (search button click handler)

    Response.Redirect("/Search-Results.aspx?search=" & httpUtility.UrlEncode(TXT_Search.Text))
    
  5. In your search results module at SearchResults.aspx, in your codebehind page-load function, do this:

    Dim MyString as String = httpUtility.URLDecode(Request.QueryString("search"))
    ' perform search ...
    


Because the controls are in different modules, you'll need to use Globals.NavigateURL to navigate to a specific page that the module is on. If the result.ascx was a control of the same module, you could use EditUrl and pass in the control key, but that only working within the same module definition.

In this case, you should probably use ModuleController.GetModulesByDefinition to get the Result modules on the portal, then navigate to the page that one of the modules is on.


In view control button click event write below code like

protected void Button1_Click(object sender, EventArgs e)
 {
    Response.Redirect(Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "WebUserControl", "mid=" + ModuleId.ToString()));          
 }

Follow below url instruction and redirection from one page to another page works.

http://www.dnnsoftware.com/Content/Dnn.Platform/Documentation/Using%20the%20Control%20Panel/Host%20Console/Extensions/Module%20Definitions%20and%20Controls/Adding%20a%20Module%20Control.html

0

精彩评论

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

关注公众号