473,406 Members | 2,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

asp:HyperLink array ?!

Hi,

I have this code:

Expand|Select|Wrap|Line Numbers
  1. <td>
  2. <a href="#" class="toolbar">Computers</a>
  3. <a href="commun.html" class="toolbar">Communications</a>
  4. <a href="electronics.html" class="toolbar">Electronics</a>
  5. <a href="#" class="toolbar">Others</a>
  6. </td>
  7.  
After that, I want to get the information from the database, so I changed my
code to:

Expand|Select|Wrap|Line Numbers
  1. <td>
  2. <asp:HyperLink CssClass="toolbar" id="HyperLink"
  3. runat="server"></asp:HyperLink>
  4. </td>
  5.  
and this is my code behind:

Expand|Select|Wrap|Line Numbers
  1. // sqlConnection
  2. String connectionString = "server=ICSFREEDOM; TRUSTED_CONNECTION=true;
  3. database=Offers";
  4. // command string
  5. String commandString = "SELECT name FROM swe_category";
  6. // data adapter
  7. sqlDataAdapter = new SqlDataAdapter(commandString, connectionString);
  8. // data set
  9. DataSet dataSet = new DataSet();
  10. // fill
  11. sqlDataAdapter.Fill(dataSet, "swe_category");
  12. // data table
  13. DataTable dataTable = dataSet.Tables[0];
  14.  
  15. foreach(DataRow dataRow in dataTable.Rows) {
  16. HyperLink.Text = dataRow["name"].ToString();
  17. HyperLink.NavigateUrl = dataRow["name"].ToString() + ".aspx";
  18. }
  19.  
Now, the problem is: I do not know how can I create an array of
asp:HyperLink

Any help please ?!

thanks...
Jul 22 '05 #1
4 3168
There 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.
Jul 22 '05 #2
Hi 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" <Th******@discussions.microsoft.com> wrote in message
news:83**********************************@microsof t.com...
Hi,

I have this code: <asp:HyperLink CssClass="toolbar" id="HyperLink"
runat="server"></asp:HyperLink>

Jul 22 '05 #3
"Thubaiti" <Th******@discussions.microsoft.com> wrote in message
news:83**********************************@microsof t.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.

Jul 22 '05 #4


"Egbert Nierop (MVP for IIS)" wrote:
"Thubaiti" <Th******@discussions.microsoft.com> wrote in message
news:83**********************************@microsof t.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.


Yes, I used Repeater control to do that..
Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Amir Eshterayeh | last post by:
Dear Friends My asp hyperlink goes to relative address instead of absolute. I like navigate url goes to outsite link like www.asp.net but now, it goes to www.mysite/www.asp.net please help....
5
by: Martin Dew | last post by:
Having some problems getting a hyperlink object to work in my repeater control, It displays the text I have asked it to for the hyperlink, but it does not act as a link. My repeater code is below...
9
by: Leon | last post by:
What Am I Doing Wrong? Code Will Not Run, I Can't See The Error! Thanks. <asp:datalist id="DataList1" runat="server" RepeatColumns="4"> <ItemTemplate> <asp:HyperLink id=HyperLink1 ImageUrl=...
4
by: Satya | last post by:
Hi all, The following code is throwing a run time error "The server tag is not well formed. " <ItemTemplate> <asp:HyperLink Runat="server" ID="lnkFile"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.