when i click on button which is inside update panel the record is saved but the saved record does not show in gridview even though i bind gridview inside button click event. I think the recent saved data is not binding bcoz the button is inside update panel.
But when the screen refresh next time the recent saved records are also shown in gridview?
Now how to bind the gridview with recent saved records?
<asp:UpdatePanel ID="updatepanel1" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnCopy" EventName="Click" />
</Triggers>
<ContentTemplate>
<asp:Button ID="btnCopy" Text="OK" runat="server" Width="50px" OnClientClick="hideMe()"
CssClass="ibutton" />
</center>
</ContentTemplate>
</asp:UpdatePanel>
Protected Sub btnCopy_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCopy.Click
dsgridview.DataBind()
gridview.DataBind()
End Sub
This is the part of the code
<script type="text/javascript" >
function ShowDialog(oldempid) {
var dialog = $("#divjQueryDialog");
// alert(oldempid);
dialog.hide()
.slideDown("slow")
.css("opacity", .90);
var str = oldempid.split(',');
var empid = str[0];
var uname = str[1];
$("#lblempid").val(empid);
$("#lbluname").val(uname);
var currentDate = new Date()
}
function hideMe() {
var dialog = $("#divjQueryDialog");
dialog.fadeOut();
//location.reload();
}
$('.close').click(function () {
$("#lblfmt").val('');
var dialog = $("#divjQueryDialog");
dialog.fadeOut();
// dialog.hide ();
});
$("#<%= btnCopy.ClientID %>").click(function (evt) {
});
</script>