Click here to Skip to main content
15,799,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

Am doing one e-commerce website using with c#

in that i have a sample module that is adding two numbers.

in this case if i enter the string value then the page will redirect to the code behind place.

but i dont want to go to code behind place,

instead of that i want to show that error in the same page itself or any other page using global.asax file(Application_Error)

which means the Application_error.

so how do i handle my page error using Application_Error file

my code is:

protected void Button1_Click(object sender, EventArgs e)

            int a = Convert.ToInt32(TextBox1.Text);
            int b = Convert.ToInt32(TextBox2.Text);
            int c = a + b;
            TextBox3.Text = c.ToString();


thanks to all

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