Hyperlink

K

Karl-Heinz

Hello,

I'm using a link in a datagrid by the operand
"DataNavigateUrlFormatString=". I assume that the link only can activate a
new aspx-page. But the code and the datagrid definitions exist already in
the calling (the 1st) page.

My second datagrid, which already exists, should be activated by a link from
a column of the 1st datagrid. The 2nd datagrid shows several topics, the 1st
shows several articles of each topic. I want to be able to click on a topic
and then all related articles should be displayed.

This time I am able to show all topics and all articles. I used the
hyperlink and a second aspx-file is invoked. It shows all articles of the
selected topic correct, but the code is very similar to that of the 1st
aspx-file which is able to show a full list of all articles. Isn't it
possible to link to this article's display routine and then to identify the
article's data to be displayed?

Any idea? Can you help? Thanks and have several nice days.

Karl-Heinz


--

Author and webmaster of:
_________________________________________
http://www.sharpmz.org
http://www.angerbichl.de
http://www.huber-bgl.de
http://www.hotelbavaria.net
http://www.Freies-Radio-Bochum.de (in work)
http://www.web-design-discounter.de (in work)
http://www.web-design-discounter.com (in work)

ICQ# 133769328
I am a member of the S.U.C. / UK
( S.U.C.: SHARP User Club http://sharpusersclub.org/ )
 
T

Todd

Not sure if this will help answer your question or not, but here
something that I did. I let the user select from a drop-down menu to
select an option. Doing so passes their selection as an input
parameter into a SQL stored procedure, which populates a dataset which
I bind to a DataGrid. After the bind, I use the following code to
create a hyperlink on an ID number for each row in the DataGrid:

x=0
While x < DataGrid.Items.Count
dgResults.Items.Item(x).Cells(5).Text = System.String.Format("<a
href=""Detail.aspx?ID=" &
CStr(ds.Tables("Results1").Rows(x).Item("IDNum")) & " "" " & "
target=""_blank"">" &
CStr(ds.Tables("Results1").Rows(x).Item("IDNum")) & "</a>")
x += 1
end While

The above snippet creates the following within the .text property of
the (5) cell of each record within my Datagrid. Assuming that I had 3
rows in my datagrid's results then the 5th cell's text property would
contain:
<a href="Details.aspx?ID=00001" target="_blank">00001</a>
<a href="Details.aspx?ID=00002" target="_blank">00002</a>
<a href="Details.aspx?ID=00003" target="_blank">00003</a>

Using x as a counter and adding one to it each time thru the loop will
cause it to iterate through each record within the entire DataGrid.
Then, when the user clicks on the link to go to the next page, I have
some code intercept the URL variable, and then use that as an input
parameter into another SQL stored procedure. This produces another
datasetset which I bind to a second datagrid to display to the screen.
So, the first page (first datagrid) is used as a broad view of
several options. The second page (second datagrid) uses the URL
variable to show the details for one specific record.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top