barrypicker
barrypicker

Reputation: 10108

Render partial webform (ASPX) in razor page

Using MVC 5 in VS2013 (razor engine) - how can I render a partial webform (ASPX page) such that the webform code behind method "Page_Load" will be called, and thus can be debugged?

Upvotes: 1

Views: 3935

Answers (1)

pool pro
pool pro

Reputation: 2114

@Html.Partial("~/Views/Shared/test/menu.aspx")

And in the Webform at the top use somthing like this:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="menu.aspx.cs" Inherits="System.Web.Mvc.ViewPage" %>

Just make sure it Inherits="System.Web.Mvc.ViewPage"

Upvotes: 2

Related Questions