RadioButtonList is unchecked after postback - asp.net

When i clicked a button control on asp.net page, my radiobuttonlist is returning back unchecked after postback.
<asp:RadioButtonList ID="rblSgkOzel" runat="server" EnableViewState="true">
<asp:ListItem Text="SGK Kapsamında" Value="sgk" Selected="True"/>
<asp:ListItem Text="Özel" Value="ozel" />
<asp:ListItem Text="Hasta Adına" Value="hasta" />
</asp:RadioButtonList>
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="denemeRepeater.aspx.cs"
Inherits="KlinikMuhasebe.denemeRepeater" %>
<%# Import Namespace="MedulaRADClassLib" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="JS/reset-fonts-grids.css" rel="stylesheet" type="text/css" />
<link href="css.css" rel="stylesheet" type="text/css" />
<link href="_cssV3.css" rel="stylesheet" type="text/css" />
<script src="JS/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="JS/liquid-canvas.js" type="text/javascript"></script>
<script src="JS/liquid-canvas-plugins.js" type="text/javascript"></script>
<script type="text/javascript" src="js_Eski/JScript.js" language="javascript"></script>
<script type="text/javascript" src="js_Eski/overlib.js" language="javascript"></script>
<script src="JS/boxy/jquery.boxy.js" type="text/javascript"></script>
<style>
.imgOpenClose
{
}
body
{
color: Black;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
$('.imgOpenCloseKurum').click(function() {
if ($(this).attr("src") == "images/openTree.gif") {
$(this).attr("src", "images/closeTree.gif");
$($(this).parent().get(0)).find('div').eq(0).show();
}
else {
$(this).attr("src", "images/openTree.gif");
$($(this).parent().get(0)).find('div').eq(0).hide();
}
});
$('.imgOpenClose').click(function() {
if ($(this).attr("src") == "images/openTree.gif") {
$(this).attr("src", "images/closeTree.gif");
$(this).parent().find('div').eq(0).show();
}
else {
$(this).attr("src", "images/openTree.gif");
$(this).parent().find('div').eq(0).hide();
}
});
$("input:radio").click(function() {
$("input:radio").each(function() {
$(this).attr("checked", "")
});
$(this).attr("checked", "checked");
}).attr("checked", "");
$("input:checkbox").click(function() {
if ($(this).attr('checked')) {
$(this).next().html("Ücretli Seans");
//$(this).attr('checked', '');
}
else {
$(this).next().html("Bedelsiz Seans");
//$(this).attr('checked', 'checked');
}
})
});
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div style="text-align: left;">
<div class="divKriter">
<table>
<thead>
<tr>
<th colspan="2">
FATURA BASKI KRİTERLERİ
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<asp:RadioButtonList ID="rblSgkOzel" runat="server" EnableViewState="true">
<asp:ListItem Text="SGK Kapsamında" Value="sgk" Selected="True"/>
<asp:ListItem Text="Özel" Value="ozel" />
<asp:ListItem Text="Hasta Adına" Value="hasta" />
</asp:RadioButtonList>
</td>
<td>
<asp:TextBox ID="txtTarihi" runat="server" ToolTip="Son Tarihi" />
<cc1:CalendarExtender ID="txtTarihi_CalendarExtender" runat="server" Enabled="True"
TargetControlID="txtTarihi" Format="dd.MM.yyyy">
</cc1:CalendarExtender>
<br />
<asp:CheckBox ID="cbBedelsiz" runat="server" Text="Ücretli Seans" Checked="true" />
<br />
<asp:Button ID="btnFaturaNolariGetir" runat="server" Text="Faturaları Getir" OnClick="btnFaturaNolariGetir_Click" />
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:DropDownList ID="ddlFaturaNolar" runat="server" />
<asp:Button ID="btnFaturaDetaylariniGetir" runat="server" Text="Fatura Detayları"
OnClick="btnFaturaDetaylariniGetir_OnClick" />
</td>
</tr>
</tbody>
</table>
</div>
<br />
<br />
<br />
<br />
<asp:Repeater ID="rptSGK" runat="server" OnItemDataBound="rpt_OnItemDataBound">
<ItemTemplate>
<div class="divKurumItem">
<img class="imgOpenCloseKurum" src="images/openTree.gif" />
<asp:RadioButton ID="rbKurum" runat="server" GroupName="rbKurumlar" />
<%# DataBinder.Eval(Container.DataItem, "kurumAdi")%>
<div style="display: none; margin-left: 10px;">
<asp:Repeater ID="rptHastalar" runat="server" OnItemDataBound="rptHastalar_OnItemDataBound">
<ItemTemplate>
<div style="display: block; margin-left: 10px;">
<img class="imgOpenClose" src="images/openTree.gif" />
<%# DataBinder.Eval(Container.DataItem, "adiSoyadi")%><br />
<div id='hid_<%# DataBinder.Eval(Container.DataItem, "refHasta_id")%>' style="margin: 10px;
display: none;">
<asp:HiddenField runat="server" ID="hdn1" Value='<%# total = 0 %>' />
<asp:Repeater ID="rptSeanslar" runat="server">
<HeaderTemplate>
<table border="1" cellpadding="5" cellspacing="2" style="margin-left: 30px;">
<thead>
<tr>
<th>
Seans Tarihi
</th>
<th>
Başvuru No.
</th>
<th>
Fatura Teslim No.
</th>
<th>
Fatura No.
</th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<%# DataBinder.Eval(Container.DataItem, "tarihi", "{0:d}") %>
</td>
<td>
<%# (rblSgkOzel.SelectedIndex==0) ? DataBinder.Eval(Container.DataItem, "basvuruNo") : "" %>
</td>
<td>
<%# (rblSgkOzel.SelectedIndex==0) ? DataBinder.Eval(Container.DataItem, "faturaTeslimNo") : "" %>
</td>
<td>
<%# (rblSgkOzel.SelectedIndex==0) ? DataBinder.Eval(Container.DataItem, "faturaNo") : ""%>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody> </table> </div>
</FooterTemplate>
</asp:Repeater>
</div>
<asp:HiddenField runat="server" ID="hdn" Value='<%# total = total + 1 %>' />
</ItemTemplate>
<FooterTemplate>
<div style="width: 500px; text-align: right; display: block;">
Toplam Satır Sayısı:
<%# total %>
</div>
</FooterTemplate>
</asp:Repeater>
</div>
<br />
</div>
</ItemTemplate>
</asp:Repeater>
<br />
<br />
<asp:Repeater ID="rptOzel" runat="server" OnItemDataBound="rpt_OnItemDataBound">
<ItemTemplate>
<div class="divKurumItem">
<img class="imgOpenCloseKurum" src="images/openTree.gif" />
<asp:RadioButton ID="rbKurumOzel" runat="server" GroupName="rbKurumlar" />
<%# DataBinder.Eval(Container.DataItem, "kurumAdi")%>
<div style="display: none; margin-left: 10px;">
<asp:Repeater ID="rptHastalar" runat="server" OnItemDataBound="rptHastalar_OnItemDataBound">
<ItemTemplate>
<div style="display: block; margin-left: 10px;">
<img class="imgOpenClose" src="images/openTree.gif" />
<%# DataBinder.Eval(Container.DataItem, "adiSoyadi")%><br />
<div id='hid_<%# DataBinder.Eval(Container.DataItem, "refHasta_id")%>' style="margin: 10px;
display: none;">
<asp:HiddenField runat="server" ID="hdn1" Value='<%# total = 0 %>' />
<asp:Repeater ID="rptSeanslarOzel" runat="server">
<HeaderTemplate>
<table border="1" cellpadding="5" cellspacing="2" style="margin-left: 30px;">
<thead>
<tr>
<th>
Seans Tarihi
</th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:CheckBox ID="cbSeansOzel" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "tarihi", "{0:d}") %>' />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody> </table> </div>
</FooterTemplate>
</asp:Repeater>
</div>
<asp:HiddenField runat="server" ID="hdn" Value='<%# total = total + 1 %>' />
</ItemTemplate>
<FooterTemplate>
<div style="width: 500px; text-align: right; display: block;">
Toplam Satır Sayısı:
<%# total %>
</div>
</FooterTemplate>
</asp:Repeater>
</div>
<br />
</div>
</ItemTemplate>
</asp:Repeater>
</div>
</form>
</body>
</html>

