Member Info
-
Protect Your PC from Viruses, Worms & Trojans 2009
By UltimateIf you're looking for a registry cleaner to speed up…
-
Play Item
How to Landscape for Shade Using an Arbor or Pergola
in Gardening & LandscapingThe Lowe's Creative Ideas team shows viewers how to get much needed…
-
Play Item
EASEUS Partition Manager Overview
in SoftwareThe hard drive. It's a key part to any system because it…
-
Play Item
How to Use Time Warping in Ableton Live
in MusicSteveNice shows us how to fit an acapella into a beat using…
-
Play Item
How to Format Numbers in Excel 2007
in SoftwareIn this Excel 2007 tutorial, learn how to format numbers by changing…
How to Use Auto-Postback Events in ASP.NET
More DIY videos at 5min.com
Published: Jun 11, 2009
Video Summary:
Video Tags:
Source: How to Use Auto-Postback Events in ASP.NET
Video Transcript: (More)
Video Summary:
Learn how to use Auto-Postback Events in ASP.NET.
Video Tags:
auto-postback events, microsoft visual c, visual studio 2005, aspnet, Microsoft Windows, web development, total training
Source: How to Use Auto-Postback Events in ASP.NET
Video Transcript: (More)
So we are getting there, we are definitely on the right tract, but really what we need is they build different automatic Postback so that as soon as we change like in here, it automatically Postback into the server and therefore automatically generates the selected index change event, so that we can display the appropriate countries for that region.
To do that, what we need to do is go back to our ASPX page and each of the controls that we want to automatically Postback as soon as a change clears. So for example, the name text box, if you look at the properties, there is a property called auto Postback. And that moment and by default, it set to false so we need to set it to true. And by doing that, the text change event will occur automatically without clicking the update button and likewise for the telephone number. We will set auto Postback property to true and for the region, we will set it to true and for the county list, we will set it to true.
Okay. Now, just out of interest, if you look at the source code behind the page, you can see for example for the drop down list, it is added the auto Postback equals true property. So, we could have just type this property in here directly if you go into two.
Okay, let us run the application and see if it works better now. So name, Helen Smith, I just made that one up. Oh look at that, straight away, as soon as I click that to the text box, into the telephone number, straight away, it posted back to the server and triggered the on text change event and displayed the person’s name in the business card. So that is very promising, telephone number, 12345 and down the list, carved out into different again.
Now look, this is not per keystroke. There is no way of capturing on keystroke events in then ASP.net web application and that is probably a good thing. I mean, can you imagine if every time you press the key, it posted back to the web server, the performance would be terrible. You have to transfer focus into different control in order to generate the on- text event, and obviously, if you are in the text control and you do not change the text and then you tab out, then no event occurs.
So the region, see that Helen works in the Asia-Pacific region, that trigger the Postback so the countries here are India, Japan and Australia. So let us select India. Okay, good. So that concludes our example here.
So what we have seen is how to handle some of the non-travel events as well as handling click events that you have on buttons. So for example if we go back into this design view, we know how handle click events on buttons and in this example, we have also seen how to handle events such as text change and selected index change on some of our other controls. We have also seen how the auto Postback mechanism enables us to trigger the events automatically instead of have to wait until a button get clicked.
To do that, what we need to do is go back to our ASPX page and each of the controls that we want to automatically Postback as soon as a change clears. So for example, the name text box, if you look at the properties, there is a property called auto Postback. And that moment and by default, it set to false so we need to set it to true. And by doing that, the text change event will occur automatically without clicking the update button and likewise for the telephone number. We will set auto Postback property to true and for the region, we will set it to true and for the county list, we will set it to true.
Okay. Now, just out of interest, if you look at the source code behind the page, you can see for example for the drop down list, it is added the auto Postback equals true property. So, we could have just type this property in here directly if you go into two.
Okay, let us run the application and see if it works better now. So name, Helen Smith, I just made that one up. Oh look at that, straight away, as soon as I click that to the text box, into the telephone number, straight away, it posted back to the server and triggered the on text change event and displayed the person’s name in the business card. So that is very promising, telephone number, 12345 and down the list, carved out into different again.
Now look, this is not per keystroke. There is no way of capturing on keystroke events in then ASP.net web application and that is probably a good thing. I mean, can you imagine if every time you press the key, it posted back to the web server, the performance would be terrible. You have to transfer focus into different control in order to generate the on- text event, and obviously, if you are in the text control and you do not change the text and then you tab out, then no event occurs.
So the region, see that Helen works in the Asia-Pacific region, that trigger the Postback so the countries here are India, Japan and Australia. So let us select India. Okay, good. So that concludes our example here.
So what we have seen is how to handle some of the non-travel events as well as handling click events that you have on buttons. So for example if we go back into this design view, we know how handle click events on buttons and in this example, we have also seen how to handle events such as text change and selected index change on some of our other controls. We have also seen how the auto Postback mechanism enables us to trigger the events automatically instead of have to wait until a button get clicked.





No comments yet.