.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Custom DispForm.aspx and Search Results

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :SharePoint
I am a developer, but am proofing somethig in SPD 2010.  I am trying to create custom New/Edit/Disp/List forms for some OOB SharePoint 2010 lists (think Announcements, etc).  I am going this route because we are leveraging a mix of OOB functionality and custom functionality.  We want to avoid users "accidentally" navigating to the OOB New/Edit/Disp/List forms and have only our custom forms displayed.  This includes things like creating new items in calendar view and links from search results. So far, I have used SPD to create a new, custom, DispForm.aspx named "DispFormCustom.aspx".  I just made minor modifications to it so far - like changing background color to red.  Otherwise the new "DispFormCustom.aspx" is exactly what SPD gives you when you say you want to create a new Display Form.  I have selected that the custom form be the "Default" display form for the list. When I go into the list, and select "View Item", I get my custom form. When I do a search (using OOB search), the search result takes me to the original "DispForm.aspx" and not my custom form (eventhough I have specified it to be the default).  I have cleared the search index and done a Full crawl and the same behavior. I did navigate to the Content Type edit screen in SPD, in the "Forms" section, modif

View Complete Post

More Related Resource Links

QueryEx (Search) results and Custom Page Index


Hi All,

I done a web part which allow the user to query the search.asmx. It return the result fine against which I apply some xslt. However I need a mean to create a Page index. I only return the result based on a range defined in the query.

I need somehow to obtain the number of result the search is returning in total against what I only want to display on the screen.

The only way I sort of figure to do that is by first make a search just to obtain the number of result it will return in total and then make a search defining a range.

Has someone done something similar?


Custom Email Alert template creating links to DispForm.aspx

