简体   繁体   English

用文本框弹出以保存数据

[英]popup with textbox to save data

I am using Asp.Net and VB.NET, I want to develop a program with a page which gives a popup on a button click and it should have a 2 to 3 text boxes to enter details and these details should be saved in to SQl Server table on click of button 我正在使用Asp.Net和VB.NET,我想开发一个带有页面的程序,该页面在按钮点击时弹出窗口,它应该有2到3个文本框来输入详细信息,这些细节应该保存到SQl单击按钮上的服务器表

Thank you 谢谢

Hi you can use jquery to solve this problem. 您好,您可以使用jquery来解决这个问题。 Via jquery you can open a small popup window in which you can have the textbox and other controls. 通过jquery,您可以打开一个小弹出窗口,您可以在其中使用文本框和其他控件。 You can write save functionality there. 您可以在那里编写保存功能。 Perhaps you should have a look at http://jqueryui.com/dialog/#modal-form to get your problem solved. 也许你应该看看http://jqueryui.com/dialog/#modal-form来解决你的问题。

You can use Ajax control toolkit. 您可以使用Ajax控件工具包。 Download and add in your visual studio. 下载并添加到您的visual studio中。 Use This Code. 使用此代码。

<style>
    .modalBackground
    {
        position: absolute;
        top: 0px;
        left: 0px;
        filter: alpha(opacity=60);
        -moz-opacity: 0.6;
        opacity: 0.6;
    }
    .popup
    {
        background-color: #ddd;
        margin: 0px auto;
        width: 330px;
        position: relative;
        border: Gray 2px inset;
    }
</style>



 <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<div>
    <asp:Panel ID="pnModelPopup" runat="server" CssClass="popup">
        <table>
            <tr>
                <td>
                    User Name:
                </td>
                <td>
                    <asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Password:
                </td>
                <td>
                    <asp:TextBox ID="txtPassword" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
               <asp:Button ID="btnSignin" runat="server" Text="Sign in"                                     Style="margin-left: 100px"
                 OnClick="btnSignin_Click" />
                </td>
                <td>
                    <asp:Button ID="btnCancel" runat="server" Text="Cancel" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server"                                PopupControlID="pnModelPopup"                                             
        TargetControlID="lnkbtnSignin" DropShadow="true"                                            BackgroundCssClass="modalBackground"
        CancelControlID="btnCancel" PopupDragHandleControlID="pnModelPopup"                       OnOkScript="onOk()">
    </asp:ModalPopupExtender>
    <div style="margin-left: 300px">
        <asp:LinkButton ID="lnkbtnSignin" runat="server">Sign in</asp:LinkButton>
    </div>
</div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM