Home > Net >  Enclosing the Button1_Click to define?
Enclosing the Button1_Click to define?

Time:04-26

 & lt; % @ Page Language="c #" AutoEventWireup="true" CodeBehind="Default. Aspx. Cs" Inherits="WebApplication1. _Default % & gt;" 




<script language="c #" runat="server" & gt;

Public void Test (object sender, EventArgs e) {

Response. Write (" this is myTest111111-222 ");
Enclosing the Button1_Click (sender, e);

}

</script>
<body>








I Button1_Click scratched red lines
error CS1061 "default1_aspx" does not contain the definition of "the Button1_Click", and couldn't find an acceptable first "default1_aspx" type parameters can be accessed extension method "the Button1_Click" (whether or not the lack of a using directive or assembly reference?)
Also not line, I change point, for the OnClick also not line: error CS0122 "Button. The OnClick (EventArgs)" inaccessible, because it has a certain level of protection


The Button1_Click want oneself to define? Where is the definition? CS?

CodePudding user response:

You Button1_Click changed to Test themselves, and with what the Button1_Click and the enclosing directly to the Button1_Click (sender, e); To get rid of it

CodePudding user response:

Your OnClick called Test, then the background should be this name,

CodePudding user response:

reference 1/f, big watermelon cut a piece of a kilo of reply:
you Button1_Click changed to Test themselves, and with what the Button1_Click and direct enclosing the Button1_Click (sender, e); Remove it


reference 1/f, big watermelon cut a piece of a kilo of reply:
you Button1_Click changed to Test themselves, and with what the Button1_Click and direct enclosing the Button1_Click (sender, e); Remove it

Use not only add remove
https://www.zhihu.com/question/456041205

CodePudding user response:

refer to the second floor is nu month god reply:
your OnClick called Test, then the background should be the same name,

No background
https://www.zhihu.com/question/456041205

CodePudding user response:

You mean should be written as this. The Test (sender, e); ?
That for the OnClick="Test" have what use?
  • Related