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
Dzung Dakao
NA
17
3.1k
App_Code folder
Oct 23 2017 12:59 PM
Hi,
I have created a simple project (website) using asp.net. The project has a default page (Default.aspx) and a class (Class1.cs). Class1.cs resides inside a folder called App_Code.
The Default.aspx page has a button and a label. On a click of the button, I'd like to populate the label with a text of "hello world".
The text (hello world) is comming from a method called "foo" which resides in Class1.cs.
When I run it locally (http://localhost:8080/Default.aspx), it works fine. But, when I upload it to the webserver, and run it from browser, it doesn't work.
Here is the error message generated from the server:
The name 'Class1' does not exist in the current context
My code:
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = Class1.foo();
}
public static string foo()
{
return "hello world";
}
Please help!
thanks
Reply
Answers (
1
)
make string bold in c#
A free tool for invoice printing