I’m trying to use GridWeb in .net 6 but I’m having issues with some libraries. does Aspose.Cells.GridWeb supports .net 6?
@nagasivaos
yes ,GridWeb can work in .net 6 and .net 7.
please try the .net6 demo from the below link:
also you need to check the dev tips here:
you can also try Aspose.Cells.GridJs for build web application
if you still meet any issue feel free to contact us.
Does it Asp.Net core web app with Razor pages? Getting below issue when trying to use ImportExcelFile
image.png (26.1 KB)
This documentation is for .Net Core Web App with MVC, I’m for .Net Core Web App with razor pages.
@nagasivaos
actually ,in the server side we use the same technology,
for the front side page we can use both MVC or razor pages
can you provide your sample project ,we will help you workout the demo.
@nagasivaos
first in the Aspose_Demo_RazorPages.csproj you need to set the TargetFramework to net6.0-windows7.0
then the compile will be successed.
then keep go on.
spare us some time
we need to get some knowlege on how to use model and controller in razor pages.(from mvc to razor page)
@nagasivaos
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSNET-54548
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
The issues you have found earlier (filed as CELLSNET-54548) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi
@nagasivaos
Please check this sample project. Most steps are same as in MVC example, however there are some differences of usage in razor pages itself.
GridWeb.net6windows_Demo_RazorPages.zip (1.5 MB)
Here, we can now use nuget to get latest v23.11.0 package for GridWeb.
Thank you @peter.zhou ,
I was able to use aspose cell gridweb with razor pages. However, I’m trying to add one button on the UI, and trying to handle button click event. But the button click is event is not getting fired. If I remove GridWebDiv from .cshtml, then the button click event is fired. Attaching the code sample? can you please help with this issue?
@nagasivaos
we have already set gridweb post action in Controllers/GridController.cs
the update for cell is ready itself.
[HttpGet("acw/{type}/{id}")]
[HttpPost("acw/{type}/{id}")]
public IActionResult Operation(string type, string id)
{
return Aspose.Cells.GridWeb.AcwController.DoAcwAction(this, type, id);
}
so you need not wrap form action in it .
you just wrap form action in the button .
<form method="post" asp-page-handler="UpdateNotificationPreferences">
<div style="margin-top: 20px; margin-left:300px">
<button>dopost</button>
</div>
</form>
you need to trigger OnGet() first to get mw initialized ,then the post will be ok
Thanks @peter.zhou ,
This works. However, My requirement is, on click of button I need to get the updated gridweb reference. But with this button click approach, I’m not getting the mw ref (it is not posting back and mw is setting to null). And also, how do I customize the Save button which is part of GridWeb to write the custom logic. For ex:-, on clicking of Save, I need to save the updated excel to some storage(blob storage in my case). As of now, if I click on Save it is downloading the update excel.
If we can customize the Save button to save it to file storage, then I can load the the excel from the file storage on the external button click. So can you please help on how to save gridweb to file storage on Save button click. ? Save button click is simply downloading the updated excel
@nagasivaos
GridWeb is not model binded .so we cannot directly get it instance from post method.
We will provide the workaround .
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSNET-54608
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Please try this hotfix.we will release official build in the next month.
gridweb.net6.23.11.1.zip (6.5 MB)
we add GridWeb.RestoreBySession method
please check the below code:
public void OnPost()
{
// do something with mw (GridWeb reference).
//Console.WriteLine("message is:" + Message + " ischeck:" + this.Notify);
mw = new Aspose.Cells.GridWeb.GridWeb();
mw.Width = Unit.Pixel(800);
mw.Height = Unit.Pixel(500);
//use this method to restore GridWeb instance
mw.RestoreBySession(HttpContext.Session);
string a1v = mw.ActiveSheet.Cells["A1"].StringValue;
string a1v2 = mw.PictureCachePath;
//do your job to save storage here
//mw.SaveToExcelFile
}