Sessions & External Pages

Posted by Community Admin on 03-Aug-2018 19:16

Sessions & External Pages

All Replies

Posted by Community Admin on 31-May-2010 00:00

Hello,
I noticed that there is no session state support and no option for external pages.

at this point, all of those limitations prevent me from evaluating the CMS further, I guess a lot of developers have trouble evaluating due the the numerous missing basic features.

1) When will a CTP2 version with session state support (or more) will be available?
2) Will it be possible to upgrade a full 3.7SP3 application to SF4.0?

BTW,
don't get me wrong, you did a great job on the SF4.0, i would definitely use SF4.0 in future projects.

Posted by Community Admin on 01-Jun-2010 00:00

Hello Lev Rosenblit,

Thank you for using our services.

1) It seems that there is some bug with our pages. The session is returned as null. This should not work this way as we would not disable something which exists in the default ASP.NET pages. We have logged this issue for fixing in our next release - Sitefinity 4.0 Beta.

2) We are going to provide wrapper classes to wrap your custom modules from 3.x sites to be used on Sitefinity 4.0. We are also going to provide an upgrade path for standard modules.


Sincerely yours,
Radoslav Georgiev
the Telerik team


Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

Posted by Community Admin on 09-Sep-2010 00:00

Hi Telerik,
 
Regards using session variables in URLs,  I’ve tried a number of techniques to get this to work and still no luck.  What I’m attempting to do with sitefinity is very basic. We created a generic content section in a page.  The code inside this generic content is simply an IFRAME,  and the src of the iframe goes to another app server.   I really need to capture a session ID set is already set fine in sitefinity, and append as name/value pair to the end of the URL.

 But I’m thinking this generic content page type might not allow evaluation of .NET expressions?  Is there another simple way to do this?  I just need the .NET or Sitefinity expression that will resolve a session ID var so that it can be used in this URL.  I can’t find the documentation for this yet and there isn’t any discussion on this need specifically.   It is this name value pair that I need some sort of usable syntax that will resolve the sessionvar,  either from w/i generic content page,  or some other page type that will let me insert the IFRAME.   Mucho thanks for any help!
 
&manufid=session['manufacturerID']

<iframe height="620" src=”http://192.168.0.33/wr/wc.dll?WR~FORMADAPTOR~LIST_RECORDS~893~&FRAME=listonly&showpdflink=no&manufid=session['manufacturerID']” frameborder="0" width="700"></iframe>

 

 


best regards,
Matthew Clark

AQS

Posted by Community Admin on 09-Sep-2010 00:00

I would suspect you'd want the following...

<iframe height="620" src="http://192.168.0.33/wr/wc.dll?WR~FORMADAPTOR~LIST_RECORDS~893~&FRAME=listonly&showpdflink=no&manufid=<%= Session["manufacturerID"] %>" frameborder="0" width="700"></iframe>

Posted by Community Admin on 09-Sep-2010 00:00

Thanks Eric,

I did try your suggestion with your exact syntax pasted into the same generic content section that I've been trying all along.  Below is the code I pasted into the section.

<iframe height="620" src="http://192.168.0.33/wr/wc.dll?WR~FORMADAPTOR~LIST_RECORDS~893~&FRAME=listonly&showpdflink=no&manufid=<%= Session['manufacturerID'] %>" frameborder="0" width="700"></iframe>


And here is the 'markup' the generic content section creates of the IFRAME src when I save it.  It goofs up all the characters so that and never gets evaluated in the resulting HTML.  This I copied out of the resulting HTML.  Is there a property or something to override this kinda markup?   Or maybe I'm overlooking escape characters that must be used?
 

<iframe height="620" src="http://192.168.0.33/wr/wc.dll?WR~FORMADAPTOR~LIST_RECORDS~893~&amp;FRAME=listonly&amp;showpdflink=no&amp;manufid=&lt;%= Session['manufacturerID'] %&gt;" frameborder="0" width="700"></iframe>

It really surprises me this is so tricky to do.  Thanks again for any help you can offer!

Matt
 


Posted by Community Admin on 10-Sep-2010 00:00

Hi Matthew,

Could you please let us know which version of Sitefinity are you using? This forum thread is related to an issue in Sitefinity 4.0. Also you can not run server side expressions in the content of the Generic Content block. You  would have to wrap this in a user control.

Kind regards,
Radoslav Georgiev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 23-Nov-2010 00:00

We get the following error message when trying to set

Session["LanguageID"] = 1;
in a control.

Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> section in the application configuration.


I set
enableSessionState="true"
in the web.config but that didn't help.  We did not have this problem with Sitefinity 4.0 SP4.  What do we need to do to enable Session State?

