jquery ajax in Admin Area not work

Jan 1, 2011 at 9:54 AM

hi

happy new year for team of most popular blogengine team.

i use blogengine 2rc for myblog with sqlserver 2005 and .net 4.0

every thing work and show true but in admin area when i change any thing and click to save button to save post or save setting

first ajax not work and page do post back and after post back dont get any operation successful message and not anything save?

thanks for help

Jan 1, 2011 at 10:02 AM
Edited Jan 1, 2011 at 10:03 AM

and some where in admin area get this eeror message

Error Details: Url : /admin/Widgets/Controls.aspx Raw Url : /admin/Widgets/Controls.aspx Message : A potentially dangerous Request.Form value was detected from the client (ctl00$cphAdmin$txtFormMessage=" ..."). Source : System.Web StackTrace : at System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection) at System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, RequestValidationSource requestCollection) at System.Web.HttpRequest.get_Form() at System.Web.HttpRequest.get_Item(String key) at BlogEngine.Core.Web.HttpModules.CompressionModule.ContextPostReleaseRequestState(Object sender, EventArgs e) in DotNetSlave.BusinessLogic\Web\HttpModules\CompressionModule.cs:line 127 at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) TargetSite : Void ValidateString(System.String, System.String, System.Web.Util.RequestValidationSource)
Jan 1, 2011 at 11:33 AM

i get some javascript error  in ff error console when  i click to save setting button in admin area

Error: this[0] is undefined
Source File: /js.axd?path=Scripts%2fjquery.validate.min.js
Line: 15

but when run locally i dont get any javascript error with same browser

localy run :cassini server

remote run : iis7

thanks

 

Coordinator
Jan 1, 2011 at 7:10 PM

If you switch the application pool to .NET 2.0/3.5, these errors will disappear.  There's also a .NET 4.0 web.config file you can use that is included with BE.  You can see this post with some more details.

The final release of BE 2.0 will include a .NET 4.0 web.config file that will eliminate these errors from happening.

Jan 2, 2011 at 9:24 PM

thanks BenAmada for reply and release v2.0

i change web.config file but i have some quesstion

1- when i change web config to .net 4.0 i must be change project .net version? or leave project version in 3.5?

2- if i change project .net version, i must change booth of project .net version? Core and website or only change website?

3-i change version of project and get membership error for that mermbership exsict in .net 2 and .net 4

4-i leave project .net version in 3.5 and change only web.config for .net 4.0 and get error in web.config in this line: <system.web.extensions>

thanks

Coordinator
Jan 2, 2011 at 9:59 PM

If you're using VS, which it sounds like you're using ... I would still use the .NET 4.0 web.config file that is included in the /setup folder.

After doing that, it would be best to right click on both the Web Site and the Core project to change each of them from .NET 3.5 to .NET 4.0.

When you do this, you may need to add a reference to System.Web.ApplicationServices.  See this post for more details.  That post may clear up some of the other issues you are seeing.

If you use the .NET 4.0 web.config from the /setup folder, that one does not define a <sectionGroup> for system.web.extensions.  This is because in a typical .NET 4.0 application pool, a <sectionGroup> for system.web.extensions is already defined in the machine.config file -- so defining it in your own web.config isn't necessary (it's actually duplication).  But someone here did report that even though they are using a .NET 4.0 application pool, they were receiving an error about system.web.extensions not being defined.  It appears in some environments that may be the case, and you need to manually define the system.web.extensions <sectionGroup>.  If this is the case for you too, I posted a .NET 4.0 <sectionGroup> for system.web.extensions in this post on Nov. 26th.  You can try adding that <sectionGroup> into your web.config file -- if you're getting an error about system.web.extensions not being defined.

Jan 3, 2011 at 10:05 AM

thanks benamada

your answer very completly and useful

my problem resolved

thanks again

Jan 3, 2011 at 11:32 AM

hi

new problem in admin area,

in admin area every thing seem ok but admin/Users/Users.aspx not work properly

when try edit user or add new user and click save button no any thing happen, and not get any script error or server side error,

in manage user profile section same problem, no any error but not working

please help,

thanks

Coordinator
Jan 3, 2011 at 10:09 PM

If you have Firefox and you view the Error Console (Tools -> Error Console), you don't see any errors when clicking the Save button?

Do you have Firebug or Fiddler available?  You could check for errors coming back from the server.

Can you add a new user?

Jan 3, 2011 at 10:43 PM

hi

thanks for reply

in the users page in the admin area i cant do any thing, in the ff error console dont get any error,

but in self registration i can add new user,

no any script error or server side error but no any thing work in users page in admin area

thanks

Jan 3, 2011 at 10:54 PM

