Code Comments
Programming Forum and web based access to our favorite programming groups.Hi, I have this code:After that, I want to get the information from the database, so I changed my code to:code:
<td> <a href="#" class="toolbar">Computers</a> <a href="commun.html" class="toolbar">Communications</a> <a href="electronics.html" class="toolbar">Electronics</a> <a href="#" class="toolbar">Others</a> </td>and this is my code behind:code:
<td> <asp:HyperLink CssClass="toolbar" id="HyperLink" runat="server"></asp:HyperLink> </td>Now, the problem is: I do not know how can I create an array of asp:HyperLink Any help please ?! thanks...code:
// sqlConnection String connectionString = "server=ICSFREEDOM; TRUSTED_CONNECTION=true; database=Offers"; // command string String commandString = "SELECT name FROM swe_category"; // data adapter sqlDataAdapter = new SqlDataAdapter(commandString, connectionString); // data set DataSet dataSet = new DataSet(); // fill sqlDataAdapter.Fill(dataSet, "swe_category"); // data table DataTable dataTable = dataSet.Tables[0]; foreach(DataRow dataRow in dataTable.Rows) { HyperLink.Text = dataRow["name"].ToString(); HyperLink.NavigateUrl = dataRow["name"].ToString() + ".aspx"; }
Post Follow-up to this messageThere was no way for you to know it, but this is a classic asp newsgroup. While you may be lucky enough to find a dotnet-savvy person here who can answer your question, you can eliminate the luck factor by posting your question to a newsgroup where the dotnet-savvy people hang out. I suggest microsoft.public.dotnet.framework.aspnet. HTH, Bob Barrows -- Microsoft MVP -- ASP/ASP.NET Please reply to the newsgroup. The email account listed in my From header is my spam trap, so I don't check it very often. You will get a quicker response by posting to the newsgroup.
Post Follow-up to this messageHi Thubaiti, This is a classic ASP group. ASP.NET questions are handled in groups with "aspnet" in their names, such as microsoft.public.dotnet.framework.aspnet. Ray at work "Thubaiti" <Thubaiti@discussions.microsoft.com> wrote in message news:8396F7D9-1971-43AB-861F-BD0E86805459@microsoft.com... > Hi, > > I have this code: > <asp:HyperLink CssClass="toolbar" id="HyperLink" > runat="server"></asp:HyperLink>
Post Follow-up to this message"Thubaiti" <Thubaiti@discussions.microsoft.com> wrote in message news:8396F7D9-1971-43AB-861F-BD0E86805459@microsoft.com... > Hi, Indeed, an asp.net question. But basically, you should use a -datarepeater- control, where you can bind your data to the template that you define yourself.
Post Follow-up to this message"Egbert Nierop (MVP for IIS)" wrote: > "Thubaiti" <Thubaiti@discussions.microsoft.com> wrote in message > news:8396F7D9-1971-43AB-861F-BD0E86805459@microsoft.com... > > Indeed, an asp.net question. > But basically, you should use a -datarepeater- control, where you can bind > your data to the template that you define yourself. > > Yes, I used Repeater control to do that..
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.