UPDATE: After you posted the updated code, I can tell that the problem is in your jQuery code. It is set to uncheck all the radio buttons as soon as the page loads.
You need to change this:
$("input:radio").click(function() {
$("input:radio").each(function() {
$(this).attr("checked", "") //uncheck all radio buttons in page
});
$(this).attr("checked", "checked"); //check only the selected radio
}).attr("checked", ""); //Unchecks all radio buttons when page loads
To This:
$("input:radio").click(function() {
$("input:radio").each(function() {
$(this).attr("checked", "")
});
$(this).attr("checked", "checked");
});
I added comments to explain what your jQuery code is doing.

Are you binding the list in the Page_Load method?
If so, make sure you are binding only when the page is not posted back, like such:
protected void Page_Load(object sender, EventArgs)
{
if (!IsPostBack)
{
//Bind to the list in this block
}
}

Related

How to display inside html table bound checkbox list and label

If normal table means I got output otherwise how do i get it? My aspx page:
<%# Page Title="" Language="VB" MasterPageFile="~/UserRegistration.master" AutoEventWireup="false"
CodeFile="Default.aspx.vb" Inherits="_Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type="text/javascript"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="Stylesheet" type="text/css" />
<script type="text/javascript">
$(function() {
$("[id$=txtdate]").datepicker({
showOn: 'button',
buttonImageOnly: true,
buttonImage: 'image/datepicker2.jpg'
});
});
</script>
<br />
<br />
<div align="center">
<asp:Label ID="label2" CssClass="label" runat="server"></asp:Label>
</div>
<div align="center">
<asp:TextBox ID="txtdate" DataFormatString="{0:MM/dd/yyyy}" AutoPostBack="true" runat="server" Width="107px"></asp:TextBox>
</div>
<br />
<br />
<table id="Table1" align="center" border="1" runat="server">
<tr>
<th>
TeamName
</th>
<th>
TeamMember
</th>
</tr>
<tr>
<td>
<asp:Label ID="lbl1" runat="server"> Team A </asp:Label>
</td>
<td>
<asp:CheckBoxList ID="cblbind" runat="server">
<asp:ListItem Text="Sinthu"></asp:ListItem>
<asp:ListItem Text="susi"></asp:ListItem>
<asp:ListItem Text="siva"></asp:ListItem>
</asp:CheckBoxList>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label1" runat="server"> Team B </asp:Label>
</td>
<td>
<asp:CheckBoxList ID="CheckBoxList1" runat="server">
<asp:ListItem Text="kavya"></asp:ListItem>
<asp:ListItem Text="subathra"></asp:ListItem>
<asp:ListItem Text="mani"></asp:ListItem>
<asp:ListItem Text="sunila"></asp:ListItem>
</asp:CheckBoxList>
</td>
</tr>
</table>
<div align="center">
<asp:Button ID="btnSubmit" Text="SUBMIT" runat="server" />
</div>
<br />
<br />
Here I put the values directly so I can get them easily.
If team name values and team member values are in the database it means how i can bind these items using a table? If the listview gridview means using bound event, what can I use in the table and how i can get the required output?

click event in modal popup does not get fired