thanks i get error detail with firebug

excuse me i dont know firebug can get response error

error detailts:

<html>
    <head>
        <title>Request format is unrecognized for URL unexpectedly ending in '/Edit'.</title>
        <style>
         body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} 
         p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
         b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
         H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
         H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
         pre {font-family:"Lucida Console";font-size: .9em}
         .marker {font-weight: bold; color: black;text-decoration: none;}
         .version {color: gray;}
         .error {margin-bottom: 10px;}
         .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
        </style>
    </head>

    <body bgcolor="white">

            <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

            <h2> <i>Request format is unrecognized for URL unexpectedly ending in '/Edit'.</i> </h2></span>

            <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

            <b> Description: </b>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.

            <br><br>

            <b> Exception Details: </b>System.InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/Edit'.<br><br>

            <b>Source Error:</b> <br><br>

            <table width=100% bgcolor="#ffffcc">
               <tr>
                  <td>
                      <code>

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.</code>

                  </td>
               </tr>
            </table>

            <br>

            <b>Stack Trace:</b> <br><br>

            <table width=100% bgcolor="#ffffcc">
               <tr>
                  <td>
                      <code><pre>

[InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in &#39;/Edit&#39;.]
   System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +518909
   System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +212
   System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +334
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +184
</pre></code>

                  </td>
               </tr>
            </table>

            <br>

            <hr width=100% size=1 color=silver>

            <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

            </font>

    </body>
</html>
<!-- 
[InvalidOperationException]: Request format is unrecognized for URL unexpectedly ending in &#39;/Edit&#39;.
   at System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)
   at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath)
   at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
--><!-- 
This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using &lt;customErrors mode="Off"/&gt;. Consider using &lt;customErrors mode="On"/&gt; or &lt;customErrors mode="RemoteOnly"/&gt; in production environments.-->

Coordinator
Jan 3, 2011 at 11:03 PM

Thanks, this is helpful.  Googling for that error message, it looks like the solution that worked for most people was to add HttpGet & HttpPost protocols to the <webServices> tag.

There's currently a <webServices> tag in the web.config file of BE.  Try adding the <protocols> section, as shown below:

<system.web.extensions>
<scripting>
  <webServices>
	<authenticationService enabled="true" requireSSL="false"/>
	<protocols>
		<add name="HttpGet"/>
		<add name="HttpPost"/>
	</protocols>
  </webServices>
</scripting>
</system.web.extensions>
Jan 4, 2011 at 9:15 AM

thanks for reply

are u sure <protocols> tag exist in web.config in iis7?

because i add this tags and get web.config error in this line?

 

Jan 4, 2011 at 12:16 PM

thank benamada

but <protocols> tag add to <system.web> section and work fine

<system.web>
<webServices>
      <protocols>
         <add name="HttpPost"/>  
         <add name="HttpGet"/>  
       </protocols>
</webServices>
......
</system.web>

but users section have problem again and not work but eroor changed

new error:

System.InvalidOperationException: Request format is invalid: application/json; charset=utf-8.
at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
Jan 4, 2011 at 12:37 PM

i found solution in this link

only add this 2 line to <system.webServer><handlers> section

 

<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />


every thing seems ok

thanks again benamada

 

 

Apr 7, 2012 at 8:13 PM

I just installed the latest 2.5 release of BlogEngine and i STILL had to do these things in web.config...I'm tired of fighting with BE :(

Coordinator
Apr 7, 2012 at 10:37 PM

IIS has several versions that can run on different OSes, latest versions can have different configurations with modules and features that can be enabled/disabled by provider. There is no way we can test BE with all possible variations. What you can do is create a pull request with changes needed for your particular case, then we can make sure they not conflicting with others and include them into common code. That would help everyone.

Apr 7, 2012 at 11:53 PM
rtur wrote:

IIS has several versions that can run on different OSes, latest versions can have different configurations with modules and features that can be enabled/disabled by provider. There is no way we can test BE with all possible variations. What you can do is create a pull request with changes needed for your particular case, then we can make sure they not conflicting with others and include them into common code. That would help everyone.

 

Done - http://blogengine.codeplex.com/SourceControl/network/forks/Qbus/BlogEngineDotNet/contribution/2059

Sorry for sounding so negative in my previous comment...I was just so tired after fighting for hours to make this work :)

I know there can be various versions of the IIS, how it's configured etc.

My Pull Request here really just contains different solutions I have found around on the web for various problems I had with my clean installation.

Coordinator
Apr 8, 2012 at 3:47 AM

Cool, I'll try it out on some common installations and if it won't break anything will add to web.config. Worse case I can add things like this commented out so it is in there as suggestion for people looking for solution.