forum

Home / DeveloperSection / Forums / on button click , sending feedback GUI module as a pop-up window and on click of submit adding to database using jquery dialog method

on button click , sending feedback GUI module as a pop-up window and on click of submit adding to database using jquery dialog method

Rashmi S 1734 05-Dec-2014
hi...
This is Rashmi.. i'm trying to create  a pop-up window for sending feedback. i have used asp button control to insert feedback details to database. I'm getting pop-up window not button event is not getting triggered. Plz help me..

This is my code:
<link href='http://fonts.googleapis.com/css?family=Montserrat+Alternates' rel='stylesheet' type='text/css'>
 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" type="text/javascript"></script>
    <link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/start/jquery-ui.css"
        rel="stylesheet" type="text/css" />
$(document).ready(function () {
        $("[id*=btnPopup]").click(function () {
            $("#modal_dialog").dialog({
                title: "POST FEEDBACK",
                width: "600",
                buttons:
                {
                    Send: function (type, data) { $(this).parent().appendTo($("form:first")); },
                close: function (type, data) { ($(this).parent().replaceWith("")); }
                },
                modal: true
            });
            return false;
        });
    });
<li><asp:LinkButton ID="btnPopup" runat="server" Text="Feedback">Feedback</asp:LinkButton></li>
<div id="modal_dialog" style="display: none;width:auto;">
                                 <table style="width:100%;">
        <tr>
            <td align="center">
                <strong style="font-size: medium">FEEDBACK</strong></td>
        </tr>
        <tr>
            <td style="height: 30px">
                <hr size="3" color="#DA6BB6"/></td>
        </tr>
        <tr>
            <td>
            
                <table style="width:100%;">
                    <tr>
                        <td style="width: 117px; font-size: medium; color: #800000;" bgcolor="#F8DDBA">
                            Name</td>
                        <td>
                            <asp:TextBox ID="txtName" runat="server" Width="350px"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width: 117px; font-size: medium; color: #800000;" bgcolor="#F8DDBA">
                            Email ID</td>
                        <td>
                            <asp:TextBox ID="txtEmailId" runat="server" Width="350px"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width: 117px; font-size: medium; color: #800000;" bgcolor="#F8DDBA">
                            Contact Number</td>
                        <td>
                            <asp:TextBox ID="txtContactNo" runat="server" Width="350px"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width: 117px; font-size: medium; color: #800000;" bgcolor="#F8DDBA" 
                            valign="top">
                            Feedback</td>
                        <td>
                            <asp:TextBox ID="txtFeedback" runat="server" Rows="8" TextMode="MultiLine" 
                                Width="350px"></asp:TextBox>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width: 117px; font-size: medium; color: #800000;" bgcolor="#F8DDBA">
                            &nbsp;</td>
                        <td>
                            &nbsp;<asp:Button ID="Button1" runat="server" style = "display:none" OnClick = "Button1_Click" 
                                Text="Post"  />
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                </table>
            
            </td>
        </tr>
        <tr>
            <td>
            
                &nbsp;</td>
        </tr>
</table>
  </div>

C# code:

protected void Button1_Click(object sender, EventArgs e)
        {
            if (b.Feedback_Add(txtName.Text, txtEmailId.Text, txtContactNo.Text, txtFeedback.Text, DateTime.Now.ToShortDateString()) == 1)
                Response.Write("<script>alert('Feedback sent successfully.')</script>");
            else
                Response.Write("<script>alert('ERROR in sending feedback.')</script>");
            txtContactNo.Text = "";
            txtEmailId.Text = "";
            txtFeedback.Text = "";
            txtName.Text = "";
        }

I can't to add feedback to database...!
Waiting for reply.......!
Thank You.....





Updated on 05-Dec-2014

Can you answer this question?


Answer

0 Answers

Liked By