T
Thubaiti
Hi,
I have this code:
After that, I want to get the information from the database, so I changed my
code to:
and this is my code behind:
Now, the problem is: I do not know how can I create an array of
asp:HyperLink
Any help please ?!
thanks...
I have this code:
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>
After that, I want to get the information from the database, so I changed my
code to:
Code:
<td>
<asp:HyperLink CssClass="toolbar" id="HyperLink"
runat="server"></asp:HyperLink>
</td>
and this is my code behind:
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";
}
Now, the problem is: I do not know how can I create an array of
asp:HyperLink
Any help please ?!
thanks...