Hi Adam,
I don't have the code I used to use in front of me. I think I put a
"Public" function in my code behind. Then here:
NavigateUrl="index.aspx?aid=<%# Container.DataItem("bsc_assmnt_area_id")%>"
I did this:
NavigateUrl="<%#
MyPublicFunction(Container.DataItem("bsc_assmnt_ar ea_id"))%>"
Then I would have MyPublicFunction return the whole URL "index.aspx?aid=10".
The function would be of type string and receive the dataitem as a string or
integer. You may have to do a CStr or CInt around the Container.DataItem
function. Another thing this allowed me to do at the time was switch that
URL on the fly which I needed to do depending on the user's security level.
Good luck! Ken.
--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.
"Adam Knight" <de*@brightidea.com.au> wrote in message
news:e6**************@TK2MSFTNGP14.phx.gbl...
Hi all,
I am wanting to url the HyperLink server control in a datagrid.
I am trying to append the id field of the datagrid to the end of the
navigate url.
The code below is causing a problem.
<asp:HyperLink ID="lnkArea" NavigateUrl="index.aspx?aid=<%#
Container.DataItem("bsc_assmnt_area_id")%>" Runat="server"><%#
Container.DataItem("name")%></asp:HyperLink>
Can anyone enlighten me and let me know how to fix this?
Cheers,
Adam