To continue with my previous blog post about RadGrid for ASP.NET AJAX in Microsoft ASP.NET MVC, I've made another example how to use RadControls for ASP.NET AJAX as pure client-side components in this environment. The biggest challenge here is the ScriptManager and scripts registration in general. By default the creation of client-side components is so tightly coupled with the ajax functionality (PageRequestManager) that the only way to enable this is to inherit from ScriptManager (or RadScriptManager) and build everything manually:

protected override void Render(HtmlTextWriter writer)
{
     foreach (RegisteredScript script in GetRegisteredClientScriptBlocks())
     {
         if (Page.Items[script.Key] == null)
         {
             Page.Items[script.Key] = true;

             if (script.ScriptType == RegisteredScriptType.ClientScriptInclude)
             {
                 writer.WriteLine(String.Format(@"<script type=""text/javascript"" src=""{0}""></script>", HttpUtility.HtmlEncode(script.Url)));
             }
         }
     }

    ...

}

The result: Fully functional client-side enabled RadControls for ASP.NET AJAX with skins, scripts and styles combination, etc.!

Untitled

Untitled3Untitled2  Untitled4 

Untitled5Untitled6 

Enjoy!

[Download]


About the Author

Vladimir Enchev

is Director of Engineering, Native Mobile UI & Frameworks

Comments

Comments are disabled in preview mode.