G
Guest
Hi,
I have just created a class that removes action attribute from HtmlForm. The
code looks like here.
namespace ComIT.Applications.Common
{
public class Form : System.Web.UI.HtmlControls.HtmlForm
{
protected override void RenderAttributes(HtmlTextWriter writer)
{
writer.WriteAttribute("name", this.Name);
base.Attributes.Remove("name");
writer.WriteAttribute("method", this.Method);
base.Attributes.Remove("method");
this.Attributes.Render(writer);
base.Attributes.Remove("action");
if (base.ID != null)
writer.WriteAttribute("id", base.ClientID);
}
}
}
I have registered it in my ASPX page. It looks like this.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<%@ Register TagPrefix="ca" Namespace="ComIT.Applications.Common"
Assembly="ComIT.Applications.Common" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title id="PageTitle" runat="server">Default</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="imagetoolbar" content="no" />
</head>
<body>
<ca:Form id="form1" method="post" runat="server">
</ca:Form>
</body>
</html>
When I switch my ASPX page to design mode, it shows following error.
Unable to cast object of type
'System.Web.Ui.Design.HtmlIntrinsicControlDesigner' to type
'System.Web.Ui.Design.ControlDesigner'.
Why is this error coming? Am I doing anything wrong?
Thanks in advanced.
Tabi
I have just created a class that removes action attribute from HtmlForm. The
code looks like here.
namespace ComIT.Applications.Common
{
public class Form : System.Web.UI.HtmlControls.HtmlForm
{
protected override void RenderAttributes(HtmlTextWriter writer)
{
writer.WriteAttribute("name", this.Name);
base.Attributes.Remove("name");
writer.WriteAttribute("method", this.Method);
base.Attributes.Remove("method");
this.Attributes.Render(writer);
base.Attributes.Remove("action");
if (base.ID != null)
writer.WriteAttribute("id", base.ClientID);
}
}
}
I have registered it in my ASPX page. It looks like this.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<%@ Register TagPrefix="ca" Namespace="ComIT.Applications.Common"
Assembly="ComIT.Applications.Common" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title id="PageTitle" runat="server">Default</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="imagetoolbar" content="no" />
</head>
<body>
<ca:Form id="form1" method="post" runat="server">
</ca:Form>
</body>
</html>
When I switch my ASPX page to design mode, it shows following error.
Unable to cast object of type
'System.Web.Ui.Design.HtmlIntrinsicControlDesigner' to type
'System.Web.Ui.Design.ControlDesigner'.
Why is this error coming? Am I doing anything wrong?
Thanks in advanced.
Tabi