We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Acwmain is undefined help

I have an ASPX page that is part of a much larger web application. I am trying to get Aspose.Cells GridWeb working on this ASPX page, but keep encountering the "acwmain is undefined" error.

I have created a virtual directory "/acw_client" that points to the physical location where the acw_client folder is located within the larger web application. I can successfully access one of the htm files located there so I know the virtual directory is setup correctly.

I added the 3 appsettings to the web.config file in this larger web application. I verified they are set by reading them from the C# backend code and displaying them on my ASPX page. They are set as:
aspose.cells.gridweb.acw_client_path = /acw_client/
aspose.cells.gridweb.force_script_path = true
aspose.cells.gridweb.forcepath = true

If I add a script tag like below to the body of my html, the error does not occur:

I should not have to include the acwmain.js script in my html code, right?

I am using version 7.1.1 that I downloaded towards the end of my evaluation on Feb 13.

What else can I check? What possibly is wrong? Are there detailed instructions somewhere for performing this setup?

Thank you very much for your help

Hi,

I have created a sample template project with a single page using GridWeb. It will illustrate how to setup GridWeb and use in your application.

The project used the latest version of Aspose.Cells for GridWeb i.e
Aspose.Cells
for GridWeb v2.7.4.2001



Please download it and run it. Once you successfully run it, import your own existing pages or create new one inside it.

You can find samples in GridWeb documentation and GridWeb offline demos.

  1. Documentation - Aspose.Cells.GridWeb
  2. Offline C# Demos - Aspose.Cells.GridWeb

Please also see the screenshot that defines how to configure your web.config file.

Screenshot:

Yes, I agree that the sample project/solution works great. I can also see that in the demo solution I downloaded and used during my evaluation.


I have updated to the latest version.

Now I want to move the artifacts that are generated from this little project/solution into my larger web application which contains artifacts from hundreds of projects. I have done the following:

* copied Aspose.Cells.GridWeb.dll to the web application’s bin folder
* copied my Page.dll to the web application’s bin folder
* copied my Page.aspx to the web application’s main folder where all the other aspx files are.
* Edited the web application’s web.config file and added the appSettings
* copied the acw_client folder to the web application
* created an IIS virtual directory /acw_client pointing to the actual location of the acw_client folder within the web application.
* restarted the web application through IIS

I again get the error “acwmain is undefined”.

Is there something I missed?

Hi,

Please check if there is a virtual directory named “acw_client” at IIS root.

Alternatively, You can change your configuration as this line:

.

Your site will work fine.

Did that. See the next to last line in my previous post : "
* created an IIS virtual directory /acw_client pointing to the actual location of the acw_client folder within the web application."


I proved the virtual directory is correct by adding a script tag in the aspx file with “src=’/acw_client/acwmain.js’” and seeing that the file was successfully loaded.

What else might I have missed?

Hi,

Did you try the alternative method which I shared in the above post? Please try it and let me know your feedback.

Anyway, I have now forwarded your issue to development team. It will look into your issue and give you advice.

We have logged this issue in our database. Once, we will have some update relating to it, we will let you know asap.

This issue has been logged CELLSNET-40569.

Hi,

From what you said, we found that, you do not need to add js link to aspx file, what you should do is only put acw_client folder to the root directory of the website, put Aspose.Cells.GridWeb.dll to “bin” directory, edit web.config file




<add key=“aspose.cells.gridweb.acw_client_path” value="/acw_client/" />

<add key=“aspose.cells.gridweb.force_script_path” value=“true” />

<add key=“aspose.cells.gridweb.forcepath” value=“true” />


Please note: clear browser cache before retest the website.

We don’t think you have configured “acw_client” directory well, you should check the directory, if the directory shown to browser as the follow format:

http://localhost/acw_client/acwmain.js

then appSetting should be configured as follows:

<add key="aspose.cells.gridweb.acw_client_path" value="/acw_client/" />

If the url format as follows:

http://localhost/website/acw_client/acwmain.js

then appSetting should be configured as follow:

<add key="aspose.cells.gridweb.acw_client_path" value="/website/acw_client/" />

I have done some more investigation on this and I believe my acw_client setting is correct. I base this on the following evidence:

My settings are currently:

Using a browser I can access http://localhost:90/CPM/workstation/client/acw_client/acwmain.js and the download window appears. This tells me I have browser access to the file.

When I encounter the error, the “footer” of the GridWeb contains all the images that come from this same folder (left arrow, right arrow, save, etc). And looking at the page source, I can see the src attribute for those image tags include the acw_client_path defined above.

My question: How is the acwmain.js file loaded?

I have attached a zip file containing a screen shot showing the GridWeb footer images and the actual page source as captured from the browser through View Source.

Hi,

Thanks for your time and feedback.

From the source “DeatilLinesSource.txt”, we did not find any shadow of “acwmain.js” and we think maybe you use a master template process filtered some js file or the client process something by using some HttpHandler or HttpModule

Please supply us a way how can we reproduce the bug.

If you could tell me how your code loads the file acwmain.js, I could look into what may be preventing it.


Thank you very much.

Hi,

I have forwarded your comment to our development team and logged your comment in our database.

We will get back to you asap.

The comment has been logged against the issue id: CELLSNET-40569

In case it helps your developers, I have attached a zip file containing 3 screen shots showing all the handlers we have defined for this web application

Hi,

We have checked the “Handlers.zip” and did not find any custom handlers.

And also we set the website to .net framework 4.0 (the same as your settings), port was set to 90, for the webpage http://localhost:90/TestGridWeb.aspx, it works well and have no javascript error.

So we are unable to reproduce the bug.

Let’s look at what is missing in the final page source. It looks to me like there is a bunch of code inserted right below the form tag:

* the <div class=“aspNetHidden”> section containing 3 input fields
* a script tag below this setting theForm and defining a __doPostBack function
* script tags and link tags where acmain.js, lang_es.js, and the css files are included
* another <div class=“aspNetHidden”> input for __EVENTVALIDATION

This is the code that is missing from my page. What inserts this and how is it inserted? Knowledge of that might help to identify the problem.

Found it!


The form did not include the attribute “runat=server”. Adding this resolved my problem.

Thank you so very much for all your help.

Hi,

Finally. Its great to know that you were able to resolve this problem.

Thanks for sharing this.

It will be helpful for other customers too to know the source of this problem.

Please feel free to ask us any other questions, we will be glad to help you.