Is it possible: rendering server tags at runtime in asp.net?

Is it possible that I reserve the asp.net code in db and load it at runtime. asp.net code contains server-side tags such asText='<%# Eval("Description") %>'

+3
source share
1 answer

You can write in aspx by plugging in what you want, and then create the page using:

BuildManager.CreateInstanceFromVirtualPath("~/MyPage.aspx",typeof(Page));

You need to wrap this when getting your HttpHandler:

var p = BuildManager.CreateInstanceFromVirtualPath("~/MyPage.aspx",typeof(Page));
HttpContext.Current.Handler =p;

(BuildManager is in System.Web.Compilation)

.... , ( ), ( 15).

: , , , . , , , , , .

+3

Source: https://habr.com/ru/post/1734760/


All Articles