MVC2/3 ChildActionOnly controller methods are accessible for Googlebot?
If have this issue for already several months and thought that I showed to Googlebot in early versions of app that controller method. But recently added new one - LatestNews
also marked with [ChildActionOnly]
attribute
Problem Elmah sometimes catching the following exception:
The action 'LatestNews' is accessible only by a child request.
from
Connection: Keep-alive Accept: */* Accept-Encoding: gzip,deflate From: googlebot(at)googlebot.com Host: soldiez.com User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
I have the following action declaration (a bit simplified of course)
[ChildActionOnly]
public virtual ActionResult LatestNews()
{
var data = DataManager.CollectNews();
return PartialView( data );
}
and View is called like that:
<asp:Content ID="Content1" ContentPlac开发者_运维知识库eHolderID="RightContent" runat="server"><%
Html.RenderAction( MVC.Home.LatestNews() );
%></asp:Content>
I'm wondering how google could find that child action. I have never been deployed version without ChildActionOnly
I would be appreciate for any help!
I wouldn't worry about this too much - the main thing is that the ChildAction attribute is working as expected.
Issues like this are often the result of greedy routes and mistyped links. You could download Glimpse (from nuget) so you can see exactly what routes are being matched but this won't help you find links that may have been mistyped (perhaps pointing to your child action).
AFAIK, Google Bot does not know anything any server language jargons. He only send a request to your server and then play with the returned response(which just include Html, js etc). He does not know about the url of your child action unless you have manually expose it.
精彩评论