Posted by Community Admin on 23-Nov-2010 00:00

Hi Craig,

In Sitefinity RC it would not be possible to use Session due to some issues in our code. The  requires some general changes which will make for the official release.

Kind regards,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 24-Nov-2010 00:00

Thanks for the super fast response!  Is there any chance that this will be fixed in a release before the final official release?

Also, in a control, I am trying to access the value of a global resource in the standard way

HttpContext.GetGlobalResourceObject("CartResources", "CART_EMPTY");

I get the following exception:

Could not find the specified key "CART_EMPTY" or class id "CartResources".

The key and resource file exist and the same code works in Sitefinity 3.7 SP4.  Is there something we need to configure in order for global resources to work in Sitefinity 4.0?  Thanks in advance.

Posted by Community Admin on 01-Dec-2010 00:00

Hi Craig,

You cannot use local or global resources if you have a custom module or custom control. When you use custom control and custom module you have to create a custom class that inherits from Telerik.Sitefinity.Localization.Resource and initialize it in Global.asax - Application_Start

Res.RegisterResource<CustomModuleResources>();

Copy Code
[ObjectInfo(typeof(CustomModuleResources), Title = "CutomModuleResourcesTitle", Description = "CustomModuleResourcesDescription")]
    public class CustomModuleResources : Resource
    
        #region Constructions
 
        static CustomModuleResources()
        
        
 
        /// <summary>
        /// Initializes new instance of <see cref="CustomModuleResources"/> class with the default <see cref="ResourceDataProvider"/>.
        /// </summary>
        public CustomModuleResources()
        
        
 
        /// <summary>
        /// Initializes new instance of <see cref="CustomModuleResources"/> class with the provided <see cref="ResourceDataProvider"/>.
        /// </summary>
        /// <param name="dataProvider"><see cref="ResourceDataProvider"/></param>
        public CustomModuleResources(ResourceDataProvider dataProvider)
            : base(dataProvider)
        
        
 
        #endregion
 
        #region Class Description
 
        /// <summary>
        /// Help
        /// </summary>
        [ResourceEntry("CustomModuleResourcesTitle",
                       Value = "Security",
                       Description = "The title of this class.",
                       LastModified = "2010/12/01")]
        public string CustomModuleResourcesTitle
        
            get
            
                return this["CustomModuleResourcesTitle"];
            
        
 
        /// <summary>
        /// Contains localizable resources for help information such as UI elements descriptions, usage explanations, FAQ and etc.
        /// </summary>
        [ResourceEntry("CustomModuleResourcesDescription",
                       Value = "Contains localizable resources for security user interface.",
                       Description = "The description of this class.",
                       LastModified = "2010/12/01")]
        public string CustomModuleResourcesDescription
        
            get
            
                return this["CustomModuleResourcesDescription"];
            
        
 
        #endregion
  
        /// <summary>
        /// word: Title
        /// </summary>
        [ResourceEntry("Title",
            Value = "Title",
            Description = "word: Title",
            LastModified = "2010/12/01")]
        public string Title
        
            get
            
                return this["Title"];
            
        

Each property is a  key that you can later localize from Interface Labels & Messages depending on the keys you have added.

You have to register this class inside Initialze method of your custom module

Copy Code
public override void Initialize(ModuleSettings settings)
       
           base.Initialize(settings);
           Res.RegisterResource<CustomModuleResources >();          
       

Internally you can access the keys as shown below

Title = Res.Get<CustomModuleResources>().Title,

Best wishes,
Ivan Dimitrov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 02-Dec-2010 00:00

Thanks Ivan for your response.  I implemented your code for the CustomModuleResources class and it worked on a test .aspx page.  However, when I put the line

Res.RegisterResource<CustomModuleResources>();
in the Global.asax Application_Start, I get the following exception on ANY page I hit:

The type String cannot be constructed. You must configure the container to supply this value.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The type String cannot be constructed. You must configure the container to supply this value.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidOperationException: The type String cannot be constructed. You must configure the container to supply this value.]
   Telerik.Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.GuardTypeIsNonPrimitive(IBuilderContext context, SelectedConstructor selectedConstructor) +161
   Telerik.Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.PreBuildUp(IBuilderContext context) +136
   Telerik.Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context) +190
   Telerik.Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlanCreatorPolicy.CreatePlan(IBuilderContext context, NamedTypeBuildKey buildKey) +108
   Telerik.Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context) +137
   Telerik.Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context) +190
   Telerik.Microsoft.Practices.ObjectBuilder2.BuilderContext.NewBuildUp(NamedTypeBuildKey newBuildKey) +113
   Telerik.Microsoft.Practices.Unity.ObjectBuilder.NamedTypeDependencyResolverPolicy.Resolve(IBuilderContext context) +48
   BuildUp_Telerik.Sitefinity.Configuration.ConfigManager(IBuilderContext ) +115
   Telerik.Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext context) +12
   Telerik.Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context) +195
   Telerik.Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context) +190
   Telerik.Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides) +163

