Link to aspx page from asp.net mvc project - asp.net

I have asp.net mvc project with razor views and i have in the same solution another project that is rendering (aspx) pages (reports and stuff) so i don't know how to call that page or show it inside view. i have tryed with render action and link but it just can't be found.
It's just one aspx page inside other project so i have path like: /projectName/page.aspx
Any help would save my day

If you have two web projects I suppose they have two iis mapping.
So calling from a site to another site you use href link, to render a page from another site the only thing I can think of is using iframe.

Related

How to apply aspx master web page header and footer into asp.net mvc view?

I have a web site built by asp.net but now I want one webpage to be redirected to a newly created asp.net mvc view. Off course I would not convert the entire site from asp.net to asp.net mvc but I want only one mvc view embedded into the web site, keeping the original master page setting like heading, footer, etc. How can I achieve it? Thanks!

Default Layout Page in ASP.NET Razor Pages

In MVC 3 with Razor view engine, you could establish the default layout page for all of your views. I can't seem to find a feature like this in ASP.NET razor pages (asp.net web pages with Razor)... anybody know if it exists?
Thanks.
You can choose a MVC View Master page, see here for screenshots: http://www.asp.net/mvc/tutorials/creating-page-layouts-with-view-master-pages-vb
For the new ASP.Net WebPages stuff, its called _PageStart.cshtml (under ~/Shared/ folder). More info here: http://www.asp.net/webmatrix/tutorials/18-customizing-site-wide-behavior
You can use Master pages in regular ASP.NET pages to set a common layout.

Sharepoint + ASP.NET Website - Encountering "A page can have only one server-side Form tag" error

I have an ASP.NET Web Site hosted in the _layouts folder of a SP2010 site.
One of the pages contains a server-side form and works fine until I try to set its master page to a Sharepoint master page (specifically a modified v4.master) to achieve a consistent look & feel.
I've placed my original page content within <asp:content> tags but it now throws an "A page can have only one server-side Form tag" error. I know that ASP.NET pages can only contain a single server-side form but what walkarounds can I use to stop Sharepoint from throwing this error?
Thanks!
Figured it out, just delete the form tags in the ASP.NET pages as there is already a server side form within v4.master itself.
The ASP.NET page will then use the form inside the master page happily without complaints :)

Embedded Resources and ASPX pages

Is it possible to embed an aspx page (self contained, no seperate codebehind file) into an assembly, in this case a SharePoint web part, and have it still act as an aspx file when called via the resource url?
Regards
Moo
no as such. however you can change you web part to a user control and enbed that in a webpart and a a aspx file.
Google for "user Control Web Part"
OR
you can look at "son of smartpart" but I don't like this approach. not very pure.
OR
Leave it as a aspx page and use the page viewer web part to load the aspx page in an iframe from sharepoint.
Download the Web Deployment Project update from MS, and it will solve your problem.
http://www.microsoft.com/downloads/details.aspx?FamilyId=0AA30AE8-C73B-4BDD-BB1B-FE697256C459&displaylang=en
You could use an httphandler but then you would have to make changes to web.config. What is your real problem? You can easily deploy a separate ASPX page when you use something like WSPBuilder to create your SharePoint code.

ASP.Net MVC View within WebForms Application

I am adding functionality to an ASP.Net webforms application and we've decided that new development will be done MVC with a view to move all functionality over eventually.
Obviously, MVC and WebForms play together rather nicely when it comes to accessing an MVC action via a URL. However, I'd like to display the MVC view within an existing tab (telerik) control on a WebForm page. This view will be using js/css file so that will need to be considered also.
Well I'd use jquery/js to load the tab dynamically on page load / select tab. If add a js function to the required handler you can fire an ajaxGet to retrieve the html from your MVC action URL.
If needed I can get some sample code. Are you using jQuery in your ASP.Net app or MSAJAX ??
Cheers
ian

Resources