Hey sandip,
I know what you want to do. And if i'm right you want to redirect to a module where you want to display a specific control according to query string. right?
If this is right, do following:
Add a new control in your module called _default.ascx and add following code there:
_default.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="_Default.ascx.cs" Inherits="_Default" %>
<asp:PlaceHolder ID="phMain" runat="server"></asp:PlaceHolder>
in .cs:
partial class _Default : PortalModuleBase
{
private string m_ModuelControl = "";
protected void Page_Load(object sender, EventArgs e)
{
LoadModuleControl();
}
private void LoadModuleControl()
{
TabController obj = new TabController();
TabInfo objTab = obj.GetTab(TabId);
string barKey = string.Empty;
barKey += objTab.TabName.Trim();
if (Request.QueryString["mctl"] != null)
barKey = Request.QueryString["mctl"].ToString();
else
{
switch (objTab.TabName.Trim().ToLower())
{
case "sysupd":
m_ModuelControl = "Navigation_Mail_MailSideBar.ascx";
break;
}
}
if (!string.IsNullOrEmpty(m_ModuelControl))
{
PortalModuleBase objPortalModuleBase = (PortalModuleBase)LoadControl(m_ModuelControl);
objPortalModuleBase.ModuleConfiguration = ModuleConfiguration;
objPortalModuleBase.ID = System.IO.Path.GetFileNameWithoutExtension(m_ModuelControl);
phMain.Controls.Add(objPortalModuleBase);
return;
}
}
This should be done in a module where you need to dispplay your control according to querystring param.
now comes the redirection part.
add following at the top of your page:
using DotNetNuke.Entities.Tabs;
then where you want to redirect use this:
TabController objtab = new TabController();
TabInfo objtabinfo = new TabInfo();
objtabinfo = objtab.GetTabByName("<Tab Name>",PortalId);
Response.Redirect(Globals.NavigateURL(objtabinfo.TabID,"","mctl=Contacts")));
remember here the mctl goes into querystirng.
I hope this helps.
tell me if I misunderstood your prob.