Total Page Preview:   000000006954

What is Postback in ASP.NET in English and Hindi

 

Postback in ASP.NET in Engilsh 

In ASP.NET, the Postback property is a flag that indicates whether a page was posted back to the server or not. When a page is first loaded, the Postback property is set to False. However, when a user interacts with a control on the page that triggers a postback, the Postback property is set to True

Here's an example to demonstrate the use of the Postback property in ASP.NET:
 
In the code above, we have a simple web form with a Label control and a Button control. When the user clicks the button, the myButton_Click event handler is executed. Here's the code for the event handler:
 
In the event handler, we check the value of the Page.IsPostBack property. If it's True, we know that the page was posted back to the server, so we update the text of the Label control to indicate that the user clicked the button. If it's False, we know that the page was just loaded, so we display a welcome message.
So, in summary, the Postback property is a flag that helps you determine whether a page was just loaded or was posted back to the server after a user interaction.

 

Postback in ASP.NET in Hindi

Postback ek aisa mechanism hai jisse ASP.NET me web page ko server pe post karne ka process hota hai. Jab koi user ASP.NET web page ke button ya kisi aur control pe click karta hai ya koi bhi action karta hai jo server-side processing ke liye zaroori hai, tab postback ka use hota hai. Postback ke dauran pura page server pe bheja jata hai, jisse server pe koi bhi server-side code, jiska use postback ka trigger banata hai, execute kiya ja sakta hai.
 
ASP.NET me Postback property ek flag hai jo yeh batata hai ki kya koi page server pe post hua hai ya nahi. Jab koi page pe pahli baar load hota hai, tab Postback property False hoti hai. Lekin jab koi user page pe control pe interact karta hai jaise button click karta hai to Postback property True ho jati hai.
 
Postback property ka use page ke state ke anusar alag alag actions perform karne ke liye kiya ja sakta hai. Jaise ki jab page pahli baar load hota hai toh kuch variables initialize kiye ja sakte hai, aur jab page postback hota hai toh dusre set of actions kiye ja sakte hai.
Yahan ek example diya gaya hai jismein Postback property ka use kiya ja sakta hai:
Upar diye gaye code mein, hum Page.IsPostBack property ki value ko check kar rahe hain jisse pata lagta hai ki page pahli baar load hua hai ya phir server pe post hua hai. Agar ye True hai toh hum ye jante hain ki page server pe post hua hai, isliye hum form data ko retrieve karke use process kar sakte hai. Agar ye False hai toh hum ye jante hai ki page pahli baar load ho raha hai, isliye hum kuch variables initialize kar sakte hai ya page pe kuch content display kar sakte hai.
 
 
 
 
 
 

Thank You

About Author

Brijesh Kumar

Database Developer

I have more then 6 years Experience in Microsoft Technologies - SQL Server Database, ETL Azure Cloud - Azure SQL Database, CosmosDB, Azure Data Factory, PowerBI, Web Job, Azure Function, Azure Storage, Web Apps, Powershall and Database Migration On-Premise to Azure Cloud.
LinkedIn : https://www.linkedin.com



Comments


                           
                           

                           

                           

Facebook User: