Sessions & External Pages
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.
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
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
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
>
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~&FRAME=listonly&showpdflink=no&manufid=<%= Session['manufacturerID'] %>" frameborder="0" width="700"></iframe>
It really surprises me this is so tricky to do. Thanks again for any help you can offer!
Matt
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
We get the following error message when trying to set
Session["LanguageID"] = 1;
enableSessionState="true"
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
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");
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>();
[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"
];
public
override
void
Initialize(ModuleSettings settings)
base
.Initialize(settings);
Res.RegisterResource<CustomModuleResources
>();
CustomModuleResources
>().Title,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
>();
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.
|
[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 |
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
>();
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.
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
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.
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