I am using VS2008 for ASP.NET apps.
My Solution Explorer has hierarchy like this:
The start-up page, Default.aspx, displays a Login form. When I press Login button, another Page with the name, selectCompany, should open. selectCompany is a Web Content Form whose master page is Master1.Master. But it is not opening, instead I am getting this error:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'FlexStock.Forms.master1'.
Source Error:
Line 1: <%# Master Language="C#" AutoEventWireup="true" CodeBehind="~/Forms/selectCompany.aspx" Inherits="FlexStock.Forms.master1" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Source File: /Forms/master1.Master Line: 1
The first line of Master1.master is like this:
<%# Master Language="C#" AutoEventWireup="true" CodeBehind="master1.master.cs" Inherits="FlexStock.Forms.master1" %>
And the first line of Web Content Form, selectCompany.aspx, is like this:
<%# Page Title="" Language="C#" MasterPageFile="~/Forms/master1.Master" AutoEventWireup="true" CodeBehind="selectCompany.aspx.cs" Inherits="FlexStock.Forms.selectCompany" %>
I am not following where is the problem.
Make sure that the class-name stated in the Inhertis-part of your page-directive matches the name of the class in your code-behind file.
Master1.master:
<%# Master Language="C#" AutoEventWireup="true" CodeBehind="master1.master.cs" Inherits="FlexStock.Forms.master1" %>
Master1.Master.cs:
namespace FlexStock.Forms {
public class master1 {
/* ... */
Have you built your project w/o any errors/warning?
Error says that its unable to find code-behind class FlexStock.Forms.master1 so issue will be likely in master1.Master.cs or designer.cs - where you may have changed the namespace or class name w/o making the same change in markup. Or there is some compilation error and VS is unable to generate the assembly (or unable to put it in bin folder)
If you can see the bin folder in Explorer, but not in VS, try "Including" it in your project.
Maybe drag the folder into Solution Explorer, and then right-click it and Include it.
Related
So this code is in a file login.aspx which literally has some html mnarkup and the below code, so where does this code get loaded from? Where is the App_Web_login.aspx.d7a6dcf1 file located ?
<%# page language="C#" autoeventwireup="true" inherits="stadm_login,
App_Web_login.aspx.d7a6dcf1" enableeventvalidation="false" theme="Niko" %>
The code is contained in a file that is associated with its page. In Visual Studio if you load the project you will see a caret next to the aspx page. Click that and you will see a file associated with that page. That is the code file, or code behind, for the login page.
When the project is built, the code for each page is wrapped into a dll file or code package for the entire project. What you see for the inherits in the page is the base class for the project and also the inheriting of the page class.
So if my project is called FooProject, then at the top of each page where it says inherits, you will something like this (the _base class .page class):
inherits=_FooProject.Login
I'm trying to use the asp.net webforms sitemap and menu control to build my asp.net mvc's sites navigation.
There are many tutorials about embedding razor views into webforms, but I want to go the otherway around. Embed a webform into a razor view.
Doing something like this looks eemi promising:
#Html.Partial("~/Views/Shared/test/menu.aspx")
Which presents an error:
Parser Error Message: 'System.Web.Mvc.ViewUserControl' is not allowed here because it does not extend class 'System.Web.Mvc.ViewPage'.
Is there a value for Inherits that would allow this to work?
Oh Duh, read the error message...
I changed the first line of the webform from this:
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="menu.aspx.cs" Inherits="System.Web.Mvc.ViewUserControl" %>
to this:
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="menu.aspx.cs" Inherits="System.Web.Mvc.ViewPage" %>
Then I ran into another issue about System.Web.Mvc.ViewPage being defined twice, so I deleted the *.designer.cs file and now its working.
I have created a application page for login functionality in sharepoint by following this post.
But this giving me an error at inheriting the page. I have folder structure and .aspx file like below.
Did I done any mistake while giving the link to the .cs file in the application page?
After I deployed into my site, it is giving me error like below.
I am trying to resolve it from 2 hrs, but unable to find the solution. Can any one suggest me the way to do it please!!
Try to add
<%# Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
before
<%# Page ... %>
Add $SharePoint.Project.AssemblyFullName$ to your Inherits attribute
Instead of <%# Page Language="C#" AutoEventWireup="true" CodeBehind="YourPage.aspx.cs" Inherits="YourNamespace.YourPage" %>
Use <%# Page Language="C#" AutoEventWireup="true" CodeBehind="YourPage.aspx.cs" Inherits="YourNamespace.YourPage,$SharePoint.Project.AssemblyFullName$" %>
This could also be happened when there are another reference to that assembly which didn't exist. To show the error, simply check Ha Doan answer.
I am in the process of upgrading a website from Visual Studio 2005 to 2010. I ran it through the importer, however I'm having some errors. Specifically I'm having the following error:
Error 615 Unknown server tag 'CTL:PayPal'
If I go to the file that it is complaining about I have the following at the top of the file:
<%# Control Language="C#" AutoEventWireup="true" Inherits="PowerShop.Admin.UI.Customer.Controls.CustomerPaymentList" %>
<%# Register TagPrefix="CTL" TagName="OrderPaymentList" Src="~/Order/Controls/OrderPaymentList.ascx" %>
<%# Register TagPrefix="CTL" TagName="PayPal" Src="~/Order/Controls/OrderWizard/PayPalDetail.ascx" %>
<%# Register TagPrefix="CTL" TagName="Term" Src="~/Order/Controls/OrderWizard/LineOfCreditDetail.ascx" %>
<%# Register TagPrefix="Shipping" TagName="AddressVerification" Src="~/Controls/AddressVerificaton.ascx" %>
<%# Import Namespace="PowerShop.Configuration" %>
I have checked and double checked the register tags and the file but everythin appears to be correct. The file exists (PayPalDetail.ascx) in the exact location I am specifying. This page does not throw any errors on any of the other register tags. Any help or insight would be much appreciated.
I think it would be in wrong place like you could have by mistake put it in the page instead of putting it in the UserControl which have the Register tag.
Also, this can occur if the Paypal user control is not able to compile due to some bug in it.
Where are you placing the CTL:Paypal tag ??
.
PS: More detailed question could have a chance of more detailed answer !
When I try to access my ASP.NET password recovery page, I get the following error:
Description: An error occurred during
the parsing of a resource required to
service this request. Please review
the following specific parse error
details and modify your source file
appropriately.
Parser Error Message: Could not load
type 'RugbyClubWebApplication.ForgotPassword'.
Source Error:
Line 1: <%# Page Language="C#" MasterPageFile="~/SubMaster.Master" AutoEventWireup="true" CodeBehind="ForgotPassword.aspx.cs" Inherits="RugbyClubWebApplication.ForgotPassword" Title="Untitled Page" %>
Line 2: <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
Line 3: </asp:Content>
Source File: /Rugby/ForgotPassword.aspx Line: 1
Any ideas?
You may be able to fix this by simply cleaning and rebuilding the entire solution.
This can sometimes happen when file or project names change and class or namespaces aren't updated. Is the name of the class defined in ForgotPassword.aspx.cs actually ForgotPassword, and is it in the namespace RugbyClubWebApplication?
i.e. you should have the following in your class file:
namespace RugbyClubWebApplication
{
public class ForgotPassword
{
...
}
}
Also, if you're using Visual Studio, is the Default Namespace of the project which contains this class correct? This is found in the Properties page of the project.
Assuming this to be an ASP.NET 2.0 Website project and that the class name and file names are correct, you should try replacing the CodeBehind attribute of the #Page directive with the CodeFile attribute, instead. In .NET 2.0 and above, the CodeBehind attribute exists only for backward compatibility and you should be using the CodeFile attribute along with the Inherits to specify a code behind file along with class name.