Get Bad Request error

Sep 17, 2010 at 8:45 AM

hi, i have a webform where i placed the jiffycms textbox. framework 4.0 vs2010 . i got a bad request error .

i put in the webconfig

<

 

httpRuntime requestValidationMode="2.0"

/>

and on the page

ValidateRequest="false"

but it doesn't work . how can i insert pictures in the textbox and get no errors?

Coordinator
Sep 17, 2010 at 12:53 PM

Hello, I'm unable to reproduce this problem you describe. Try downloading the samples project and see if that works for you. Right now according to your post, you have already taken the right steps and you shouldn't be having the issue you describe. If you find out the problem let me know and i'll fix it asap.

Also, I have rebranded jiffycms to Typps and made several releases since. Try and download the latest version, if you have not already.

Thanks for reporting,

Alessandro

Coordinator
Sep 19, 2010 at 7:58 PM
Edited Sep 19, 2010 at 8:00 PM
thomas_klinger wrote:

hi, i have a webform where i placed the jiffycms textbox. framework 4.0 vs2010 . i got a bad request error .

i put in the webconfig

<

 

 

httpRuntime requestValidationMode="2.0"

/>

and on the page

ValidateRequest="false"

but it doesn't work . how can i insert pictures in the textbox and get no errors?

 

perhaps I should have mentioned this earlier but it slipped my mind. As asp.net 4.0 introduces some breaking changes when running in IIS7 integrated mode, it might throw a fit because we are registering the handlres in both IIS6 and IIS7 ; you can tell ASP.NET that this is OK by adding the following setting in your web.config file :

 

<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
</system.webServer>

 

This setting is important, which you may have missed. If the app pool your application is running in, is infact IIS7 integrated mode ( instead of classic mode) then you need to make this setting. Let me know if this is the problem. Full sample web.config is below :

 

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
	<system.web>
		<pages theme="classic">
		</pages>
		<httpRuntime requestValidationMode="2.0"/>
		<compilation debug="true" targetFramework="4.0">
		</compilation>
		<httpHandlers>
			<add verb="*" path="typps.axd" type="Typps.WebResourceHandler"/>
		</httpHandlers>
	</system.web>
	<system.webServer>
		<validation validateIntegratedModeConfiguration="false"/>
		<handlers>
			<add verb="*" path="typps.axd" type="Typps.WebResourceHandler" name="WebResourceHandler" preCondition="integratedMode"/>
		</handlers>
	</system.webServer>
</configuration>

 

Sep 20, 2010 at 11:55 AM

hi ale55andro, many thanks for your help. with download the latest Typps Version and your Code above now it works correct under Framework 4.0 :)
is that correct that the upload button is an extra button out of the image browser dialog?
or how can i implement the image upload to the image browser?

 

Coordinator
Sep 20, 2010 at 12:10 PM

Hi Thomas, Yes, you must enable the upload functionality first. Basically the image picker is exposed as a complex property of the control. Declaratively, you can attempt the following :

<t:Editor ID="Editor1" runat="server">
        <EmbeddedImagePicker ID="ImagePicker1"
            ImageUploadEnabled="true"
            OnImageUploaded="Editor1_ImageUploaded" runat="server">
        </EmbeddedImagePicker>
    </t:Editor>

Note above ImageUploadEnabled="true" and the event handler that will fire when someone attempts to upload an image. There will be no postback, so you must do whatever you plan to do with the uploaded file in this event handler, so :

protected void Editor1_ImageUploaded(object sender,
        UploadedImageFileEventArgs e)
    {
        //grab the uploaded image and do something
    }

Everything in the following document concerns the image picker and can be applied in the same way : http://docs.typps.com/2010/08/image-picker.html#uploadingimages

Alessandro