SharePoint – Search results DispForm.aspx Redirect

When you do a search in SharePoint 2010 you get the results listed with a link to the Default DispForm.aspx.

image

But this opens up the ugly Standard Form.

image

While you might have put a lot of efforts in designing a Custom Form.

image

Solution is simple :

Add a redirect to the Standard Form to the Custom Form and you are done. Using the jQuery().SPServices library.

image

Code is here :

<script language="javascript" src="/sites/Scripts/jquery.SPServices-0.7.2.min.js"></script><script type="text/javascript">

$.noConflict();

$(document).ready(function(){
// alert(jQuery().SPServices.Version());

// Get Activity ID from URL
   var queryStringVals = jQuery().SPServices.SPGetQueryString();
   var ID = queryStringVals["ID"];

//alert (ID);

var URL = 'https://www.yoursite.com/ICT/Lists/HelpDesk/DispForm.aspx?ID=' + ID;

//alert ('We go to this ' + URL);

window.location.href = URL;
});
</script>

Enjoy !!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: