Comments on Subsite do not work

Topics: ASP.NET 2.0, Controls
Aug 5, 2008 at 3:47 PM
If I make the BlogEngine.NET 1.4.5 a root website, all is great including comment functionality. However, when setup as a subsite (virdir/application) to an existing web site, everything works great except the comments. The ajax-loader image just sits there 'spinning'- the callback never seems to get invoked.

In firebug I can see the Blog.js file is loaded, and in both IE and Firefox the rest of the ajax features work great.

Is there a BaseSite / RelativeWebRoot that needs to be adapted somewhere, or? Any idea what I can change to get this working?

Best regards.
Aug 5, 2008 at 7:51 PM
Have you tried the Standard theme that comes with the BlogEngine v1.4.5 (that should work) or are you using a custom theme.?

From my experience, the Standard theme shows the Comment area working O.K, but when I loaded my custom theme I got the problems that you have noticed.

I therefore concluded that it had something to do with the CSS properties in style.css of my custom theme.

The way I got it to work was to copy the entire comments section from the style.css in Standard to my custom style.css of my theme, overwrting the existing comments area.(in my style.css file), I then copied all codes found in comments.aspx to my custom comment.aspx (ie: Line 2-12, entire Div section)

Everthing worked fine from there.

If you wish, you can check it out at: www.tekSioux.com

Hope that helps.

Aug 5, 2008 at 8:28 PM
Go to a post, then open Firebug, go to the Net tab, now add a comment. Firebug will show the request/post. Look at the url that the comment is being posted to, is it missing the subdirectory? You can also click on the response in firebug and you can see if there was an exception thrown during execution.
Aug 5, 2008 at 11:56 PM
@teksioux: I copied and renamed the standard theme and only modified a couple color settings. I switched back to the standard theme with no change.

@ joeflateau: Good tip, thanks. Yes, the Response does display an error:
eThe target 'ctl00$cphBody$CommentView1' for the callback could not be found or did not implement ICallbackEventHandler
The post seems to displays all the proper values.
Enter search term or APML url

Administration
__CALLBACKID ctl00$cphBody$CommentView1
__CALLBACKPARAM Tony-|-tony@devnet.superoffice.com-|-devnet.superoffice.com-|--|-tony-|-false-|-false-|-1ba4fe60-9080-403e-9887-32707c0ff8d7
__EVENTARGUMENT
__EVENTTARGET
__EVENTVALIDATION /gibberish
__VIEWSTATE /gibberish
_ctl0:cphBody:CommentView1:ddlCountry
_ctl0:cphBody:CommentView1:hfCaptcha 1ba4fe60-9080-403e-9887-32707c0ff8d7
_ctl0:cphBody:CommentView1:txtContent
_ctl0:cphBody:CommentView1:txtEmail tony@devnet.superoffice.com
_ctl0:cphBody:CommentView1:txtName Tony
_ctl0:cphBody:CommentView1:txtWebsite devnet.superoffice.com


The response header Host value does not contain the subsite - just the parent, but the Referrer url is correct.

Connection close
Date Tue, 05 Aug 2008 22:44:09 GMT
Server Microsoft-IIS/6.0
X-Powered-By ASP.NET
Content-Encoding deflate
x-pingback http://devnet.superoffice.com/blog/pingback.axd
Cache-Control private, no-store
Content-Type text/html; charset=utf-8
Content-Length 193
Request Headers
Host devnet.superoffice.com
User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
Accept text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language en-US,nb-NO;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
Content-Type application/x-www-form-urlencoded
Referer http://devnet.superoffice.com/blog/post/Still-waiting-for-the-next-SDK-Release.aspx
Content-Length 2014
Cookie __utma=82236820.623239798.1196937221.1214569463.1214574149.11; __utma=120984733.1765519917.1201257697.1217945291.1217975968.26; __utmz=120984733.1217790730.24.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); __utmz=82236820.1214574149.11.7.utmcsr=localhost:6666|utmccn=(referral)|utmcmd=referral|utmcct=/sixwebdebug/default.aspx; ASP.NET_SessionId=jdcdhpvlrcrhkeevljmmkqim; __utmb=120984733; __utmc=120984733; .AUXBLOGENGINE=4C1B4... .BLOGENGINEROLES=CqqmPdQRU9P...
Pragma no-cache
Cache-Control no-cache

Any suggestions?
Aug 6, 2008 at 12:47 AM
Right click a comment request/post in Firebug > Net and click "Copy Location" then paste it here, do the same for Request/Response headers and Response Body.
Aug 6, 2008 at 4:05 AM
Tonster, 

Are you using any script compression HttpModule, by any chance?  That would mess up BE.NET comments and cause the behavior you're describing.

Regards,
Dave
Aug 6, 2008 at 8:40 AM
Thanks guys for responding,

@daveburke: No script compression module. This is a vanilla installation, no extras. I even unchecked Enable HTTP compression in Settings to see if that was related, no change.

@joeflateau: 

Location:
http://devnet.superoffice.com/blog/post/Still-waiting-for-the-next-SDK-Release.aspx

Request Headers:
Host: devnet.superoffice.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-US,nb-NO;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Referer: http://devnet.superoffice.com/blog/post/Still-waiting-for-the-next-SDK-Release.aspx
Content-Length: 1904
Cookie: __utmz=82236820.1214574149.11.7.utmcsr=localhost:6666|utmccn=(referral)|utmcmd=referral|utmcct=/sixwebdebug/default.aspx; __utmz=120984733.1217790730.24.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); __utma=120984733.1765519917.1201257697.1217975968.1218006162.27; __utma=82236820.623239798.1196937221.1214569463.1214574149.11; ASP.NET_SessionId=wcs05gey2wpsul3x404oltyr; __utmb=120984733; __utmc=120984733
Pragma: no-cache
Cache-Control: no-cache

