Thanks guys. My problem is solved by Sain above. I just need to call the method
bindEmail()
As soon as the records are inserted. It works now and fine.
Question
Guys i have a form and a data gridview in the same page. I bind my data gridview to a SQL and use my form to submit records to the database. My form and my gridview are on thesame page. I want to force my grid to reload and update its records automatically ,whenever a new record is inserted. In order i want to see my new record displayed in the gridview. I use the update panel triggers function as below
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="btnEmailSave" />
</Triggers>
</asp:UpdatePanel>
My problem is , when ever i click the 'btnEmailSave', my records get inserted and the page reload as expected. However the gridview records don't change.It rather remain the same.
I bind my gridview as follows in the pageload method.
if (!(IsPostBack))
{
bindEmail();
bindDrClient();
}
Please i am not sure why it isn't updating. Any help would be appreciated.
Solution
Thanks guys. My problem is solved by Sain above. I just need to call the method
bindEmail()
As soon as the records are inserted. It works now and fine.