Hello all, and sorry if this question has already been answerd, but I'm having some trouble with a hyperlink column out of a datagrid field that will link to the editIdea.ascx control user control in my module.
I have a custom class (for now at least) that I am using, called Utility
Imports DotNetNuke
Imports System.Text
Imports System.Web
Namespace DotNetNuke.Modules.ShareIdeas
Public Class Utility
Public Const ideaID As String = "ideaID"
Public Const CurrentPage As String = "CurrentPage"
Public Const UrlPageID As String = "PageID"
Public Const ParamPageID As String = UrlPageID & "="
Public Enum MultipageDesktopType
IdeaDetail
PendIdeaList
End Enum
Public Shared Function NavigateURL(ByVal ParamArray AdditionalParameters As String()) As String
Dim PortalSettings As DotNetNuke.Entities.Portals.PortalSettings = PortalController.GetCurrentPortalSettings
Return DotNetNuke.Common.NavigateURL(PortalSettings.ActiveTab.TabID, String.Empty, AdditionalParameters)
End Function
Public Shared Sub SetLoadPage(ByVal LoadPage As Integer, ByRef LoadControlName As String, ByRef ControlPath As String)
Select Case LoadPage
Case Utility.MultipageDesktopType.PendIdeaList
LoadControlName = "IdeasPending.ascx"
ControlPath = "/Admin/UserControls/"
Case Utility.MultipageDesktopType.IdeaDetail
LoadControlName = "EditIdea.ascx"
ControlPath = "/UserControls/"
End Select
End Sub
End Class
End Namespace
This is what I'm using to generate the code that I'll use in my hyperlink.
Here is the vb code on the page that calls the hyperlink
Private Sub grdIdeas_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles grdIdeas.ItemDataBound
If (e.Item.ItemType = ListItemType.Item) Or (e.Item.ItemType = ListItemType.AlternatingItem) Then
Dim hl As HyperLink = e.Item.Cells(1).Controls(0)
hl.NavigateUrl = Utility.NavigateURL(Utility.ParamPageID & Utility.MultipageDesktopType.IssueDetail, "id=" & DataBinder.Eval(e.Item.DataItem, "IdeaID"))
'hl.NavigateUrl = NavigateURL(Utility.ParamPageID & Utility.MultipageDesktopType.IssueDetail, "ideaId=" & DataBinder.Eval(e.Item.DataItem, "IdeaID"))
'hl.NavigateUrl = NavigateURL(Utility.MultipageDesktopType.IssueDetail, "EditIdea", "ideaId=" & DataBinder.Eval(e.Item.DataItem, "IdeaID"))
'hl.NavigateUrl = NavigateURL("", "mid=" & ModuleId.ToString, "IdeaID" & "=" & DataBinder.Eval(e.Item.DataItem, "IdeaID"))
End If
End Sub 'ItemDataBound
I've looked though several examples to see what I could be doing wrong, as the hyperlink generates the correct information for the UserID and creates the link, however when I click the link I'm ether taken back to the home page of the module, the home page of the site, or to a blank page (with site navigation, just nothing shown on the page where the module resides)
Futhermore it should be noted that the module is using tab pages. Within the module, at the top of the page you can click on different tabs to navigate your way though the different areas of the module. I didn't know if that could be causing the issue.