0

i wanna access a link using tab id instead of Static URL as my URl is

Response.Redirect("~/Activities/Calendar.aspx?date=" + DateTime.Now.ToString("MM/dd/yyyy"))

and i use the following Code

Dim objModuleController As DotNetNuke.Entities.Modules.ModuleController
Dim objModuleInfo As DotNetNuke.Entities.Modules.ModuleInfo = objModuleController.GetModule(CInt(CType(Settings("DetailsCalendar"), Integer)))
Dim TabID As Integer = objModuleInfo.TabID

If CBool(CType(Settings("DetailsCalendar"), String)) Then
    Response.Redirect(NavigateURL(TabID, "date", DateTime.Now.ToString("MM/dd/yyyy")))
End If

but it redirect me to a wrong URL what am i doing wrong or how to write it , i adon know how to use TabID with URLs

Matt Wilko
  • 26,994
  • 10
  • 93
  • 143
omnia Mm
  • 157
  • 5
  • 16

2 Answers2

1

If your control inherits "PortalModuleBase" it already has the TabId on it.

But the root cause of your issues with Navigate Url is that the structure that it has is similar to the following for the overload you are trying

NavigateUrl(int TabId, string contolKey, string[] params)

You need to pass the values so you are only appending the params

From your example you should be fine with

NavigateUrl(TabId, string.Empty, "date", DateTime.Now.ToString("MM/dd/yyyy"))

The key here is that you are not passing a control key.

Mitchel Sellers
  • 62,228
  • 14
  • 110
  • 173
0

this is the right code which make it works :)

Dim objModuleController As New DotNetNuke.Entities.Modules.ModuleController
Dim objModuleInfo As DotNetNuke.Entities.Modules.ModuleInfo = objModuleController.GetModule(CInt(CType(Settings("DetailsCalendar"), Integer)))

If CBool(CType(Settings("DetailsCalendar"), String)) Then
IF (objModuleInfo.TabID <> 0 ) Then
Response.Redirect(NavigateURL(objModuleInfo.TabID, String.Empty ,"date="+ DateTime.Now.ToString("MM/dd/yyyy")))
End If
End If
omnia Mm
  • 157
  • 5
  • 16