Click here to Skip to main content
15,914,014 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

Suppose I have this:
<asp:LinkButton runat="server" CssClass="lFilename" ID="grdlinkFilename" Text='<%#Eval("FILEPATH")%>' CommandArgument='<%#Eval("FILEPATH")%>'  OnCommand="grdlinkFilename_click"> </asp:LinkButton>


How can I pass the <%#Eval("FILEPATH")%> to an external javacript(jquery) file?

Someone please help me with this.
Posted
Updated 27-May-13 20:38pm
v3

 
Share this answer
 
Comments
Chris N.P. 27-May-13 23:19pm    
That's new to me. Can you provide a sample?
Hello ,
Please use this code as below ..

ASP.NET
<asp:linkbutton runat="server" cssclass="lFilename" id="grdlinkFilename" text="<%#Eval("FILEPATH")%>" commandargument="<%#Eval("FILEPATH")%>" getpath="<%#Eval("FILEPATH")%>" oncommand="grdlinkFilename_click" xmlns:asp="#unknown"></asp:linkbutton>


You just add the attribute like GetPath as given above then write in JQuery script as below code.

JavaScript
alert($('#MainContent_grdlinkFilename').attr("GetPath"));
 
Share this answer
 
Comments
Chris N.P. 28-May-13 3:18am    
Is "getpath" case sensitive?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900