473,769 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems with dynamic links in Datalist

I am displaying subcategories in my datalist, and now I have a
bizarre thing happen when I add a new subcategory record in my sql
database, the new subcategory link does not click into the next page:

Here is the code surrounding my dynamic 'subcategory':

<a href="prov-results1.aspx?c ounty=<
%#Server.UrlEnc ode(Request.Que ryString("count y")) & "&subcat=" &
Server.UrlEncod e((Eval("SubCat egory").ToStrin g())) & "&category= " &
Server.UrlEncod e((Eval("Catego ry").ToString() )) & "&uregion=" &
Server.UrlEncod e((Eval("uregio n").ToString()) )%>"><%#
Eval("SubCatego ry")%></a>

In the page source code , the subcategory that works has + signs
after the Category value. I have used
Server.UrlEncod e((Eval("Catego ry").ToString() .trim())) to eliminate
these erroneous + signs, but that disables ALL the links from
working :

<a href="prov-results1.aspx?
county=Clark&su bcat=Asbestos&c ategory=Attorne ys+++++++++++++ +++++++++++
++&uregion=lv"> Asbestos</a>

The subcategory that I have just added to the database doesnt work
when trying to click:

<a href="prov-results1.aspx?
county=Clark&su bcat=CriminalLa w&category=Atto rneys&uregion=" >CriminalLaw</
a>
....i've used NavigateURL in the datalist in the past, but with
problems

??
Ed

Aug 30 '07 #1
1 1865
Something that I might recommend (it may not explain your problem) would be
to, first of all, use the ASP.NET HyperLink control instead. I might also
suggest that because you have so many inline functions that you use the
ItemDataBound event, the String.Format method, and assign the results to the
NavigateUrl property. Also, I believe that when inside the <%# %tags, you
need to use + instead of &. Also, did you try doing a View Source of the
output for your current code? This can sometimes help you figure out exactly
what part is not working. Good Luck!
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"mister-Ed" <27**@cox.netwr ote in message
news:11******** **************@ x35g2000prf.goo glegroups.com.. .
>I am displaying subcategories in my datalist, and now I have a
bizarre thing happen when I add a new subcategory record in my sql
database, the new subcategory link does not click into the next page:

Here is the code surrounding my dynamic 'subcategory':

<a href="prov-results1.aspx?c ounty=<
%#Server.UrlEnc ode(Request.Que ryString("count y")) & "&subcat=" &
Server.UrlEncod e((Eval("SubCat egory").ToStrin g())) & "&category= " &
Server.UrlEncod e((Eval("Catego ry").ToString() )) & "&uregion=" &
Server.UrlEncod e((Eval("uregio n").ToString()) )%>"><%#
Eval("SubCatego ry")%></a>

In the page source code , the subcategory that works has + signs
after the Category value. I have used
Server.UrlEncod e((Eval("Catego ry").ToString() .trim())) to eliminate
these erroneous + signs, but that disables ALL the links from
working :

<a href="prov-results1.aspx?
county=Clark&su bcat=Asbestos&c ategory=Attorne ys+++++++++++++ +++++++++++
++&uregion=lv"> Asbestos</a>

The subcategory that I have just added to the database doesnt work
when trying to click:

<a href="prov-results1.aspx?
county=Clark&su bcat=CriminalLa w&category=Atto rneys&uregion=" >CriminalLaw</
a>
...i've used NavigateURL in the datalist in the past, but with
problems

??
Ed

Aug 31 '07 #2

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

Similar topics

5
3326
by: Sally B. | last post by:
Hello, I searched, but couldn't find answers--probably because I'm not sure what this is called... Anyway, I have about 50 web pages and I want to have some JavaScript that will read in a list of keywords, scan the web page and create links on any of those keywords... Is there any way to do this sort of thing? Thanks!
3
1612
by: Chad THomas | last post by:
I have a data repeater controll on a page. in each row that is displayed, I would like to have an action column that has differnet links shown depending on certain criteria from the database. In traditional asp you could check the value as you looped through the recordset, but in asp.net I am not sure how to do it if you are binding to a control. Thanks, Chad
12
1862
by: Alan Silver | last post by:
Hello, I Classic ASP, I used to have a standard way of making the top-level site navigation links. I had an include file which included a Sub like this ... Sub MakeLink(TocURL, TocText) If TocURL = ThisURL Then Response.Write("<br>" & TocText) Else
1
2970
by: simon | last post by:
Hello, i'm looking to create an aspx page that is basically a FAQ page i'm not sure if this can be done, but would love some help with suggestions of how to do it another way if this is not possible on the aspx page i have a table with 1 row and 2 columns in it, in the column on the left i have an asp:label, lblLinks and in the column on the right i have another asp:label, lblBody i'm reading the content of the links and body from...
0
1091
by: goldenboy651 | last post by:
I am making a website for a tv station as an intern so I'm not a pro and need all the help I can get. They want a dynamic site for a program. I have a main page which lets the user choose a season. I have them submit a form, which takes them to a season page and makes a page specific to each season. They want a page for each show in the season. I don't know how to send the information to the next page in order to determine what information...
7
1810
by: koonda | last post by:
Hi guys, I am trying to create a web interface in C# using ASP.NET. The database being used is SQL Server. I have some problems loading the tables in the datalist controls. When I run the program the DataList controls are loaded not with tables but something like this: "System.Data.DataRowView" in the three list boxe controls. Because I have three tables and I want to load them in the three list box controls. And then I want to select values...
3
2768
by: Peter K | last post by:
Hi I need to make a list of "download file links" on a webpage. All the data is dynamic - it depends on the user's actions how many files, and which files, I need to present in the list. The files are identified by an id in a database. How do I do this? I was thinking I could somehow make a list of <a href...> tags which could call a method in my c# code-behind. Is this possible? Or is there a better way?
12
9508
by: Lazoris | last post by:
OK heres a newb question and I'm sorry for it, but im getting back into web design after like 5 years off and im stuck even though i should know the problem i cant seem to correct it atm. What I'm trying to do is create a page that pulls up a list of items in a DB page, lists the items and creates a dynamic link using the item_id making the item_name a link to a more detailed page. So that when they click the Item_name it uses the item_id...
0
1915
by: =?Utf-8?B?Y2luZHk=?= | last post by:
I have am dynamically loading a web user control based on the click of a tab strip I load the default control for the first tab in the page load event after checking page is not postback. After that the controls are loaded/unloaded based on the SelectionChanged event for the tab strip and again in Page load because with a dynamic load viewstate has to be reloaded. I have a datalist in the user control and I am trying to create the...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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
10049
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
7410
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
6674
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
5307
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
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3964
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
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.