Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to add a parameter "Force=True" when the user is redirected to userdisp.aspx (when you click on people's name) What is the best way to do it?

Details: I need that because I do not have a mysites setup on the production server and you need this parameter to display userprofile properties to the user.

Note: My master pages do not have a code behind.

share|improve this question
add comment

3 Answers

I don't know of an easy SharePoint way to do this (hopefully one of the other great minds here can fill this gap) but I do know that you can do it in about an hour or so using URLRewriter tool from Microsoft. Simply set up an inbound rule looking for that page without the Force parameter and rewrite it to include the parameter.

This requires IIS7 and also that you manually copy the UrlRewriter rules to the web.config of each Web Front End in the farm.

share|improve this answer
    
Yeah instead I chose the simpler option and wrote a js urlrewriter. –  Hna0002 Jan 9 '12 at 21:14
add comment

You could try to customize the following Codeplex feature: https://solutionizing.codeplex.com/releases/view/25378 It sounds like it would fit your needs but I haven't tried it myself.

share|improve this answer
add comment
up vote 3 down vote accepted

I wrote a simple js urlrewriter for it and added it to the master page.

 $(document).ready(function () {
    var originalURL = document.URL;
    var url = document.URL;
    if ((url.indexOf("userdisp.aspx") != -1) && (url.indexOf("Force=True") == -1)) {
        if (url.indexOf("?") != -1) {
            var mainurl = url.substring(0, url.indexOf("?"));
            if ((mainurl.indexOf("userdisp.aspx") != -1) && (url.indexOf("?") + 1) != url.length) {
                url = url + "&Force=True";
            }
            else if ((mainurl.indexOf("userdisp.aspx") != -1) && (url.indexOf("?") + 1) == url.length) {
                url = url + "Force=True";
            }
        }
        else {
            url = url + "?Force=True";
        }
    }
    if (originalURL != url) window.location = url;
});
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.