How to create a new ascx file in modules ?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 anni tempo fa
i want to create a duplilcate copy of ForumActiveDiscussions.ascx but with a different name so that i can use the same thing in different ways.

1) i created CurrentThreads.ascx , (copies code from  ForumActiveDiscussions.ascx and .cs file and pasted it on CurrentThreads.ascx / .cs file)

2) added the new with the old one as i want to use both on the same page:
<%@ Register TagPrefix="nopCommerce" TagName="ForumActiveDiscussions" Src="~/Modules/ForumActiveDiscussions.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="ActiveThreads" Src="~/Modules/CurrentThreads.ascx" %>

3) re-compiled the project


4) when i try to run the project i get this error on the page where i am using (CurrentThreads.ascx):

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0103: The name 'GetLocaleResourceString' does not exist in the current context

Source Error:



Line 20:                     <tr class="activediscussionsheader">
Line 21:                         <td class="topicname">
Line 22:                             <%#GetLocaleResourceString("Forum.TopicTitle")%>
Line 23:                         </td>
Line 24:                         <td class="replies">




I don't know why i am getting this error as when i try to view "activediscussions.aspx" page everything works fine as by default all the resourcestrings area available....then why they are not working when i am using "CurrentThreads.ascx"
13 anni tempo fa
Problem Solved !!!

solution:

in the new ascx, i changed this

public partial class CurrentThreads : System.Web.UI.UserControl

TO


public partial class CurrentThreads : BaseNopUserControl

save changes > re-build project..and it worked....
13 anni tempo fa
Thanks for this... I had the same issue and your fix fixed it!
13 anni tempo fa
steveeb wrote:
Thanks for this... I had the same issue and your fix fixed it!


You're Welcome
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.