存储在数据库ASCX

编程入门 行业动态 更新时间:2024-10-25 04:17:24
本文介绍了存储在数据库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

本文发布于:2023-10-24 13:38:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1524087.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据库   ASCX

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!