Click here to Skip to main content
15,916,842 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to change dynamically the asp.net label text in run time. For that purpose i need if else condition in c# asp.net design mode. Please anybody help me thanks in advance

What I have tried:

I don't know how to achieve this so i haven't written any code
Posted
Updated 24-Oct-18 1:33am

1 solution

No, you don't. Design mode is pre-compilation, run time is always post compilation.

You just need an ordinary if ... else statement.

Add a button Click event handler and test your condition:
C#
if (myBoolean)
   {
   myLabel.Text = "It's true!";
   }
else
   {
   myLabel.Text = "No, it's false ... :sigh:";
   }
 
Share this answer
 
Comments
Member 8583441 24-Oct-18 8:07am    
Okay sir i will check this code
Member 8583441 24-Oct-18 8:13am    
It is working thanks sir
OriginalGriff 24-Oct-18 8:16am    
You're welcome!

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