WebBrowser inside Asp.net mvc website - asp.net-mvc

I have an asp.net mvc website and inside a page, I would like to have a WebBrowser to browse other sites.
Is it possible ? OR at least to display a single external Webpage without leaving my page...
If yes, what is the best way to do it ?

ASP.NET MVC is an Web Project. not a native Application.
If you want to insert a WebBrowser, use Iframe tag in view page.
<iframe src="http://somewebsite.com/path/to/show" width="100" height="100"></iframe>

Related

MAUI Blazor - Use Webview as component

I have a MAUI .NET6 application with blazor pages and components, and I would like to display a kind of web browser inside a page, in order to display some internet content.
I tried to use the BlazorWebView, but I couldn't figure out how to use a XAML component inside a blazor component.
For now I have an iframe, but some internet content is blocked. I would like to have like a real browser.
Have you some ideas how to achieve this ?
You cannot embed XAML inside of Razor pages. Whenever you are inside of a BlazorWebView you will need to find a "web way" to fix whatever you're doing. So that would indeed be an iframe or something like that.
Another way around it would be to navigate to a .NET MAUI native page and show a WebView on that, but seeing how you describe things, that is not what you want.

Integrating VUE to the exsiting mvc razer page application

I have an existing MVC razor page application. From the home page that is implemented in MVC razer page when I click on login button other pages I need to implement in the VUE JS . How can do that ? How do I put link to the vuejs component.
If you want the login button can link to a vue component, it should be in a Vue Instance, then use vue router to do the redirection.
But if you want to have a single page application, and mixing asp.net mvc views with vue.js is not a good idea. Eventually, you will face many problems. It could be better implement web api services with dotnet core and vue as the client

MVC empty WebSite project based on aspx pages

In Visual Studio we have a two ways that create the web projects.
I create the "WebSite" project, empty-project (like: File -> New -> WebSite... and so on).
After that, when the WebSite created I want to make it to MVC WebSite with ASPX, and not Razor pages.
[I decide create the MVC WebSite not Project Site, with this way, because the Visual Studio doesn't provide us WebSite with MVC template based aspx pages].
After creating some pages I want to create and integrate any Razor page.
Describe for question:
IF I attempt use in the Razor view page - " #model MyWebSite " it does not discovering, and I can't use with the ViewBag property later
Question:
What Can I do ?
What NuGet packeg I need install or what dll recourse I need adding to Bin folder of project.
Yes, you can use Razor with an existing ASP.NET WebSite. Simply open your website using the WebMatrix tool and start adding CSHTML files. One caveat is that if your website is using WebForms controls the WebMatrix tool will not provide any help working with them in existing aspx pages. Additionally, Razor does not support WebForms so you will not be able to add something like to a CSHTML file.

MVC - Opening an asp.net page from the controller

I don't know if this is possible.
Can I have a mvc controller open a popup asp.net page? The asp.net page is within the mvc application, it's basically to run a crystal report viewer.
What happens just now is the mvc view loads and lists reports, then when a report is clicked it launches and exports to pdf. We now want this embedded in a web page instead of exporting to pdf(for various reasons one being no local download of the pdf report).
So sfter reading up i came across the solution to use a folder within the mvc app and use a webform in there. Now I'm trying to find how to open the .aspx pop-up from the controller where the report viewing is initiated.
Does that make any sense.
Any links/help is appreciated
Controllers in ASP.NET MVC are not supposed to open popups. You could do this using javascript inside the view. The window.open javascript function could be helpful:
window.open('/report.aspx', 'report');

Using ReportViewe Control in asp.net mvc

I'm asp.net mvc for my project and now I have to show a couple of reports using the ReportViewer control. I need to specify a couple of properties before rendering the report ie. ReportServer Url.
Is it possible to achieve this using asp.net mvc?
You can't use reportviewer control in asp.net mvc because it needs postbacks.
But you can use it to generate an image and show it (some googling should give you results about how to accomplish that).
Another option - you can make a hybrid application (web forms + mvc).
And another option - you can try javascript charts. Google charts looks good for example.

Resources