TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
2.1k
474.3k
Web form error has an error on Default.aspx
Nov 11 2020 8:24 AM
Hi Team
If you have an error when creating a web form, error "Compiler Error Message: CS1061: 'default_aspx' does not contain a definition for 'btnStart_Click' and no accessible extension method 'btnStart_Click' accepting a first argument of type 'default_aspx' could be found (are you missing a using directive or an assembly reference?)
//Default.aspx
<asp:Button ID=
"btnStart"
runat=
"server"
OnClick=
"btnStart_Click"
/>
// Error is on this line, how to resolve this?
<asp:TextBox ID=
"SomeText"
runat=
"server"
></asp:TextBox>
//Default.cs
string
results;
private
async
void
btnStart_Click(
object
sender, EventArgs e)
{
SaySomething();
SomeText.Text = results;
}
async System.Threading.Tasks.Task<
string
> SaySomething()
{
await System.Threading.Tasks.Task.Delay(1000);
results =
"Hello result"
;
return
results;
}
Reply
Answers (
1
)
Auto download of ics file
Using sublime text 3 with asp.net ?