i have inquiry form which gets open in modal popup extender. when i click on button to store data click event does not get fired
i don't know whats going wrong can any one help me to solve this problem
thanks in advance
here is my code
DefaultMaster.master
<%# Master Language="C#" AutoEventWireup="true" CodeFile="DefaultMasterPage.master.cs"
Inherits="DefaultMasterPage" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link type="text/css" rel="Stylesheet" href="../JyotiInstitute/Styles/StyleSheet.css" />
<link type="text/css" rel="Stylesheet" href="../JyotiInstitute/Styles/sliderman.css" />
<link type="text/css" rel="Stylesheet" href="../JyotiInstitute/Styles/style1.css" />
<link type="text/css" rel="Stylesheet" href="../JyotiInstitute/Styles/style2.css" />
<script type="text/javascript" src="Script/jquery-1.3.2.js"></script>
<script type="text/javascript" src="Script/scroll-startstop.events.jquery.js"></script>
<script type="text/javascript" src="Script/sliderman.1.3.7.js"></script>
<script type="text/javascript" src="Script/easytabs.js"></script>
<script type="text/javascript" src="Script/modernizr.custom.04022.js"></script>
<script type="text/javascript" src="Script/modernizr.custom.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
$('#toTop').fadeIn();
} else {
$('#toTop').fadeOut();
}
});
$('#toTop').click(function () {
$("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
});
$(function () {
$('.fadein img:gt(0)').hide();
setInterval(function () {
$('.fadein :first-child').fadeOut()
.next('img').fadeIn()
.end().appendTo('.fadein');
},
4000);
});
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<div class="page-wrap">
<div id="absolute">
<div id="div1" class="div1">
<asp:ImageButton runat="server" ImageUrl="Images/sef111.png" Style="margin-top: 10px;
margin-left: 5px" ID="OpenPopUp1" CausesValidation="false" OnClick="OpenPopUp1_Click" />
<asp:Button ID="btnPopUp1" runat="server" Style="display: none" />
</div>
<div id="div2" class="div2">
<asp:ImageButton ID="OpenPopUp2" runat="server" ImageUrl="Images/scef1.png" Style="margin-top: 2px;"
CausesValidation="false" OnClick="OpenPopUp2_Click" />
<asp:Button ID="btnPopUp2" runat="server" Style="display: none" />
</div>
</div>
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BackgroundCssClass="modalBackground"
PopupControlID="Panel1" TargetControlID="btnPopUp1" CancelControlID="btnClose1">
</asp:ModalPopupExtender>
<asp:Panel runat="server" ID="Panel1" CssClass="modalPopup" align="center" Style="display: none">
<center>
<div class="outer_div">
<div class="inner_div">
<h1>
Student Enquiry Form</h1>
</div>
<div>
<br />
<asp:Literal runat="server" Text=" Your enquiry sent successfully..." ID="ltrMsg1"
Visible="false"></asp:Literal>
<br />
<asp:Label ID="Label2" runat="server" Text="Fileds marked with * are mandatory"></asp:Label>
<br />
<br />
<center>
<table>
<tr>
<td>
<asp:DropDownList ID="drpCourses" runat="server" CssClass="select">
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtName" CssClass="textbox"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender2" runat="server" TargetControlID="txtName" WatermarkText="* Full Name ">
</asp:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtEmail" CssClass="textbox"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender3" runat="server" TargetControlID="txtEmail" WatermarkText="* E-mail ID ">
</asp:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="TextBox1" runat="server" Text="+91" ReadOnly="true" CssClass="textbox"
Width="30px"></asp:TextBox>
<asp:TextBox runat="server" ID="txtMobile" CssClass="textbox" Width="172px"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender4" runat="server" TargetControlID="txtMobile" WatermarkText="* Mobile number ">
</asp:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtCity" CssClass="textbox"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender6" runat="server" TargetControlID="txtCity" WatermarkText="City ">
</asp:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtState" CssClass="textbox"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender5" runat="server" TargetControlID="txtState" WatermarkText="State ">
</asp:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtComments" TextMode="MultiLine" CssClass="textboxMulti"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender7" runat="server" TargetControlID="txtComments" WatermarkText="Comments ">
</asp:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td>
<br />
<center>
<asp:Button ID="btnSave" Text="Save" runat="server" CssClass="btnConrol"
onclick="btnSave_Click" />
</center>
</td>
</tr>
</table>
<%--<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Please select course"
SetFocusOnError="true" ControlToValidate="drpCourses" CssClass="ErrorMsg"></asp:RequiredFieldValidator><br />--%>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Please enter full name"
SetFocusOnError="true" ControlToValidate="txtName" CssClass="ErrorMsg"></asp:RequiredFieldValidator><br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Please enter Email-ID"
SetFocusOnError="true" ControlToValidate="txtEmail" CssClass="ErrorMsg"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" ControlToValidate="txtEmail"
ValidationExpression="\w+([-+.']\w+)*#\w+([-.]\w+)*\.\w+([-.]\w+)*" runat="server"
CssClass="ErrorMsg" SetFocusOnError="true" ErrorMessage="Invalid Email" /><br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Please enter mobile number"
SetFocusOnError="true" ControlToValidate="txtMobile" CssClass="ErrorMsg"></asp:RequiredFieldValidator>
</center>
</div>
</div>
</center>
<asp:ImageButton ImageUrl="Images/close1.png" runat="server" ID="btnClose1" Style="float: right;
margin-top: -645px; margin-right: -20px;" />
</asp:Panel>
<asp:ModalPopupExtender ID="ModalPopupExtender_2" runat="server" BackgroundCssClass="modalBackground"
PopupControlID="Panel2" TargetControlID="btnPopUp2" CancelControlID="btnClose2">
</asp:ModalPopupExtender>
<asp:Panel runat="server" ID="Panel2" CssClass="modalPopup" align="center" Style="display: none">
<center>
<div class="outer_div">
<div class="inner_div">
<h1>
Institute Enquiry Form</h1>
</div>
<div>
<br />
<asp:Literal runat="server" Text=" Your enquiry sent successfully..." ID="ltrMsg2"
Visible="false"></asp:Literal>
<br />
<asp:Label ID="Label1" runat="server" Text="Fileds marked with * are mandatory"></asp:Label><br />
<br />
<table>
<tr>
<td>
<asp:TextBox runat="server" ID="txtFullName" CssClass="textbox"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender8" runat="server" TargetControlID="txtFullName" WatermarkText="* Full Name ">
</asp:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtEmailId" CssClass="textbox"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender9" runat="server" TargetControlID="txtEmailId" WatermarkText="* E-mail ID ">
</asp:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="TextBox3" runat="server" Text="+91" ReadOnly="true" CssClass="textbox"
Width="30px"></asp:TextBox>
<asp:TextBox runat="server" ID="txtMobileNum" CssClass="textbox" Width="172PX"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender10" runat="server" TargetControlID="txtMobileNum"
WatermarkText="* Mobile number ">
</asp:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtCityName" CssClass="textbox"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender11" runat="server" TargetControlID="txtCityName"
WatermarkText="City ">
</asp:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtStateName" CssClass="textbox"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender12" runat="server" TargetControlID="txtStateName"
WatermarkText="State ">
</asp:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtPin" CssClass="textbox"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender14" runat="server" TargetControlID="txtPin" WatermarkText="Pin Code ">
</asp:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtComment" TextMode="MultiLine" CssClass="textboxMulti"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender13" runat="server" TargetControlID="txtComment" WatermarkText="Comments ">
</asp:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td>
<br />
<center>
<asp:Button runat="server" ID="btnStore" Text="Save" CssClass="btnConrol"
onclick="btnStore_Click" />
</center>
</td>
</tr>
</table>
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Field cannot be left blank"
SetFocusOnError="true" ControlToValidate="txtFullName" CssClass="ErrorMsg"></asp:RequiredFieldValidator><br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="Field cannot be left blank"
SetFocusOnError="true" ControlToValidate="txtEmailId" CssClass="ErrorMsg"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="regEmail" ControlToValidate="txtEmailId" ValidationExpression="\w+([-+.']\w+)*#\w+([-.]\w+)*\.\w+([-.]\w+)*"
runat="server" CssClass="ErrorMsg" SetFocusOnError="true" ErrorMessage="Invalid Email" /><br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ErrorMessage="Field cannot be left blank"
SetFocusOnError="true" ControlToValidate="txtMobileNum" CssClass="ErrorMsg"></asp:RequiredFieldValidator>
</div>
</div>
</center>
<asp:ImageButton ImageUrl="Images/close1.png" runat="server" ID="btnClose2" Style="float: right;
margin-top: -630px; margin-right: -20px;" />
</asp:Panel>
<div id="head-wrap">
<div id="back-wrap">
</div>
<div id="menu">
<ul class="tabs">
<li>News </li>
<li>E-Prospectus</li>
<li>Help Center</li>
<li>Contact Us</li>
<li>Test</li>
</ul>
</div>
<div id="tab-container">
<div id="tabs">
<div id="logo_hm">
<div id="hm_outer">
<a href="Index.aspx">
<img alt="" src="Images/hm.png" style="margin-left: 4px; margin-top: 4px; border-radius: 5px" /></a>
</div>
</div>
<div id="tab_outer">
<div id="MainMenu">
<center>
<ul id="nav">
<li style="display: inline"><span>Home</span></li>
<li style="display: inline; top: 0px; left: 0px;"><a href="AboutUs.aspx"><span>About
Us</span></a> </li>
<li style="display: inline"><span>Academics</span>
<ul class="nav first">
<li>Overview</li>
<li>Ordinances & Regulations</li>
<li>Programmes </li>
</ul>
</li>
<li style="display: inline; width: 100px"><span>Study Centers</span>
<ul class="nav first">
<li>Join As Study Center</li>
</ul>
</li>
<li style="display: inline"><span>Downloads</span></li>
</ul>
</center>
</div>
<div id="search-box">
<div id="searchwrapper">
<form action="">
<asp:TextBox runat="server" ID="txtSearch" CssClass="searchbox"></asp:TextBox>
<asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server" TargetControlID="txtSearch"
WatermarkText="Courses, Study Centers">
</asp:TextBoxWatermarkExtender>
<%-- <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="Images/search1.png"
CssClass="searchbox_submit" PostBackUrl="~/Search.aspx" />--%>
<a href="Search.aspx">
<img alt="" src="Images/search1.png" class="searchbox_submit" /></a>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="middle-wrap">
<div id="left">
<div id="logo">
<img alt="" src="Images/Jyoti_logo .jpg" width="100%" height="100%" />
</div>
</div>
<div id="right">
<div style="float: left;">
<div id="slider">
<div id="Div3" class="fadein">
<img src="Images/c1.jpg" alt="" />
<img src="Images/c2.jpg" alt="" />
<img src="Images/c3.jpg" alt="" />
<img src="Images/c4.jpg" alt="" />
<img src="Images/c5.jpg" alt="" />
</div>
<div class="SliderName_3Description">
<span>Jyoti Institute of IT & Management</span>
<br />
<span style="text-transform: none; font-size: 14px">Jaunpur (UP)</span>
</div>
<%-- <div class="slider">
<center>
<div id="slider_container_3">
<div id="SliderName_3">
<img alt="" src="Images/c1.jpg" />
<img alt="" src="Images/c2.jpg" />
<img alt="" src="Images/c3.jpg" /><img alt="" src="Images/c5.jpg" />
<img alt="" src="Images/c4.jpg" />
</div>
<div class="SliderName_3Description">
<span>Jyoti Institute of IT & Management</span>
<br />
<span style="text-transform: none; font-size: 14px">Jaunpur (UP)</span>
</div>
</div>
</center>
<script type="text/javascript">
demo3Effect1 = { name: 'myEffect31', top: true, move: true, duration: 400 };
demo3Effect2 = { name: 'myEffect32', right: true, move: true, duration: 400 };
demo3Effect3 = { name: 'myEffect33', bottom: true, move: true, duration: 400 };
demo3Effect4 = { name: 'myEffect34', left: true, move: true, duration: 400 };
demo3Effect5 = { name: 'myEffect35', rows: 3, cols: 9, delay: 50, duration: 100, order: 'random', fade: true };
demo3Effect6 = { name: 'myEffect36', rows: 2, cols: 4, delay: 100, duration: 400, order: 'random', fade: true, chess: true };
effectsDemo3 = [demo3Effect1, demo3Effect2, demo3Effect3, demo3Effect4, demo3Effect5, demo3Effect6, 'blinds'];
var demoSlider_3 = Sliderman.slider({ container: 'SliderName_3', width: 790, height: 300, effects: effectsDemo3,
display: { autoplay: 3000 },
description: { background: '#000000', opacity: 0.5, height: 30, position: 'bottom' }
});
</script>--%>
</div>
</div>
</div>
</div>
</div>
<div id="Content-wrap">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
<div class="site-footer">
<center>
<span>&COPY; Copyrights, 2013 Jyoti Institute | Designed & Developed by Weblord Infotech</span>
</center>
</div>
</form>
</body>
</html>
DefaultMaster.master.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class DefaultMasterPage : System.Web.UI.MasterPage
{
Enquiry objEnquiry = new Enquiry();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void OpenPopUp1_Click(object sender, ImageClickEventArgs e)
{
ModalPopupExtender1.Show();
}
protected void OpenPopUp2_Click(object sender, ImageClickEventArgs e)
{
ModalPopupExtender_2.Show();
}
private void Clear()
{
drpCourses.SelectedIndex = 0;
txtName.Text = "";
txtFullName.Text = "";
txtEmail.Text = "";
txtEmailId.Text = "";
txtMobile.Text = "";
txtMobileNum.Text = "";
txtCity.Text = "";
txtCityName.Text = "";
txtState.Text = "";
txtStateName.Text = "";
txtPin.Text = "";
txtComment.Text = "";
txtComments.Text = "";
}
protected void btnStore_Click(object sender, EventArgs e)
{
//Studycenter enquiry form
//objEnquiry.EnterStudyCenterEnquiry(0, txtFullName.Text, txtEmailId.Text, txtMobileNum.Text, txtCityName.Text, txtStateName.Text, txtPin.Text, txtComment.Text);
ltrMsg2.Visible = true;
Clear();
}
protected void btnSave_Click(object sender, EventArgs e)
{
//Student enquiry form
//objEnquiry.EnterStudentEnquiry(0, drpCourses.SelectedItem.Text, txtName.Text, txtEmail.Text, txtMobile.Text, txtCity.Text, txtState.Text, txtComments.Text);
ltrMsg1.Visible = true;
Clear();
}
}
Is a request being submited to the server or is it not doing anything it all?
In the case of nothing happening my experience usually is a validationhandler that's invisible and blocking the call.
Try adding causesValidation="False" to your save button as a test to see if that is the issue
If it works without validation find the validator that's failing and fix it ! ;)
In my case I used UseSubmitBehavior="false". The reason behind this is explained here:
Microsoft Docs on UseSubmitBehavior
Gets or sets a value indicating whether the Button control uses the client browser's submit mechanism or the ASP.NET postback mechanism.
It appears that instead of trying to postback it was using the client browser submit so my code behind wasnt firing,

Add Master Page form values not returning on request.form

UPDATED ISSUE:
I converted some pages to use master pages and they worked fine.
When doing request.form on child page (form declaration is in master page) I get a null value (just doing Request.Form("field") returns NULL but before master pages it worked
NOTE: ALL the code worked fine before implementing master pages!!
The button code is:
<asp:Button ID="btnPACheck" runat="server" Text="<%$Resources:share,btnPACheck %>" onclick="btnPACheck_Click" />
The view soruce on the html page for the button is:
<input type="submit" name="ctl00$ContentPlaceHolder1$btnPACheck" value="Continue" id="ctl00_ContentPlaceHolder1_btnPACheck" />
The onclick code is long but it is declared like this (and first line has the debug line placed on it and it is not getting to it):
protected void btnPACheck_Click(object sender, EventArgs e)
{
bool validPA = false;
Master page is below:
<%# Master Language="C#" AutoEventWireup="true" CodeFile="MasterPageSiteWide.master.cs" Inherits="MasterPageSiteWide" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%# Register src="~/ucBanner.ascx" TagName="Banner" TagPrefix="ucBanner" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
body {
background: url(page-bg.gif) repeat-x top left #5997C8;
CLIP: rect(19px 65px 50px 10px);
margin-top: 10px;
margin-bottom:30px;
margin-right: 40px;
margin-left: 60px;
width:80%;
}
TD.bluerow {
height: .10pc;
background-color: #000066;
}
TD.medbluerow {
height: .0005pc;
background-color: #6699CC;
}
.panel_with_padding {
padding-top:10px;
padding-left:10px;
padding-right:10px;
padding-bottom:10px;
}
</style>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server" method="post">
<asp:ScriptManager ID="ScriptManager1" EnableScriptGlobalization="true" EnableScriptLocalization="true" runat="server"></asp:ScriptManager>
<asp:RoundedCornersExtender Corners="All" TargetControlID="MainPanel" BorderColor="Black" ID="RoundedCornersExtender1" runat="server"></asp:RoundedCornersExtender>
<asp:Panel BackColor="White" runat="server" ID="MainPanel" CssClass="panel_with_padding">
<div>
<br />
<div>
<asp:Label ID="lblTopHeading" runat="server" Font-Bold="true" Font-Size="X-Large" Text=""></asp:Label>
</div>
<br />
<ucBanner:Banner ID="bannerStrip" runat="server"></ucBanner:Banner>
<br />
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
<br /><br />
<hr />
<div>
© Copyright 20xx-2012, Ford Motor Company. All rights reserved.
</div>
</asp:Panel>
</form>
</body>
</html>
Content page (part of cant post whole thing too long) where button is:
<%# Page Language="C#" MasterPageFile="~/MasterPageSiteWide.master" AutoEventWireup="true" CodeFile="initial.aspx.cs" ValidateRequest="false" Inherits="initial" UICulture="auto"%>
<%# MasterType virtualPath="~/MasterPageSiteWide.master"%>
<%# Register src="~/ucBanner.ascx" TagName="Banner" TagPrefix="ucBanner" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<title>Hotline - Dealer Prior Approval - Begin</title>
<link href="Styles/dpaStyles.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
function OpenPopUp() {
window.open("collectvin.aspx", "List", "scrollbars=no,resizable=no,width=400,height=350");
}
function InvokePop(vin) {
val = document.getElementById(vin).value;
// to handle in IE 7.0
if (window.showModalDialog) {
retVal = window.showModalDialog("collectvin.aspx?Control1=" + vin + "&ControlVal=" + val, 'Show Popup Window', "dialogHeight:90px,dialogWidth:250px,resizable:yes,center:yes,");
document.getElementById(vin).value = retVal;
}
}
function checkChoice() {
var hasFound = false
for (i = 0; i < document.secpaform.SecPACode.length; i++) {
if (document.secpaform.SecPACode[i].checked == true) {
hasFound = true
break;
}
}
if (!hasFound) {
alert("Please select one...")
document.secpaform.SecPACode[0].focus();
return false
}
else
return true
}
function checkOldVin() {
//alert('inside checkOldVin');
if (frmInitial.txtOldVin.value == '') {
alert('Please enter the VIN for an older vehicle!!!');
frmInitial.txtOldVin.focus();
return false;
}
var alphanumeric = /^[0-9a-zA-Z]+$/;
if (!frmInitial.txtOldVin.value.match(alphanumeric)) {
alert('VIN must be numbers and letters only!');
frmInitial.txtOldVin.focus();
return false;
}
return true;
}
function checkPartChoice() {
//alert('in checkPartsChoice');
}
</script>
<style type="text/css">
body {
background: url(page-bg.gif) repeat-x top left #5997C8;
CLIP: rect(19px 65px 50px 10px);
margin-top: 10px;
margin-bottom:30px;
margin-right: 40px;
margin-left: 60px;
width:80%;
}
TD.bluerow {
height: .10pc;
background-color: #000066;
}
TD.medbluerow {
height: .0005pc;
background-color: #6699CC;
}
p.MsoNormal
{margin-top:0in;
margin-right:0in;
margin-bottom:10.0pt;
margin-left:0in;
line-height:115%;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<!-- -------------------------->
<!-- start outer table, rounded corners -->
<!-- -------------------------->
<table style="width: 95%;" align="center" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="8" height="11" bgcolor="#ffffff"><img src="images/ccbackground/HLEFT.jpg" alt=""/></td>
<td bgcolor="#ffffff" background="images/ccbackground/TOPbg.jpg"><img src="images/ccbackground/TOPbg.jpg" alt=""/></td>
<td width="8" height="11" bgcolor="#ffffff"><img src="images/ccbackground/HRIGHT.jpg" alt=""/></td>
</tr>
<tr>
<td width="8" background="images/ccbackground/LEFTbg.jpg"><img src="images/ccbackground/LEFTbg.jpg" alt=""/></td>
<td align="center" height="800" valign="top" bgcolor="white" >
<div>
<asp:Label ID="lblTopHeading" runat="server" Font-Bold="true" Font-Size="X-Large" Text="<%$Resources:share,lblTopHeading %>" EnableViewState="false"></asp:Label>
</div>
<!-- -------------------------->
<!-- begin main page content -->
<!-- -------------------------->
<asp:UpdatePanel ID="tryUP" runat="server">
<ContentTemplate>
<table width="100%" align="center" style="font-size:14px; font-family:Verdana,Arial;">
<tr align="center">
<td align="center" >
<br />
<ucBanner:Banner ID="bannerStrip" runat="server"></ucBanner:Banner>
<asp:LinkButton ID="LinkButton1" Text="English" Visible="false" runat="server" onclick="LinkButton1_Click"></asp:LinkButton><br />
<asp:Label ID="Label22" runat="server" Font-Size="Small" Text="<%$Resources:share,lblpartstatement %>" EnableViewState="false"></asp:Label>
<br />
<asp:LinkButton ID="LinkButton2" Text="<%$Resources:share,lblPartsList %>" Visible="true" runat="server" ></asp:LinkButton>
<br />
</td>
</tr>
<tr>
<td style="font-size:10px; padding-left:130px;">
<asp:Label ID="lblInitialHeading" runat="server" Font-Bold="true" Text="" EnableViewState="false"></asp:Label>
</td>
<td align="center" valign="top">
<asp:Label ID="Label1" runat="server" Font-Bold="true" Font-Size="Large" Text=""></asp:Label>
</td>
</tr>
<tr align="center">
<td align="center">
<div id="Div1" class="example1" runat="server" visible="true" >
<a href="javascript:window.close();" style="color:Red; float:right">
<span>
<asp:Label ID="lblClose" Font-Names="Verdana" Font-Size="Medium" runat="server" Text="<%$ Resources:share,lblClose %>"></asp:Label>
</span>
</a>
</div>
</td>
</tr>
<tr align="center">
<td align="center" valign="top" style="font-size:16px; font-family:Verdana,Tahoma; font-weight:bold">
<div id="divButtons" runat="server" visible="true" >
<asp:Label ID="lblPAtypeheading" runat="server" Font-Names="Verdana" Text="<%$ Resources:share,lblPAtypeheading %>"></asp:Label> <asp:Label ID="lblPAtype" Font-Names="Verdana" runat="server" Font-Underline="true" Text=""></asp:Label>
</div>
</td>
</tr>
</table>
<br />
<div id="divPAnotrequired" runat="server" visible="false">
<asp:Label ID="lblNotRequired" runat="server" Font-Names="Verdana" Text="<%$Resources:share,lblPANotRequired %>" EnableViewState="false"></asp:Label>
<br />
</div>
<div id="divRADnotrequired" runat="server" visible="false">
<asp:Label ID="Label5" runat="server" Font-Names="Verdana" Text="<%$Resources:share,lblRADNotRequired %>" EnableViewState="false"></asp:Label>
<br />
</div>
<div id="divCHMSLnotrequired" runat="server" visible="false">
<asp:Label ID="Label7" runat="server" Font-Names="Verdana" Text="<%$Resources:share,lblCHMSLNotRequired %>" EnableViewState="false"></asp:Label>
<br />
</div>
<div id="divTaurusRearLampNotRequired" runat="server" visible="false">
<asp:Label ID="Label11" runat="server" Font-Names="Verdana" Text="<%$Resources:share,lblTaurusRearLampNotRequired %>" EnableViewState="false"></asp:Label>
<br />
</div>
<div id="divRangerChatterNotRequired" runat="server" visible="false">
<asp:Label ID="Label15" runat="server" Font-Names="Verdana" Text="<%$Resources:share,lblRangerChatterNotRequired %>" EnableViewState="false"></asp:Label>
<br />
</div>
<div id="divFlexSqueakNotRequired" runat="server" visible="false">
<asp:Label ID="Label16" runat="server" Font-Names="Verdana" Text="<%$Resources:share,lblFlexSqueakNotRequired %>" EnableViewState="false"></asp:Label>
<br />
</div>
<div id="divEscapeNoiseNotRequired" runat="server" visible="false">
<asp:Label ID="Label17" runat="server" Font-Names="Verdana" Text="<%$Resources:share,lblEscapeNoiseNotRequired %>" EnableViewState="false"></asp:Label>
<br />
</div>
<div id="divFiestaGlassNotRequired" runat="server" visible="false">
<asp:Label ID="Label18" runat="server" Font-Names="Verdana" Text="<%$Resources:share,lblFiestaGlassNotRequired %>" EnableViewState="false"></asp:Label>
<br />
</div>
<div id="divScratchesNotRequired" runat="server" visible="false">
<asp:Label ID="Label20" runat="server" Font-Names="Verdana" Text="<%$Resources:share,lblScratchesNotRequired %>" EnableViewState="false"></asp:Label>
<br />
</div>
<div id="divCostCap" runat="server" visible="false">
<asp:Label ID="lblCostCap" runat="server" Font-Size="Medium" Font-Names="Verdana" ForeColor="IndianRed" Font-Bold="true" Text="<%$Resources:share,lblCostCap %>" EnableViewState="false"></asp:Label>
<div id="closeButtonDiv" class="closeButton" runat="server" visible="true" >
</div>
</div>
<div id="divRadMileage" runat="server" visible="false">
<div class="medBlueRow" style="width:700px; height:2px;"></div>
<table width="90%" align="center" style="font-size:14px; font-family:Verdana,Arial;">
<tr>
<td style="font-size:16px; font-family:Verdana,Tahoma; font-weight:bold">
<asp:Label ID="Label4" runat="server" Font-Names="Verdana" Text="<%$Resources:share,lblRadMileage %>" EnableViewState="false"></asp:Label>
</td>
</tr>
<tr>
<td align="center" style="font-size:12px; font-family:Verdana,Tahoma; font-weight:bold" height="125" valign="middle">
<asp:RadioButtonList ID="RadioButtonList1" runat="server" OnSelectedIndexChanged="btnIndexchange_Click" AutoPostBack="True">
<asp:ListItem Text="<%$Resources:share,lblYes %>" Value="yes"></asp:ListItem>
<asp:ListItem Text="<%$Resources:share,lblNo %>" Value="no"></asp:ListItem>
</asp:RadioButtonList>
<br />
<asp:Button ID="Button1" runat="server" Visible="false" Text="<%$Resources:share,btnDslParts %>" />
<br /><br />
</td>
</tr>
</table>
</div>
<div id="divCHMSL" runat="server" visible="false">
<table width="90%" align="center" style="font-size:14px; font-family:Verdana,Arial;">
<tr>
<td style="font-size:16px; font-family:Verdana,Tahoma; font-weight:bold">
<asp:Label ID="Label6" runat="server" Font-Names="Verdana" Text="<%$Resources:share,lblCHMSL %>" EnableViewState="false"></asp:Label>
</td>
</tr>
<tr>
<td align="center" style="font-size:12px; font-family:Verdana,Tahoma; font-weight:bold" valign="middle">
<asp:RadioButtonList ID="RadioButtonList2" runat="server" OnSelectedIndexChanged="btnIndexchangeCHMSL_Click" AutoPostBack="True">
<asp:ListItem Text="<%$Resources:share,lblCHMSLYes %>" Value="yes"></asp:ListItem>
<asp:ListItem Text="<%$Resources:share,lblCHMSLNo %>" Value="no"></asp:ListItem>
</asp:RadioButtonList>
Found Solution: Found the issue.
The form was doing Request. Form and that was returning NULL for all the values.
I just changed it to do the formfield.value instead of request.form("FormField")
This solved the issue.
Sorry for initial confusion on what the initial issue was.

IE 8 not displaying page

My page is not displaying in IE8. It works fine if I debug in IE and change it to IE7 standards under Internet Explorer 8 browser mode. I'm not sure what is wrong. If I add a meta tag with IE7 specified, it loads the page, and then looks like it forwards it to a blank page. All of the html is there in the debug information, and it works fine in IE7 browser mode, or in Firefox. Any ideas? Here is my header:
Master Page:
<%# Master Language="C#" AutoEventWireup="true" CodeFile="Site2.master.cs" Inherits="Site2" %>
<%# Register TagPrefix="uc" TagName="Header" Src="~/Controls/Header.ascx" %>
<%# Register TagPrefix="uc" TagName="Footer" Src="~/Controls/Footer.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<link href="Styles/Site.css" rel="Stylesheet" type="text/css" />
<script src="<%= ResolveClientUrl("Scripts/jquery-1.4.1.js") %>" type="text/javascript" > </script>
<script src="<%= ResolveClientUrl("Scripts/Jquery.min.js") %>" type="text/javascript" > </script>
<script src="<%= ResolveClientUrl("Scripts/menu.js") %>" language="javascript" type="text/javascript" > </script>
<script src="<%= ResolveClientUrl("Scripts/jquery-ui-1.8.10.custom.min.js") %>" type="text/javascript" > </script>
<script src="<%= ResolveClientUrl("Scripts/EasyConfirm.js") %>" type="text/javascript" > </script>
<link href="<%= ResolveClientUrl("Styles/jquerySmoothness.css") %>" rel="stylesheet" type="text/css" />
</head>
<body >
<form id="form1" runat="server" enctype="multipart/form-data" method ="post" >
<asp:ScriptManager ID="ScriptManager1" AjaxFrameworkMode="Enabled" EnablePartialRendering="true" runat="server" />
<div class="container">
<uc:Header runat="server" ID="headerTest" Title="RTSC SCM" Subtitle="Logistics SOS" />
<div class="content2 " style ="position:relative; padding-bottom: 10px" >
<asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server"/>
<%--</asp:ContentPlaceHolder>--%>
<!-- end .content --></div>
<uc:Footer runat="server" ID="footer" TeamName="RTSC Logistics SOS Tool Support Team" />
<!-- end .container --></div>
</form>
</body>
</html>
Page:
<%# Page Title="RTSC SOS - Storage Request View" Language="C#" MasterPageFile="~/Site2.master" AutoEventWireup="true" CodeFile="StorageRequest.aspx.cs" Inherits="Forms_StorageRequest" ContentType="IE7" %>
<%# Register TagPrefix="uc" TagName="EmployeeSearch" Src="~/Controls/TinyEmployeeSearch.ascx" %>
<%# Register Src="~/Controls/AdditionalInfo.ascx" TagPrefix="R" TagName="AddInfo" %>
<%# Register Src="~/Controls/LamEditComments.ascx" TagPrefix="R" TagName="StorageLocation" %>
<%# Register Src="~/Controls/RequestHeader.ascx" TagPrefix="R" TagName="reqheader" %>
<%# Register Src="~/Controls/HandlingUnitInfo.ascx" TagPrefix="R" TagName="handlingView" %>
<%# Register Src="~/Controls/DocumentGrid.ascx" TagPrefix="R" TagName="docView" %>
<%# Register Src="~/Controls/EmailGrid.ascx" TagPrefix="R" TagName="emailView" %>
<%# Register src="~/Controls/RequestInfo.ascx" tagname="requestinfo" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<script type ="text/javascript" src="../Forms/FormsJS/StorageRequest.js"></script>
<script type ="text/javascript" src="../Scripts/ajaxfileupload.js"></script>
<div id="input" runat ="server" style="width: 960px" >
<R:reqheader id="m_reqHeaderCtr" runat="server" />
<r:docView ID="docView" runat="server" Visible = "true" />
<r:emailView ID="emailView" runat="server" Visible = "true"/>
<uc1:requestinfo ID="requestinfo1" runat="server" Visible = "false" />
<%-- Request Edit Information --%>
<fieldset id="RequestEdit" runat ="server" style="border-color: #CCC; width: 960px;" >
<legend style="border-style: none;font-size:small; color: Blue;">Request Information</legend>
<div style="margin: 0px; padding: 0px; float:left" >
<table>
<tr style="height: 25px;">
<td class ="BDecoNone bold" width="60px">
<img id="star1" runat ="server" src="../Images/red_star.gif" alt="Red Star" class="RedStars"/> Program:
</td>
<td width="120px">
<asp:DropDownList ID="strgProg_DD" Height="20px" runat="server" AutoPostBack="false" CssClass="TBDecoSmall">
</asp:DropDownList>
<span id="Program_Span" runat="server" />
</td>
<td runat="server" id="Other_TR" class="bold" style="text-align:right;display:none;">
<img id="star3" runat ="server" src="../Images/red_star.gif" alt="red_star" class="RedStars" />
<asp:Label ID="OtherTD" Text = "Other Program:" Width = "73px" runat ="server" ></asp:Label>
</td>
<td width="100px">
<asp:TextBox ID="m_otherProgramTB" runat="server" CssClass="TBDecoNone" ViewStateMode="Enabled" Height="12px" Wrap="False"></asp:TextBox>
</td>
<td width="100px">
</td>
</tr>
</table>
<table>
<tr>
<td class="bold TBDecoSmall " >
<img id="star4" runat ="server" src="../Images/red_star.gif" alt="Red Star" class="RedStars"/>Ownership:
</td>
<td colspan="1">
<span id="m_ownershipSpan" runat="server" class="bold" />
<asp:RadioButtonList ID="OwnRadioButtonList" runat="server" CssClass="bold" RepeatColumns="5" RepeatDirection="Horizontal"></asp:RadioButtonList>
</td>
<td>
</td>
</tr>
</table>
<table>
<tr>
<td class="bold TBDecoQuan" style ="width:150px">
<img id="star5" runat ="server" src="../Images/red_star.gif" alt="Red Star" class="RedStars"/>Check to Certify:
</td>
<td colspan="1">
<span ID="Material_CB_Span" runat="server"></span>
<asp:CheckBox ID="Material_CB" runat="server" AutoPostBack="false" CssClass="cb bold" Text="Material is NOT Classified" Width="150px" />
</td>
</tr>
</table>
<table>
<tr>
<td class="bold TBDecoSmall" style="width: 150px; height: 24px;">
<img id="star6" runat ="server" src="../Images/red_star.gif" alt="Red Star" class="RedStars"/>Storage Requirements:
</td>
<td colspan="1" style="height: 24px">
<asp:CheckBoxList ID="m_storageList" runat="server" AutoPostBack="false" CssClass="Space bold" RepeatColumns="5" />
</td>
</tr>
</table>
<table>
<tr ID="TempStorageInstruction_TR" runat="server" >
<td class="bold TBDecoSmall" colspan="1" style="width: 180px">
<img id="star7" runat ="server" src="../Images/red_star.gif" alt="Red Star" class="RedStars"/>Temperature Storage Instructions:
</td>
<td >
<span ID="TempStorageSpan" runat="server" class="bold"></span>
<asp:TextBox ID="TempStorageInstruction_TB" runat="server" CssClass="Bmar TBDecoLong" ValidationGroup="saveAll" ViewStateMode="Enabled" Height="20px" TextMode="MultiLine" Width="220px"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr ID="OtherStorageInstruction_TR" runat="server" >
<td class="bold TBDecoSmall" style="width: 150px">
<img id="star8" runat ="server" src="../Images/red_star.gif" alt="Red Star" class="RedStars"/> Other Storage Instructions:
</td>
<td >
<span ID="m_otherInstSpan" runat="server" class="bold"></span>
<asp:TextBox ID="OtherStorageInstruction_TB" runat="server" CssClass="Bmar TBDecoLong" Height="20px"
TextMode="MultiLine" ValidationGroup="saveAll" ViewStateMode="Enabled" Width="220px"></asp:TextBox>
</td>
<td>
</td>
</tr>
</table>
</div>
<div style="position: relative; width: 360px; float: right; height: auto; padding-top: 5px; top: 0px;" >
<div class="TBDecoNone" style ="padding: 0x; margin: 0px; float: left" >
<img id="star2" runat ="server" src="../Images/red_star.gif" alt="Red Star" class="RedStars"/> Program Point of Contact:
</div>
<div style ="float : left">
<uc:employeesearch id="progrmPointOfContact_TB" runat="server" scheme="Red" Enabled="false" />
</div>
</div>
</fieldset>
<fieldset runat="server" id ="EditGrid" style="border-color: #CCC; width: 960px;">
<legend style="border-style: none;font-size:small; color: Blue;">
Handling Unit Information</legend>
<div id="GridHolder">
<R:handlingView ID="handlingViewGrid" runat="server" Visible = "true" />
<br />
</div>
<div>
<input type="button" id="m_addNewItem" value="Add Material" style="border-color:#87BF83;color:Black" class="AddB" onclick="AddMaterial()" />
</div>
<div id="m_detailsView" runat="server" style="display:none">
<table cellpadding="1" cellspacing="1">
<tr>
<td class="TextDeco"><img src="../Images/red_star.gif" alt="red_star" class="RedStars"/>Material Number:</td>
<td class="TextDeco"><img src="../Images/red_star.gif" alt="red_star" class="RedStars"/>Description: </td>
<td class="TextDeco"> Manufacturer:</td>
<td class="TextDeco"> Model:</td>
</tr>
<!-- End Header section-->
<tr style="height: 20px; vertical-align: top;">
<!--Material TextBox ID=MatNum_TB-->
<td>
<asp:TextBox ID="MatNum_TB" runat="server" CssClass="TBDeco" Width="175px" Wrap="False"></asp:TextBox>
<br />
</td>
<!--Description TextBox-->
<td>
<asp:TextBox ID="Des_TB" runat="server" CssClass="TBDeco" Width="175px" Wrap="False"></asp:TextBox>
</td>
<!--Manufacturer TextBox-->
<td class="TBDeco">
<asp:TextBox ID="Manufac_TB" runat="server" CssClass="TBDeco" Width="250px" Wrap="False"></asp:TextBox>
<br />
</td>
<!--Model TextBox-->
<td>
<asp:TextBox ID="Model_TB" runat="server" CssClass="TBDeco" Wrap="False" Width="100px"></asp:TextBox>
<br />
</td>
</tr>
<tr>
<td class="TextDeco">
<img src="../Images/red_star.gif" alt="red_star" class="RedStars"/>Material Type:
</td>
<td class="TextDeco" style ="width:150px">
<img src="../Images/red_star.gif" class="RedStars" alt="red_star"/>Inv. Classification:
</td>
<td class="TextDeco" >
<img src="../Images/red_star.gif" alt="red_star" class="RedStars"/>Shelf-Life:
</td>
<td class="TextDeco" >
</td>
</tr>
<tr valign="top">
<td>
<!--Material Type DropDownList-->
<asp:DropDownList ID="MatType_DD" Height="20px" runat="server" CssClass="TBDeco" Width="150px" ></asp:DropDownList>
<br />
</td>
<!--Inventory DropDownList-->
<td>
<asp:DropDownList ID="Inv_DD" Height="20px" runat="server" CssClass="TBDeco" Width="150px"></asp:DropDownList>
<br />
</td>
<td width="240px">
<div style="float: left; height: 20px auto; width: 130px;" >
<asp:TextBox ID="SLife_TB" runat="server" CssClass="TBDecoSmall" Wrap="False" Width="120px" onclick="document.getElementById('ContentPlaceHolder2_SLife_TB').focus();"></asp:TextBox>
<br />
</div>
<div style="float:right; height: 20px auto;" >
<asp:CheckBox ID="Unlimit_CB" runat="server" AutoPostBack="false" CssClass="TBDecoSmall" Height="20px" Text="Unlimited" />
</div>
</td>
</tr>
<!--Header-->
<tr>
<td class="TextDeco">
<img src="../Images/red_star.gif" alt="red_star" class="RedStars"/>Charge Number:
</td>
<td class="TextDeco" style="margin-left:15px;">
Owning Cost Center:
</td>
<td class="TextDeco" style="margin-left:15px;">
Unit Value:
</td>
</tr>
<tr class="bold" style="vertical-align: top">
<!--Charge Number TextBox-->
<td width="250px">
<asp:TextBox ID="Charge_TB" runat="server" CssClass="TBDeco" Width="143px"></asp:TextBox>
<br />
</td>
<!--Owning Cost Center TextBox-->
<td>
<asp:TextBox ID="Own_TB" runat="server" CssClass="TBDeco" Width="143px"></asp:TextBox>
<br />
</td>
<td>
<asp:TextBox ID="Line_TB" runat="server" CssClass="TBDeco" Width="120px"></asp:TextBox>
<br /><br />
</td>
</tr>
</table>
<table cellpadding="1" cellspacing="1" rules="none" frame="void" style="margin: 0px; padding: 0px" >
<tr class="bold ">
<td width="108px">
<img src="../Images/red_star.gif" alt="red_star" class="RedStars" />Serialized:
</td>
<td width="60px" >
<asp:RadioButtonList ID="Seri_RB" runat="server" RepeatDirection="Horizontal" AutoPostBack="false" Width="80px" >
<asp:ListItem Value="1">Yes</asp:ListItem>
<asp:ListItem Value="0">No</asp:ListItem>
</asp:RadioButtonList>
</td>
<td width="193px">
<img id="starForQuantity" runat ="server" src="../Images/red_star.gif" alt="Red Star" class="RedStars"/> Quantity:
<br />
<asp:TextBox ID="Quan_TB" runat="server" Width="143px" Wrap="False" CssClass="TBDecoNone"></asp:TextBox>
</td>
<td width="300px" id="SerialNumber" runat ="server" >
<img id="starForSerial" runat ="server" src="../Images/red_star.gif" alt="Red Star" class="RedStars"/> Serial Number:
<br />
<asp:TextBox ID="Seri_TB" runat="server" Width="120px" CssClass="TBDecoNone" Wrap ="false" ></asp:TextBox>
</td>
</tr>
<tr class="bold " >
<td>
<img src="../Images/red_star.gif" alt="red_star" class="RedStars"/>Moisture Sensitive:
</td>
<td width="60px">
<asp:RadioButtonList ID="Moist_RB" runat="server" AutoPostBack="false" RepeatDirection="Horizontal" >
<asp:ListItem Value="1">Yes</asp:ListItem>
<asp:ListItem Value="0">No</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr class="bold " >
<td >
<img src="../Images/red_star.gif" alt="red_star" class="RedStars"/>Hazardous:
</td>
<td width="80px">
<asp:RadioButtonList ID="Haz_RB" runat="server" RepeatDirection="Horizontal" AutoPostBack="false" >
<asp:ListItem Value="1">Yes</asp:ListItem>
<asp:ListItem Value="0">No</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
</table>
<table>
<tr class="bold" runat="server" id="MSDS_TR" style="display:none">
<td width="130px;">
<img src="../Images/red_star.gif" alt="red_star" class="RedStars"/>
<asp:Label ID="MSDSLabel" runat="server" Text="MSDS Number:"></asp:Label>
</td>
<td width="100px">
<asp:TextBox ID="MSDS_TB" runat="server" CssClass="TBDecoSmall" Wrap="False" Width="100px"></asp:TextBox>
</td>
<td></td>
<td width="440px" colspan="1" >
<div style="float:left" > Attached MSDS: </div>
<input type="file" id="MSDSFileUpload" runat="server" style="width:330px;height:20px" />
</td>
</tr>
</table>
<table id="pkg" runat ="server" >
<tr class="bold" >
<%-- Pack_TR is to make the red star image visible/invisible--%>
<td runat="server" id="Pack_TR" visible="true" >
<img src="../Images/red_star.gif" alt="red_star" class="RedStars"/>Packaging Requirement:
</td>
<td colspan="3" style="width: 468px; text-align:left;" align="left">
<asp:CheckBoxList ID="PackingReq_CBL" runat="server" AutoPostBack="false"
CssClass="Space" RepeatDirection="Horizontal" Visible="true" />
</td>
</tr>
</table>
<table id ="pkgOther" runat ="server" style="display:none">
<tr id="OtherPkgRequirent_TR" runat="server" class="bold " style ="vertical-align:middle;" >
<td>
<img src="../Images/red_star.gif" alt="red_star" class="RedStars"/>Other Packaging Requirement:
</td>
<td colspan="2" align="left">
<asp:TextBox ID="OtherPkgRequirent_TB" runat="server" Width="550px" Wrap="False"></asp:TextBox>
</td>
<td>
</td>
</tr>
</table>
<center>
<div id="mat_err" style="color:red" runat="server" ></div>
<div style="">
<input type="button" id="btnSave" value="Save Material Number" onclick="return SaveMaterialData();" />
<input type="button" id="btnSaveAddMaterial" value="Save and Add Material Number" />
<input type="button" id="btnCancel" value="Cancel" onclick="Cancel()" />
</div>
</center>
</div>
</fieldset>
</div>
</asp:Content>
Have you tried running it through the XHTML validator?
http://validator.w3.org/
you may find errors in there that are compromising the rest of the page's html.

Cannot get the ModalPopupExtender to run via code

I cannnot get the ModalPopupExtender to work via code. If I set the ModalPopupExtender's property TargetControlID="btn", it works. When I set TargetControlID="HiddenField1" to use the mpe.show() method in the code, it does not work (the dgvResults_RowCommand event fires fine, I have tested it). I have gone through many sites looking at code, and cannot figure out whats wrong. Thanks in advance for any help
<%# Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="Michlala._Default" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<style type="text/css">
.modalPopup
{
background-color: Black;
filter: alpha(opacity=80);
opacity: 0.8;
z-index: 10000;
}
.style1
{
width: 100%;
}
.style5
{
text-align: center;
}
</style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<h1> Student Feedback</h1>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<br />
<asp:TextBox ID="txtSID" runat="server" Width="61px" Height="25px"></asp:TextBox>
<asp:Button ID="btnSID" runat="server" onclick="Button1_Click"
Text="Submit Student ID" />
<asp:GridView ID="dgvResults" runat="server" Visible="False"
onrowcommand="dgvResults_RowCommand">
<Columns>
<asp:TemplateField>
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Button ID="btnFeedback" runat="server" onclick="Button1_Click1"
Text="Add FeedBack" CommandName="InsertFeedback" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" />
<asp:HiddenField ID="HiddenField1" runat="server" />
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
TargetControlID="HiddenField1"
PopupControlID="pnlModalPanel"
CancelControlID="btnCancel"
BackgroundCssClass="modalPopup" >
</asp:ModalPopupExtender>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Panel ID="pnlModalPanel" runat="server" style="display:none" Width="481px" >
<table class="style1">
<tr>
<td>
Course
</td>
<td>
Semester
</td>
<td class="style5">
Teacher Assitant
</td>
<td class="style5">
Lecturer
</td>
</tr>
<tr>
<td>
&nbsp
<asp:TextBox ID="txtCourse" runat="server"></asp:TextBox>
</td>
<td>
&nbsp
</td>
<td>
&nbsp
</td>
<td>
&nbsp
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center">
<asp:Button ID="btnSubmit" runat="server" Text="Submit" />
</td>
<td colspan="2">
&nbsp
<asp:Button ID="btnCancel" runat="server" Text="Cancel" />
</td>
</tr>
</table>
</asp:Panel>
<asp:DropDownList ID="ddlSemester" runat="server">
</asp:DropDownList>
<asp:Label ID="lblRes" runat="server" Text="Label"></asp:Label>
<br />
</asp:Content>
in the server side code
protected void dgvResults_RowCommand(object sender, GridViewCommandEventArgs e)
{
ModalPopupExtender mpe = new ModalPopupExtender();
mpe.Show();
}
You need to fin the ModalPopupExtender in the selected row and then call it with the name:
if (e.CommandName.Equals("InsertFeedback"))
{
int index = Convert.ToInt32(e.CommandArgument);
// Retrieve the row that contains the button clicked
// by the user from the Rows collection.
GridViewRow row = dgvResults.Rows[index];
ModalPopupExtender mpe = (ModalPopupExtender)row.FindControl("ModalPopupExtender1");
mpe.Show();
}

Resources