About Chris Expertise I can answer pretty much any question relating to VB.NET and its use in a Windows environment. I can also handle most questions using C#. I specialize in ASP.NET web development and MSSQL database access, but have some stale knowledge of the old ASP - I'd prefer to avoid questions about it.
Experience I have over 5 years of industry experience using VB.NET and other .NET technologies for web and database development.
Education/Credentials I have some college education, but does it really matter in this field of work?
I Create the following code in macromedia Dream Weaver Mx 2004, while in Dream Weaver preview Page it's working Correctly,
But While opening the following page in IE Its Displays the following Error Message. Please Find me the Better Soloution.
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<asp:TextBox text="Victory" runat="server"/>
</body>
</html>
Server Error in '/' Application.
--------------------------------------------------------------------------------
Control 'ctl00' of type 'TextBox' must be placed inside a form tag with runat=server.
Description: An unhandled exception occurred during the execution of the current web request.
Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Control 'ctl00' of type 'TextBox' must be placed
inside a form tag with runat=server.
Source Error:
An unhandled exception was generated during the execution of the current web request.
Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): Control 'ctl00' of type 'TextBox' must be placed inside a form tag with runat=server.]
System.Web.UI.Page.VerifyRenderingInServerForm(Control control) +1997503
System.Web.UI.WebControls.TextBox.AddAttributesToRender(HtmlTextWriter writer) +48
System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer) +17
System.Web.UI.WebControls.TextBox.Render(HtmlTextWriter writer) +17
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
System.Web.UI.Page.Render(HtmlTextWriter writer) +26
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1896
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
Answer It's exactly as the error says - you can not place ASP.Net controls of any kind within HTML unless the HTML element you're placing them in (or one of its parents) has the runat="server" setting, as well as an id="someID" specified. Similarly, the PostBack system will not work unless you've got these controls within a <form> tag. In general, you should start with the template file that Visual Studio creates for you (which I've slightly modified to match your original):