This page is missing a HtmlHead control which is required for the CSS stylesheet link that is being

Posted by Taanu51 under ASP.NET on 2/5/2013 | Points: 10 | Views : 4603 | Status : [Member] | Replies : 3
Error :

This page is missing a HtmlHead control which is required for the CSS stylesheet link that is being added. Please add .

i have added the runat="server" to the head in the master page - still the same message.

when i am trying to add calendar extender in usercontrol then only i am getting this error

This page is missing a HtmlHead control which is required for the CSS stylesheet link that is being added. Please add .

Please solve the issue..Thanks in advance

Tanisha Sayyad
.Net and Android Developer
INDIA(Andhra Pradesh)



Responses

Posted by: Pavanandey on: 2/5/2013 [Member] Bronze | Points: 25

Up
0
Down
Could you please the code here

Thanks
Pavan Kumar
Mark Answer if this fits the need

Taanu51, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Taanu51 on: 2/5/2013 [Member] Starter | Points: 25

Up
0
Down
Thanks for your response..

Here is the code..

i am trying to add user controls dynamically

In default.aspx.cs

[WebMethod]
public static string GetUserControl(string cN)
{
return RenderControl("~/UserControls/" + cN);
}
public static string RenderControl(string controlName)
{
try
{
Page page = new Page();
UserControl userControl = (UserControl)page.LoadControl(controlName);
userControl.EnableViewState = false;
HtmlForm form = new HtmlForm();
form.Controls.Add(userControl);
form.Attributes.Add("runat", "server");

if (ScriptManager.GetCurrent(page) == null)
{
ScriptManager sMgr = new ScriptManager();
form.Controls.AddAt(0, sMgr);
}
page.Controls.Add(form);
StringWriter textWriter = new StringWriter();

HttpContext.Current.Server.Execute(page, textWriter, false);

return textWriter.ToString();
}
catch (Exception ex)
{
throw ex;
}

In usercontrol acsx

<asp:TextBox ID="txtDOB" runat="server" Width="80"></asp:TextBox>
<img id="imgBtn" runat="server" src="calendar.png" alt="Click here to pick the date."
hspace="4" />
<ajaxToolkit:CalendarExtender ID="calDOB" TargetControlID="txtDOB" PopupButtonID="imgBtn"
runat="server" Format="MM/dd/yyyy">
</ajaxToolkit:CalendarExtender>
if i kept this ajaxtoolkit in comment its working fine.otherwise it throws an error like this

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





Tanisha Sayyad
.Net and Android Developer
INDIA(Andhra Pradesh)

Taanu51, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Leul1983 on: 7/11/2017 [Member] Starter | Points: 25

Up
0
Down
Error :

This page is missing a HtmlHead control which is required for the CSS stylesheet link that is being added. Please add .

i have added the runat="server" to the head in the master page - still the same message.

when i am trying to add calendar extender in usercontrol then only i am getting this error

This page is missing a HtmlHead control which is required for the CSS stylesheet link that is being added. Please add .

Please solve the issue..Thanks in advance

Taanu51, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response