Click here to Skip to main content
15,894,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a text box which is randomly generate number and also having drop down list which have auto postback value to be true..my problem is whenever i select the dropdownlist value it automatically change the text box value...how to retain the value in the textbox...plz help me..my mail id is:manosekar18@gmail.com
Posted

1 solution

Use "!IsPostBack" condition on page load
eg->
C#
if (!IsPostBack)
{
Random rnd = new Random();
TextBox1.Text = rnd.Next(1000).ToString("000");
}
 
Share this answer
 

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