ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

How can we identify that the Page is Post Back?

user-image
تم إضافة السؤال من قبل Zaid Rabab'a , Software Development Team Leader , Al-Safa Co. Ltd.
تاريخ النشر: 2013/01/22
marwa khalaf
من قبل marwa khalaf , .Net Developer , Sands National Academy

Page object has an "IsPostBack" property, which can be checked to know that is the page posted back.

Furqan Ul Karim
من قبل Furqan Ul Karim , Senior Delivery Manager (Contract) , Virgin Red

Page's IsPostBack property in asp.net.
you can also figure out by checking the value for the hidden control __EVENTTARGET and __EVENTARGUMENT where __EVENTTARGET contains the control id caused the postback and later one will hold the value

if (basename($_SERVER['HTTP_REFERER']) == $_SERVER['YOUR_SCRIPT_NAME']) { // DO SOMETHING }

Hazem Salama
من قبل Hazem Salama , Senior Member of Technical Staff , Verizon Communications

Page.IsPostBack method

Rahul. K Nair Chaithrakam
من قبل Rahul. K Nair Chaithrakam , Senior Software Engineer , Emirates airlines

With the help of “IsPostBack” property In Asp.net we can check if a page is rendered for the first time or responding to a post back.

Eg:

            protectedvoid Page_Load(object sender, EventArgs e)

                {

                if (!IsPostBack)

                {

                    // Can write code here or call the method you want

                }

 

                if (IsPostBack)

                {

                     //Can write code here or call the method you want

                }

 

                }  

jemini patel
من قبل jemini patel

Page object has an "IsPostBack" property, which can be checked to know that is the page posted back to server or not, if "IsPostBack" property is "True" then page called postback and page loading through the "Post" Request (page loading second or higher time) else if "IsPostBack" property returns false then page is loading through "Get" Request (page loading first time).

Rani Alomari
من قبل Rani Alomari , Full Stack .Net Developer , Jordan Center for Diseases Control (JCDC)

by checking the control's property 'IsPostBack'

Mohammad Ibrahim Rashid
من قبل Mohammad Ibrahim Rashid , IT Consultant (Information Technology Consultant) , SABIC Petrochemicals

In Page_Load Event of your page you can test "IsPostBack" Property of your page instance.

Maher Alsilwy
من قبل Maher Alsilwy , CONSULTANT , B7R DESIGN WWW.B7RDES.COM

in the Page_Load Event check this condition if(isPostBack == false) { // here your code }

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