我有一个Main.Master
带有按钮的页面。
在设计视图中,我双击该按钮,它会在Main.Master
页面中创建一个单击事件,如下所示;
<script runat="server">
protected void btnKayit_Click(object sender, EventArgs e)
{
}
</script>
我希望它在Main.Master.cs
页面上创建,当我这样做时,它会给我这个错误;
CS1061: 'ASP.main_master' does not contain a definition for 'btnKayit_Click' and no extension method 'btnKayit_Click' accepting a first argument of type 'ASP.main_master' could be found (are you missing a using directive or an assembly reference?)
我怎么解决这个问题?
编辑:aspx代码;
<asp:Button CssClass="arama" ID="btnKayit" runat="server" Text="Kayıt Ol" Height="30px"
Width="75px" Style="margin: 0px; float: left; width: 75px; padding: 0px; margin-bottom: 0px;
color: #d55355; font-size: 12px" onclick="btnKayit_Click" />