Reputation: 13
This is my first post here. I am doing a college project and I am stuck in an error.
I am building an e-learning website in ASP.net and they are static pages. Now, when I am opening a contact-us form it is throwing me an error.
Contact us form is in another folder.
I am a noob :( Please explain me in easy way.
Upvotes: 1
Views: 57
Reputation: 13
Well! The issues was I didn't selected the C# and my project was on vb. This is the reason why it thrown me that error.
If this error comes we need to make sure what files we are having and in which language we are making project :)
Upvotes: 0
Reputation: 16693
enter code here
The error you are getting means that there is no file called default.aspx.cs
in the same directory as your default.aspx
file.
Please make sure that this file exists.
You may have deleted it, or moved it to a different location.
Your IIS is trying to link the default.aspx.cs
, which is the code file, to the default.aspx file, which is your HTML
file, which uses the code.
You can see the link between the files at the top level declarations in your ASPX
file:
"Codefile = default.aspx.cs"
If you cannot file the default.aspx.cs
file, I suggest you re-create the ASPX
file using your development editor. This will create the default.aspx.cs
file automatically under your ASPX
file.
From MSDN:
The code-behind page model for Web Forms allows you to keep the markup in one file—the .aspx file—and the programming code in another file. The name of the code file varies according to what programming language you are using. For example, if you are working with a page named SamplePage, the markup is in the file SamplePage.aspx and the code is in a file named SamplePage.aspx.vb (for Visual Basic) and SamplePage.aspx.cs (for C#).
Hope this helps.
Upvotes: 1