Click here to Skip to main content
15,885,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using a data list to save questions ,


I'm using a link button and a asp button in datalist , but whenever i click my asp button my link button text is getting changed .


after adding a question I'm setting my l;ink button name to 'remove' from 'add' (in client side using javascript)

But if i click my asp button my link button is getting reset to 'add'
Posted
Updated 1-Jun-14 21:37pm
v5
Comments
Nelek 2-Jun-14 3:56am    
and the question is?
Nandakishore G N 2-Jun-14 5:52am    
What have you done till now paste it...

use clientidmode if you are using 4.0 and keep it static.
 
Share this answer
 
Try setting text for linkbutton from serverside.
lbtn.Text="remove";
 
Share this answer
 
Comments
Member 10843538 2-Jun-14 5:10am    
is that the only way to acheive it . can it be done in clientside ?
Nitij 2-Jun-14 6:26am    
If you are using an update panel then make sure to set the correct state of the inputs from the server in case the update panel is updated.
Are you trying to update label text which is in update panel?
Can you try the below code.
XML
<asp:Label runat="server" Text="salam" ID="lbl" ></asp:Label>
<asp:HiddenField id="hdlbl" runat="server" />
document.getElementById("lbl").InnerHTML = "10"; // update client side
document.getElementById("hdlbl").value = "10";


Add the following code in page load

if(Page.IsPostBack)
{
lbl.Text = hdlbl.value;
}
 
Share this answer
 
Comments
Member 10843538 2-Jun-14 6:30am    
but my label is in datalist

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