Integration with ASP

149 views
Skip to first unread message

Biby

unread,
Dec 16, 2010, 2:36:01 PM12/16/10
to PaintWeb discussions
Hi
I got some doubts with the PaintWeb integration

1) Is it possible to integrate PaintWeb with classic ASP projects or
any asp.net projects
2) I tried to integrate it with my classic ASP project and I got error
message like " Demo: PaintWeb initialization failed." and " Error:
Failed loading the configuration file."

Could you please help me to integrate it with my classic ASP web
application. I tried to run the demo from my site and it also shows
the same error message.


Following is the sample code that I used from your site


<!DOCTYPE html>
<html lang="en">
<head>

<title>PaintWeb simple demo</title>


<!-- $URL: http://code.google.com/p/paintweb $
$Date: 2010-06-26 22:58:27 +0300 $ -->
</head>
<body>

<p><img id="editableImage" src="PaintWeb/demos/freshalicious.jpg"
alt="Freshalicious"></p>

<p><button id="buttonEditImage">Edit image!</button></p>

<div id="PaintWebTarget"></div>

<script type="text/javascript" src="PaintWeb/build/paintweb.js"></
script>

<script type="text/javascript"><!--
(function () {
// Function called when the user clicks the "Edit image" button.
function pwStart () {
document.body.insertBefore(loadp, btn.parentNode);

timeStart = (new Date()).getTime();


pw.init(pwInit);
//alert (pw.config.configFile);
};

// Function called when the PaintWeb application fires the "appInit"
event.
function pwInit (ev) {
var initTime = (new Date()).getTime() - timeStart,
str = 'Demo: Yay, PaintWeb loaded in ' + initTime + ' ms! ' +
pw.toString();

document.body.removeChild(loadp);

if (ev.state === PaintWeb.INIT_ERROR) {
alert('Demo: PaintWeb initialization failed.');
return;

} else if (ev.state === PaintWeb.INIT_DONE) {
if (window.console && console.log) {
console.log(str);
} else if (window.opera) {
opera.postError(str);
}

} else {
alert('Demo: Unrecognized PaintWeb initialization state ' +
ev.state);

return;
}

img.style.display = 'none';
btn.style.display = 'none';
};

var img = document.getElementById('editableImage'),
btn = document.getElementById('buttonEditImage'),
target = document.getElementById('PaintWebTarget'),
loadp = document.createElement('p'),
timeStart = null,

// Create a PaintWeb instance.
pw = new PaintWeb();

pw.config.guiPlaceholder = target;
pw.config.imageLoad = img;
pw.config.configFile = 'config-example.json';
loadp.appendChild(document.createTextNode('Loading, please
wait...'));


if (btn.addEventListener) {
btn.addEventListener('click', pwStart, false);
} else if (btn.attachEvent) {
btn.attachEvent('onclick', pwStart);
} else {
btn.onclick = pwStart;
}
})();
--></script>

</body>
<!-- vim:set spell spl=en fo=tcroqwanl1 tw=80 ts=2 sw=2 sts=2 sta et
ai cin fenc=utf-8 ff=unix: -->
</html>



Thanks,

MC

unread,
Sep 16, 2012, 2:25:31 PM9/16/12
to pain...@googlegroups.com
Hi,
 
I have the same issues and initialization errors. Was there ever a resolution to this? If so, can you post it? I'm using classic ASP on IIS 7.5. Thanks.

Dhanashri Kulkarni

unread,
Sep 17, 2012, 5:02:53 AM9/17/12
to pain...@googlegroups.com
you have to perform some IIS settings to enable java components or something like that in it..
it worked for me. I will check and send the link

--
You received this message because you are subscribed to the Google Groups "PaintWeb discussions" group.
To view this discussion on the web visit https://groups.google.com/d/msg/paintweb/-/JrlDWvomHxgJ.
To post to this group, send email to pain...@googlegroups.com.
To unsubscribe from this group, send email to paintweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/paintweb?hl=en.



--
Dhanashri

Dhanashri Kulkarni

unread,
Sep 17, 2012, 6:52:32 AM9/17/12
to pain...@googlegroups.com
Try this:
the settings are as follows: 

IIS7 configuration to support JSON


IIS7 configuration to support JSON:
Using IIS manager: clock on IIS server (the main node on the left - where you see the machine name)
  1. Add ‘json’ MIME Type
  • Double click on ‘MIME Types’ icon
  • Click ‘Add…’ link (under Actions section on the right side)
  • In ‘Add MIMI Type’ window type:
File name extension: .json 
MIME type: application/x-javascript
  • Click OK, You should see the .json MIME Type added to the list of the MIME Types list.
2. Add Script Map Handler for ‘json’ MIME Type
  • Double click on ‘Handler Mappings’ icon
  • Click on ‘Add Script Map…’ link (under Actions section on the right side)
  • In ‘Add Script Map’ window type:
Request path: *.json
Executable: C:\Windows\System32\inetsrv\asp.dll
Name: JSON
  • Click OK (Message box pops up with a message: Do you want to allow this ISAPI extension?...etc ) Click Yes, You should see the .json extension added to the list of the Handler Mappings list

IIS6 configuration to support JSON:
Using IIS manager
  1. Add ‘json’ MIME Type
    • On the main IIS server right click and select ‘Properties’
    • From ‘Properties’ window in ‘MIME Types’ section click on ‘MIME Types’ button.
    • From ‘MIME Types’ window click on ‘New…’ button
    • In ‘MIME Type’ window type:
Extension: .json 
MIME type: application/x-javascript
  • Click OK, You should see the .json MIME Type added to the list of the MIME Types.
  • Click OK to the ‘MIME Types’ window
  • Click OK to ‘Properties’ window
2. Add Application Extension for ‘json’ MIME Type
- On the ‘Default Web Site’ (or the site where you want to enable json for) right click and select ‘Properties’.
- From ‘Properties window’ select ‘Home Directory’ tab if not selected.
- Click on ‘Configuration…’ button.
- From ‘Application Configuration’ window select ‘Mappings’ tab if not selected.
- From ‘Mapping’ tab click ‘Add…’ button.
- In ‘Add\Edit Application Extension Mapping’ window type:
Executable: C:\WINDOWS\system32\inetsrv\asp.dll
Extension: .json 
Select ‘All verbs’ on ‘Verbs’ radio button selection. 
Check ‘Script engine’ and ‘Verify that file exist’ check boxes then click OK, You should see the .json extension added to the list of Application extensions.
- Click ‘OK’ to ‘Application Configuration’ window this will open ‘Inheritance Overrides’ window click ‘OK’ then click ‘OK’ on the Properties window. 
Important Note:
Make sure you have Active Server Pages Allowed in the Web Service Extensions section of your IIS configuration.
IIS6:
IIS6 Manager -> (local computer) -> Web Service Extensions -> Active Server Pages
Then click ‘Allow’ button.


IIS7:
1. from IIS7 manager click on the computer name item on the left 
2. click on “ISAPI and CGI Restrictions” icon (in IIS section) 
3. the “ISAPI and CGI Restrictions” window will show then make sure the ‘Restriction’ for ‘Active Server Pages’ is ‘Allowed’

------------------------------------------------------------------------------------------------
Sorry I could not find the settings for IIS 7.5
I hope this will solve your problem. have a nice day.
:)
--
Dhanashri

MC

unread,
Sep 17, 2012, 6:01:30 PM9/17/12
to pain...@googlegroups.com
 
Dhanashri,
 
Thank you for this. Your instructions are the resolution to the ASP problem. The issue was JSON mime type and handler not being set in IIS as ASP was already enabled.  Paintweb now works on my IIS 7.5 server.
 
Best regards.

Dhanashri Kulkarni

unread,
Sep 18, 2012, 5:30:02 AM9/18/12
to pain...@googlegroups.com
My  pleasure...

Regards,
Dhanashri Kulkarni.

Software developer, Manorama Infosolutions pvt. ltd.
Tarabai park, Kolhapur, INDIA.

To view this discussion on the web visit https://groups.google.com/d/msg/paintweb/-/f5-OQWoO6FgJ.

To post to this group, send email to pain...@googlegroups.com.
To unsubscribe from this group, send email to paintweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/paintweb?hl=en.



--
Dhanashri

Reply all
Reply to author
Forward
0 new messages