I have a gridview and dropdownlist, let say the content of dropdownlist is YEAR and the content of gridview is Name and Year. Now for everytime I change the Value of dropdownlist the content of gridview will change but it will not load the page
Thanks
Put your DropDownList and GridView inside the Update Panel. Set the OnSelectedIndexChange Event and Set Auto Postback to true for DropDownList. You will be having the Partial Postback not full Postback.
Your page will be refreshed until you set it as trigger in your update panel like this
<asp:updatepanel> <contenttemplate> // you dropdown and anything you want will come here </contenttemplate> <triggers> <asp:AsyncPostBackTrigger controlid = "yourdropdownid" eventname="selectedindexchanged"/> </triggers> </asp:updatepanel>
In addition to what's recommended by Azim and Emad, you need to DataBind your gridview while postbacks.
Put this in your PageLoad Event Handler
if Not Me.IsPostBack then 'Runs on Page Load 'Bla Else 'Runs on Post Back GridView.DataBind() End If
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.