I have a module with an ascx view control and a second ascx view control with key MakeTest
When the user clicks in a hyperlink i'm using this in order to redirect him to the other view control:
Response.Redirect(Globals.NavigateURL(TabId, "MakeTest", "mid=" + ModuleId));
This works, but when you're on the second view control (MakeTest) the other modules from the same tab dissapears as when you're in edit mode
Can't this be avoided somehow?
I have a banners module at the top in all pages, but it's very sad to see it dissapear when i'm still in view mode.
Please help me,
BTW, the behaviour in edit mode is one of the most strange and non orthogonal behaviours of DNN.
Yes, I agree with you. This is one of the most non intuitive behaviour of DNN. This is should be fixed some how because the design was bad IMO.
Well, personally i do not like the concept of admin skin for editing data if you can't set different skins for different pages when editing the data... too limiting. It makes no sense to have a decent skin engine and don't allow to exploit it fully...
I think we should have the capability for both... If the ViewControls l,oaded int he regular skin and the edit controls loaded in the admin skin, you could make your module work however you prefer... sometimes i like to have all of the screen real estate for editing... sometimes it is overkill.. I'd like to be able to choose.
FYI - When I say View Contrl and Edit Control I am referring to using NavigateURL and EditURL respectively.. they both load a module control but if one loaded in the original sin and the other in the Admin Skin then I think we could cover both scenario's for people.. you could still edit data with a ViewControl :-)
I agree, by simply "replacing" the master module control with the view control the page integrity is maintained. This shouldnt be to difficult, after reading this thread I got it to work (a little buggy still but proof of concept anyway). The concept so far: isViewControl Function **not included** simply checks the url and the ctl thats being loaded - if the ctl has a type of view and the the id's are different - that is its not the master module. then return true then just copy the controlsource and a few other properties into a Moduleinfo - find the master module in the activetabs modules and replace it, in the code below I actually remove it and add another back in but there is no need to that. The code below is def. not the solution as other issues would need to be addressed - caching for starters, and a few others.
this testing code was placed in skin.vb init right after isadminmodule --- wich also needs modified--
I would like to see this get done in some form or another, redirecting within your custom module without being in a admin or edit scenerio would really help with large custom modules.
If IsViewControl() ThenDim arrViewModules As ArrayList Dim modKey As String If Not IsNothing(Request.QueryString("ctl")) Then
modKey = Request.QueryString("ctl")End If Dim objViewModuleControls As New ModuleControlController 'Get the active module - and replace it Dim ModId As Integer = -1 Dim defId As Integer = -1 If Not IsNothing(Request.QueryString("mid")) Then
ModId = Int32.Parse(Request.QueryString("mid"))End If Dim objModControl As ModuleControlInfo
objModule = objModules.GetModule(ModId, PortalSettings.ActiveTab.TabID)
defId = objModule.ModuleDefID
arrViewModules = objViewModuleControls.GetModuleControlsByKey(modKey, objModule.ModuleDefID)If arrViewModules.Count > 0 Then
objModControl =CType(arrViewModules(0), ModuleControlInfo) End If 'objmodulecontrol is not a objmodule Dim removeIndexN As Integer = -1 For removeIndexN = 0 To PortalSettings.ActiveTab.Modules.Count - 1
objModule =CType(PortalSettings.ActiveTab.Modules(removeIndexN), ModuleInfo) If defId = objModule.ModuleDefID Then Exit For End If Next
objModule.ModuleDefID = objModControl.ModuleDefID
objModule.ModuleControlId = objModControl.ModuleControlID
objModule.ControlSrc = objModControl.ControlSrc
objModule.ControlTitle = objModControl.ControlTitle
can you post the is view control function as well
read my stupid blog http://codemypantsoff.com