More in this section

Forums / Developing with Sitefinity / How to append login info as querystring variables

How to append login info as querystring variables

3 posts, 1 answered
  1. Pavliks
    Pavliks avatar
    68 posts
    Registered:
    06 Apr 2010
    01 Feb 2010
    Link to this post
    Hi,

    I have a client that requires Sitefinity to be integrated with their ERP system to pull product data. The product data is customized for different users. To integrate with this the ERP system only needs the email address and a User ID, that has been entered into the Sitefinity user account, to be appended as querystring variables.

    What would be the best way to have this information automatically appended to links within the Sitefinity sitemap?

    Thanks,
    Steve
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    01 Feb 2010
    Link to this post
    Hello S. Webb,

    Thank you for using our services.

    I am not quite sure if you wish only to modify the links on the navigation (append query string information) or do it on a more "global" way in the application. If it is just for the navigation and you are using the built in navigation controls in Sitefinity you can add query string to each item's url added in navigation menu in the ItemDataBound event handler.

    However I think that a good approach would be to implement a custom HttpModule which will perform this based on some criteria. I guess not every url has to contain this information. Any way you can easily achieve this by inheriting from IHttpModule, create a handler for begin request and modify the URLs. Sample skeleton for the module bellow:
    using System;
    using System.Web;
     
    /// <summary>
    /// Summary description for CustomHttpModule
    /// </summary>
    public class CustomHttpModule: IHttpModule
    {
        #region IHttpModule Members
     
        public void Dispose()
        {
            //throw new NotImplementedException();
        }
     
        public void Init(HttpApplication context)
        {
            context.BeginRequest += new EventHandler(context_BeginRequest);
        }
     
        void context_BeginRequest(object sender, EventArgs e)
        {
            //add logic for appending query string information and perform Response.Redirect
        }
     
        #endregion
    }

    You can find a tutorial on creating custom HttpModule here: Walkthrough: Creating and Registering a Custom HTTP Module

    Kind regards,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Answered
  3. Pavliks
    Pavliks avatar
    68 posts
    Registered:
    06 Apr 2010
    01 Feb 2010
    Link to this post
    This is exactly what I was looking for.

    Thanks,
Register for webinar
3 posts, 1 answered