Control 'c1_t1' of type TextBox must be placed inside a form tag with runat=server in Asp.Net -
i creating shopping website on admin side adding add_product.aspx web form getting error "control 'c1_t1' of type 'textbox' must placed inside form tag runat=server." product page html given below , have master page..
<%@ page title="" language="c#" masterpagefile="~/admin/admin.master" autoeventwireup="true" codefile="add_product.aspx.cs" inherits="admin_add_product" %> <asp:content id="content1" contentplaceholderid="c1" runat="server"> <h3>add product page</h3> <table> <tr> <td>product name</td> <td> <asp:textbox id="t1" runat="server"></asp:textbox> </td> </tr> <tr> <td>product description</td> <td> <asp:textbox id="t2" runat="server"></asp:textbox> </td> </tr> <tr> <td>product price</td> <td> <asp:textbox id="t3" runat="server"></asp:textbox> </td> </tr> <tr> <td>product qty</td> <td> <asp:textbox id="t4" runat="server"></asp:textbox> </td> </tr> <tr> <td>product image</td> <td> <asp:fileupload id="fileuploadimageuploader" runat="server" /> </td> </tr> <tr> <td colspan="2"> <asp:button id="btnupload" runat="server" text="upload" onclick="btnupload_click" /> </td> </tr> </table> </asp:content>
it have master page , adding master page code below
<%@ master language="c#" autoeventwireup="true" codefile="admin.master.cs" inherits="admin_admin" %> <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>simple responsive admin</title> <!-- bootstrap styles--> <link href="assets/css/bootstrap.css" rel="stylesheet" /> <!-- fontawesome styles--> <link href="assets/css/font-awesome.css" rel="stylesheet" /> <!-- custom styles--> <link href="assets/css/custom.css" rel="stylesheet" /> <!-- google fonts--> <link href='http://fonts.googleapis.com/css?family=open+sans' rel='stylesheet' type='text/css' /> </head> <body> <form> <div id="wrapper"> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="adjust-nav"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#"> <img src="assets/img/logo.png" /> </a> </div> <span class="logout-spn"> <a href="#" style="color: #fff;">logout</a> </span> </div> </div> <!-- /. nav top --> <nav class="navbar-default navbar-side" role="navigation"> <div class="sidebar-collapse"> <ul class="nav" id="main-menu"> <li class="active-link"> <a href="index.html"><i class="fa fa-desktop "></i>dashboard <span class="badge">included</span></a> </li> <li> <a href="ui.html"><i class="fa fa-table "></i>ui elements <span class="badge">included</span></a> </li> <li> <a href="blank.html"><i class="fa fa-edit "></i>blank page <span class="badge">included</span></a> </li> <li> <a href="#"><i class="fa fa-qrcode "></i>my link one</a> </li> <li> <a href="#"><i class="fa fa-bar-chart-o"></i>my link two</a> </li> <li> <a href="#"><i class="fa fa-edit "></i>my link 3 </a> </li> <li> <a href="#"><i class="fa fa-table "></i>my link four</a> </li> <li> <a href="#"><i class="fa fa-edit "></i>my link 5 </a> </li> </ul> </div> </nav> <!-- /. nav side --> <div id="page-wrapper"> <div id="page-inner"> <div class="row"> <div class="col-lg-12"> <h2>admin dashboard</h2> </div> </div> <!-- /. row --> <hr /> <!-- /. row --> <!--this content area --> <asp:contentplaceholder id="c1" runat="server"> </asp:contentplaceholder> </div> </div> <!-- /. row --> <div class="row"> <div class="col-lg-12 "> <br /> <div class="alert alert-danger"> <strong>want more icons free ? </strong>checkout fontawesome website , use icon <a target="_blank" href="http://fortawesome.github.io/font-awesome/icons/">click here</a>. </div> </div> </div> <!-- /. row --> </div> <div class="footer"> <div class="row"> <div class="col-lg-12"> © 2014 yourdomain.com | design by: <a href="http://binarytheme.com" style="color: #fff;" target="_blank">www.binarytheme.com</a> </div> </div> </div> <!-- /. wrapper --> <!-- scripts -at botom reduce load time--> <!-- jquery scripts --> <script src="assets/js/jquery-1.10.2.js"></script> <!-- bootstrap scripts --> <script src="assets/js/bootstrap.min.js"></script> <!-- custom scripts --> <script src="assets/js/custom.js"></script> </form> </body> </html>
as error states:
"control 'c1_t1' of type 'textbox' must placed inside form tag runat=server."
and form element is:
<form>
the error telling want do. form element needs runat="server"
:
<form runat="server">
Comments
Post a Comment