Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
When GridWeb session mode is ViewState, it stores its temporary session files inside the Application Base Directory. Sometimes, it is not OK to store temporary session files there because the Application Base Directory might not have write permission on it. In such cases, GridWeb throws an exception.
[UnauthorizedAccessException: Access to
the path 'D:\inetpub\wwwroot\AsposeExcelTest\gwb_tempGridWeb1' is denied.]The solution to the above problem is to give write access to the Application Base Directory or change the GridWeb temporary session files path to one that has write access using the GridWeb.SessionStorePath property. This path should be relative to the Application Base Directory.
The following sample code specifies the path where GridWeb stores temporary session files.
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.
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()
});
}
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.