什么是asp.net中的回发?而且还有ISPostBack和AutoPostBack [英] what is postback in asp.net? and w?hat is ISPostBack and AutoPostBack

查看:110
本文介绍了什么是asp.net中的回发?而且还有ISPostBack和AutoPostBack的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请以简单的方式向我提供我能够轻松理解的答案。







谢谢

解决方案

回发:请求被发送到服务器以获取页面,它将完整地访问服务器并获取所有相应的数据。



Ispostback:此属性将检查页面是否第一次被调用,假设您第一次打开页面它将获得回发并且下次单击同一页面上的按钮提交一些数据时现在如果检查属性ispostback是否为false导致页面未首次调用,因此它只会发送/接收该事件所需的数据。



autopostback:autopostback意味着当您想要在某些控件的事件上向服务器发送一些请求时,您可以使用此属性。例如,如果要检查用户名是否唯一的文本框的文本更改事件,则为该文本框创建ontextchange事件,并将autopostback设置为true。因此,当事件发生时,它将使用用户名向服务器发送请求,以检查它是否唯一。如果autopostback为false,则不会调用您的活动。





i希望这对您有帮助。


< blockquote>请参阅 IsPostBack If-Block的复杂性ASP.NET [ ^ ]。


进一步解决方案1 ​​

回发概念介绍 [ ^ ]



解释 autopostback [ ^ ]

please provide me the answer in simple way that i can easily understand.



thanks

解决方案

postback : request is sent to the server for a page and it will go for a full trip to the server and get all the respective data.

Ispostback : this property will check if the page is called for the first time or not, suppose you open a page for the first time it will get postback and next time you click on a button on the same page to submit some data and now if you check the property ispostback is false cause the page is not called for the first time so it will only send / receive data which are required by that event.

autopostback : autopostback means when you want to send some request to the server on some control's event you can use this property. for example on text change event of the textbox you want to check whether username is unique is not then you create ontextchange event for that textbox and you also set the autopostback to true. so when the event occur it will send request to server with the username to check that it is unique or not. if autopostback is false your event will not be called.


i hope this will help you.


See The Intricacies of the IsPostBack If-Block in ASP.NET[^].


Further to Solution 1
Introduction to concept of Postback[^]

Explanation of autopostback[^]


这篇关于什么是asp.net中的回发?而且还有ISPostBack和AutoPostBack的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