存储在数据库ASCX [英] Storing ascx in database

查看:189
本文介绍了存储在数据库ASCX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在ascx控件code存储到数据库中。然后,而不是从加载文件路径位置的控制,我想从数据库中检索,并将其加载到用户控件。该UserControl.LoadControl只有两个选择超载。如果没有从数据库中保存的控制到一个临时文件,然后从临时文件加载,是有可能做到这一点直接从数据库?

I would like to store the ascx control code into a database. Then rather then load the control from a filepath location, I would like to retrieve it from the database and load it into the UserControl. The UserControl.LoadControl only has two overload options. Without saving the control from a database to a temporary file and then load from the temporary file, is it possible do this direct from the database?

推荐答案

您可以使用 ParseControl 呢? 链接到MSDN。

Can you use ParseControl instead? Link to MSDN.

该方法接受一个字符串,然后在飞行中为控制对象进行编译。

The method accepts a string that is then compiled on the fly as a Control object.

您可以从数据库中加载您的控制标记,然后将它交给 ParseControl 让你控制的实例了。

You could load your control markup from the database and then hand it off to ParseControl to get an instance of your control back.

希望这有助于!

这篇关于存储在数据库ASCX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