This is a migrated thread and some comments may be shown as answers.

Rad dock state load in mvc

3 Answers 69 Views
Dock
This is a migrated thread and some comments may be shown as answers.
ajay
Top achievements
Rank 1
ajay asked on 07 Apr 2021, 07:07 AM

I have a product in asp.net web forms which has 6000+ plus clients with differant databases.

I stored raddock state of user controls in database. now i want to convert my application to mvc. so now how could i load this state in mvc . user controls treated as partial view

3 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 07 Apr 2021, 10:31 AM

Hi ajay,

I am afraid that I will have to disappoint you, but neither RadDock nor any other form the controls in the UI for ASP.NET AJAX suite are supported in MVC environment and cannot function there. More details on this matter can be found here:

https://docs.telerik.com/devtools/aspnet-ajax/mvc/overview

Regards,
Vessy
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
ajay
Top achievements
Rank 1
answered on 07 Apr 2021, 10:57 AM

madam,i understand that we could not use Ajax controls in mvc . my question i have saved all rad dock state in database and i want to load partial view of mvc according to that Dock state. basically i designed dynamic website and designer just drag and drop dock according to client need. Now i want to convert my application to mvc and want to use same dock state only for loading partial view .

For ex: my state of one website is  : {"UniqueName":"HeaderControl","DockZoneID":"RadDockZone2","Width":"100%","Height":"120px","ExpandedHeight":"0","Top":"0px","Left":"0px","Resizable":"False","Closed":"False","Collapsed":"False","Pinned":"False","Title":"HeaderControl(100%*140px)  None","Text":"","Tag":"UserControl/HeaderControl.ascx","Index":"0"}|{"UniqueName":"MenuControl","DockZoneID":"RadDockZone2","Width":"100%","Height":"40px","ExpandedHeight":"0","Top":"0px","Left":"0px","Resizable":"False","Closed":"False","Collapsed":"False","Pinned":"False","Title":"MenuControl(100* 40 ) None","Text":"","Tag":"UserControl/MenuControl.ascx","Index":"1"}|{"UniqueName":"widgetsControl","DockZoneID":"RadDockZone2","Width":"100%","Height":"672px","ExpandedHeight":"0","Top":"0px","Left":"0px","Resizable":"False","Closed":"False","Collapsed":"False","Pinned":"False","Title":"widgetsControl(100* 672 ) None","Text":"","Tag":"UserControl/widgetsControl.ascx","Index":"2"}|{"UniqueName":"HomepagecontentControl","DockZoneID":"RadDockZone1","Width":"750px","Height":"","ExpandedHeight":"0","Top":"0px","Left":"0px","Resizable":"False","Closed":"False","Collapsed":"False","Pinned":"False","Title":"HomepagecontentControl(750px*800)Left","Text":"","Tag":"UserControl/HomepagecontentControl.ascx","Index":"0"}|{"UniqueName":"WhatsNewControl","DockZoneID":"RadDockZone1","Width":"250px","Height":"200px","ExpandedHeight":"0","Top":"0px","Left":"0px","Resizable":"False","Closed":"False","Collapsed":"False","Pinned":"False","Title":"WhatsNewControl(250px*200px)  Right","Text":"","Tag":"UserControl/WhatsNewControl.ascx","Index":"1"}|{"UniqueName":"CalendarControl","DockZoneID":"RadDockZone1","Width":"250px","Height":"210px","ExpandedHeight":"0","Top":"0px","Left":"0px","Resizable":"False","Closed":"False","Collapsed":"False","Pinned":"False","Title":"CalendarControl(250* 210 ) Right","Text":"","Tag":"UserControl/CalendarControl.ascx","Index":"2"}|{"UniqueName":"EventCalenderControl","DockZoneID":"RadDockZone2","Width":"100%","Height":"25px","ExpandedHeight":"0","Top":"0px","Left":"0px","Resizable":"False","Closed":"False","Collapsed":"False","Pinned":"False","Title":"EventCalenderControl(100* 25 ) None","Text":"","Tag":"UserControl/EventCalenderControl.ascx","Index":"3"}|{"UniqueName":"Bannercontrol","DockZoneID":"RadDockZone2","Width":"100%","Height":"","ExpandedHeight":"0","Top":"0px","Left":"0px","Resizable":"False","Closed":"False","Collapsed":"False","Pinned":"False","Title":"Bannercontrol(100* 450 ) None","Text":"","Tag":"UserControl/Bannercontrol.ascx","Index":"4"}|{"UniqueName":"WidgetControl7","DockZoneID":"RadDockZone1","Width":"250px","Height":"500px","ExpandedHeight":"0","Top":"0px","Left":"0px","Resizable":"False","Closed":"False","Collapsed":"False","Pinned":"False","Title":"WidgetControl7(250* 500 ) Right","Text":"","Tag":"UserControl/WidgetControl7.ascx","Index":"3"}|

0
Vessy
Telerik team
answered on 12 Apr 2021, 09:17 AM

Hi ajay,

The Dock state is a Json data designed specifically for the needs and implementation of RadDock for ASP.NET AJAX. If you want to use the same property values, applying them to your custom control/partial view, you can deserialize the saved data to an object collection and assign the values in ta partial view after that. You can find useful information on this matter here:

https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-how-to?pivots=dotnet-5-0

You will also need to make sure that the "Tag" property value is changed to point the target partial view but not an user control like below:

"Tag":"UserControl/HomepagecontentControl.ascx"

After that you can use the @Html.Partial("_MenuBar") on the page, passing the Tag tag property pointing to the desired state. 

https://www.tutorialsteacher.com/mvc/partial-view-in-asp.net-mvc

If the above does not help, please, elaborate on how do you want to use the stored Dock data in a partial view without RadDock and what is the exact difficulties that you are facing.

Regards,
Vessy
Progress Telerik

Тhe web is about to get a bit better! 

The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.

Tags
Dock
Asked by
ajay
Top achievements
Rank 1
Answers by
Vessy
Telerik team
ajay
Top achievements
Rank 1
Share this question
or