MSK Afridi

MSK Afridi

  • NA
  • 44
  • 1.6k

understanding IsPostBack Property

Apr 14 2020 1:19 PM
Hi there,
 
I am C# newbie.I need to use IsPostBack Property on my web site but I have understanding issues with it. now after exploring the web, I found that the ist page is loaded as get request but when I click again on the link of the same page so this will be a postback. so what I did is to put IsPostBack property on that page load event as follows
  1. if (!IsPostBack)  
  2. {  
  3. Response.Wriet("page loaded for the first time");  
  4. }  
  5. esle  
  6. {  
  7. Response.Wriet("page is not loaded for the first time");  
  8. }  
Now the above code when run for the first time so it is ok and work fine but when i click a link of the same page even again and again so I am getting the message" page loaded for the first time". what i thin that it should display the other message as the page is being posted back
 
please help in this regard what concept I am missing
Regards

Answers (4)