Hi, we have a WISEJ 3.0 WebApp using an AspNetPanel which opens an ASP.NET MVC website. Whats the best way to transfer a lot of data from Wisej to the model of the ASP.NET website? Any experiences with it or suggestions? Somewhere I read, it could be possible to access the Wisej Session from outside? Might be wrong.
Hi Rene,
Please check-out the sample attached here.
Look at “test.aspx” page, to get the idea about calling Wisej WebMethod from JavaScript.
Also, look at Window1.cs, to see how to define a WebMethod.
For more information about this, please check out this old forum post at: https://wisej.com/support/question/how-to-call-c-function-from-pagesource-javascript
Best Regards and Happy Holidays!
Alaa
Hi Rene,
Thank you for getting back to us!
We’ll look into this and get back to you ASAP!
Best Regards and Happy Holidays,
Alaa
We are integrating an ASP.NET MVC application into our Wisej.NET application using the AspNetPanel component.
Currently, the MVC application, hosted locally, is successfully displayed within the Wisej.NET panel. However, the objective is to dynamically transfer data (e.g., SQL datasets, project file paths, or other parameters) from the Wisej.NET application to the ASP.NET MVC application. Wisej.NET Code (ListLabel_WebDesignerLauncher) Below is the initialization code for the AspNetPanel in our Wisej.NET application:
Wisej.Web.Form F = new Wisej.Web.Form
{
Height = 600,
Width = 800,
Text = “Web Designer”
};
// Create and configure AspNetPanel
Wisej.Web.AspNetPanel P = new Wisej.Web.AspNetPanel
{
Dock = DockStyle.Fill,
PageSource = “http://localhost:11278”
};
F.Controls.Add(P);
F.Show();
Currently, this implementation only loads the MVC application within a Wisej.NET form. Our goal is to dynamically pass data, such as SQL datasets and project file paths, eventually as JSON string, from Wisej.NET to the ASP.NET MVC controller for use in the MVC app.
ASP.NET MVC Code
Here’s the controller action in the MVC application responsible for initializing the Web Designer:
public ActionResult WebDesignerLauncher(string reportRepositoryID)
{
if (!RepositoryItem.IsValidItemId(reportRepositoryID))
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
if (!GetCurrentRepository().ContainsItem(reportRepositoryID))
return Content(“The selected project does not exist”);
IDataProvider dataProvider = GetSqlDataProvider();
var options = new WindowsClientWebDesignerOptions
{
DataSource = dataProvider,
DataMember = “HauptTabelle”,
ProjectFile = @”C:\Path\To\Reports\MyReport.LST”,
ProjectType = LlProject.List,
VariableInitializer = variables =>
{
variables.Add(“RIC.Copyright”, “Firma”);
variables.Add(“RIC.Druckvorlage”, “MyReport.LST”);
// Additional variables…
}
};
return View(“WebDesignerLauncher”, options);
}
The WebDesignerLauncher action accepts a reportRepositoryID parameter to load the corresponding project file, initialize the Web Designer with datasets, and set variables dynamically. ASP.NET MVC View The MVC view renders the Web Designer using the provided model: @model WindowsClientWebDesignerOptions @Html.ListLabelMvcWindowsClientWebDesigner(Model)
Question
What is the best way to dynamically transfer data (e.g., SQL datasets, project file paths, or other parameters) from the Wisej.NET application to the ASP.NET MVC controller? Is there a direct way to set or get session variables? The issue could be solved with an http-Post with a big JSON in body. But it would be nice to have a more direct and efficient way.
Hi Rene,
Would you please provide more information on this matter please?
Best Regards,
Alaa
Please login first to submit.