Response Headers:
Connection: close
Date: Wed, 06 Aug 2008 07:02:42 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Content-Encoding: deflate
x-pingback: http://devnet.superoffice.com/blog/pingback.axd
Cache-Control: private, no-store
Content-Type: text/html; charset=utf-8
Content-Length: 193

Response Body:
eThe target 'ctl00$cphBody$CommentView1' for the callback could not be found or did not implement ICallbackEventHandler.

When viewing the html source, as the error message states 'ctl00$cphBody$CommentView1' is nowhere to be found. However, _ctl0:cphBody:CommentView1 is. The name of the control is mangled.

BUT, when I setup the site as a root site in IIS, and then add a comment, everything works as expected. The previous target (ctl00$cphBody$CommentView1) is found, and the comment is added accordingly.

Location:
http://localhost:8066/post/Tony-Entry.aspx

Request Headers:
Host: localhost:8066
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-US,nb-NO;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Referer: http://localhost:8066/post/Tony-Entry.aspx
Content-Length: 2118
Cookie: SoCrmCurrentTrayAppInstalled=False; SoCrmCurrentTrayAppInstalled=False; rating=1924b6a8-a7b5-408d-937a-aee890cb8cfa; comment=name=rftgdfg&email=dfg123@df.com&url=&country=
Pragma: no-cache
Cache-Control: no-cache

Response Headers:
Cache-Control: private, no-store
Content-Length: 894
Content-Type: text/html; charset=utf-8
Content-Encoding: deflate
Server: Microsoft-IIS/7.0
x-pingback: http://localhost:8066/pingback.axd
Set-Cookie: comment=name=MyName&email=dfg123@df.com&url=&country=; expires=Fri, 06-Aug-2010 07:29:23 GMT; path=/
X-Powered-By: ASP.NET
Date: Wed, 06 Aug 2008 07:29:23 GMT

Response Body:
1100|/wEWhQECqr/n5gsCyqvt2wMC1eX3owwCruLkxgwC/ubfrwUCwYnNwAkCwYnlwAkCwond3wkCwYm9wAkCwYnpwAkCwYmJwAkCwYmFwAkCwYnd3wkCwImVwAkCwInFwAkCwInZ3wkCwInJwAkCwInd3wkCwInxwAkCwIn5wAkCwIm9wAkCwIntwAkCwInRwAkCu4mVwAkCw4n5wAkCk6vrigECw4nlwAkCw4nxwAkCw4m9wAkCtom9wAkCw4nd3wkCwonhwAkCwonxwAkCxYnBwAkCxYnRwAkCs4mNwAkCxYnJwAkCxYmFwAkCxInxwAkCxImZwAkCxIm9wAkCx4nJwAkCwonJwAkCx4m9wAkCx4nlwAkCx4mFwAkCtontwAkCtonhwAkCtomJwAkCuYmBwAkCuYntwAkCuYnFwAkCuYm9wAkCuYm5wAkCuYnJwAkCronhwAkCuYnlwAkCuYmFwAkCuInpwAkCuIm1wAkCuInxwAkCu4nd3wkCu4nJwAkCu4m9wAkCu4mRwAkCu4nRwAkCuon5wAkCuomNwAkCuon9wAkCuonZ3wkCuomZwAkCuomFwAkCuomJwAkCvYnxwAkCvYnhwAkCvYnZ3wkCvYmNwAkCvYmFwAkCvYnV3wkCvYntwAkCvYn5wAkCvIm1wAkCvInlwAkCvInd3wkCvImZwAkCvInRwAkCvInxwAkCv4npwAkCron5wAkCronZ3wkCw4ntwAkCronJwAkCromVwAkCronlwAkCromFwAkCvYnBwAkCrom9wAkCsYn5wAkCromVwAkCsInxwAkCsImJwAkCsImRwAkCs4n5wAkCs4ntwAkCw4mBwAkCs4nRwAkCs4nhwAkCs4mZwAkCqIn5wAkCxYmBwAkCuonhwAkCs4nJwAkCw4mVwAkCs4nZ3wkCsomRwAkCsomdwAkCsomVwAkCsomFwAkCsontwAkCsom9wAkCsonpwAkCwYnJwAkCtYn5wAkCx4n9wAkCtYmBwAkCtYnZ3wkCtYnd3wkCtInJwAkCtIntwAkCqYnJwAkCqImRwAkCubT85wMC76m9yAyHQqDm0bS6zaHbOLdkZhGVYVxnIA==

<div id="id_73f819c0-4e78-45f0-acbb-3ff2ac62773a" class="vcard comment">
  <p class="date">8/6/2008 3:29:23 AM <a href="#id_73f819c0-4e78-45f0-acbb-3ff2ac62773a">#</a></p>
  <p class="gravatar"><img class="photo" src="   <p class="gravatar"><img class="photo" src="http://www.gravatar.com/avatar/c8e65d3529b5e78184f6ef6ba4f042ed.jpg?s=80&amp;d=wavatar" alt="MyName" /></p>
  <p class="content">My Comment Test</p>
  <p class="author">
    <span class="fn">MyName</span>
   
   
  </p>
</div>

Any thoughts on why the subsite mangles the control id? The site (host as a subsite) is accessible if you want to look at it further.

Thanks for your assistance, any more suggestions very welcome.

Best regards.

Aug 12, 2008 at 7:11 PM

dasBlog does not suffer from this problem, so goodbye blog engine :(, hello dasBlog.

Best regards.

Nov 21, 2008 at 1:47 PM
Guys,

This thread http://www.codeplex.com/blogengine/Thread/View.aspx?ThreadId=36899 shows a solution for this issue. Check it out !

Bye,

Bruno Caimar