Attempting to create web-based version of application with VS

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
ThomasWYale
Posts: 43
Joined: Thu Jun 20, 2019 5:19 pm

Attempting to create web-based version of application with VS

Post by ThomasWYale »

Please forgive my ignorance. Though I have viewed Robert's video "Beginner Level: New features in the X# support for Visual Studio," I'm afraid it assumes prior background with Visual Studio, which I do not have. I suppose the best way to explain things is to list separate issues one by one. Also, the forum doesn't permit me to insert images within the text, so I include them at the end.

1) My goal is to create a version of an application, which I have successfully migrated from VO 2.8 to X#, which run online from a web page. My application has 88,035 lines of code, consists of a main dialog window from which a total of 68 different forms can be opened (of course not all at one time), has 4 DB servers, and opens a maximum of 138 DBF's with a maximum of 215 indexes—all of which should give you a good idea how enormous it is. (First image is a screenshot of the main interface)

2) Another forum commenter told me that I need to draw aspx pages, presumably to build forms identical to those in my application, with the same kind of controls (comboboxes, treeviews, listviews, et al). ASP seems to be associated with Web Forms. So to this end, I have upgraded from Windows 7 to 10 to install Visual Studio 2022, and merely assumed that I should install the workload "ASP.NET and web development". I did so and selected what I thought would be the necessary options as shown in the following screenshot. (Second image is a screenshot of the options I selected in the installer)

3) I then created a new project using "ASP.NET Web Application (.NET Framework)" project type. I merely assumed—and of this I admit that I'm totally wrong—that there would be something like a form designer as found in VO and X#, but the Toolbox was empty. At this point, I'm totally at sea. I have no idea what to do, or what options to choose. (Third image is of the VS interface with the project open)

4) The forum commenter also advised me to have the aspx pages "recall" the logic placed in DLL's. As far as the logic goes, this is somewhat vague. Does it include all classes and their methods, and everything else minus all references to forms and dialogs, while retaining methods for mouse, window, control, menu, treeview and listview events, as well as pushbutton clicks? To do this, would it be advisable to create another project specifically for this purpose in X#? And how is this content placed in a DLL (which I also assume is through X#)?

I'm not even sure whether something like this could be done with an application of this magnitude. If not, perhaps I can publicize and market my software in a way other than from a web application, and try to motivate potential users to download it to their own machines, despite that a web-based version seems to be preferable.
Attachments
VS.jpg
VS.jpg (57.01 KiB) Viewed 569 times
VS Installer.jpg
VS Installer.jpg (107.04 KiB) Viewed 569 times
Discovery interface.jpg
Discovery interface.jpg (56.66 KiB) Viewed 569 times
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Attempting to create web-based version of application with VS

Post by ic2 »

Hello Thomas,

First of all, you have multiple options to create web-based programs. We have always used CGI, which basically means that a VO or X# exe produces HTML pages which are issued. When a user presses e.g. a button, a new resulting HTML page is created and issued. Advantage is that the business logic can closely resemble that of a desktop/server app. Disadvantage is that not every hosting company allows exe's to run, but you can solve that with a VPS for example. And you will need a Windows server.

