Skip to content

Forgetting AutoPostBack=”true”

July 6, 2012

A very busy week now ends, after tweaking around the publishing of ASP.NET web sites, I had overseen some of the basic things in ASP.NET in the code.

If you find that when you use the wizard to set the index changed on the drop down list in ASP.NET and find that when you change the index on the website, and the code within the indexchanged method is not working, you realise that AutoPostback has not been set like so: –

<asp:DropDownList ID=”ddlDropDownListt” runat=”server”
                    onselectedindexchanged=”ddlDropDownList_SelectedIndexChanged” AutoPostBack=”True”></asp:DropDownList>

Always remember to add AutoPostBack=”True” for the web server to cause a postback and run the specified method which from above is ddlDropDownList_SelectedIndexChanged.

What I realise is that if you run other methods that causes a postback, this method also reflects the changes made, so they run in sequence during post backs behind the scenes.

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: