Click here to Skip to main content
16,004,778 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
How can Check Page Load event the textbox value empty or not empty then textbox value can empty then insert the value other wise redirect the next page
Posted
Comments
♥…ЯҠ…♥ 19-Nov-13 2:53am    
can you clearly tell what is your requirement?
Thanks7872 19-Nov-13 2:57am    
This is not question,this is your requirement. What is the problem you are facing while doing this?

1 solution

Hi Krishna,

I think you want to validate the textbox,
at page load event you want to check whether text box has value or not,
Here is sample code you can make use of
C#
protected void Page_Load(object sender, EventArgs e)
{
if (String.IsNullOrEmpty(txtbox.Text)) //your textbox name comes here
            {
                txtbox.Text = "Your string goes here";
            }
            else
            {
                Response.Redirect("About.aspx");
            }
}


Hope this helps you a bit.

Regards,
RK
 
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