Aspose.Cells.Grid Web control and MVC for .NET

Hello Aspose Team,

We are considering Aspose.Cells.Grid Web control because we need to show information in web like in Excel but we need to integrate it in a MVC4.net application. In Aspose web we can see there are some video tutorials for using Aspose.Cells with MVC but there isn't anything regarding that particular control, so the question is:

Is Aspose.Cells.Grid Web control compatible with MVC model for .NET?

(There is a reply saying it is not compatible but is from 2011, so I just wanted to make sure https://forum.aspose.com/t/121739)

Thank you in advance,

Maria.

Hi,


Well, I am afraid, the situation is pretty much the same, we think Aspose.Cells.GridWeb control might not work well on ASP.NET MVC due to the differences and hurdles of .NET MVC . Anyways, I have logged a ticket with an id “CELLSNET-42334” into our database for your issue. Our concerned developer may look into it in details if this can be enhanced or supported for the underlying platform.

Once we have any update on it, we will let you know here.

Thank you.

Hi Maria, were you able to get the GridWeb working with MVC?

thanks

Marty

Hi,

Thanks for your posting and considering Aspose.Cells.GridWeb.

We have looked into this issue earlier and concluded:


Every control in ASP.NET inherits from System.Web.UI.Control and have
the RenderControl method. When you want to get the html output of the
control at any point of the page execution lifecycle you can use the
following method.


public string RenderControl(Control ctrl)
{
StringBuilder sb = new StringBuilder();
StringWriter tw = new StringWriter(sb);
HtmlTextWriter hw = new HtmlTextWriter(tw);

ctrl.RenderControl(hw);
return sb.ToString();
}

At this point ASP.NET MVC does not have full support for asp.net controls. Using this trick you can render control's html directly on the view using html helper. While this is good for read-only controls it will not work with controls that require event handling because in ASP.NET MVC by default you are missing the page lifecycle.


For full support, we 'll need to rewrite all the server side code and it is not in our current plan.

Please also see this article.

( Using WebControls In ASP.NET MVC Views – Part 3 - CodeProject )

However, we have also logged your comment in our database for product team consideration and investigation. Once, there is some update for you, we will let you know asap.

Hi,

Thanks for considering Aspose.Cells for GridWeb.

Here is a workaround for integrating GridWeb control into MVC project.

Please check our projects and let us know your feedback.

First Project, use ignoreroute

Navigate to http://localhost:40249/GridWebDemo/WebForm1.aspx

Second Project, it is more mvc way, but we need to set readonly for GridWeb.

Navigate to http://localhost:53708/ViewPage1

but actually if we want to use mvc data model way to cooperate with GridWeb serverside business logic, we need to do more heavy work, as we need to rewrite all the serverside business logic to cooperate with MVC way, so we will put it into schedule in future.

Download link is invalid!

@pswxy1314,

Please find attached both projects for your reference.

Please keep this in mind:
“…but actually if we want to use mvc data model way to cooperate with GridWeb serverside business logic, we need to do more heavy work, as we need to rewrite all the serverside business logic to cooperate with MVC way, so we will put it into schedule in future”.
GridWebInMvc1.zip (962.8 KB)
GridWebInMvc2.zip (505.1 KB)

Hi, Someone please provide a code of aspose cell gridweb in mvc? As I couldn’t found any such code on aspose site or even on github. I need to implement such functionality in my application using aspose.cell gridweb in mvc.

@yamakvakharia,

Please find attached the demo project to use Aspose.Cells for GridWeb in MVC framework for your reference.
GridWeb.asp.netcore.demo.zip (1.1 MB)

While trying to download attached file it give me “Sorry, this file is private. Only visible to topic owner and staff members.” message.

@yamakvakharia,
You may download it from this dropbox link.
https://www.dropbox.com/s/nxe50b1mwadze6u/GridWeb.asp.netcore.demo.zip?dl=0