.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

Modify Search Control for a Publishing Site

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :C#

Hello all,

We are currently implementing a search control in a master page for a publishing site.  The current control that we are using is as follows:<asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server">
<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox" Version="4"/>

I am currently looking to see what I can do to specify some settings that the client is after.  First, the search is only returning results from the site level.  We want to get results back from the complete collection.  Is there a way I can specify this using a value in the above control?  Secondly, by default I am getting the "Search This Site" in the control when you view site in browser.  How can I modify this?  I either don't want to show anything for text or chance it to Search all site."  Can this be achieved just change the behavior of the control above.

Any assistance appreciated.






View Complete Post

More Related Resource Links

How to add List item in search results for anonymous in a publishing site?

Hi all,   For now, results in Library (document set or not) are shown and the link is the binary file. This is ok. But for list, anonymous users can't view results. As logged in I see the items in the AllItems.aspx page. How could I allow this result to be viewed by anonymous users too?      Thank you,   Benoit Pironet

How to set default Image to RichFieldImage control in custom Publishing Page layout in Site defini




How to set  default Image to RichFieldImage control  in custom Publishing Page layout in Site definition?


How to modify the login control



I'd like to record more information than the default control allows as well as perform actions with the input when the form is submitted but I'm having trouble figuring out how.

So firstly, if I want to record the middlename for example, how would I do that, and by default, where would it go if anywhere?
When the form is submitted, I'd like to take specific input, such as just the middlename for example, and write some linq to sql code to specify when and how it's stored.
In what event would I put this code?


"Type ASP.x is not defined" error for dynamic user control when publishing updateable


