Exclude content from Search Index
Ad you could in 3.x versions, how do you exclude content from search such as footer information?
Hi Laura,
Well, if your footer is a custom control the easiest way is to add the following code in the Render method of your control:
using
System.Web.UI;
protected
override
void
Render(HtmlTextWriter writer)
var indexRenderMode =
this
.GetIndexRenderMode();
if
(indexRenderMode == IndexRenderModes.Normal)
base
.Render(writer);
I am not sure what you mean.
For another example, on every page we have copy up in the header area such as:
For immediate assistance, call XYZ Company at 1-800-000-000.
Hi Laura,
Is your header area a Content block or user control like an .ascx file? If it isn't an .ascx file you could create one and add the code I pasted to you in my first reply.
Greetings,Thanks Lubomir,
Helpful info :)
If your header and footer embed (hard coded) to master page, you can use this code block;
<%if (Page.GetIndexRenderMode() == IndexRenderModes.Normal) %>
<header>contents......</header>
<%%>