Member Info
-
Protect Your PC from Viruses, Worms & Trojans 2009
15 views | By UltimateIf you're looking for a registry cleaner to speed up…
-
Play Item
Cancer and Gemini
0 views | in AstrologyHey baby, what's your sign?' It might be the cheesiest pickup line…
-
Play Item
How to Groom your Pet at Home
0 views | in DogsMary and Mason brave the wild world of pet grooming. It can…
-
Play Item
Dobor & Lap Slide Resonator Guitar Lessons - Away In a Manger
0 views | in MusicTroy Brenningmeyer Dobro / Resonator Slide Guitar Lessons - Away In a…
-
Play Item
Making Peanut Butter Cookie Dough
0 views | in DessertsThis video will show how to make peanut butter cookie dough.
Learn about the Auto-Postback Source Code
More DIY videos at 5min.com
Published: Jun 11, 2009
Video Summary:
Video Tags:
Source: Learn about the Auto-Postback Source Code
Video Transcript: (More)
Video Summary:
Overview the Auto-Postback Source Code.
Video Tags:
auto-postback events, microsoft visual c#, visual studio 2005, asp.net, Microsoft Windows, web development, total training
Source: Learn about the Auto-Postback Source Code
Video Transcript: (More)
If you are curious and you are wondering how this auto postback mechanism works, open up the web page again and click view source and see what you find, you will find it is quite interesting. I will just do that here quickly. I will just run the application; type in the Name, Andy; Telephone number, 12345; Region, Americas; and Country, Canada. And if I do a view source—okay.
So here, you can see there is extra hidden field called EVENTTARGET and EVENTARGUMENT and there is an extra client side script method that ASP.NET generated and returned to the browser. And this java script function is called “doPostback”. And every event that has an Auto-Postback property set to true, such as the NameTextBox, has an additional client side event called “onchange”. And it calls the java script function “doPostback”. And to doPostback function it takes two parameters. The first parameter identifies which control is generating the postback, and the second parameter is just an empty string actually, provides any additional information required by the event.
Okay. So what does this effectively saying is that when the user changes the text entry in that textbox, it will call the client site doPostback function specifying this textbox control name and then empty second parameter. So let us have look at the doPostback function.
The duo postback function takes the two parameters, the eventTarget, say for example, the name of the button or the textbox and the eventArgument which is an empty string and ultimately adds the information to the formed object and causes a submit; so very impressive. And remember you do not have to write any of the code here. This is generally to do automatically by ASP.NET. But you do get the benefit from it by having automatic postback capabilities as we found here.
Okay, so that really is the end of this lesson. So you have seen two examples in this lesson. The first example illustrated the page processing model. We talked about how controls get initialized and we saw how to do state mechanism enables ASP.NET to remember state changes between subsequent visits to the web page. Secondly, in this event demo example, we have seen how to handle events such as text change and selected index change and we have seen how the auto postback mechanism can be used to cause such events to happen automatically. So I hope that was all worthwhile and enjoyable. In the next lesson, we are going to have a look at validation.
So here, you can see there is extra hidden field called EVENTTARGET and EVENTARGUMENT and there is an extra client side script method that ASP.NET generated and returned to the browser. And this java script function is called “doPostback”. And every event that has an Auto-Postback property set to true, such as the NameTextBox, has an additional client side event called “onchange”. And it calls the java script function “doPostback”. And to doPostback function it takes two parameters. The first parameter identifies which control is generating the postback, and the second parameter is just an empty string actually, provides any additional information required by the event.
Okay. So what does this effectively saying is that when the user changes the text entry in that textbox, it will call the client site doPostback function specifying this textbox control name and then empty second parameter. So let us have look at the doPostback function.
The duo postback function takes the two parameters, the eventTarget, say for example, the name of the button or the textbox and the eventArgument which is an empty string and ultimately adds the information to the formed object and causes a submit; so very impressive. And remember you do not have to write any of the code here. This is generally to do automatically by ASP.NET. But you do get the benefit from it by having automatic postback capabilities as we found here.
Okay, so that really is the end of this lesson. So you have seen two examples in this lesson. The first example illustrated the page processing model. We talked about how controls get initialized and we saw how to do state mechanism enables ASP.NET to remember state changes between subsequent visits to the web page. Secondly, in this event demo example, we have seen how to handle events such as text change and selected index change and we have seen how the auto postback mechanism can be used to cause such events to happen automatically. So I hope that was all worthwhile and enjoyable. In the next lesson, we are going to have a look at validation.
- Browse Our Content
- Show All Categories ...
- Technology
- Computers
- Gadgets & Gizmos
- Programming
- Software
- General





No comments yet.