Ask a Question related to ASP.NET General, Design and Development.
-
John Wallace #1
Dynamically adding controls to page SOURCE file
Hi,
I have a class, derived from "Control" which I can include on a page
using:
<tag:MyControl attr1=value></tag:MyControl>
My questions are:
1. What's the best way to programatically add this reference to pages
on the server - to the actual source file as opposed to generating it
upon page request?
2. What's the best way to parse source code like this and RETRIEVE all
such references, to interrogate the attributes?
3. Are there any classes that will let me build a well-formed
reference (like the one above) - as opposed to just concatenating the
string manually!
e.g. If the following aspx page is uploaded:
<%@ Page language="c#" Codebehind="NewPage.aspx.cs"
AutoEventWireup="false" Inherits="NS.NewPage" %>
<html><head></head>
<body>
Some Text
</body>
</html>
It should change to this:
<html><head></head>
<body>
<tag:MyControl attributes...></tag:MyControl>
Some Text
</body>
</html>
I have valid reasons for doing this! Obviously I can use string-based
methods to update the source but I'm sure there's a better way
Thanks.
John
John Wallace Guest
-
Adding controls dynamically to a datagrid
Hi, We have a requirement, where based on the UI type selected in a dropdown, a control should get added to the column of a grid dynamically. For... -
Dynamically Adding Controls
I am trying to dynamically add controls to my page, but am having trouble with controls such as buttons. I have been able to add simple controls... -
Dynamically adding controls to a data repeater
I would like to create a composite control based on a data repeater how do I dynamically add and bind child controls to it? I imagine this is not a... -
dynamically adding user controls
I have a web form that has a button called "Add Blank Row". Every time this button is pressed a new "blank row" user control should be added to the... -
Dynamically adding custom controls to page source file
Hi, I have a class, derived from "Control" which I can include on a page using: <tag:MyControl attr1=value></tag:MyControl> My questions are:...



Reply With Quote

