Open an asp classic frame in a view mvc? - model-view-controller

I need some help about if it's possible to get an asp frame and open it inside a MVC View. I researched this but I didn't find nothing about a solution for this case. So, if some one had this problem to solve and could help me with something I will appreciate. I really don't know if this is possible.

One (and possibly the only?) solution for this would be to use an iframe on the MVC view with a source URL of the classic ASP page. I can't see any other way of doing it as they are two unrelated technologies, so any solution would revolve around making the classic ASP page 'appear' to be part of the MVC page.

You could use System.net.Webrequest to call the classic asp page and then pass that content to the MVC view.

Related

KendoUI Mobile with asp.net mvc

Is it possible to do a KendoUI mobile project, using ASP.net mvc? Watching the introduction on Pluralsight, I'm sort of confused. As an example, KendoUI Mobile uses something like this to navigate:
<a href="#someView" data-role="button">Go to some view</button>
When rendering views through RenderBody in my main layout, will I have to specify this view as a mobile view, or does the application defined in my main layout pick up on this?
So, I guess my question is this; Has anyone got any experience on this combination and, if so, could you provide some resources as to where this combination is being used?
I figured this on out. Seems to be a few projects out there using this combination. One example is this project: KendoUI mobile task manager
That being said, I'll try to play around and tweak the framework to my needs.
The answer is Yes. I was searching for the same answers, and found this resource very helpful, using MVC4, with detailed explanations:
Single Page App using MVC and Kendo Mobile
When searching for references and tutorials, what is not immediately clear is that Kendo UI Mobile is a different setup from Kendo UI. As WhizKid points out it is a single page application, and all your data must go through AJAX.
If you have not used them before, you will probably need to learn Kendo's MVVM and datasources. You must decide what sort of interface you will use for data exchange (eg. WebApi, OData) and fix the routing.
The reason I am going this way is because Kendo comes with good looks, and MVC can help me with localization.

Create custom controls in asp mvc 3

I have to create custom controls in ASP.NET MVC 3. Controls like customized buttons which I will put in DLL and reuse in any project.
Do you know a good way or maybe you can give me a good tutorial to do this.
Thanks.
You can't, WebControls are for Web Forms. In asp.net mvc anything view related(html, javascript, css) is decoupled from the controller. The best you can do is to have helpers which are simply extension methods. But something similar to the webcontrols is specific to web forms only.
This post and this should give you an idea
You would need to use Partial Views to re-use code.
http://rachelappel.com/razor/partial-views-in-asp-net-mvc-3-w-the-razor-view-engine/

Render ASP.NET MVC string to View without HttpContext or ControllerContext?

I need to render an ASP.NET MVC view to a string so as to be able to send it via an email (it is an order confirmation email defined in an .ascx file ).
I've successfully been able to render an ASP.NET MVC View to string using one of the methods in this question.
However now I need to be able to do it via a WCF service (that will be accessed via silverlight) and so I don't have a ControllerContext. This WCF service is contained within the same project as my MVC project so has access to all my models etc.
I've looked at several questions on Stackoverflow about this issue, but they all seem to need a controller context. I thought there was something in mvccontrib but it doesn't seem to be there anymore.
The closest I've found is the accepted answer to the aforementioned question, but it unfortunately breaks with RenderPartial within the view you're rendering.
I'm hoping maybe some of the behind the scenes work for ASP.NET MVC 2 related to RenderAction may help make this possible now?
BuildStarted and I have put together a standalone Razor templating engine which you might find useful (Github). You'll need to adapt your .ascx content into a simple string template, but it should do the job.
If you've got NuGet, you can run Install-Package RazorEngine
You may checkout the following blog post. Also Postal is worth looking at.
You need to create a fake HttpContextBase with a fake HttpRequestBase that return meaningful values from their properties.

WebForms and MVC

I'm working in a Banking Online Platform written in WebForms and I'm wondering if the same could or should be written in MVC.
I've read a lot on MVC but i didn't tried yet but i must ask a question for the experts.
Every transaction has a 3 Stage Process where the users input the data, review the data and gets a 3rd step where get's the confirmation. I currently have 40+ processes like this. The way i do it? Single ASPX with MultiView.
How can i do the same in MVC? Would i have 40+ x 3 Views (120+ aspx) ?
Thank U all.
The same can be achieved in MVC by using partial views.
MVC has full control over the rendered HTML and JavaScript frameworks is much easier to implement. It is also a lot more easier to write unit tests.
It is also 'lighter' in the sense that it does not have any View State events (which is the thing that makes Web Forms big when working with big data)

Manually coding MVC Views vs. asp:ServerControls

I barely got into ASP.Net webforms when MVC came out, and now I'm ready to try it out. But, I want to clarify something to be sure I understand the View coding in ASP.Net MVC...
I've heard that you must hand-code all the HTML in the View layouts, and that you cannot use server controls for this. Now, I like the way you can use the asp:ListView to present a list of data in webforms, and I've made heavy use of the SelectedItemTemplate and the concept of SelectedItem as a whole. So, I fear a big headache in having have to handle all that output yourself, versus letting the server controls do it. Same goes for DataGridView and the Select, Edit, Delete commadds that come with that server control.
In a particular case I am brainstorming over, I have Customer names displayed in a asp:ListView, and then when you click on a Customer name, it uses the SelectedItemTemplate that expands within the ListView to highlight that row and show more details about that particular Customer (right in the ListView).
I'd love to see some sample asp.Net MVC view code that shows how to handle this commone UI presentation technique.
there are some good GridView for ASP.NET MVC
http://www.codeproject.com/KB/aspnet/MVCFlexigrid.aspx
http://www.reconstrukt.com/ingrid/example1.html

Resources