in designing part:
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="abc" runat="server" DataSourceID="SqlDataSource1" AutoGenerateColumns="False">
<Columns>
<asp:BoundField HeaderText="ID" DataField="id" />
<asp:BoundField HeaderText="Name" DataField="name1" />
<asp:BoundField HeaderText="STS" DataField="sts" />
</Columns>
</asp:GridView>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="data source=c174; initial catalog=newtry; integrated security=true;"
SelectCommand="select * from table_1"></asp:SqlDataSource>
</div>
<div>
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource2" AutoGenerateColumns="False">
<Columns>
<asp:BoundField HeaderText="ID" DataField="id" />
<asp:BoundField HeaderText="Name" DataField="name1" />
<asp:BoundField HeaderText="STS" DataField="sts" />
</Columns>
</asp:GridView>
<asp:Button ID="Button2" runat="server" Text="Button" OnClick="Button2_Click" Style="height: 26px" />
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="data source=c174; initial catalog=newtry; integrated security=true;"
SelectCommand="select * from table_1"></asp:SqlDataSource>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
in coding part on button click
protected void Button1_Click(object sender, EventArgs e)
{
UpdatePanel1.DataBind();
}
protected void Button2_Click(object sender, EventArgs e)
{
UpdatePanel2.DataBind();
}
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="abc" runat="server" DataSourceID="SqlDataSource1" AutoGenerateColumns="False">
<Columns>
<asp:BoundField HeaderText="ID" DataField="id" />
<asp:BoundField HeaderText="Name" DataField="name1" />
<asp:BoundField HeaderText="STS" DataField="sts" />
</Columns>
</asp:GridView>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="data source=c174; initial catalog=newtry; integrated security=true;"
SelectCommand="select * from table_1"></asp:SqlDataSource>
</div>
<div>
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource2" AutoGenerateColumns="False">
<Columns>
<asp:BoundField HeaderText="ID" DataField="id" />
<asp:BoundField HeaderText="Name" DataField="name1" />
<asp:BoundField HeaderText="STS" DataField="sts" />
</Columns>
</asp:GridView>
<asp:Button ID="Button2" runat="server" Text="Button" OnClick="Button2_Click" Style="height: 26px" />
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="data source=c174; initial catalog=newtry; integrated security=true;"
SelectCommand="select * from table_1"></asp:SqlDataSource>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
in coding part on button click
protected void Button1_Click(object sender, EventArgs e)
{
UpdatePanel1.DataBind();
}
protected void Button2_Click(object sender, EventArgs e)
{
UpdatePanel2.DataBind();
}
No comments:
Post a Comment