Page 1 of 1
Overiding with the ConLib Custom folder doesn't seem to work
Posted: Tue Feb 10, 2009 7:34 am
by europhile
There's some good posts about customising pages but I'm having a problem with one assumption - the ConLib\Custom allows new .ascx controls (and their .cs) so they can be referenced fine as [[ConLib:Custom\<filename>]]. This is similar to the Scriplets method.
However, like the Scriptlets, it is anticipated that .ascx files in the ConLib\Custom with the same name as the original one in the base folder will over-ride the original. Eg. a copy of MiniBasket.ascx (with same name) can be modified in the Custom folder so that it doesn't show the Shipping Estimator (visible="false"). Unfortunately, it doesn't seem to kick in, the original with Shipping Estimator still shows! If I make the same change in the original base file, naturally it works and the Estimator doesn't show - great. But I thought that Custom controls with same name will override, which makes backup and future updates much easier.
I tried reloading/recycling the app, stop/start, but no joy. Am I missing something or does this override behaviour not work on ConLib unlike Scriptlets?
Phil
Re: Overiding with the ConLib Custom folder doesn't seem to work
Posted: Tue Feb 10, 2009 7:49 am
by jmestep
You need to change the code within the files that are used in the Custom folder. For example- Custom added in both these places. You don't need to change the CodeFile= because it's relative to the folder the page is in.
public partial class ConLib_Custom_RegisterDialog : System.Web.UI.UserControl
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="RegisterDialog.ascx.cs" Inherits="ConLib_Custom_RegisterDialog" %>
Edit:
You also need to make sure that your scriplet is using ConLib:Custom/RegisterDialog instead of ConLib:RegisterDialog
Re: Overiding with the ConLib Custom folder doesn't seem to work
Posted: Tue Feb 10, 2009 8:30 am
by europhile
Yes, that's what I said, I am editing the ConLib\Custom .ascx file but it doesn't make any difference!
Have you definately left an original filename.ascx Control the same but changed the ConLib\Custom filename.ascx with same name, which then overrides it? Because it doesn't seem to override on mine. Phil.
Re: Overiding with the ConLib Custom folder doesn't seem to work
Posted: Tue Feb 10, 2009 9:12 am
by mazhar
ConLib/Custom controls doesn't override the default ones. You need to update the locations to make use of the new control from custom folder.
Re: Overiding with the ConLib Custom folder doesn't seem to work
Posted: Tue Feb 10, 2009 9:26 am
by europhile
Thanks but your edit above has an answer (ie. use conLib\Custom) but the point is - see your thread "Customizing display pages" and Joe's reply (would've posted there but its a longer thread and this is a specific problem):
4. You copy a "built-in" user control into ~/ConLib/Custom and make sure the file name is the same as the original. Then you make changes to it.
AC7 will override the "built-in" user control and use the modified copy you placed in ~/ConLib/Custom. The original remains as it was.
5. You create a brand new user control and store it in ~/ConLib/Custom.
You will be able to reference this custom control on any scriptlet page using the format [[ConLib:Custom\<filename>]]. Be sure to reference it without the .aspx extension. It used to require the extension but this was changed when Beta went to RC1.
His #4 is what should be achievable, but you are recommending dropping down to #5, which means you have to mess about adding the Custom to every ConLib that references the overriding control. Hassle, and from the thread - should be unnecessary.
So back to original question, does it (#4 method) work - because it doesn't seem to on mine? Phil.
Re: Overiding with the ConLib Custom folder doesn't seem to work
Posted: Tue Feb 10, 2009 9:42 am
by mazhar
#4 will not work. You have to go with #5
Re: Overiding with the ConLib Custom folder doesn't seem to work
Posted: Tue Feb 10, 2009 9:43 am
by jmestep
#4 doesn't work, and I don't know if it ever did. I think old Able documentation might have said it worked that way.
Re: Overiding with the ConLib Custom folder doesn't seem to work
Posted: Tue Feb 10, 2009 10:02 am
by europhile
Right, phew, glad we sorted that out. Thanks for your help, Phil.
NB: Hope this can be implemented in upgrade mazhar, it would save a lot of fannying around as the underlying idea and method in Scriptlets is an excellent one (ie. auto override)
