May 23, 2012

Missing a HtmlHead control when Ajax is involved

I had a web application, which was using Ajax. And I was using the Calendar Extender Control from the Ajax toolkit.

I was using a master page that references style sheets. Once I run the application, I got this message,

This page is missing a HtmlHead control which is required for the CSS stylesheet link that is being added. Please add <head runat="server" />.

StackTrace:
       at AjaxControlToolkit.ScriptObjectBuilder.RegisterCssReferences(Control control) in d:\hg\act\Server\AjaxControlToolkit\ExtenderBase\ScriptObjectBuilder.cs:line 303
       at AjaxControlToolkit.ExtenderControlBase.OnLoad(EventArgs e) in d:\hg\act\Server\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs:line 305
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
 

I was searching for a solution for sometime and finally, found this solution. It was really a simple solution. All you need to do is,

1. Add a script manager
2. Add a javascript function

and finally everything works fine.

Solution :

Add the following for your page:

<asp:ScriptManagerID="ScriptManager1"runat="server">
</asp:ScriptManager>

 
// here make a function which calls automatically

 
<scriptlanguage="javascript">

 
function show()

{

document.write("<head runat='server'></head>");
}
</script>

 

May 08, 2012

Remove sql server 2005 express tools - Installing SQL Server 2008

I was trying to install SQL Server 2008 Express edition, and installation wizard gives, "SQL Server 2005 express tools already installed. " error. To proceed I need to remove SQL Server 2005 Express tools.

I tried removing SQL Server 2005 Express tools from Uninstall Program window, but still the same error continues. In order to fix this you must remove following registry key from registry.

Solution
1) Open Run Menu and type regedit.
2) It will open Registry Editor
3) Now go to following location.

HKEY_LOCAL_MACHINE > Software > Wow6432Node > Microsoft > Microsoft SQL Server > 90

4) Right click on 90 and click on Delete.
5) Press Yes to confirm deletion.
Now try to install SQL Server 2008 and it would work this time.