Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add new control from text file

Status
Not open for further replies.

nevin2007

Programmer
Aug 21, 2009
31
IR
Hi
I have a text file like this :
Code:
<br /><div style="width:100%;height:auto;font-family:Tahoma; font-size:14px; font-weight:bold">Headertext</div><br />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="AccessDataSource_grid"
BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4"  Width="100%" CssClass="mediumthm">
<FooterStyle BackColor="#E2E2E2" ForeColor="Black" />
<RowStyle BackColor="White" ForeColor="Black" />
<Columns>
<asp:BoundField DataField="FLD10" HeaderText="F2" SortExpression="FLD10" >
<ItemStyle Width="100px" HorizontalAlign="Right" VerticalAlign="Middle" /></asp:BoundField><asp:BoundField DataField="FLD11" HeaderText="F11" SortExpression="FLD11" >
<ItemStyle Width="100px" HorizontalAlign="Right" VerticalAlign="Middle" /></asp:BoundField>
</Columns>
<PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
<HeaderStyle BackColor="#E2E2E2" Font-Bold="True" ForeColor="Black" />
</asp:GridView>
<asp:AccessDataSource Id="AccessDataSource_grid" runat="server"
SelectCommand="SELECT [FLD10],[FLD11] FROM [data] WHERE ([codid] = ? and [cods] = ?) ORDER BY [th] DESC">
<SelectParameters>
<asp:ControlParameter ControlID="codid" Name="codid"
PropertyName="Text" Type="Double" />
<asp:ControlParameter ControlID="cods" Name="cods"
PropertyName="Text" Type="Double" />
</SelectParameters>
</asp:AccessDataSource>
<br /><div style="width:100%;height:auto;font-family:Tahoma; font-size:14px; font-weight:bold">text2</div><br />

I want to read text file and add those control to aspx page.
Is it possible ?
 
I'm sure this is possible, but why would you want to do this? I'm sure it would get complicated, and messy, and adding controls to a page dynamically is usually never a good idea. I have to ask, why do you want to do this? I'm sure we could figure out a better way to do what you want to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top