asp:Button stopped working without changing the code
I'm stuck on this error and I cannot figure it out why is happening. I took a look on the web in order to find something helpfull but there is nothing specific about my case, at least I couldn't find it.
Error:
CS1061: 'beaulard21_aspx' does not contain a definition for 'Btn_submit_Click' and no extension method 'Btn_submit_Click' accepting a first argument of type 'beaulard21_aspx' could be found (are you missing a using directive or an assembly reference?).
Snippet where the error occurs:
<form>
<div class='form-group'>
<input name='email' type='email' class='form-control' id='emailCliente' placeholder='Email' runat='server'>
</div>
<div class='form-group'>
<input name='name' type='text' class='form-control' id='nomeCliente' placeholder='Nome' runat='server'>
</div>
<div class='form-group'>
<textarea name='comment' class='form-control' rows='5' id='messaggio' placeholder='Messaggio (opzionale)' runat='server'></textarea>
</div>
<!-- Error is thrown in the next line -->
<asp:Button id='BtnInvia' Text='Invia' CssClass='btn btn-secondary' OnClick='Btn_submit_Click' runat='server'/>
</form>
My code behind function:
private void Btn_submit_Click(object sender, EventArgs e)
{
//EMAIL SENDING ALGORITHM
}
Remarks
I have the same form with the same button and the same IDs in other 2 pages, and currently they work perfectly. Yesterday this page was also working without any issues and I didn't change anything. I'm not getting the point.
Any help would be appreciated.
c# asp.net
add a comment |
I'm stuck on this error and I cannot figure it out why is happening. I took a look on the web in order to find something helpfull but there is nothing specific about my case, at least I couldn't find it.
Error:
CS1061: 'beaulard21_aspx' does not contain a definition for 'Btn_submit_Click' and no extension method 'Btn_submit_Click' accepting a first argument of type 'beaulard21_aspx' could be found (are you missing a using directive or an assembly reference?).
Snippet where the error occurs:
<form>
<div class='form-group'>
<input name='email' type='email' class='form-control' id='emailCliente' placeholder='Email' runat='server'>
</div>
<div class='form-group'>
<input name='name' type='text' class='form-control' id='nomeCliente' placeholder='Nome' runat='server'>
</div>
<div class='form-group'>
<textarea name='comment' class='form-control' rows='5' id='messaggio' placeholder='Messaggio (opzionale)' runat='server'></textarea>
</div>
<!-- Error is thrown in the next line -->
<asp:Button id='BtnInvia' Text='Invia' CssClass='btn btn-secondary' OnClick='Btn_submit_Click' runat='server'/>
</form>
My code behind function:
private void Btn_submit_Click(object sender, EventArgs e)
{
//EMAIL SENDING ALGORITHM
}
Remarks
I have the same form with the same button and the same IDs in other 2 pages, and currently they work perfectly. Yesterday this page was also working without any issues and I didn't change anything. I'm not getting the point.
Any help would be appreciated.
c# asp.net
add a comment |
I'm stuck on this error and I cannot figure it out why is happening. I took a look on the web in order to find something helpfull but there is nothing specific about my case, at least I couldn't find it.
Error:
CS1061: 'beaulard21_aspx' does not contain a definition for 'Btn_submit_Click' and no extension method 'Btn_submit_Click' accepting a first argument of type 'beaulard21_aspx' could be found (are you missing a using directive or an assembly reference?).
Snippet where the error occurs:
<form>
<div class='form-group'>
<input name='email' type='email' class='form-control' id='emailCliente' placeholder='Email' runat='server'>
</div>
<div class='form-group'>
<input name='name' type='text' class='form-control' id='nomeCliente' placeholder='Nome' runat='server'>
</div>
<div class='form-group'>
<textarea name='comment' class='form-control' rows='5' id='messaggio' placeholder='Messaggio (opzionale)' runat='server'></textarea>
</div>
<!-- Error is thrown in the next line -->
<asp:Button id='BtnInvia' Text='Invia' CssClass='btn btn-secondary' OnClick='Btn_submit_Click' runat='server'/>
</form>
My code behind function:
private void Btn_submit_Click(object sender, EventArgs e)
{
//EMAIL SENDING ALGORITHM
}
Remarks
I have the same form with the same button and the same IDs in other 2 pages, and currently they work perfectly. Yesterday this page was also working without any issues and I didn't change anything. I'm not getting the point.
Any help would be appreciated.
c# asp.net
I'm stuck on this error and I cannot figure it out why is happening. I took a look on the web in order to find something helpfull but there is nothing specific about my case, at least I couldn't find it.
Error:
CS1061: 'beaulard21_aspx' does not contain a definition for 'Btn_submit_Click' and no extension method 'Btn_submit_Click' accepting a first argument of type 'beaulard21_aspx' could be found (are you missing a using directive or an assembly reference?).
Snippet where the error occurs:
<form>
<div class='form-group'>
<input name='email' type='email' class='form-control' id='emailCliente' placeholder='Email' runat='server'>
</div>
<div class='form-group'>
<input name='name' type='text' class='form-control' id='nomeCliente' placeholder='Nome' runat='server'>
</div>
<div class='form-group'>
<textarea name='comment' class='form-control' rows='5' id='messaggio' placeholder='Messaggio (opzionale)' runat='server'></textarea>
</div>
<!-- Error is thrown in the next line -->
<asp:Button id='BtnInvia' Text='Invia' CssClass='btn btn-secondary' OnClick='Btn_submit_Click' runat='server'/>
</form>
My code behind function:
private void Btn_submit_Click(object sender, EventArgs e)
{
//EMAIL SENDING ALGORITHM
}
Remarks
I have the same form with the same button and the same IDs in other 2 pages, and currently they work perfectly. Yesterday this page was also working without any issues and I didn't change anything. I'm not getting the point.
Any help would be appreciated.
<form>
<div class='form-group'>
<input name='email' type='email' class='form-control' id='emailCliente' placeholder='Email' runat='server'>
</div>
<div class='form-group'>
<input name='name' type='text' class='form-control' id='nomeCliente' placeholder='Nome' runat='server'>
</div>
<div class='form-group'>
<textarea name='comment' class='form-control' rows='5' id='messaggio' placeholder='Messaggio (opzionale)' runat='server'></textarea>
</div>
<!-- Error is thrown in the next line -->
<asp:Button id='BtnInvia' Text='Invia' CssClass='btn btn-secondary' OnClick='Btn_submit_Click' runat='server'/>
</form>
<form>
<div class='form-group'>
<input name='email' type='email' class='form-control' id='emailCliente' placeholder='Email' runat='server'>
</div>
<div class='form-group'>
<input name='name' type='text' class='form-control' id='nomeCliente' placeholder='Nome' runat='server'>
</div>
<div class='form-group'>
<textarea name='comment' class='form-control' rows='5' id='messaggio' placeholder='Messaggio (opzionale)' runat='server'></textarea>
</div>
<!-- Error is thrown in the next line -->
<asp:Button id='BtnInvia' Text='Invia' CssClass='btn btn-secondary' OnClick='Btn_submit_Click' runat='server'/>
</form>
c# asp.net
c# asp.net
asked Jan 18 at 14:16
SimoSimo
918317
918317
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Try to delete the button and the code behind and then make a rebuild for your solution and then create it again.
sometimes caching in VS makes some unexpected problems!
I hope this will helpful for you!
Love you man <3
– Simo
Jan 18 at 14:43
You're Welcome :D
– Mohammad Taher Assad
Jan 19 at 8:39
add a comment |
- Ensure you don't have any other errors or warnings.
- Try to remove event handler name in your HTML and generate it again using Visual Studio. Then check if it appears in the same code-behind file you looked before.
I don't have any error or warning when I compile the solution. Now I'm trying the second point you suggested.
– Simo
Jan 18 at 14:37
Thanks for the help, I chose the other answer as solution because it was more accurate for my case. Anyway you deserve an upvote for sure. Thanks alot
– Simo
Jan 18 at 14:44
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54255825%2faspbutton-stopped-working-without-changing-the-code%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try to delete the button and the code behind and then make a rebuild for your solution and then create it again.
sometimes caching in VS makes some unexpected problems!
I hope this will helpful for you!
Love you man <3
– Simo
Jan 18 at 14:43
You're Welcome :D
– Mohammad Taher Assad
Jan 19 at 8:39
add a comment |
Try to delete the button and the code behind and then make a rebuild for your solution and then create it again.
sometimes caching in VS makes some unexpected problems!
I hope this will helpful for you!
Love you man <3
– Simo
Jan 18 at 14:43
You're Welcome :D
– Mohammad Taher Assad
Jan 19 at 8:39
add a comment |
Try to delete the button and the code behind and then make a rebuild for your solution and then create it again.
sometimes caching in VS makes some unexpected problems!
I hope this will helpful for you!
Try to delete the button and the code behind and then make a rebuild for your solution and then create it again.
sometimes caching in VS makes some unexpected problems!
I hope this will helpful for you!
answered Jan 18 at 14:32
Mohammad Taher AssadMohammad Taher Assad
364
364
Love you man <3
– Simo
Jan 18 at 14:43
You're Welcome :D
– Mohammad Taher Assad
Jan 19 at 8:39
add a comment |
Love you man <3
– Simo
Jan 18 at 14:43
You're Welcome :D
– Mohammad Taher Assad
Jan 19 at 8:39
Love you man <3
– Simo
Jan 18 at 14:43
Love you man <3
– Simo
Jan 18 at 14:43
You're Welcome :D
– Mohammad Taher Assad
Jan 19 at 8:39
You're Welcome :D
– Mohammad Taher Assad
Jan 19 at 8:39
add a comment |
- Ensure you don't have any other errors or warnings.
- Try to remove event handler name in your HTML and generate it again using Visual Studio. Then check if it appears in the same code-behind file you looked before.
I don't have any error or warning when I compile the solution. Now I'm trying the second point you suggested.
– Simo
Jan 18 at 14:37
Thanks for the help, I chose the other answer as solution because it was more accurate for my case. Anyway you deserve an upvote for sure. Thanks alot
– Simo
Jan 18 at 14:44
add a comment |
- Ensure you don't have any other errors or warnings.
- Try to remove event handler name in your HTML and generate it again using Visual Studio. Then check if it appears in the same code-behind file you looked before.
I don't have any error or warning when I compile the solution. Now I'm trying the second point you suggested.
– Simo
Jan 18 at 14:37
Thanks for the help, I chose the other answer as solution because it was more accurate for my case. Anyway you deserve an upvote for sure. Thanks alot
– Simo
Jan 18 at 14:44
add a comment |
- Ensure you don't have any other errors or warnings.
- Try to remove event handler name in your HTML and generate it again using Visual Studio. Then check if it appears in the same code-behind file you looked before.
- Ensure you don't have any other errors or warnings.
- Try to remove event handler name in your HTML and generate it again using Visual Studio. Then check if it appears in the same code-behind file you looked before.
answered Jan 18 at 14:26
opewixopewix
4,02311135
4,02311135
I don't have any error or warning when I compile the solution. Now I'm trying the second point you suggested.
– Simo
Jan 18 at 14:37
Thanks for the help, I chose the other answer as solution because it was more accurate for my case. Anyway you deserve an upvote for sure. Thanks alot
– Simo
Jan 18 at 14:44
add a comment |
I don't have any error or warning when I compile the solution. Now I'm trying the second point you suggested.
– Simo
Jan 18 at 14:37
Thanks for the help, I chose the other answer as solution because it was more accurate for my case. Anyway you deserve an upvote for sure. Thanks alot
– Simo
Jan 18 at 14:44
I don't have any error or warning when I compile the solution. Now I'm trying the second point you suggested.
– Simo
Jan 18 at 14:37
I don't have any error or warning when I compile the solution. Now I'm trying the second point you suggested.
– Simo
Jan 18 at 14:37
Thanks for the help, I chose the other answer as solution because it was more accurate for my case. Anyway you deserve an upvote for sure. Thanks alot
– Simo
Jan 18 at 14:44
Thanks for the help, I chose the other answer as solution because it was more accurate for my case. Anyway you deserve an upvote for sure. Thanks alot
– Simo
Jan 18 at 14:44
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54255825%2faspbutton-stopped-working-without-changing-the-code%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown