Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NavigateURL of HyperlinkColumn - Container.Dataitem

Status
Not open for further replies.

lpatnaik

Programmer
Jul 11, 2002
53
Hi,
I am trying to send a value to a javascript function as a parameter and invoke the function too as below:

<asp:HyperLinkColumn NavigateUrl=&quot;javascript:funShowTCDetails('<%# DataBinder.Eval(Container.DataItem,&quot;TC_ID&quot;)%>');&quot; DataTextField=&quot;TC_ID&quot; ItemStyle-Width=&quot;50px&quot; HeaderText=&quot;ID&quot; HeaderStyle-CssClass=&quot;datagridHeaderCapstyle&quot; FooterStyle-CssClass=&quot;try&quot;>
<ItemStyle CssClass=&quot;capstyle&quot;></ItemStyle>
</asp:HyperLinkColumn>

I dont know why its not working, i am getting all sorts of parser errors such as :
Literal content ('<asp:HyperLinkColumn NavigateUrl=&quot;javascript:funShowTCDetails('') is not allowed within a 'System.Web.UI.WebControls.DataGridColumnCollection'
 
I believe u should replace the following code:
DataBinder.Eval(Container.DataItem,&quot;TC_ID&quot;)

with
DataBinder.Eval(Container, &quot;DataItem.TC_ID&quot;)

Try it. NetAngel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top