I am relatively new to ASP.NET & C#
I am creating a basic form with student name, program dropdown and semester number dropdown. I am using postback to populate semester number dropdown list. I am showing the data i acquired through the form into labels. I am using IsPostBack to populate the labels with data
My problem is that when I change program, it fires the postback to populate semester dropdown and since I am using that event to display data, I cant really select semester number.
How can I differentiate between submit button postback and dropdown postback?
Thanks!!!
Instead of coding inside the load event handler or using isPostBack. Just use buttons event handler. You can do that by double clicking on button in design view.
However better way of doing this altogether is use .Net Ajax Update Panel with script manager which is very simple to use.
Below is the simple example of using script manger and update panel, you can use it for drop down list so you don’t have to postback for that. So postback should be only for button.
Instead of textbox in above code you can have dropdown list.