I've also create one small ASPX web program earlier. You will need a Windows server for that too. It looks like you did not start with a APSX project. I created a solution and added a ASP project searching ASP C# and got this:
ASPXSample1.jpg
ASPXSample1.jpg (13.81 KiB) Viewed 569 times
Or, adding a project to an existing solution, like this (2nd option, Web Form)
ASPXSample2.jpg
ASPXSample2.jpg (38.68 KiB) Viewed 569 times
Once you have the project in your solution Explorer it looks like this
ASPXSample3.jpg
ASPXSample3.jpg (35.61 KiB) Viewed 569 times
I double click on Default.aspx and make sure that I click Split below the XAML screen code, so I end up with this screen (you'll see the Design/Split/Source options below the screen design view. You can also right click on Default.aspx.designer.cs and open View Designer.

It's only than that you will see, as in the picture, a regular Toolbox. You can add control on the screen and double click them for a code behind method.

It's always a bit of trial & error. As it is VS it's a lot of trial and more error. But eventually you will get something like this:
ASPXSample4.jpg
ASPXSample4.jpg (79.22 KiB) Viewed 569 times
I hope it helps,

Dick
ThomasWYale
Posts: 43
Joined: Thu Jun 20, 2019 5:19 pm

Attempting to create web-based version of application with VS

Post by ThomasWYale »

Thank you for your kind response. I was able to create the ASP.NET Web application as you showed it, and experimented with it, only to inadvertently delete other content when I was trying to delete controls from the Toolbox. In any event, with what was left, I clicked and dragged a treeview, then ran it, but the treeview wasn't visible at all. And there was only event associated with the treeview, TreeView1_SelectedNodeChanged, and no others, such as TreeViewItemExpanding/Expanded/SelChanged/KeyDown as in an X# or VO application. A checkbox worked, anyway.

I have my doubts that pursuing a web app this way, not merely learning how to make these controls visible and working even when I clicked and dragged them onto the form, but it could curtail the functionality of some other controls for lack of those other events. My application uses a few of them.

And I understand the reason behind running the exe directly: ISP's don't want to compromise security.

Ultimately, the VPS seems to be the best alternative. The application at present wouldn't lose any functionality for lack of events that ASP controls seem to lack. Would any VPS suffice? Perhaps this one? https://www.atlantic.net/vps-hosting/
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Attempting to create web-based version of application with VS

Post by wriedmann »

Hi Thomas,
sorry if that may sound harsh: please forget it to transform a VO application to a web based application. It will simply not work.
A web application is a completely different thing and has not only to be rewritten, but also be renewed architecturally (IMHO the same is true for a migration to SQL or a GUI platform like WPF).
Your best bed would be to rent a virtual server running Windows and remote desktop services and use your application there.
I'm afraid there will be some costs for it, either using Windows server or a software layer like AADS or RemotePlus.
But these costs will be a lot lower than a complete rewrite (and we are doing the same, even if the half of our small company is doing web applications so we have the knowledge in-house).
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
ThomasWYale
Posts: 43
Joined: Thu Jun 20, 2019 5:19 pm

Attempting to create web-based version of application with VS

Post by ThomasWYale »

Hi, Wolfgang.

Yeah, Dick made a good point with running it through a VPS or virtual machine on a Windows server. I've already emailed a company that provides VPS cloud services and asked them about it.

Thanks,

Tom
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Attempting to create web-based version of application with VS

Post by ic2 »

Hello Wolfgang,
wriedmann wrote:Hi Thomas,
sorry if that may sound harsh: please forget it to transform a VO application to a web based application. It will simply not work.
A web application is a completely different thing and has not only to be rewritten, but also be renewed architecturally (IMHO the same is true for a migration to SQL or a GUI platform like WPF).
"Screenwise" you are right. Every migration, WPF or a CGI based webprogram, requires every screen to be rewritten, although VO screens to WPF could be done by Paul Piko's Facelift (https://piko.com.au/facelift/).

For CGI you have to "construct" HTML to show any screen/window which is a totally different approach to painting a screen in e.g. X#/VO, Winforms etc. But if the majority of your code is Business Logic then this doesn't need to change at all. Although CGI is not a 'hot' technology it is the easiest way to make a program web based.

Finally, bear in mind that a web application is always a front end and a back end. The front end is pure HTML/CSS (in a CGi program this is produced by the same exe which handles the back end), or JavaScript for example. Popular back end languages are Ruby and Python, but it can be anything, also C# or X#, PHP etc. ASPX is a web development framework and used for both front- and backend. I have used ASPX to build the front end (webscreen) and C# to do the back end (the logic to process the user choices).

Dick
info@task.si
Posts: 31
Joined: Mon Nov 02, 2015 2:08 pm

Attempting to create web-based version of application with VS

Post by info@task.si »

Hi Thomas !
I agree with Wolfgang. Producing "Web" app is totally different thing. Almost one year I am trying to transform VO app to X# and Winforms and at the same time fron X# to web using Blazor frame. Why Blazor ? It is new technoloqy mixing C#, razor and HTML . But Blazor is capable also to use X# DLL (functions, classes writtwn in X#). I can not tell you how much code can be reusable from X#. But if it is 30% than it is reasonable.
Regards, Andrej Terkaj
User avatar
TimothyS
Posts: 58
Joined: Thu Dec 15, 2016 3:39 pm
Location: Australia

Attempting to create web-based version of application with VS

Post by TimothyS »

Hi Thomas,

This is a big job. Have a look at the article Building Web apps - Danilo under Articles/User contributions. Danilo describes how to create a Web Forms app using XSharp code.
I have used his advice and it works. BUT it is pretty much a rewrite.
Putting your app on a virtual cloud server is faster, but will cost you more. This is called a hybrid cloud application and that market is getting bigger.
BTW Tried using Blazor with X#. Worked on beta Blazor, but not the production versions. Looks like we need to wait until X# will run with DotNet 5.
Regards,
Tim
info@task.si
Posts: 31
Joined: Mon Nov 02, 2015 2:08 pm

Attempting to create web-based version of application with VS

Post by info@task.si »

Hi Tim !

I use Blazor also in a real production ( .Net 6 , Visual Studio 2022) . Of course using X# (.net core dialect) as a library in Blazor solutions. I could show you some screen grabs, but they are in slovene language.
I am waiting also for new X# .NET. Hoping soon.
Regards, Andrej
User avatar
kevclark64
Posts: 127
Joined: Thu Aug 15, 2019 7:30 pm
Location: USA

Attempting to create web-based version of application with VS

Post by kevclark64 »

Your application looks pretty specialized, rather than being an application everyone might use. That being the case, one would think that anyone who needed such an application would be quite willing to download it. I realize that if you made it web-based then it would be cross platform and so open up more markets for you potentially. But I can't help thinking that the effort that would go into making it a web app might be more profitably spent on marketing what you already have. Just an opinion.
Post Reply