This is a migrated thread and some comments may be shown as answers.

passing dynamic parameter value with a href

1 Answer 346 Views
Grid
This is a migrated thread and some comments may be shown as answers.
L
Top achievements
Rank 1
L asked on 25 Dec 2008, 04:53 PM
hi

I have this code which was previouly in a Radgrid and the code works fine in the grid.

telerik:GridTemplateColumn HeaderText="Register" UniqueName="TemplateColumn">
            <ItemTemplate>
            <a href="#" onclick="openRadWindow2('<%#DataBinder.Eval(Container.DataItem,"CATID")%>'); return false;">Register</a>
            </ItemTemplate>
        </telerik:GridTemplateColumn>

But when i changed this code to

<

td class="style102">

 

 

<a href="#" onclick="openRadWindow2('<%#DataBinder.Eval(Container.DataItem,"CATID")%>'); return false;">Register</a></td>

 


which is now outside of a gird and became a hyperlink on its own in the page it gave me an error:
Compiler Error Message: BC30456: 'DataItem' is not a member of 'System.Web.UI.Control'

How do i pass parameter value using hyperlink since this hyperlink is no loner in a radgrid? Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 29 Dec 2008, 07:51 AM
Hi Lui Nai Wah,

You can use DataBinder.Eval only inside of a data-bound control.

Greetings,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
L
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or