riganti / dotvvm

Open source MVVM framework for Web Apps
https://www.dotvvm.com
Apache License 2.0
753 stars 97 forks source link

Redirect from dotvvm page to aspx page #1866

Open dhavalcharadva-sf opened 2 months ago

dhavalcharadva-sf commented 2 months ago

Hi Team,

I am converting one of the Web Form pages. And I want to redirect from viewmodel to existing aspx pages until it get converted. But I couldn't do it.

I have used Session.Redirect but its not working correctly.

Could someone tell me correct way?

exyi commented 2 months ago

You cannot unfortunately use WebForms primitives in DotVVM pages, but you might be interested in the adapters package (https://www.nuget.org/packages/DotVVM.Adapters.WebForms). It adds the context.RedirectToRouteHybrid method, which redirect to WebForms or DotVVM route, depending on which one exists. You can also use the context.RedirectToUrl method to redirect to any URL from DotVVM page.

More info about the adapters package is in https://www.dotvvm.com/blog/48/Announcing-DotVVM-Adapters-for-ASP-NET-Web-Forms. I'll leave this open, as we should add a page to the documentation.

dhavalcharadva-sf commented 2 months ago

I have added the nuget package but mentioned extention methods are not exist in context.