I have a user control (ContainerCtrl) which programmatically instantiates another user control (SimpleCtrl) in OnLoad. It builds and runs fine, but when I publish it I get the error "error BC30002: Type 'ASP.SimpleCtrl' is not defined." (If I publish without the "updateable" option there's no error, but I need the site to be updateable.)

I assume this has to do with the particulars of how the assembly(ies) are built for the different compiler options. My question is, how can I get it to work properly for "updateable" publishing?

VS 2008 / .NET 3.5 sp1

The code follows (web.config is the default from Visual Studio).

Many thanks, Dave


<%@ Control Language="VB" ClassName="SimpleCtrl" CodeFile="SimpleCtrl.ascx.vb" Inherits="_SimpleCtrl" %>

    Simple control


Partial Class _SimpleCtrl
    Inherits UserControl

    'Nothing to see here.

End Class


<%@ Control Language="VB" CodeFile="ContainerCtrl.ascx.vb" Inherits="_ContainerCtrl"

Find It: Integrate Search Into Your Site With ASP.NET


We implement search providers for both Live.com and SharePoint so you can take advantage of either in your own applications.

Marco Bellinaso

MSDN Magazine September 2007

Provisioning: Use Web Services Provisioning to Control Access, Usage, and Billing on Your Site


Building Web Services to provide enterprise-level solutions is only the first step. You need to take care of the infrastructure aspects of your solution as well, including provisioning, billing, security, and reporting. In this article, the author uses the .NET Framework and SQL Server 2000 to design a provisioning system that will take care of all these housekeeping tasks. He discusses the general requirements of a Web Service provisioning system, walks through the implementation, and then outlines various scenarios for putting this system to work.

Chandu Thota

MSDN Magazine December 2002

Is it possible to modify the defualt My Site url?

Currently, when users select the My Site link, they are directed to "http://mysite.domain.com/personal/domain_username/default.aspx"

I would like to direct them to this instead "http://mysite.domain.com/personal/domain_username/home/default.aspx"

Assuming this is possible to implement, but I don't know how. Thank you for your help.

Top-Level Search Scope not showing in Sub-Site


I've got a site 'B' created under site 'A' in SharePoint. When I'm at Site A, I can search and find things that exist in both A&B. However, when I'm in B, the 'highest' search scope I can pick is 'B.' I'd like to be able to select one step higher so that I can search A&B from any page. Is this possible?

Search Usage Reports Missing for Site


We have Usage Analysis enabled on our employee portal farm.  The SSP in this farm crawls all local SharePoint sites and one child farm.  When we view search and query reports, one of the site collections (in a dedicated web app) is missing.  All other web apps/site collections appear in the search/query reports.  The missing site collection is using the standard search pages and web parts - no customization with the object model that might break usage logging.

Has anyone else ran into this or know the solution?

Search does not find text in Word document stored in document library on a Report Center site within



We have a document library on a site created off of the Report Center site template. We uploaded a Word 2007 document with the word zebra in the text. Using the search bar at the top of the page we selected This list: Our document library and searched for zebra. We received no results.

We tested the same thing on another site (site template Team site) within the same site collection and search worked fine.

Does the Report Center search function differently then the search functionality on the Team site?

Tamara Bredemus SharePoint Minion...working up to Maven

Portal Search Work - Site Collection Search Does Not


In our SharePoint installation we have an SSP which indexes local office sharepoint server sites.  However there is a problem, although we can do portal searches which reveal search results it is not able to do local searches at the site collection level and as a result we are presented with the typical error below.


No results matching your search were found.

  1. Check your spelling. Are the words in your query spelled correctly?
  2. Try using synonyms. Maybe what you're looking for uses slightly different words.
  3. Make your search more general. Try more general terms in place of specific ones.
  4. Try your search in a different scope. Different scopes can have different results.

I am unsure as to why this strange event is occuring.  We do not have the WSS Search component running in the MOSS environment as the SSP service should be able to index and server search queries at the portal and local site collection level.


Any thoughts to this?



modify login control



is it posible to change the way to log in a wss3 site.

i created a wss 3 site collection. to enter the site a login control pop up then you need to log in using windows authentication before ypu can see the site.

now i want to change this pop up thing in to a nice page. so the user can see a welcome page and there he can fill in his username and password to log in.

i want to keep using windows authentication not FBA.

is this possible?


Displaying the Server Ribbon and Site Actions Menu on Customized Search Pages Upgraded to SharePoint

Learn how to add the Site Actions menu and SharePoint Server ribbon to SharePoint Server 2007 search pages that you upgrade to SharePoint Server 2010 by using visual upgrade.

Publishing SharePoint Site


I have published a sharepoint website that I created but I now have the following problem:

  • from the internal network, everything works fine..
  • from the external network (via web):

  1. the People Picker web part does not work (error in WebForm_DoCallBack)
  2. The "assigned to" field is empty, but when I see the source code, the users are there. They are just not displayed.
Can anyone help me. Thanks in advance..

SharePoint Search not working on one site collection

I am running into some weird behavior with how SharePoint is crawling site/list data.  Let's say our main intranet site is http://www.intranet.com: Most of our older sites are setup with URLs like http://www.intranet.com/sites/sitename .  Crawling is working fine on these sites and I can execute a search and find all of the results I would expect.  At some point recently (before I joined this firm), they made a decision that all new sites would have the URL http://www.intranet.com/SiteDirectory/sitename .  Any sites which fall into this bucket are not being crawled, it would seem. If I check Central Adman>Shared Services>Search Administration, I can see that the first content source being crawled is http://www.intranet.com so I would imagine this crawl should pick up anything under /SiteDirectory/ but it is not.  I also checked the Crawl Settings on this page and it is set to "Crawl everything under the hostname for each start address".  Lastly, I see that there were only 21 errors in the last full crawl but none of these errors apply to a /SiteDirectory/ site. In short, what could be causing the crawl to apparently skip all of the sites within /SiteDirectory/ and how can this best be fixed?

SharePoint 2010 Publishing Site : Operation is not valid due to the current state of the object.

  I think as usual, the new version of SharePoint 2010 has a lot of problems. the below messege appear in a publushing site (FBA) enabled and when I try to access the pages list or even approve a page of accessing the SiteCollectionImages list and ......... etc every link produce the below error. I'm very frustrated with 2010.  Server Error in '/' Application. <nativehr>0x8107058a</nativehr><nativestack></nativestack>Operation is not valid due to the current state of the object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: <nativehr>0x8107058a</nativehr><nativestack></nativestack>Operation is not valid due to the current state of the object. Source Error: 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. Stack Trace: [COMException (0x8107058a): <nativehr>0x8107058a</nativehr><nativestack></nativestack>Operation is not valid due to the current state of the object.] Microsoft.SharePoint.Library.SPR

Publishing site template saved using /_layouts/savetmpl.aspx

A trick we used in MOSS 2007 doesn't seem to work in SharePoint 2010 although it seemed to work for someone who asked the same question in this forum.  We know publishing site do not have the "Save as site template" as an option in the site settings so we used <site>/_layouts/savetmpl.aspx to save the site template.  Unfortunately, new site created using the saved template is throwing a 404 error.  And the site was actually created (can see in View All Site Content).  We need to be able to easily create sub-sites with the same look and feel and set of document libraries/lists.  Any advice? 
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