2

I'm new to React, so please bare with me.

I have made a simple ASP.NET Web Forms project that successfully opens a page in React. My next question is, is it at all possible to open a new popup from the React-page with the content of an ASPX-page, and in some way communicate between the 2 pages?

Scenario:We have bought access to a simple layout designer, made with React, that we want to feed JSON with different settings. These settings, however, are currently coming from a ASP.NET Web Forms page (hosting an ASCX control) which is generating the JSON. Is this scenario completely impossible? Maybe we can use a service to communicate between the two, but its important that this 3rd party designer (which through the developer of this, has access to implement custom features, like opening a popup or similar) can open a settings-popup we have created in ASP.NET Web Forms.

If this is too complicated, any ideas would be appreciated to how we can accomplish this. For example, are iframes still a thing? Or are there new technologies that works better? (In case we need to host a page outside the React project, that communicates back).

I hope my explanation is understandable, otherwise let me know, and I'll try to elaborate.

Hope you can help, thank you in advance!

For clarification, we have hired the developers of the 3rd party software to help us implement the solution, React-wise, so I just need to find out what the possibilities are in regards to the integration of the 2 worlds.

1 Answer 1

3

be it bootstrap, jQuery + jQuery.ui dialogs, or react? They all should work. however, what you can't do in ALL cases is allow ANY postback in that dialog form you displayed. Once you do a postback- then the page cycle starts and it blows out the dialog form.

And this issue is not really limited to webforms, but that of you now having to avoid post-back when such dialogs are displayed. Of course while web forms are somewhat legacy today, they are VERY nice in how easy it is to wire up controls and their events to code behind.

Needless to say, adopteding one of these frameworks that has all those great dialogs and widgets? They sure are nice, but now it means you having to write ajax calls and avoid post-backs - and that can be a lot of work. So while even jQuery.UI can load a WHOLE different aspx page into a div and pop it up? (and it works VERY well). Well, ok, you now have that cool differnt page as a dialog popup form, but you can't fire any post-backs via standard asp.net buttons and controls when you do this. And as noted, this issue is not really limited to asp.net web forms, but only that webforms obvsilty encouraged a LOT of post-backs with code behind. The amount of round-trips from those post-backs is costly, but HUGE savings in time to write such code with great ease.

You could try a dialog form with a update panel surrounding the controls that do cause post-backs. So, in web forms, the VERY thing that was you friend and resulted in GREAT ease of coding is now your very same enemy. (that enemy being lots of post-backs and round trips).

So, you have to give up a LOT of code and forms that do postbacks simply can't be shoved and dropped into say some popup dialog form, since that form VERY likely had a lot of post-backs - and they will collapse that dialog and start the round trip process.

As long as you keep the above in mind? Then adopting bootstrap, jQuery.UI dialogs or react should work just fine - but you be spending lots of time writing out ajax calls, and those calls to code behind will NOT have use of the textboxes and controls on the form - since they are sill sitting on the browser + users desktop and do not come along for the ride when you make the ajax calls to the server side code.

Sign up to request clarification or add additional context in comments.

2 Comments

Hi Albert. Thank you very much for taking the time to reply. I know the shell of the project (ASP.NET Web Forms) is legacy and the whole postback-scenario it works around, will mess up the integration between React and Web Forms. I'm most likely just going to serve up a prerendered page (from the initial load of the asp.net form) in a popup. When saving/loading, its going to be done through AJAX via JSON which in turn shouldnt cause any postbacks. Since yesterday I've come to the somewhat conclusion (as you point out) that this will be possible. Please do let me know if I'm mistaking.
it really not a lot to do with asp.net and webforms, but only webforms tended to do a lot of post backs and thus that made things "easy". So adopting these frameworks really applies to any browser code and system you have - post backs will tend to blow out those dialogs. Issue not really limited to asp.net webforms. It a question of how you want to do things and spending all that extra time wiring up these things - you have to do that extra work with any of these frameworks. But, these frameworks came into being to help reduce the workload - but they still increase your costs by a lot.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.