Click to See Complete Forum and Search --> : Use detailsview record somewhere else on the page


emmetmurray
03-10-2008, 11:43 AM
Hi,

I have a simple detailsview grid linking to a database, created using Visual web developer.

I want to be able to use the details of the record returned, somewhere else on the page.

So, say my detailsview returned "ID", "Name", "Surname". I then want to be able to use "ID" as part of a link further down the page. e.g website.com/(ID)

Any ideas on how do do this, or another way to get round the problem?

Thanks

jimboypogi
03-12-2008, 12:31 AM
...So, say my detailsview returned "ID", "Name", "Surname". I then want to be able to use "ID" as part of a link further down the page. e.g website.com/(ID) ...


Hi emmetmurray,

What framework are you using?

You can bind it using a LinkButton control by simply using Eval by doing so <%= Eval("ID"%> inside the fields property.

...
<Fields>
<asp:HyperLinkField NavigateUrl="http://website.com/<%= Eval("ID"%>" />
</Fields>
...

Is that what you mean?


cheers,
JimboyPogi