Adding new page

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 лет назад
Hi,

I have added a new page.
StoreLocations.aspx

And I modified the function
protected void btnRegister_Click(object sender, EventArgs e)
        {
            string url = CommonHelper.GetStoreLocation() + "storelocations.aspx";
            //string url = CommonHelper.GetStoreLocation() + "register.aspx";
            //string returnURL = CommonHelper.QueryString("ReturnURL");
            //if (!String.IsNullOrEmpty(returnURL))
            //{
            //    url += "?ReturnUrl=" + returnURL;
            //}
            Response.Redirect(url);
        }

<%@ Page Language="C#" MasterPageFile="~/MasterPages/TwoColumn.master" AutoEventWireup="true"
    Inherits="NopSolutions.NopCommerce.Web.StoreLocations" CodeBehind="StoreLocations.aspx.cs"%>

<%@ Register TagPrefix="nopCommerce" TagName="StoreLocations" Src="~/Modules/StoreLocations.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cph1" runat="Server">
    <nopCommerce:StoreLocations ID="ctrlStoreLocation" runat="server" />
</asp:Content>

Here i am getting the warning:
Warning  27  Element 'StoreLocations' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing.  \Console\StoreLocations.aspx  6  18  


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace NopSolutions.NopCommerce.Web
{
    public partial class StoreLocations : BaseNopPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}

-------------------------------------------------------------------------------
<%@ Control Language="C#" AutoEventWireup="true" Inherits="NopSolutions.NopCommerce.Web.Modules.StoreLocationsControl"
    CodeBehind="StoreLocations.ascx.cs" %>


==========================================================================

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: 'NopSolutions.NopCommerce.Web.Modules.StoreLocationsControl' is not allowed here because it does not extend class 'System.Web.UI.UserControl'.

Source Error:


Line 1:  <%@ Control Language="C#" AutoEventWireup="true" Inherits="NopSolutions.NopCommerce.Web.Modules.StoreLocationsControl"
Line 2:      CodeBehind="StoreLocations.ascx.cs" %>



Source File: /Modules/StoreLocations.ascx    Line: 1
13 лет назад
U didn't build the solution before visiting new page ...
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.