Where to add the importing products aspx and aspx.cs

Mohamed Tassisto asked on July 5, 2017 16:16

I would like to know where to put the 2 script files from this article to my web app folder

Correct Answer

Mohamed Tassisto answered on July 7, 2017 09:44

After copy/pasting it you need to add the namespace, I feel dumb

0 votesVote for this answer Unmark Correct answer

Recent Answers


Brenden Kehren answered on July 5, 2017 16:31

Following best practices, you'd use a custom directory in the /CMSModules directory OR in the /CMSGlobalFiles directory.

Once you copy them to that location, then simply access it with the relative url to that path.

0 votesVote for this answer Mark as a Correct answer

Mohamed Tassisto answered on July 5, 2017 16:54 (last edited on July 5, 2017 17:16)

I get these 2 errors while runat is set to "server" for both labels:

  • The name 'lblInfo' does not exist in the current context

  • The name 'lblError' does not exist in the current context

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on July 5, 2017 19:15

Check your aspx and aspx.cs file, make sure the aspx's @Page CodeFile attribute points to your aspx.cx file, and the Inherits value matches the Class name on your aspx.cs

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ImportProducts.aspx.cs" Inherits="ImportProducts" Theme="Default" %>

public partial class ImportProducts : System.Web.UI.Page

0 votesVote for this answer Mark as a Correct answer

Mohamed Tassisto answered on July 6, 2017 08:46

Trevor the values are the same as you said but I still receive the same errors

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on July 6, 2017 15:13

Can you paste the exact aspx and aspx.cs code somewhere like a paste-bin so we can see them? That error usually means there is a disconnect between the aspx and the aspx.cs that the .cs file can't see the controls (lblError and lblinfo) which are found on the aspx page.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.