
29 Answers, 1 is accepted

This appears to be the fix i am looking for, however i get an unknown tag error when i load the page.
i followed the instructions exactly as you wrote them but for some reason a parser error occurs telling me that the tag prefix is not registered.
Have telerik actually fixed this themselves yet?

Did you modify your web config file and add <add tagPrefix="Martinbeeby" namespace="Martinbeeby.Core.Controls"/> ?
This is what registers the control with your application so that you can use it without compiling the code.

I certainly did. i get the error
Parser Error Message: Unknown server tag 'Martinbeeby:RadDockLayoutNew'.
In objectBrowser the fully qualified namespace of the classes comes up as Infonetica.Red.Martinbeeby.Core.Controls however i have tried the web.config with just your namespace and with the one stated above.
After changing the tag prefixes in the aspx page and switching to design view everything looks ok. its just when i run it.
What is the root namespace of the project that you created the class in? this could be where im getting it wrong, as yours may have overlap by default.
I fully understand the source of the issue that you wrote up, but was really struggling to find a workaround to it until i saw your post. thanks for your help so far.
Ive spent the last 4 days trying to think of a better way to engineer the whole layout thing to workaround this issue and a couple more such as different zone layouts per user etc..

In the example I added here the default namespace is MartinBeeby.
Have you nested this namespace inside your own namespace?
prehaps you could send me the project zipped up and i could take a look? Or is the file too big?

Im pleased to say i got it working - the page required a register directive for the tagPrefix because it is not marked on the assembly (which can be done in assemblyInfo if necessary).
i got the clue from the following link, although im using web app projects so had to modify the assembly reference to my own dll as app_code directory does not exist.... http://alpascual.com/blog/al/archive/2007/04/30/Fixing-the-error-Unknown-server-tag-when-you-create-or-inherit-a-control-on-App_5F00_code-folder.aspx
Many thanks for your help, you have no idea how grateful i am! :-D
Regards,
Guy

One last thing, There is a slight bug with the code below.
I haven't had a chance to fix it properly, but i do have a work around. The add button on the portal can still create view state problems.
One of our testers discovered a bug that when you add more than one new widget to you page in one session. The veiwstate gets applied from the first control to the second control.
This has something to do with the page control hierarchy, as the control is added to the updatepanel and not to the raddock.
My work around is to simply remove the Ajax link on the add button. (It sucks I know) So that the button causes postback.
To be honest this works fine for my needs and I didn't have time to investigate the problem completely.

i havent been able to reproduce the bug you speak of but will keep an eye out for it.
incase anyone else needs this solution, the best way to make it work is the following....
follow martins instructions for all the code, but set the namespace in the class to something of your choice - i used 'Fixes'.
because the root namespace for my web project is already GHC this means that these classes live in the namespace GHC.Fixes
so in your web.config where you add the tagprefix put the full namespace for the class also... Note that my tags will be prefixed with 'Fixes' rather than 'martinbeeby'
<system.web>
<add tagPrefix="Fixes" namespace="GHC.Fixes"/>
Then in each page that you use these new controls you must add a register directive at the top of the page like so...
<%@ Register TagPrefix="Fixes" NameSpace="GHC.Fixes" Assembly="GHC" %>
The Assembly attribute is the name of the dll (minus the extension) that contains the controls. My dll compiles down to GHC.dll so my assembly attribute has a value of GHC.
ns2.discountasp.net

Ok what the mistake may have been
You don't need the <%@ Register TagPrefix="Fixes" NameSpace="GHC.Fixes" Assembly="GHC" %> on each page
Thats what the <add tagPrefix="Fixes" namespace="GHC.Fixes"/> is for.
How ever you probably need to register the namespace in the web config as below:
<pages enableEventValidation="false"> |
<namespaces> |
<add namespace="Martinbeeby.Core"/> |
</namespaces> |
<controls> |
<add tagPrefix="Martinbeeby" namespace="Martinbeeby.Core.Controls"/> |
<!-- added line below for ajax support --> |
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> |
</controls> |
</pages> |

You are the man - been banging my head against the wall with this VS error for a few days. Your fix worked like a charm. This thread is pretty old, I don't understand why Telerik hasn't incorporated your fix into the latest 2 releases.
Thanks again,
Brian

I'm really glad this post helped. I'm not sure why the problem hasn't been addessed in the latest versions of the controls.
I guess It's not really a problem with the dock control. Its more a limitation of the portal demo.
Who cares I guess. As with most things, once you understand the problem it's pretty easy to fix.

Worked like a charm!

joseph

Cheers,
Stuart,

It should be marked as very IMP fix.
People would save lot of time if coded like that to begin with (but then they will not realize how tough it was otherwise :) )

Cheers Martin
http://www.thewayithink.co.uk

This fixed the issue I was having too.

//andii

Thanks
Helena

I really want to try the code in c# but I'm having an error, tye type or namespace name 'ViewStateModeByIdAttribute could not be found.
Any solutions?
thanks,
Ryan

and then you need add this to the class
using System.Web.UI.WebControls;

Thanks you for your solutions. I haven't tried it yet but I have a question.
After removing a dock or docks, I got the "failed to load viewstate" error when it posted back to server specially the the dock or docks contains the control using viewstate such as radgrid(paging) or controls(textbox) with button.
does Anybody know it will solve the my issues?
Thanks,
DW



The main reason why the RadDock class is not marked with the ViewStateModeById attribute is because of the performance cost when loading the ViewState information.
The ViewState problems with the RadDock control come from the fact that after closing a given dock it is not recreated on the next postback, and its ViewState information is loaded to another control placed on its spot in the Controls tree of the Page.
For the time being the suggested solution for resolving ViewState problems in applications that are highly dependent on the ViewState, is inheriting the RadDock class and marking it with the ViewStateModeById attribute.
Kind regards,
Pero
the Telerik team

"The base class includes the field 'RadDockZoneM', but its type (Martinbeeby.Core.Controls.RadDockZoneNew) is not compatible with the type of control (Martinbeeby.Core.Controls.RadDockZoneNew). "
I have cleaned my solution , rebuilt it, removed Telerik.Web.UI refernces and re-added it. I re-organized the folders but still I can'f figure out why this is happening
In my scenario I only need to decalre a RadDockLayout and a RadDockZone .. the actual RadDocks will be added dynamically in the zone.
Some help will be much appriciated.
Thanks in advance
Is it possible that you might have a circular reference in your project. Could you please follow the instructions in the links below and see the issues will be resolved?
http://connect.microsoft.com/VisualStudio/feedback/details/104839/the-base-class-includes-the-field-but-its-type-is-not-compatible-with-the-type-of-control
http://support.microsoft.com/kb/919284
All the best,
Pero
the Telerik team

I managed to fix the problem by adding the MartinBeeby Class in a seperate class library and it worked.
But it seems it is only partially working. In my zones I dynamically add UserControls. Although I am keeping the items in the RadComboBox for example.. but I am loosing the selected/checked items after postbacks and even the text inputted...
Thanks againg
Please check the online demo My Portal as it implements loading of user controls in dynamically added RadDock controls and can be used as a base for achieving the same on your end.
Note the I am willing to help you, but currently I am mostly guessing as to what your setup is. If you are still having difficulties, please open a support ticket and send a simple, runnable page that isolates the problem so that I can inspect it locally and suggest a concrete solution.
Regards,
Slav
the Telerik team