如何使用更新面板更新div内的表 [英] how to update table inside div using update panel

查看:48
本文介绍了如何使用更新面板更新div内的表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



Hi,

<div id="MSGd" style="display: none" class="topline bottomline leftline rightline centered">  
<div class="bodytext" align="left">
  <table id="lst1" width="700"cellpadding="0" cellspacing="0" border="0">

    <tr>
        <td align="left" class="bottomline">
            <div class="bodytext">
                P.I.D
            </div>
        </td>
        <td align="left" class="bottomline">
            <asp:TextBox ID="txtpid" runat="server" MaxLength="20" Width="150"></asp:TextBox>
            <%--<asp:Button ID="btnpid" runat="server" Width="30" Text="pid" OnClick="btnpid_Click" bac CssClass="style=ba" />--%>
            <asp:ImageButton ID="btnpid" runat="server"  OnClick="btnpid_Click" ImageUrl="~/App_Themes/DISHA/Images/search-icon.gif" />
        </td>
                        <td align="left" class="bottomline">
                            <div class="bodytext">
                                Patient Name
                            </div>
                        </td>
                        <td align="left" class="bottomline">
                            <asp:TextBox ID="txtpatientname" runat="server" MaxLength="20" Width="150"></asp:TextBox><span

                                style="color: #ff0033">*</span>
                        </td>
                    </tr>



点击 btnpid 按钮我调用了一个存储过程。


On click of btnpid button I called a stored procedure.

ds = BFB.fn_Get_PID(txtpid.Text);

if (ds.Tables[0].Rows.Count > 0)
{
    txtmobile.Text = ds.Tables[0].Rows[0]["MobileNo"].ToString();
    txtpatientname.Text = ds.Tables[0].Rows[0]["Fname"].ToString();
    txtguardiansname.Text = ds.Tables[0].Rows[0]["FatherName"].ToString();
    txtphone.Text = ds.Tables[0].Rows[0]["PhoneNo"].ToString();
    ddlsex.SelectedValue = ds.Tables[0].Rows[0]["sex"].ToString();
    txtday.Text = ds.Tables[0].Rows[0]["Age"].ToString();
}



每件事都运转正常,但唯一的问题是Div MSGd 点击btnpid后隐藏


Every thing work fine but the only problem is Div MSGd get hide after click of btnpid

推荐答案

点击按钮,页面 PostBack ,所以Page将再次加载定义的控件及其属性。



我可以看到有一个 style =display:在div MSGd 上定义没有属性,所以它被隐藏了。



请检查Page的流程并尝试在此按钮点击事件内或之后的正确位置显示。
On button click, the Page will PostBack, so the Page will load again with the defined controls and its properties.

As I can see there is a style="display: none" property defined on div MSGd, so it is getting hided.

Please check the flow of Page and try to show it at the correct place inside or after this button click event.


这篇关于如何使用更新面板更新div内的表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