Why would you not use the web controls?
Look at the System.Web.UI.HtmlControls namespace there's HtmlTable objects and HtmlTabkleRow and HtmlTableCell, just foreach your DataTable into HtmlTable controls and add to the Page.Controls collectio or a PlaceHolder.Controls collection.
Do you know about the repeater control?
Are you using framework 3.5? it has the new ListView which is like a repeater on steriods !! it's the Dogs Kahoonas.
lol thanks for your reply, unfortunately am using 2.0 of the framework (wow!). Have a pretty good idea of what to do now though will keep you updated cheers
unfortunately am using 2.0 of the framework (wow!).
Well that's what 90% if the software world is using. Hell I'm still maintaining Framework 1.1 projects.
Back in the time of classic ASP, one day I found myself conactenating <tr> <td> tags in a loop for a recordset in VBScript for the umpteenth time (I was still a fairly green coder then) when I suddenly realised "Hey! the computer should be doing the work, I'm bored of typing strHTML = strHTML & "<some tag> blah..."
I had just discovered what OOP meant and what a Class was and that VBScript could do classes (to certain extent.) So I made one that concatenated <tr> <td> tags (eventually I made it do subtotal rows and all sorts but that's another story) so from then on I just passed the recordset object to my table class and asked it to WriteTable().
Of course lots of other developers were doing this too. That's why webcontrols exist in .NET, and that's why I struggle with the concept of ever not wanting to just do Control.DataSource = dt; Control.DataBind(); But I guess that's because the novelty of seeing my carefully concatenated HTML rendered in a page has worn off now, when it was a new concept I though it was great.
cool, well thanks for the reply. BTW in reply to your ealir question I am not using web controls (like formview etc) because I have already tried them (I am using vista home basic) and bound them to sql d/b but they are not visible on the web page :-(
I've replied in your other thread.
How are you 'Browsing' your ASP.NET app ?
I can't understand why you can't get web controls to appear on the page. Can you post some code?
p.s. Do you know about the empty data template?
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="a.aspx.cs" Inherits="Restricted_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD html 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"> <!-- saved from url=(0047)http://localhost:51704/blah/LoginPage.aspx --> <html xmlns="http://www.w3.org/1999/xhtml"><head><title runat="server" > - a Page</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta content="MShtml 6.00.6000.16587" name="GENERATOR"/><link rel="stylesheet" type="text/css" href="demo.CSS" runat="server" /></head> <body runat="server" > <form id="a" runat="server" > <div > <h1 runat="server" visible="true">You are logged in </h1> <h1 runat="server" visible="true"> with the following details:</h1> <p> <asp:Table ID="Table1" runat="server" > <asp:TableRow runat="server" > <asp:TableCell runat="server"></asp:TableCell> <asp:TableCell runat="server"></asp:TableCell> <asp:TableCell runat="server"></asp:TableCell> </asp:TableRow> <asp:TableRow runat="server"> <asp:TableCell runat="server"></asp:TableCell> <asp:TableCell runat="server"></asp:TableCell> <asp:TableCell runat="server"></asp:TableCell> </asp:TableRow> <asp:TableRow runat="server"> <asp:TableCell runat="server"></asp:TableCell> <asp:TableCell runat="server"></asp:TableCell> <asp:TableCell runat="server"></asp:TableCell> </asp:TableRow> </asp:Table> <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="username" DataSourceID="SqlDataSource1" Height="50px" Width="125px"> <Fields> <asp:BoundField DataField="username" HeaderText="username" SortExpression="username" /> <asp:BoundField DataField="role" HeaderText="role" SortExpression="role" /> <asp:BoundField DataField="email" HeaderText="email" SortExpression="email" /> <asp:BoundField DataField="tel" HeaderText="tel" SortExpression="tel" /> <asp:BoundField DataField="fax" HeaderText="fax" SortExpression="fax" /> <asp:BoundField DataField="organisation" HeaderText="organisation" SortExpression="organisation" /> </Fields> </asp:DetailsView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:demoConnectionString5 %>" SelectCommand="SELECT [username], [role], [email], [tel], [fax], [organisation] FROM [users] WHERE ([username] = @username)"> <SelectParameters> <asp:Parameter Name="username" Type="String" /> </SelectParameters> </asp:SqlDataSource> </p> <p> If any of your details are incorrect,you can request to update them by clicking below</p> <input style="WIDTH: 130px" type="submit" value="Update my details" id="Label3"/> <h1>Please select the type of data you would<br/> like to submit an Update request for:</h1> <h2> <asp:Button ID="Button1" runat="server" Text="Log out" Font-Underline="False" /> </h2> </div> </form> </body></html>
yes I would really like to know why i cant use web controls too lol
I'm working in Excel to extract content of a table from a web page and populate Excel sheet cells with it. I'm trying to extract data from a table that gets loaded to a web page after show results method gets called. I have an error that says "Run-time error ...
When accessing from ######1.co.uk (which has an SSL) to document root ###/production everything works fine.
However when accessing ###/production from ######2.co.uk (which doesn't have an SSL - set up in the vhost file) the home page displays fine but the other pages are returning a 404.
Here's the entry in ...
I would like to know if this is an appropriate forum to ask these questions.
Website Example: http://www.shoparc.com
I would like create a similar site in WordPress. I have some experience with WordPress but would like to know:
What theme is this site using?
How would I create ...