I have a requirement to customise the alert template for a standard blog post list. To do this I: 1. Created a copy of alertstemplate.xml 2. Copied the genericList alert template node and customised 3. Registered the new template file against the site collection, iisreset and finally assigned the new Alert template to the list, when alerts are created the custom template is emailed. The problem now arises that the 'View <Post Title>' in the toolbar section now creates a hyperlink to http..../Lists/Posts/Dispform.aspx?ID=xx rather than post.aspx. I have checked using sharepoint designer that the list supporting files has the correct display item form of Lists/Posts/Post.aspx. Additionally if I reset the alert template for the list back to use the Generic list template the same problem still occurs so this leads me to believe it is not the customisations that are the problem. Code used to assign the alert template to the Posts list: var ats = new SPAlertTemplateCollection((SPWebService) site.WebApplication.Parent); var newTemplate = ats[alertName]; if (newTemplate == null) { // We did not find the specified Template. throw new Exception("Failed to find template SPAlertTemplateType.NewsPost in the template collection."); } list.AlertTemplate = newTemplate; list.Update(); Any assistance will be most welcome, thanks in advance. Alan

change search results page According to custom setting page

I want to create user settings page will be able to choose which will  search results display page x or page y Settings will be saved somewhere. When the user searches on sharepoint search page will display to the user  the page that he select in the search page settings page x or  page y   my questions : 1. Is it necessary to treat the user profile - If so how? 2. how results can be directed to the search results page after a user choose Specific page? 3. where save the settings from custom settings page  ?

Sorting search results by custom managed property


I am customizing the XSLT for the core results webpart to give the user the option to sort search results by a certain managed property. There are several managed properties that I am listing on the search results page, and when the user clicks one, it should sort the results by that property.

In MOSS 2007, you could use the "v=property" parameter in the URL to define the sort order, but this doesn't seem to work anymore in SharePoint 2010. Are there any ideas on how to accomplish this?

I need to pass a variable from a url to an .aspx search/results page


When I was using FrontPage, a .asp page would receive a varialbe from the url when ?field=value was added to the end of the url.  I am now using Expression Web and have found that this doesn't work with .aspx pages.  Can anyone tell me what code needs to be added to the page to accomplish this with .aspx?  I create the .aspx page with VB as the coding selection.

I am not sure what forum this should be in.



Eleanor V

How can I add custom Search Paging webpart in the Search results page in MOSS 2007


I have created a Basic webpart page and added Content editor webpart to extend the functionality of Advanced Search webpart. This is working fine. Also added OOB Search Paging webpart int his page. But when the number of items returned by the Search Core results webpart exceeds the Page size (10) then when I click on the next link in the Paging webpart then all results are lost and retrieved from All Sites scope. Is there any way to hook into the Search paging webpart.?

Please note that in the Content Editor webpart I have used custom search scope.

I need help with regard to this.

Thanks in advance!.

How to filter search results before displaying in searchresults.aspx

I have a discussion forum list with discussion topics. Whenever discussion comments are added to any of these discussion topics, they are stored in different database. My query is, when search is done from the sharepoint top right search box, all the results from the entire site are displayed, i want to display only results from discussion forum topic list. how to filter these search results when they are displayed in searchresults.aspx

Sharing custom DispForm.aspx across sites

We have a need to customize the default dispform.aspx for displaying announcement content type.  I have created a test site and created a modified dispform to display the announcements like i wanted.  I would now like to copy this modified dispform.aspx to another site and display the announcements for that site using the customized dispform.aspx.  Apparantly I cannot simply copy the modified dispform.aspx to the site.  Also, what would I need to do to change the default list form dispform.aspx for the entire site collection.  Any assistance would be greatly appreciated.

WSS 3.0 - How can I get a document ID in Search Results.aspx page.



Does anyone know how I can get the ID of a document in the SearchResults.aspx page?

I have got javascript code in this page to update the link of the icon to edit the document as opposed to viewing it (Need Document ID though).

There must be a way to do this using server side code??????

Your help would be most welcome.




QueryEx (Search) results and Custom Page Index


Hi All,

I done a web part which allow the user to query the search.asmx. It return the result fine against which I apply some xslt. However I need a mean to create a Page index. I only return the result based on a range defined in the query.

I need somehow to obtain the number of result the search is returning in total against what I only want to display on the screen.

The only way I sort of figure to do that is by first make a search just to obtain the number of result it will return in total and then make a search defining a range.

Has someone done something similar?


Custom Webpart connecting to Search core results webpart




I want to connect custom webpart (custom search box) to the Search Core results webpart.


Please let me know how to achieve this.


Thanks in advance.


How to include element 'imageurl' in custom search results

Hi All,
Well, this one is a bit of a puzzler... I've written a custom Advanced Search by adding my own properties exampled:

KeywordQuery kQuery = new KeywordQuery(ServerContext.Current);
resultTbls = kQuery.Execute();
tblResult = resultTbls[ResultType.RelevantResults];

The issue is I cannot reference element 'imageurl' in the XSL because of my custom properties. If I don't add any custom properties then 'imageurl' returns as default as expected. I also cannot do the following as it raises an exception:

Is there a way to include element 'imageurl' whilst having custom properties? Or is the default search results working its magic and applying 'pixie dust' in generating element 'imageurl?'

The section xsl looks like this:
<xsl:template match="Result">
  <xsl:variable name="id" select="id"/>
  <xsl:variable name="url" select="url"/>
  <span class="srch-Icon">
   <a href="{$url}" id="{concat('CSR_IMG_',$id)}" title="{$url}">
   <img align="absmiddle" src="{imageurl}" border="0" alt="{imageurl/@imageur

Custom views on .aspx webpage


Hi again, i have a client that needs me to create a custom view on thier webpage similar to Microsoft Word.

It goes about that, when I click on an image it redirects me to another page and must create a custom view for a certain paragraph on that page. I am not sure how to do this and wonder if anyone knows how.

I am using C# programming language if that helps at all. I Heard that using javascript would work but i dont know javascript yet so is there any alternative?

How to display a count of search results with keywords in a label?


Sorry for a basic post here; I am very new to VB!

I am currently building a search page, which includes a textbox and two drop-down lists, a search button, and a datagrid. If results are found and displayed, I would like a label to display:

(e.g.) "24 results found for 'blue sky clouds' "

...where the integer represents the results count, and the keywords and/or drop-down list selections are included in the string.

If no results are found I would like the label to display:

(e.g.) "No results were found that match your selection. Please try again"

I would also like the label to be invisible until a search occurs.

Thanks in advance!

SharePoint Security: Trim SharePoint Search Results for Better Security


SharePoint search may return too much information, causing data security problems. Learn how to use the custom security trimmer to ensure users see only the documents they have permission to view.

Ashley Elenjickal, Pooja Harjani

MSDN Magazine July 2010

How can I prioritise search results to show where document metadata has a hit first and then where t


When my users run a search against a site with a bunch of document libraries they will often search for terms that are in the title of the doc, if they do know the title they will put that in. What I would like to do is have the results ordered such that if any hits are on the document metadata (eg Title) then they are presented first and any results that are from hits on the content of the documents are presented later.

So, if they get the title spot on in their search query that document will appear first .... if they don't get it right then the likelyhood is that the title is something like what they entered so similar titled docs are presented first and then those with matching content ....

How can I achieve this?


No Results matching your search were found. WSS 3.0


I've got one sharepoint 3.0 site, which is a hostNamedSiteCollection which won't return any results when we search it - searching the entire site or a single list both produce the same "no results matching your search were found".
The site uses Windows Authentication.  We have no Alternate Access Mappings set up. It is regular HTTP
I've added test content to other sites housed in the same Web Application and searched - that new data is appearing in the results.
I did a backup using STSADM and restored the site to my dev server (as both a hostNamedSiteCollection & a regular site collection) - searches return results just fine.
I deleted the site from the prod server and restored it (into a different content database even!) from a backup  I made with STSADM - no results are returned.
I restored the site to the same web application as a Standard site (http://webapp/sites/sitename) (NOT a host named site collection) and results ARE returned.

I've looked at the trace logs & application logs on the server, but can't find any errors that I can tell might be related..

This is the only site I've ever seen have this problem.  We have plenty of other hostNamedSiteCollections and search is working fine on them.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend