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>© 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,
Related
I'm working on shopping cart application where I have listed all the products in a ListView. Then on button click of each product the image slider changes. Now I want to make it on mouseover instead of click. Below is the code I have tried to achieve.
ASP
<div class="col-md-12 ">
<div class="col-md-4 single_left pull-left">
<div class="flexslider">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Repeater runat="server" ID="Repeater">
<HeaderTemplate>
<ul class="slides">
</HeaderTemplate>
<ItemTemplate>
<li data-thumb='<%# "assets/products/"+DataBinder.Eval(Container.DataItem, "Image1") %>'>
<asp:Image ID="image5" runat="server"
ImageUrl='<%# "assets/products/"+DataBinder.Eval(Container.DataItem, "Image1") %>' />
</li>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:Repeater>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<script defer src="assets/js/jquery.flexslider.js"></script>
<link rel="stylesheet" href="assets/css/flexslider.css" type="text/css" media="screen" />
<!-- FlexSlider -->
<div class="caption">
<strong>
<asp:Label ID="lblPrice" runat="server" Text="*"></asp:Label></strong>
<strong>
<asp:Label ID="ItemCode" runat="server" Text="*"></asp:Label></strong>
<p>
<small><strong>
<asp:Label ID="lblDesc" runat="server" Text="*"></asp:Label>
</strong></small>
<br />
<asp:Label ID="lblID" Style="display: none;" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
<small>
<asp:Label ID="lblMsg" runat="server" Text="*" ForeColor="#990000"></asp:Label>
</small>
<br />
</p>
<asp:TextBox ID="txtqty" type="number" class="form-control" Text="0" runat="server"></asp:TextBox>
</div>
<asp:LinkButton ID="btnSubmit" type="submit" CssClass="add-cart item_add" runat="server" OnClick="btnSubmit_Click"><i class="fa fa-save"></i> Add to Cart</asp:LinkButton>
<script>
// Can also be used with $(document).ready()
$(window).load(function () {
$('.flexslider').flexslider({
animation: "slide",
controlNav: "thumbnails"
});
});
</script>
</div>
<div class="col-md-8 single-top-in simpleCart_shelfItem">
<asp:ListView ID="ImagesList" runat="server"
DataKeyNames="ID"
GroupItemCount="15"
OnPagePropertiesChanging="ImagesList_PagePropertiesChanging" OnSelectedIndexChanged="OnSelectedIndexChanged">
<EmptyDataTemplate>
No Images found.
</EmptyDataTemplate>
<LayoutTemplate>
<table>
<tr runat="server" id="groupPlaceholder" />
</table>
</LayoutTemplate>
<GroupTemplate>
<tr>
<td runat="server" id="itemPlaceholder" />
</tr>
</GroupTemplate>
<ItemTemplate>
<td>
<asp:LinkButton ID="LBtn" runat="server"
CommandName="Change"
OnCommand="btnDetails_Command"
CommandArgument='<%# Eval("Notes") %>'>
<img src='<%#"assets/products/"+Eval("ImageUrl").ToString() %>' class="image" style="Width:50px;Height:50px" alt="Change" onmouseover="this.OnCommand" />
</asp:LinkButton>
</td>
</ItemTemplate>
</asp:ListView>
</div>
<div class="clearfix"></div>
<!---->
</div>
I must say that your approach of mouseovering which triggers click - seems not as the right solution. ( Just saying)
Anyway - Change your code to :
<asp:LinkButton ... CssClass="myButton"
...
</asp:LinkButton>
Then , via jQuery (which you already use) :
$(function (){
$(".myButton").on('mouseover',function (){this.click()});
});
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.
I have multiple UpdatePanels on a webpage, one inside UserControl (Purple ColorBox as show in image) and other inside the main page. When the paging user-control (< 1 2 3 >) of Main page is invoked it shows the corresponding UpdateProgress of 'Latest News' Section but also shows the UpdatePanelAnimationExtender of 'Subscribe' User-control.
I am using UpdatePanelAnimationExtender for user-control and UpdateProgress for the Latest-New which is on the main page.
I tried to change the properties but it keeps on coming; if I keep UpdateMode="Conditional" for user control then progress bar goes in loop and show continuously.
Screen Shot
How can I make changes to this code to show only corresponding progress bar. I have looked over 50 example from last few days but nun seems to be working. I would appreciate if someone can help me to get this fixed.
<!-- LatestNewArea -->
<div class="LatestNewArea">
<asp:UpdatePanel ID="updLatestNews" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Repeater ID="rptLatestNews" runat="server" EnableViewState="False" onitemdatabound="rptLatestNews_ItemDataBound">
<ItemTemplate>
<asp:HyperLink ID="hylLatestNews" CssClass="chylLatestNews" runat="server" NavigateUrl=''>
<div class="LatestNewsWrapper">
<div class="LatestNewsDateBox">
<div class="LNYYYY">
<asp:Label ID="lblYYYY" runat="server" Text="2012"></asp:Label>
</div>
<div class="LNDDMM">
<asp:Label ID="lblDDMM" runat="server" Text="12/08"></asp:Label>
</div>
</div>
<div class="LatestNewsTitle">
<asp:Label ID="lblLatestNewsTitle" runat="server" Text="First News for the Website"></asp:Label>
</div>
<div class="LatestNewsHDate">
<asp:Label ID="Label1" runat="server" Text="Hijri: 15 Rajab 1433"></asp:Label>
</div>
<div class="LatestNewsDesc">
<asp:Label ID="Label2" runat="server" Text=""></asp:Label>
</div>
</div>
<div class="LNHLine"> </div>
</asp:HyperLink>
</ItemTemplate>
</asp:Repeater>
<!-- Pager -->
<div class="LatestNewsPagerWrapper">
<div class="LatestNewsPagerInnerWrapper">
<asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="50" AssociatedUpdatePanelID="updLatestNews" >
<ProgressTemplate>
<div id="imgLoadingArticleList" class="imgLoadingArticleList">
<asp:Image ID="imgLoading" runat="server" ImageUrl="~/images/ajax-loader-bar2.gif" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<uc1:PagerControl ID="PagerControl1" runat="server" CssClass="gold-pager" PageMode="LinkButton" />
</div>
</div>
<!-- Pager -->
</ContentTemplate>
</asp:UpdatePanel>
</div>
<!-- LatestNewArea -->
User Control Page Code
<script type="text/javascript">
function onUpdating() {
// get the divImage
var panelProg = $get('divImage');
// set it to visible
panelProg.style.display = '';
// hide label if visible
var lbl = $get('<%= this.pnlSubscribe.ClientID %>');
lbl.innerHTML = '';
}
function onUpdated() {
// get the divImage
var panelProg = $get('divImage');
// set it to invisible
panelProg.style.display = 'none';
}
</script>
<table cellpadding="0" cellspacing="0" class="SubscribeContainer">
<tr>
<td align="center">
<table cellpadding="0" cellspacing="0" class="SubscribeWrapper" border="0">
<tr>
<td valign="top">
<asp:UpdatePanel ID="updSubscribe" runat="server" >
<ContentTemplate>
<asp:Panel ID="pnlSubscribe" runat="server" Height="10px">
<div class="SubHeading"><asp:Label ID="lblTitle" runat="server" Text="JOIN US"></asp:Label></div>
<div class="dSubName">
<asp:TextBox ID="txtName" CssClass="txtSubscribe" runat="server" Text="NAME" onfocus="if(this.value=='NAME')this.value='';" onblur="if(this.value=='')this.value='NAME';"></asp:TextBox>
</div>
<div class="dSubEmail">
<asp:TextBox ID="txtEmail" CssClass="txtSubscribe" runat="server" Text="YOUR EMAIL" onfocus="if(this.value=='YOUR EMAIL')this.value='';" onblur="if(this.value=='')this.value='YOUR EMAIL';"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvEmailSub" runat="server" ErrorMessage="*"
ControlToValidate="txtEmail" ValidationGroup="SubEmail" ></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="revEmailSub" runat="server"
ErrorMessage="*" ControlToValidate="txtEmail" ValidationExpression="\w+([-+.']\w+)*#\w+([-.]\w+)*\.\w+([-.]\w+)*"
ValidationGroup="SubEmail" ></asp:RegularExpressionValidator>
</div>
<div class="dSubSubmit">
<asp:Button ID="btnSubscribe" CssClass="btnSubscribe" runat="server" ValidationGroup="SubEmail" Text="Subscribe" onclick="btnSubscribe_Click" />
</div>
</asp:Panel>
<div class="dSubMSG">
<asp:Label ID="lblMSG" runat="server" Text=""></asp:Label>
</div>
<div id="divImage" style="display:none" class="dSubAni">
<asp:Image ID="Image1" runat="server" ImageUrl="~/Images/loader-sub.png" Visible="true"/>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanelAnimationExtender ID="UpdatePanelAnimationExtender1" TargetControlID="updSubscribe" runat="server">
<Animations>
<OnUpdating>
<Parallel duration="0">
<ScriptAction Script="onUpdating();" />
<EnableAction AnimationTarget="btnSubscribe" Enabled="false" />
</Parallel>
</OnUpdating>
<OnUpdated>
<Parallel duration="0">
<ScriptAction Script="onUpdated();" />
<EnableAction AnimationTarget="btnSubscribe" Enabled="true" />
</Parallel>
</OnUpdated>
</Animations>
</asp:UpdatePanelAnimationExtender>
</td>
</tr>
</table>
</td>
</tr>
</table>
Other Info: ASP.Net 4.0, C# & Paging control is a user control that uses linkbutton for paging
I tried many solution but non of them worked in a proper way. Finally i decided to replace UpdatePanelAnimationExtender of user control with UpdateProgress as I was able to trap the initiating UpdatePanel for AsyPostback
For some reason i was not able to trap AsyPostback when i used UpdatePanelAnimationExtender
This approach can be used for multiple update panel one need to trap the initiating control for post-back
BELOW IS A WORKING CODE
// Function to hide control on update
function onUpdateOfSubscribe() {
var panelProg = $get('divImage');
// set it to visible
panelProg.style.display = '';
// hide label if visible
var lbl = $get('<%= this.pnlSubscribe.ClientID %>');
lbl.innerHTML = '';
}
//Code to track the initiating event so to associate updateprogress
var currentPostBackElement;
function pageLoad() {
var manager = Sys.WebForms.PageRequestManager.getInstance();
manager.add_initializeRequest(OnInitializeRequest);
}
//On OnInitializeRequest
function OnInitializeRequest(sender, args) {
var manager = Sys.WebForms.PageRequestManager.getInstance();
currentPostBackElement = args.get_postBackElement().parentElement;
var cmdAuthoriseButton = '<%= btnSubscribe.ClientID %>';
if (cmdAuthoriseButton == args._postBackElement.id) {
// Show UpdateProgress for subscribe
onUpdateOfSubscribe();
}
}
</script>
<table cellpadding="0" cellspacing="0" class="SubscribeContainer">
<tr>
<td align="center">
<table cellpadding="0" cellspacing="0" class="SubscribeWrapper" border="0" >
<tr>
<td valign="top">
<asp:UpdatePanel ID="updSubscribe" runat="server" UpdateMode="Conditional" >
<ContentTemplate>
<asp:Panel ID="pnlSubscribe" runat="server" Height="10px">
<div class="SubHeading"><asp:Label ID="lblTitle" runat="server" Text="JOIN US"></asp:Label></div>
<div class="dSubName">
<asp:TextBox ID="txtName" CssClass="txtSubscribe" runat="server" Text="NAME" onfocus="if(this.value=='NAME')this.value='';" onblur="if(this.value=='')this.value='NAME';"></asp:TextBox>
</div>
<div class="dSubEmail">
<asp:TextBox ID="txtEmail" CssClass="txtSubscribe" runat="server" Text="YOUR EMAIL" onfocus="if(this.value=='YOUR EMAIL')this.value='';" onblur="if(this.value=='')this.value='YOUR EMAIL';"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvEmailSub" runat="server" ErrorMessage="*"
ControlToValidate="txtEmail" ValidationGroup="SubEmail" ></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="revEmailSub" runat="server"
ErrorMessage="*" ControlToValidate="txtEmail" ValidationExpression="\w+([-+.']\w+)*#\w+([-.]\w+)*\.\w+([-.]\w+)*"
ValidationGroup="SubEmail" ></asp:RegularExpressionValidator>
</div>
<div class="dSubSubmit">
<asp:Button ID="btnSubscribe" CssClass="btnSubscribe" runat="server" ValidationGroup="SubEmail" Text="Subscribe" onclick="btnSubscribe_Click" />
</div>
</asp:Panel>
<div class="dSubMSG">
<asp:Label ID="lblMSG" runat="server" Text=""></asp:Label>
</div>
<div id="divImage" style="display:none" class="dSubAni">
<asp:Image ID="Image1" runat="server" ImageUrl="~/Images/loader-sub.png" Visible="true"/>
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnSubscribe" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="updSubscribe" >
<ProgressTemplate>
</ProgressTemplate>
</asp:UpdateProgress>
</td>
</tr>
</table>
</td>
</tr>
</table>
I have 2 panels and using ajax modalpopup control
<asp:Panel ID="pnlHead" runat="server" CssClass="modalPopup">
<asp:Panel ID="pnlBody" runat="server">
<div id="popupHead">
<div id="popup_left">
<asp:Label ID="lblProduct" runat="server"></asp:Label></div>
<!-- end banner_left -->
<div id="popup_right">
</div>
<!-- end banner_right -->
</div>
</asp:Panel>
<p>
<asp:PlaceHolder ID="phcontrol" runat="server"></asp:PlaceHolder>
</p>
<div>
<center>
<asp:ImageButton ID="imgbtnOk" runat="server" OnClick="imgbtnOk_Click" />
</center>
</div>
</asp:Panel>
<asp:Panel ID="pnlHeadWD" runat="server" CssClass="modalPopupWD"
BackImageUrl="~/WebSiteContent/Images/Cloud.JPG">
<asp:Panel ID="pnlBodyWD" runat="server">
<div id="Div1" style="position: absolute; left: 15%; top: 15%; vertical-align: middle;">
<br />
<br />
<br />
<br />
<br />
<p>
<asp:PlaceHolder ID="phcontrolWD" runat="server"></asp:PlaceHolder>
</p>
<div>
<center>
<asp:ImageButton ID="imgbtnOkWD" runat="server" Visible="false" OnClientClick="$find('pnlHeadWD').hide(); return false;" />
</center>
</div>
</div>
</asp:Panel>
</asp:Panel>
<asp:TextBox ID="txtHidden" Visible="false" runat="server"></asp:TextBox>
<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="lblCopyright"
PopupControlID="pnlHead" BackgroundCssClass="modalBackground" DropShadow="true"
PopupDragHandleControlID="pnlBody">
</cc1:ModalPopupExtender>
<cc1:ModalPopupExtender ID="ModalPopupExtender2" runat="server" TargetControlID="lblCopyright"
BehaviorID="pnlHeadWD" PopupControlID="pnlHeadWD" BackgroundCssClass="modalBackground"
DropShadow="true" PopupDragHandleControlID="pnlBodyWD">
</cc1:ModalPopupExtender>
when I tried to call the first ModalPopupExtender1 then even the second ModalPopupExtender2 is getting executed and 2 modal popup extenders are shown.
public void Populate_Popup(String URL,String Message_Identifier)
{
this.ModalPopupExtender1.Show();
}
public void Populate_Popup2(string Message)
{
this.ModalPopupExtender2.Show();
}
Your TargetControlID="lblCopyright" is the same for both ModalPopupExtenders.
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
}
}