简体   繁体   English

使用Azure Blob存储中的ascx文件

[英]Using ascx file from Azure Blob storage

I'm trying to store user controls (ASCX) into Azure Blob (since I need to update them very often). 我正在尝试将用户控件(ASCX)存储到Azure Blob中(因为我需要经常更新它们)。

I use ParseControl. 我使用ParseControl。 However, it doesn't cause compilation such as PlaceHolder. 但是,它不会导致PlaceHolder等编译。

Question: Is there anyway I can access file from Blob like Page.LoadControl("MyControl.ascx"); 问题:无论如何我可以从Page.LoadControl(“MyControl.ascx”)访问Blob中的文件;

My last option is to write into temporary file if nothing work. 我的最后一个选择是写入临时文件,如果没有任何工作。

Thank you for your help! 谢谢您的帮助!

I think the easiest for you will be to create one custom VirtualPathProvider . 我认为最简单的方法是创建一个自定义的VirtualPathProvider You can take this sample as a starting point. 您可以将此示例作为起点。

Then just call Page.LoadControl("~/Your_Registered_Path/Control.ascx") 然后只需调用Page.LoadControl(“〜/ Your_Registered_Path / Control.ascx”)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM