473,669 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3179
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.publi c.dotnet.framew ork.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.publi c.dotnet.framew ork.aspnet.

Ray at work

"Thubaiti" <Th******@discu ssions.microsof t.com> wrote in message
news:83******** *************** ***********@mic rosoft.com...
Hi,

I have this code: <asp:HyperLin k CssClass="toolb ar" id="HyperLink"
runat="server"> </asp:HyperLink>

Jul 22 '05 #3
"Thubaiti" <Th******@discu ssions.microsof t.com> wrote in message
news:83******** *************** ***********@mic rosoft.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******@discu ssions.microsof t.com> wrote in message
news:83******** *************** ***********@mic rosoft.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
8949
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. I create the navigatURL from database dynamically. I see the same question mentioned here but the response is not souitable for me: http://www.dotnet247.com/247reference/msgs/11/57708.aspx
5
6685
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 but here is the snippet of my asp:hyperlink object; <asp:HyperLink NavigateUrl="authonly/clientdetails.aspx?searchID="+<%#DataBinder.Eval(Conta iner.DataItem,"CLIENTREF")%> ID="Hyperlink1"><%#DataBinder.Eval(Container.DataItem,...
9
2715
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= '<%# String.Format("Toyota/Images/Showroom/" & Container.DataItem("PathToDisplyPic"))%>' NavigateUrl='<%#
4
2212
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" NavigateUrl="javascript:OpenImage('<%# DataBinder.Eval(Container.DataItem,"FileName") %>');"><%#
0
8382
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8802
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8586
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6209
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2028
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1787
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.