UserControl.IsPostBack Özellik

Tanım

Kullanıcı denetiminin istemci geri göndermesine yanıt olarak yüklendiğini veya ilk kez yüklenip erişilmediğini belirten bir değer alır.

public:
 property bool IsPostBack { bool get(); };
[System.ComponentModel.Browsable(false)]
public bool IsPostBack { get; }
[<System.ComponentModel.Browsable(false)>]
member this.IsPostBack : bool
Public ReadOnly Property IsPostBack As Boolean

Özellik Değeri

true kullanıcı denetimi bir istemci geri göndermesine yanıt olarak yükleniyorsa; aksi takdirde , false.

Öznitelikler

Örnekler

Aşağıdaki örnek, kullanıcı denetiminin özelliği döndürürsefalse, bir kullanıcı denetimiyle ilişkili uygulama durumuna iki anahtar değer çifti IsPostBack ekler. Bu koşul karşılandığında kod, anahtarları ve değerlerini eklemek için kullanıcı denetiminin Application özelliği aracılığıyla yöntemini kullanırAdd.

if (!myControl.IsPostBack)
{
  // Add new objects to the HttpApplicationState.
  // These will be maintained as long as the application is active.
  myControl.Application.Add("Author","Shafeeque");
  myControl.Application.Add("Date",new DateTime(2001,6,21));
  // Add an object to the cache with expirations 
  // set to 0.1 minute.
  myControl.Cache.Insert("MyData1", "somevalue", null, DateTime.Now.AddMinutes(0.1), Cache.NoSlidingExpiration);
}
If (Not myControl.IsPostBack) Then
  ' Add new objects to the HttpApplicationState.
  ' These will be maintained as long as the as the application is active.
  myControl.Application.Add("Author","Shafeeque")                
  myControl.Application.Add("Date",new DateTime(2001,6,21))
  ' Add an object to the cache with expirations
  ' set to 0.1 minute.
  myControl.Cache.Insert("MyData1", "somevalue", Nothing, DateTime.Now.AddMinutes(0.1), Cache.NoSlidingExpiration)        

Şunlara uygulanır

Ayrıca bkz.