c# - Page Directive Error After Copying Default.aspx From Another Project? -


In the solution, explore in my web-application (asp.net, C #) I copy and paste the default .aspx page I am doing this error in another project when I run the default. Aspx page

  & lt;% @ page language = "c #" codeless = "default. Aspx.cs "AutoEventWireup =" false "Inheritance =" Default "%> 

Parser error message: Could not load 'default' type.

Can anyone tell me how to fix this?

In addition to making sure that according to the matching of class names, the earlier answer has been said , There are significant differences between "codehead" and "codefile" instructions. Formerly, what you are using, old, .NET 1.1 is the way to do things. In that case, your code in your back should declare examples of all the controls on your page that you need to access, and you should not use partial orbits.

For CodeFile, you should use partial sections, and you do not need to declare any control; This work is done for you in the second part of the partial class.

If you are porting an existing page, then you need to understand which model is needed and behind this, use the same declaration in both codes and page instructions.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -