Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Using EditUrl with a separate user controlUsing EditUrl with a separate user control
Previous
 
Next
New Post
11/20/2008 7:17 PM
 

This editor blows, by the way.  I've lost text/code 3 times now.

I need to get EditUrl/NavigateUrl working from a user control (inherting from System.Web.UI, etc) and it's being dropped onto a View control.  I can get the hard coded Url below to work but can't find example one of getting EditUrl or NavigateUrl to work.

This is kicking my babushka, I could really use some help:

 

Private Sub lstLinks_ItemDataBound( _ByVal sender As Object, _ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles lstLinks.ItemDataBoundIf e.Item.ItemType = ListItemType.Item Then

 

 

h1.Target =

Dim h1 As HyperLink = e.Item.FindControl("editlink")Dim strh1 As String = h1.NavigateUrl.ToString"_blank"

h1.NavigateUrl =

"http://www.microsoft.com"

 

End If

 

 

 

End Sub 

 

 

 

 
New Post
11/20/2008 7:30 PM
 

what is your question?


Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
New Post
11/21/2008 12:24 AM
 

Eric,

Thank you for your prompt reply.  I was looking for an example of how to properly set up a string for EditUrl, to then be placed in the NavigateUrl property, etc.  Wrong think totally but yep, could have asked that better.

A friend who does regular .Net work happens to be my roommie and helped me out.  Here's my code with questions I've also emailed to a couple other DNN buddies:

 

        Private Sub lstLinks_ItemDataBound( _
            ByVal sender As Object, _
            ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) _
            Handles lstLinks.ItemDataBound
 
            If e.Item.ItemType = ListItemType.Item Then
                Dim h1 As HyperLink = e.Item.FindControl("editlink")
                Dim strh1 As String = h1.NavigateUrl.ToString
                Dim oModuleBase As New PortalModuleBase
                'h1.Target = "_blank"   'This will open a page in a new browser
                h1.NavigateUrl = oModuleBase.EditUrl()ß This directs me to a home page, no modules.
                h1.NavigateUrl = oModuleBase.EditUrl("Edit") ß I don’t but should see my edit control or an error
                h1.NavigateUrl = oModuleBase.EditUrl("","", "Edit")ß same here.
            End If
Here is the Url I’m getting for all 3: http://localhost/linkmanager/Home/tabid/36/ctl/Edit/mid/-1/Default.aspx
        End Sub
    End Class
 
End Namespace
 
OK, with the correct control key (“Edit”) I should get the Edit page, right? I get a clean white basic DNN home page. So, I tried different overloads and … got a clean white DNN home page. The method call with no parameters should direct me back to the same page.
 
I should be on to the edit control and working with it right now and later the Settings. What am I missing?
 
To be more exact: The View works fine.  I have my definitions set up OK.  So, my Edit and Settings keys are correct.  Well, when I specify ("Edit") I should at least get an error that the topiclinksedit.ascx won't load or ideally, the page.  I'm not.
 
I'm not seeing something basic here ... :)
 
Thanks in advance.

 

 
New Post
11/21/2008 4:50 PM
 

I have this solved and here is the correct code.  The actual issue I was having difficulty with was resolved by correctly referencing the parent page, so that the correct Module ID was being found.  There was no issue with Edit Url.

Imports

System.Web.UI.WebControls

Imports

DotNetNuke

Imports

DotNetNuke.Common.Utilities

Imports

DotNetNuke.Entities.Modules

Imports

DotNetNuke.Entities.Modules.PortalModuleBase

Imports

DotNetNuke.Entities.Users.UserInfo

Imports

DotNetNuke.Modules.Links

Imports

DotNetNuke.Services.Localization

Imports

 

DotNetNuke.Services.Exceptions

Namespace

 

 

 

DTS.TopicLinksPartial Class LinksListInherits UserControlPrivate oModuleBase As PortalModuleBase = Nothing

#

Region "Event Handlers"

 

''' -----------------------------------------------------------------------------

 

''' <summary>

 

''' Page_Load runs when the control is loaded

 

''' </summary>

 

''' <remarks>

 

''' </remarks>

 

''' <history>

 

''' [mdurthaler] 17 Nov 08 This is a user control which will be instantiated

 

''' once for each list of links on the DNN Module

 

''' </history>

 

''' -----------------------------------------------------------------------------

 

 

 

 

Private Sub Page_Load( _ByVal sender As System.Object, _ByVal e As System.EventArgs) Handles MyBase.LoadIf Not IsPostBack Then

 

Try

 

 

Dim objLinks As New DTSTopicLinksController'Grab the User Info

 

 

Dim mUser As Entities.Users.UserInfo = Entities.Users.UserController.GetCurrentUserInfo'Grab the Module Info

 

Dim oModInfo As ModuleInfo = Nothing

oModuleBase =

 

 

 

 

lstLinks.RepeatDirection = RepeatDirection.Vertical

lstLinks.DataSource = objLinks.ListLinks(iUserID, iTabModID,

lstLinks.DataBind()

 

CType(Me.Parent, DotNetNuke.Entities.Modules.PortalModuleBase)Dim iUserID As Integer = _CType(Me.Parent, DotNetNuke.Entities.Modules.PortalModuleBase).UserInfo.UserIDDim iTabModID As Integer = _CType(Me.Parent, DotNetNuke.Entities.Modules.PortalModuleBase).TabModuleId"Reference")Catch exc As Exception 'Control failed to load

 

End Try

 

End If

 

'This is the basic code for getting the individual list names.

 

 

Dim oDataList As DataList = CType(pnlList.FindControl("lstLinks"), DataList)If Not oDataList Is Nothing Then

lblListTitle.Text = oDataList.GetType.Name.ToString()

 

End If

 

 

End Sub

 

''' -----------------------------------------------------------------------------

 

''' <summary>

 

''' Page_Unload runs when the page is unloaded. It is used to solve caching problems

 

''' with the core that cause certain items to not work.

 

''' </summary>

 

''' <remarks>

 

''' </remarks>

 

''' <history>

 

''' </history>

 

''' -----------------------------------------------------------------------------

 

 

 

 

Private Sub Page_Unload( _ByVal sender As Object, _ByVal e As System.EventArgs) Handles MyBase.UnloadEnd Sub

#

End Region

 

 

 

 

 

Private Sub lstLinks_ItemDataBound( _ByVal sender As Object, _ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) _Handles lstLinks.ItemDataBoundIf e.Item.ItemType = ListItemType.Item Then

 

 

Dim h1 As HyperLink = e.Item.FindControl("editlink")'h1.Target = "_blank" 'This will open a page in a new browser

h1.NavigateUrl = oModuleBase.EditUrl()

 

End If

 

End Sub

 

End

End Class Namespace

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Using EditUrl with a separate user controlUsing EditUrl with a separate user control


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out