Specify the path where GridWeb stores temporary files

About file cache

Specify the path where GridWeb stores temporary session files

The following sample code specifies the path where GridWeb stores temporary session files.

About picture cache

When there are shapes/pictures in the worksheet, GridWeb will save all the shapes/pictures to a cache path.
The default cache path is System.Web.HttpContext.Current.Server.MapPath("/acwcache").
You can also use GridWeb.PictureCachePath to set this path to a specific location.

When we open a page, GridWeb will resolve the request image URL and get the image stream from the cache by the URL ID.

For example, if your page address is http://ip/mygridwebapp/test.aspx, the image request URL generated by GridWeb will be http://ip/mygridwebapp/test.aspx/acw_image/imageid.

Sometimes the shapes/pictures are not loaded when you use Friendly URL

You need to check the image URL request.

The normal image request should be like: http://ip/mygridwebapp/test.aspx/acw_image/imageid

but your request goes like this: http://ip/mygridwebapp/test/acw_image/imageid.

If you use Friendly URL, you need to filter out the image URL request for GridWeb. Thus the GridWeb control server can get and resolve the request and find the image stream from the cache path.

For example, we assume your page URL is like this: http://ip/mygridwebapp/test.aspx

Then the code below is a workaround to fix this issue.

// Write your custom URL resolver: MyWebFormsFriendlyUrlResolver
public class MyWebFormsFriendlyUrlResolver : WebFormsFriendlyUrlResolver
{
    public MyWebFormsFriendlyUrlResolver() { }

    public override string ConvertToFriendlyUrl(string path)
    {
        if (!string.IsNullOrEmpty(path))
        {
            // Filter your GridWeb‑related page; here we use 'mygridwebapp' to identify
            // as we assume your page is: http://ip/mygridwebapp/test.aspx
            if (path.ToLower().Contains("mygridwebapp"))
            {
                // Here the filter code
                return path;
            }
        }
        return base.ConvertToFriendlyUrl(path);
    }
}

// In RouteConfig.cs set the custom URL resolver: MyWebFormsFriendlyUrlResolver
public static class RouteConfig
{
    public static void RegisterRoutes(RouteCollection routes)
    {
        var settings = new FriendlyUrlSettings();
        settings.AutoRedirectMode = RedirectMode.Permanent;
        routes.EnableFriendlyUrls(settings, new IFriendlyUrlResolver[] {
            new MyWebFormsFriendlyUrlResolver()
        });
    }
}