Here's what I've come up with after reviewing some other posts about passing skinsrc, skinname, containersrc, and containername as querystring parameters to force a skin/container.
What I've done is create a function that I pass in the standard EditUrl & the PortalSettings.ActiveTab.
The from the PortalSettings.ActiveTab I can get the SkinSrc, SkinPath, ContainerSrc and ContainerPath of the current tab I'm on.
Reusable function that builds the url string:
Friend Function syBuildEditURL(ByVal sURL As String, ByVal objTabInfo As DotNetNuke.Entities.Tabs.TabInfo) As String
Dim sResult As String = sURL
Dim sSkinName As String = objTabInfo.SkinPath
Dim sSkinSrc As String = Path.GetFileNameWithoutExtension(objTabInfo.SkinSrc)
Dim sContainerName As String = objTabInfo.ContainerPath
Dim sContainerSrc As String = Path.GetFileNameWithoutExtension(objTabInfo.ContainerSrc)
sSkinName = Left(sSkinName, sSkinName.Trim.Length - 1) ' trim off last "/"
sSkinName = sSkinName.Substring(sSkinName.LastIndexOf("/") + 1)
If InStr(objTabInfo.SkinPath, "_default") > 0 Then
sSkinSrc = "[G]Skins/" & sSkinName & "/" & sSkinSrc
Else
sSkinSrc = "[L]Skins/" & sSkinName & "/" & sSkinSrc
End If
sContainerName = Left(sContainerName, sContainerName.Trim.Length - 1) ' trim off last "/"
sContainerName = sContainerName.Substring(sContainerName.LastIndexOf("/") + 1)
If InStr(objTabInfo.ContainerPath, "_default") > 0 Then
sContainerSrc = "[G]Containers/" & sContainerName & "/" & sContainerSrc
Else
sContainerSrc = "[L]Containers/" & sContainerName & "/" & sContainerSrc
End If
sResult = String.Format("{0}&skinname={1}&skinsrc={2}&containername={3}&containersrc={4}", _
sURL, System.Web.HttpUtility.UrlEncode(sSkinName), System.Web.HttpUtility.UrlEncode(sSkinSrc), System.Web.HttpUtility.UrlEncode(sContainerName), System.Web.HttpUtility.UrlEncode(sContainerSrc))
Return sResult
End Function
When I need to call the second control, I can do something like the following:
Try
Dim sURL As String = syBuildEditURL(EditUrl("ItemID", Null.NullInteger.ToString), Me.PortalSettings.ActiveTab)
Response.Redirect(sURL, True)
Catch exc As Exception
ProcessModuleLoadException(Me, exc)
End Try
Hope this will be useful to others.....