user3373775
user3373775

Reputation: 39

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

Thank you

Upvotes: 0

Views: 1939

Answers (2)

Raghubar
Raghubar

Reputation: 2788

You can use Ajax control toolkit. Download and add in your 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>

Upvotes: 1

Amnesh Goel
Amnesh Goel

Reputation: 2655

Hi you can use jquery to solve this problem. Via jquery you can open a small popup window in which you can have the textbox and other controls. You can write save functionality there. Perhaps you should have a look at http://jqueryui.com/dialog/#modal-form to get your problem solved.

Upvotes: 1

Related Questions