473,466 Members | 1,313 Online
Bytes | Software Development & Data Engineering Community
Create 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?county=<
%#Server.UrlEncode(Request.QueryString("county")) & "&subcat=" &
Server.UrlEncode((Eval("SubCategory").ToString())) & "&category=" &
Server.UrlEncode((Eval("Category").ToString())) & "&uregion=" &
Server.UrlEncode((Eval("uregion").ToString()))%>"> <%#
Eval("SubCategory")%></a>

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

<a href="prov-results1.aspx?
county=Clark&subcat=Asbestos&category=Attorneys+++ +++++++++++++++++++++
++&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&subcat=CriminalLaw&category=Attorneys &uregion=">CriminalLaw</
a>
....i've used NavigateURL in the datalist in the past, but with
problems

??
Ed

Aug 30 '07 #1
1 1848
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********@hotmail.com
http://www.nathansokalski.com/

"mister-Ed" <27**@cox.netwrote in message
news:11**********************@x35g2000prf.googlegr oups.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?county=<
%#Server.UrlEncode(Request.QueryString("county")) & "&subcat=" &
Server.UrlEncode((Eval("SubCategory").ToString())) & "&category=" &
Server.UrlEncode((Eval("Category").ToString())) & "&uregion=" &
Server.UrlEncode((Eval("uregion").ToString()))%>"> <%#
Eval("SubCategory")%></a>

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

<a href="prov-results1.aspx?
county=Clark&subcat=Asbestos&category=Attorneys+++ +++++++++++++++++++++
++&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&subcat=CriminalLaw&category=Attorneys &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
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...
3
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...
12
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...
1
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...
0
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....
7
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...
3
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...
12
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...
0
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...
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
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,...
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...
1
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...
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
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.