Click here to Skip to main content
16,012,316 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I have asp.net label that his text is binding from the SQL.
If the text contains 'x' - I need to make this label to linkButton.
Is it possible?
Posted
Comments
Sergey Alexandrovich Kryukov 21-Jul-15 13:18pm    
If you only could define "turn"...
—SA

you can hide the original control and swap its text to the new.
VB
if label1.text = "xxx" then
label1.visible = false
linkbutton1.postbackurl = label1.text
linkbutton1.visible = true
else

end if
 
Share this answer
 
Reserve a place holder on the body, then insert into it a label or link button dynamically based on if else condition.
1. https://msdn.microsoft.com/en-us/library/kyt0fzt1(v=vs.140).aspx[^]
2. http://www.dotnetfunda.com/articles/show/2394/create-link-button-dynamically-in-aspnet-csharp[^]
 
Share this answer
 
v3

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