I want the code to work in childpages...
Masterpage code:
source code:
<script type="text/javascript">
<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" />
$("[id*=btnPopup]").live("click", function () {
$("#modal_dialog").dialog({
title: "POST FEEDBACK",
width: "600",
modal: true,
buttons: {
Send: function () {
//$("[id*=Button1]").click();
$(document.getElementById('<%= Button1.ClientID %>')).click();
},
Close: function () {
$(this).dialog('close');
}
},
open: function (type, data) { $(this).parent().appendTo("form"); },
close: function (type, data) { $(this).parent().replacewith(""); }
});
return false;
});
</script>
<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>
</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>
</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>
</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>
</td>
</tr>
<tr>
<td style="width: 117px; font-size: medium; color: #800000;" bgcolor="#F8DDBA">
</td>
<td>
<asp:Button ID="Button1" runat="server" style = "display:none" OnClick = "Button1_Click"
Text="Post" />
</td>
<td>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</div>
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 = "";
}
This is not working....!
Webpage without masterpage:
<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" />
<script type="text/javascript">
$(document).ready(function () {
$("#modal_dialog").dialog({
title: "jQuery Dialog Popup",
width: "600",
modal: true,
buttons: {
Send: function () {
//$("[id*=Button1]").click();
$(document.getElementById('<%= Button1.ClientID %>')).click();
},
Close: function () {
$(this).dialog('close');
}
},
open: function (type, data) { $(this).parent().appendTo("form"); },
close: function (type, data) { $(this).parent().replacewith(""); }
});
return false;
});
</script>
<body>
<form id="form1" runat="server">
<div>
<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>
</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>
</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>
</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>
</td>
</tr>
<tr>
<td style="width: 117px; font-size: medium; color: #800000;" bgcolor="#F8DDBA">
</td>
<td>
<asp:Button ID="Button1" runat="server" style = "display:none" OnClick = "Button1_Click"
Text="Post" />
</td>
<td>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</div>
</div>
</form>
</body>
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>window.alert('Feedback sent successfully.');window.location='/Visitor/HomePage.aspx';</script>");
}
else
{
Response.Write("<script>window.alert('ERROR in sending feedback.');window.location='/Visitor/HomePage.aspx';</script>");
}
//System.Threading.Thread.Sleep(10000);
txtContactNo.Text = "";
txtEmailId.Text = "";
txtFeedback.Text = "";
txtName.Text = "";
/
}
This code is working....!
I want the code to execute in childpages
Any help appreciated..!
Thank You...!