开发者

render text file and change object's properties

开发者 https://www.devze.com 2023-02-08 22:35 出处:网络
i want to generate the output of an asp.net page by reading a text file, get the controls out of the text, change te properties of these controls, render it and displaying it.

i want to generate the output of an asp.net page by reading a text file, get the controls out of the text, change te properties of these controls, render it and displaying it.

so for example, the text file may contain:

<head>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <sys:Label ID="Label开发者_如何转开发1" runat="server" Text="empty1"></sys:Label>
        <sys:Label ID="Label2" runat="server" Text="empty2"></sys:Label>
    </div>
    </form>
</body>
</html>

after reading the text, i would like to change the properties of the sys:label controls. After that, the text will be rendered, and displayed.

Problem is, how can i reach these controls ?


You could to create those text files as ASCX files, load them with Page.LoadControl and reach it's inner controls with Page.FindControl.

0

精彩评论

暂无评论...
验证码 换一张
取 消