控件'maincontentplaceholderid_btn'类型'button'必须放在带有runat = server的表单标签内。 [英] Control 'maincontentplaceholderid_btn' of type 'button' must be placed inside a form tag with runat=server.
问题描述
嗨朋友们.....
我已经创建了母版页然后我添加了内容页面,之后我在contentplaceholder中添加了按钮控件但是它的投掷像这样的错误..请帮助
我尝试过:
<%@ Page Title =LoginLanguage =C#MasterPageFile =〜/ MenuPage.MasterAutoEventWireup =trueCodeBehind =Login.aspx.csInherits =DailyExpenses.Login%> < br $>
< asp:Content ID =logincontentidContentPlaceHolderID =maincontentplaceholderidrunat =server>
< asp:按钮ID =btnrunat =server/>
Hi friends.....
I have Created master page then i have added content page after that i have added button control inside the contentplaceholder but its throwing error like this..pls help
What I have tried:
<%@ Page Title="Login" Language="C#" MasterPageFile="~/MenuPage.Master" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="DailyExpenses.Login" %>
<asp:Content ID="logincontentid" ContentPlaceHolderID="maincontentplaceholderid" runat="server">
<asp:Button ID="btn" runat="server" />
推荐答案
尝试这样的事情
try something like this
<pre><!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Medgate IT</title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
这篇关于控件'maincontentplaceholderid_btn'类型'button'必须放在带有runat = server的表单标签内。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!