Total Page Preview:   000000000813

What is response redirect in ASP.NET in English and Hindi

 

 

Response redirect in ASP.NET in English

In ASP.NET, Response.Redirect is a method that is used to redirect a user to a different web page or URL. This can be useful when you want to redirect a user after they have submitted a form, or when you want to send them to a different page based on some condition.

Here is an example of how to use Response.Redirect in ASP.NET:

In this example, we have a form with a text box and a button. When the user clicks the button, the code checks if the text in the text box is "redirect". If it is, the Response.Redirect method is called with the URL of the new page to redirect to. If the text is not "redirect", an error message is displayed on the current page.

Note that when Response.Redirect is called, it immediately sends a response to the browser with a 302 redirect status code, which tells the browser to go to the new URL. The browser then sends a new request to the new URL, so any state information from the previous page (such as form data) will be lost. If you need to preserve state information, you can use other methods like Server.Transfer or Session variables.

 

Response redirect in ASP.NET in Hindi

"Response.Redirect" ek method hai jo ASP.NET web applications me use kiya jata hai, jisse hum ek page se dusre page par redirect kar sakte hain. Ye method ek URL parameter leta hai, jise wo redirect karta hai. Jab ye method execute hota hai, toh web server user ko redirect kiye gaye URL par bhejta hai.

Yaha ek example diya gaya hai jisme "Response.Redirect" ka use kiya gaya hai:
Is example me, ek button control ko click karne par "Button1_Click" event trigger hota hai. Is event me "Response.Redirect" method ka use kiya gaya hai jisse user ko "Welcome.aspx" page par redirect kiya jata hai.
Agar humein redirect ke sath kuch additional information pass karna hai, jaise ki query string, tab hum URL me parameter add kar sakte hain. Niche diye gaye example me iska use dikhaya gaya hai:
Is example me, "name" query string parameter ke sath "Welcome.aspx" page par redirect kiya gaya hai. Ye parameter URL ke end me "?" character ke baad add kiya gaya 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: