Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > databound and hyperlink field needed in gridview

Reply
Thread Tools

databound and hyperlink field needed in gridview

 
 
Carlos
Guest
Posts: n/a
 
      06-07-2006
Hi all,

I need a field that it is both databound, and hyperlink in a gridview. That
is, the value is obtained from a query, and at the same time needs to point
to a new page where
will be used to make another query. How can this be possible in asp .net?

Thanks in advance,

Carlos.



 
Reply With Quote
 
 
 
 
PeterKellner
Guest
Posts: n/a
 
      06-08-2006
On Wed, 7 Jun 2006 11:00:25 -0400, "Carlos" <(E-Mail Removed)>
wrote:

>Hi all,
>
> I need a field that it is both databound, and hyperlink in a gridview. That
>is, the value is obtained from a query, and at the same time needs to point
>to a new page where
>will be used to make another query. How can this be possible in asp .net?
>
>Thanks in advance,
>
> Carlos.
>
>


Hi Carlos,

I'd suggest adding another column to your gridview of type
TemplateField. It would look something like what is below. id is a
column in my database table referenced in gridview's datasource.

....
<asp:BoundField DataField="aka" HeaderText="aka"
SortExpression="aka" />
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HyperLink1"
NavigateUrl='<%#
"http://peterkellner.net/downloads?id=" + Eval("id") %>'
runat= "server">GO TO
PETERKELLNER>NET</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>


Peter Kellner
http://peterkellner.net
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
databound custom controls vs composite databound custom controls rodchar ASP .Net 0 11-26-2007 03:51 PM
Gridview row databound event - can't get past the 1st row of gridview maurban@gmail.com ASP .Net 5 10-13-2006 09:37 PM
1.Enter space bar for field names and save the field.The field shoud not get saved and an alert should be there as"Space bars are not allowed" Sound Javascript 2 09-28-2006 02:43 PM
Changing databound gridview field to hyperlink- need 2 more params RJ ASP .Net Datagrid Control 1 09-12-2006 04:57 PM
templated databound control problem - not showing databound Manu ASP .Net Web Controls 0 05-22-2006 09:46 AM



Advertisments