[ResolutionFailedException: Resolution of the dependency failed, type = "Telerik.Sitefinity.Configuration.ConfigManager", name = "XmlConfigProvider".
Exception occurred while: while resolving.
Exception is: InvalidOperationException - The type String cannot be constructed. You must configure the container to supply this value.
-----------------------------------------------
At the time of the exception, the container was:

  Resolving Telerik.Sitefinity.Configuration.ConfigManager,XmlConfigProvider
  Resolving parameter "providerName" of constructor Telerik.Sitefinity.Configuration.ConfigManager(System.String providerName)
    Resolving System.String,(none)
]
   Telerik.Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides) +327
   Telerik.Microsoft.Practices.Unity.UnityContainer.Resolve(Type t, String name, ResolverOverride[] resolverOverrides) +15
   Telerik.Microsoft.Practices.Unity.UnityContainerExtensions.Resolve(IUnityContainer container, String name, ResolverOverride[] overrides) +82
   Telerik.Sitefinity.Abstractions.ObjectFactory.Resolve(String name) +75
   Telerik.Sitefinity.Data.ManagerBase`1.GetManager(String providerName, String transactionName) +275
   Telerik.Sitefinity.Services.InstallContext..ctor() +19
   Telerik.Sitefinity.Services.SystemManager.Initialize() +101
   Telerik.Sitefinity.Abstractions.Bootstrapper.RegisterRoutes(RouteCollection routes) +207
   Telerik.Sitefinity.Abstractions.Bootstrapper.Bootstrap() +94
   Telerik.Sitefinity.Web.SitefinityHttpModule.Init(HttpApplication context) +24
   System.Web.Routing.UrlRoutingModule.System.Web.IHttpModule.Init(HttpApplication application) +10
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +431
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +194
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +339
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +253

[HttpException (0x80004005): Resolution of the dependency failed, type = "Telerik.Sitefinity.Configuration.ConfigManager", name = "XmlConfigProvider".
Exception occurred while: while resolving.
Exception is: InvalidOperationException - The type String cannot be constructed. You must configure the container to supply this value.
-----------------------------------------------
At the time of the exception, the container was:

  Resolving Telerik.Sitefinity.Configuration.ConfigManager,XmlConfigProvider
  Resolving parameter "providerName" of constructor Telerik.Sitefinity.Configuration.ConfigManager(System.String providerName)
    Resolving System.String,(none)
]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8950644
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +256
If I remove that single line from Application_Start, the exception goes away.
What am I missing? Thanks in advance.

Posted by Community Admin on 02-Dec-2010 00:00

Hello Craig,

Register the resource class as shown below

protected void Application_Start(object sender, EventArgs e)
    
 
        Bootstrapper.Initialized += new EventHandler<Telerik.Sitefinity.Data.ExecutedEventArgs>(this.AfterInit);
    
 
    private void AfterInit(object sender, ExecutedEventArgs args)
    
        Res.RegisterResource<CustomModuleResources>();
    


Kind regards,
Ivan Dimitrov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 02-Dec-2010 00:00

Thank you Ivan.  That solved the problem!  One last issue:  When I go to Interface Labels & Messages and try to edit one of the properties of the CustomModuleResources class, the edit UI is blank.  The "Save Changes" button is there but the area where you set the text of the label is blank.  For the built-in labels, the edit UI displays correctly.   I have attached a screen shot.  Thanks in advance.

Posted by Community Admin on 02-Dec-2010 00:00

Hi Craig,

Could you open the web browse console or FireBug -NET tab and see whether there are failing requests? It looks like that there is a bug here.

Kind regards,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 03-Dec-2010 00:00

Thanks Ivan.  I believe I have figured out the cause of the bug.  In Firebug, there is one failing request (404 Not Found):
localhost/.../

The successful request is:
localhost/.../

As you can see, it fails when "SpecialTest" is surrounded by  "%5Bhighlight%5D".  When I do a search for "SpecialTest" in Interface Labels & Messages, the matching Resource key is highlighted in yellow.  This is what causes the bug.  If I switch to "Sort: By date", the yellow highlight goes away and the edit UI works.

By the way, SpecialTest is just another property I had added to the CustomModuleResources class that you created.

Posted by Community Admin on 03-Dec-2010 00:00

Hello Craig,

Yes this is a bug. Also the service call does not include the name of the custom class in some cases. I logged the issue for fixing with ID 100991

Greetings,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed