Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > HyperLink Column in DataGrid

Reply
Thread Tools

HyperLink Column in DataGrid

 
 
Samuel Shulman
Guest
Posts: n/a
 
      12-06-2006
I am trying to add HyperLink column with an image

Below is the code that I use
<asp:TemplateField>

<ControlStyle Height="75px" Width="75px" />

<ItemStyle Height="75px" Width="75px" />

<ItemTemplate>

<asp:HyperLink ID="HPF1" runat="server" Height="75px" Width="75px"
ImageUrl='<%# Eval("ImageFilePath") %>' NavigateUrl='<%# Eval("ProductURL")
%>' />

</ItemTemplate>

</asp:TemplateField>


The problem is that the image appears in it's original size and I want it to
be 75px / 75px only

Thank you,
Samuel



 
Reply With Quote
 
 
 
 
Patrick.O.Ige
Guest
Posts: n/a
 
      12-07-2006
Samuel you aren't giving the image the height and width but the hyperlink.
if you want to use the asp:hyperlink then just resize it

"Samuel Shulman" <> wrote in message
news:%...
> I am trying to add HyperLink column with an image
>
> Below is the code that I use
> <asp:TemplateField>
>
> <ControlStyle Height="75px" Width="75px" />
>
> <ItemStyle Height="75px" Width="75px" />
>
> <ItemTemplate>
>
> <asp:HyperLink ID="HPF1" runat="server" Height="75px" Width="75px"
> ImageUrl='<%# Eval("ImageFilePath") %>' NavigateUrl='<%#

Eval("ProductURL")
> %>' />
>
> </ItemTemplate>
>
> </asp:TemplateField>
>
>
> The problem is that the image appears in it's original size and I want it

to
> be 75px / 75px only
>
> Thank you,
> Samuel
>
>
>



 
Reply With Quote
 
 
 
 
Samuel Shulman
Guest
Posts: n/a
 
      12-07-2006
I can't actually size the picture but I do size the HyperLink

The idea is to have the image within the HyperLink so users can click on the
image and navigate the product's page

Regards,
Samuel



"Patrick.O.Ige" <> wrote in message
news:%...
> Samuel you aren't giving the image the height and width but the hyperlink.
> if you want to use the asp:hyperlink then just resize it
>
> "Samuel Shulman" <> wrote in message
> news:%...
>> I am trying to add HyperLink column with an image
>>
>> Below is the code that I use
>> <asp:TemplateField>
>>
>> <ControlStyle Height="75px" Width="75px" />
>>
>> <ItemStyle Height="75px" Width="75px" />
>>
>> <ItemTemplate>
>>
>> <asp:HyperLink ID="HPF1" runat="server" Height="75px" Width="75px"
>> ImageUrl='<%# Eval("ImageFilePath") %>' NavigateUrl='<%#

> Eval("ProductURL")
>> %>' />
>>
>> </ItemTemplate>
>>
>> </asp:TemplateField>
>>
>>
>> The problem is that the image appears in it's original size and I want it

> to
>> be 75px / 75px only
>>
>> Thank you,
>> Samuel
>>
>>
>>

>
>



 
Reply With Quote
 
Patrick.O.Ige
Guest
Posts: n/a
 
      12-07-2006
Hi Samuel,
If thats the case then do this
<asp:HyperLinkColumn Target="_blank" DataNavigateUrlField="ID"
DataNavigateUrlFormatString="yourlaspx?ID={0}"
Text="<img border='0'
src='/images/yourimage.gif' />"></asp:HyperLinkColumn>
In the Text="<img border='0' src='/images/yourimage.gif' / height='75px'
width='75px'>"
in Text property resize your image as above
Hope that helps
Patrick

"Samuel Shulman" <> wrote in message
news:...
> I can't actually size the picture but I do size the HyperLink
>
> The idea is to have the image within the HyperLink so users can click on

the
> image and navigate the product's page
>
> Regards,
> Samuel
>
>
>
> "Patrick.O.Ige" <> wrote in message
> news:%...
> > Samuel you aren't giving the image the height and width but the

hyperlink.
> > if you want to use the asp:hyperlink then just resize it
> >
> > "Samuel Shulman" <> wrote in message
> > news:%...
> >> I am trying to add HyperLink column with an image
> >>
> >> Below is the code that I use
> >> <asp:TemplateField>
> >>
> >> <ControlStyle Height="75px" Width="75px" />
> >>
> >> <ItemStyle Height="75px" Width="75px" />
> >>
> >> <ItemTemplate>
> >>
> >> <asp:HyperLink ID="HPF1" runat="server" Height="75px" Width="75px"
> >> ImageUrl='<%# Eval("ImageFilePath") %>' NavigateUrl='<%#

> > Eval("ProductURL")
> >> %>' />
> >>
> >> </ItemTemplate>
> >>
> >> </asp:TemplateField>
> >>
> >>
> >> The problem is that the image appears in it's original size and I want

it
> > to
> >> be 75px / 75px only
> >>
> >> Thank you,
> >> Samuel
> >>
> >>
> >>

> >
> >

>
>



 
Reply With Quote
 
Samuel Shulman
Guest
Posts: n/a
 
      12-08-2006
That works,

Thank you

Samuel

"Patrick.O.Ige" <> wrote in message
news:...
> Hi Samuel,
> If thats the case then do this
> <asp:HyperLinkColumn Target="_blank" DataNavigateUrlField="ID"
> DataNavigateUrlFormatString="yourlaspx?ID={0}"
> Text="<img border='0'
> src='/images/yourimage.gif' />"></asp:HyperLinkColumn>
> In the Text="<img border='0' src='/images/yourimage.gif' / height='75px'
> width='75px'>"
> in Text property resize your image as above
> Hope that helps
> Patrick
>
> "Samuel Shulman" <> wrote in message
> news:...
>> I can't actually size the picture but I do size the HyperLink
>>
>> The idea is to have the image within the HyperLink so users can click on

> the
>> image and navigate the product's page
>>
>> Regards,
>> Samuel
>>
>>
>>
>> "Patrick.O.Ige" <> wrote in message
>> news:%...
>> > Samuel you aren't giving the image the height and width but the

> hyperlink.
>> > if you want to use the asp:hyperlink then just resize it
>> >
>> > "Samuel Shulman" <> wrote in message
>> > news:%...
>> >> I am trying to add HyperLink column with an image
>> >>
>> >> Below is the code that I use
>> >> <asp:TemplateField>
>> >>
>> >> <ControlStyle Height="75px" Width="75px" />
>> >>
>> >> <ItemStyle Height="75px" Width="75px" />
>> >>
>> >> <ItemTemplate>
>> >>
>> >> <asp:HyperLink ID="HPF1" runat="server" Height="75px" Width="75px"
>> >> ImageUrl='<%# Eval("ImageFilePath") %>' NavigateUrl='<%#
>> > Eval("ProductURL")
>> >> %>' />
>> >>
>> >> </ItemTemplate>
>> >>
>> >> </asp:TemplateField>
>> >>
>> >>
>> >> The problem is that the image appears in it's original size and I want

> it
>> > to
>> >> be 75px / 75px only
>> >>
>> >> Thank you,
>> >> Samuel
>> >>
>> >>
>> >>
>> >
>> >

>>
>>

>
>



 
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
gridview column values to another page via gridview hyperlink column Keith G Hicks ASP .Net 3 02-18-2008 06:17 AM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink davetichenor ASP .Net 1 10-30-2006 02:57 PM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink Dave ASP .Net Datagrid Control 0 10-21-2006 07:48 PM
How to assign a column of URLs to Hyperlink Column of a DataGrid c =?Utf-8?B?ZGF2aWQ=?= ASP .Net 11 07-17-2006 07:20 PM
HyperLink Column and Button Column in a DataGrid =?Utf-8?B?V2FyYW4=?= ASP .Net 0 08-09-2005 12:00 AM



Advertisments