PDA

View Full Version : تابع ()dopostback_ در جاوا اسکریپت چطور کار می کنه



sahar-sahra
دوشنبه 04 مرداد 1389, 19:22 عصر
سلام
کسی می دونه تابع dopostback که سمت کاربر هست، یعنی از توابع جاوا اسکریپت وقتی تو کدهای HTML برنامه ی ASP.NET اضافه میشه، چطوری کار میکنه؟؟ اینکه به تعداد کنترلها فیلد نوع مخفی می سازه رو می دونم. اما یه چیزایی از متنی که دارم برام واضح نیست. آخرش اطلاعات بعد از هر بار کلیک به سمت سرور میره یا نه؟ یعنی پاسخ آنی برنامه بدون اینکه به سرور اطلاعات بده و بگیره چه جوریه آخرش؟؟
اجازه بدین متن رو براتون
Pasteکنم.


Remember, ASP.NET generates the __doPostBack() function automatically, provided at
least one control on the page uses automatic postbacks.
Finally, any control that has its AutoPostBack property set to true is connected to the
__doPostBack() function using the onclick or onchange attributes. These attributes indicate
what action the browser should take in response to the client-side JavaScript events onclick
and onchange.
The following example shows the tag for a list control named lstBackColor, which posts
back automatically. Whenever the user changes the selection in the list, the client-side
onchange event fires. The browser then calls the __doPostBack() function, which sends the
page back to the server.
<select ID="lstBackColor" onchange="__doPostBack('lstBackColor','')"
language="javascript
">
In other words, ASP.NET automatically changes a client-side JavaScript event into a
server-side ASP.NET event, using the __doPostBack() function as an intermediary..


اگه راهنمایی کنید ممنون میشم