Click here to Skip to main content
12,694,842 members (33,245 online)
Rate this:
 
Please Sign up or sign in to vote.
hi guys,

i have a little problem using the link button in asp.net

here is my code:

<asp:LinkButton ID="Download" runat="server" onclick="Download_Click" CommandArgument='<%# videoName %>' >Click To Download 

my problem is, the text "Click To Download" does not show but it show the value inside the CommandArgument='<%# videoName %>'. also have tried:

<asp:LinkButton ID="Download" text="Click To Download" runat="server" onclick="Download_Click" CommandArgument='<%# videoName %>' />


but same thing happened.

please help me with this guys.. thank you
Posted 14-Jan-13 17:27pm
Updated 14-Jan-13 17:49pm
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

Use the Text property:
<asp:linkbutton id="Download" runat="server" onclick="Download_Click" commandargument="<%# videoName %>" xmlns:asp="#unknown">Text="Click To Download" /></asp:linkbutton>
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

<asp:linkbutton id="LinkButton1" runat="server" xmlns:asp="#unknown">This India</asp:linkbutton>
  Permalink  
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Please check your onclick event... you done some thing wrong in javascript..
and one more thing when u bind value to link button dynamically use following systax
CommandArgument='<%# Bind("columnName")%>'
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

<asp:linkbutton id="LinkButton1" commandargument="<%# Eval("OrganisationID") %>" commandname="Delete" runat="server" xmlns:asp="#unknown"><img src="pathtoimage.jpg" alt="delete group" />delete</asp:linkbutton>
  Permalink  
v2

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 16 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100