Radiobutton in modalpopup causing postback even when inside UpdatePanel - c#

Posted is an abridged code of my user control. I have added an update panel over radio button and want to execute a server function which will toggle between consultant drop down list and reference name text box based on the selection without a full post back. But the radio button is causing a full postback. What am I doing wrong here?
<aj:ModalPopupExtender ID="ModalPopup1" runat="server" PopupControlID="Panel1"
BackgroundCssClass="PopupBackground" CancelControlID="closeButton">
</aj:ModalPopupExtender>
<asp:Panel ID="Panel1" runat="server" CssClass="PopupPanel" align="center" style = "display:none">
<h1 class="PopupHeading">Add New Candidate</h1>
<table class="PopupTable">
<tr>
<td>
<asp:Label ID="firstNameLabel" runat="server" Text="First Name" CssClass="PopupLabel"></asp:Label>
</td>
<td>
<asp:TextBox ID="firstNameTextBox" runat="server" Font-Size="14px" ></asp:TextBox>
</td>
<td class="ValidationError">
<asp:RequiredFieldValidator ID="nameRequiredFieldValidator" runat="server"
ValidationGroup="AddCandidateValidationGroup"
ErrorMessage="Name is required" Text="*"
ControlToValidate="firstNameTextBox" CssClass="failureNotification">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="emailLabel" runat="server" Text="Email" CssClass="PopupLabel"></asp:Label>
</td>
<td>
<asp:TextBox ID="emailTextBox" runat="server" Font-Size="14px" ></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
ValidationGroup="AddCandidateValidationGroup"
ErrorMessage="Email is required" Text="*"
ControlToValidate="emailTextBox" CssClass="failureNotification">*</asp:RequiredFieldValidator>
</td>
<td>
<asp:RegularExpressionValidator ID="emailRegularExpressionValidator"
runat="server" ErrorMessage="Incorrect Email"
ValidationGroup="AddCandidateValidationGroup"
ControlToValidate="emailTextBox"
ValidationExpression="\w+([-+.']\w+)*#\w+([-.]\w+)*\.\w+([-.]\w+)*"
CssClass="failureNotification" Text="Incorrect email">
</asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="referredByLabel" runat="server" Text="Referred By" CssClass="PopupLabel"></asp:Label>
</td>
<td>
<asp:UpdatePanel ID="updatepanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:RadioButtonList ID="RefConsRadButList" runat="server" AutoPostBack="true"
RepeatDirection="Horizontal" OnSelectedIndexChanged="RefConsRadButList_SelectedIndexChanged" CausesValidation="false">
<asp:ListItem >Consultant</asp:ListItem>
<asp:ListItem>Referral</asp:ListItem>
<asp:ListItem Selected="True">N/A</asp:ListItem>
</asp:RadioButtonList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="RefConsRadButList" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td>
<asp:Label ID="consultantNameLabel" runat="server" Text="Consultant Name" Visible="false" CssClass="PopupLabel"></asp:Label>
</td>
<td>
<asp:DropDownList ID="ConsultantDrDoList" runat="server" Visible="false">
<asp:ListItem>Select Consultant</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
<asp:Label ID="referenceNameLabel" runat="server" Text="Reference Name" Visible = "false" CssClass="PopupLabel"></asp:Label>
</td>
<td>
<asp:TextBox ID="ReferralNameTextBox" runat="server" Visible="false"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="refNameRequiredFieldValidator" runat="server"
ValidationGroup="AddCandidateValidationGroup"
ErrorMessage="Referral name is required" Text="*"
ControlToValidate="phoneTextBox" CssClass="failureNotification">*</asp:RequiredFieldValidator>
</td>
</tr>
</table>
<br />
<asp:Button ID="addButton" runat="server" Text="Add" onclick="addButton_Click" ValidationGroup="AddCandidateValidationGroup"/>
<asp:Button ID="closeButton" runat="server" Text="Close" />
<div id="AddStatus">
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
ValidationGroup="AddCandidateValidationGroup"
HeaderText="Add user failed due to the following errors:" CssClass="PopupValidationError"/>
</div>
</asp:Panel>

instead of using updatepanel on modalpopup panel you can try something from code behind to serve the purpose.
<asp:scriptmanager id="ScriptManager1" runat="server">
</asp:scriptmanager>
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BackgroundCssClass="modalBackground"
CancelControlID="btnCancel" PopupControlID="Panel1"
TargetControlID="HiddenField1">
</asp:ModalPopupExtender>
<asp:Panel ID="Panel1" runat="server" CssClass="Panel">
<asp:RadioButtonList ID="RadioButtonList1" runat="server" Height="34px" RepeatDirection="Horizontal"
Width="129px" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged"
AutoPostBack="True">
<asp:ListItem>Option1</asp:ListItem>
<asp:ListItem>Option2</asp:ListItem>
</asp:RadioButtonList>
<asp:TextBox ID="txt1" runat="server"
Visible="False"></asp:TextBox>
<asp:TextBox ID="txt2" runat="server"
Visible="False"></asp:TextBox>
</asp:Panel>
===========================================
Code Behind:
===========================================
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (RadioButtonList1.SelectedIndex == 0)
{
txt1.Visible = true;
ModalPopupExtender1.Show();
}
else
{
txt2.Visible = true;
ModalPopupExtender1.Show();
}
}

Related

RequiredFieldValidator for dropdownlist not working on Submit button click

I have a RequiredFieldValidator for dropdownlist. Both are inside UpdatePanel. It is not validating user selection from dropdownlist when submit button is clicked. Please guide what am I missing.
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div id="divFilter">
<asp:UpdatePanel ID="uplMain" runat="server">
<ContentTemplate>
<asp:PlaceHolder ID="PlaceHolder1" runat="server">
<table>
<tr>
<td valign="top">
<table>
<tr>
<td>
<asp:CheckBox ID="chkBusiness" runat="server" Text="Business Division" CssClass="chkbox" />
</td>
<td>
<asp:DropDownList ID="ddlBusiness" runat="server" AppendDataBoundItems="true" AutoPostBack="true"
CausesValidation="True" OnSelectedIndexChanged="ddlBusiness_SelectedIndexChanged"
ValidationGroup="grpSubmit" Width="350px">
<asp:ListItem Selected="True" Value="-1">--- SELECT ---</asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="rfvBusiness" runat="server" ControlToValidate="ddlBusiness"
ToolTip="Please select a Business." ErrorMessage="*" CssClass="required" Display="Dynamic"
ValidationGroup="grpSubmit" Enabled="false">
</asp:RequiredFieldValidator>
</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:PlaceHolder>
<hr size="1" />
<div style="text-align: center">
<table style="width: 10%">
<tr>
<td>
<asp:Button ID="btnHome" runat="server" Text="Home" OnClick="btnHome_Click" CssClass="btn" />
</td>
<td>
<asp:Button ID="btnSubmitReport" runat="server" Text="Submit" OnClick="btnSubmitReport_Click"
ValidationGroup="grpSubmit" CssClass="btn" />
</td>
</tr>
</table>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
Try setting the Enabled attribute in the RequiredFieldValidator element to "True".

error creating control , Unable to create type 'cc1: TabContainer', could not load file or assembly System.Web.extension, Version=1.0.61025.0'

error creating control , Unable to create type 'cc1: TabContainer', could not load file or assembly System.Web.extension, Version=1.0.61025.0'
The system cannot find the file specified
im getting this error . can u tell me where im wrong? why cant i see my design in aspx ?
code
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<cc1:TabContainer runat="server" ID="Tab_Continer" ActiveTabIndex="0">
<cc1:TabPanel ID="TabPnl_Project" runat="server">
<HeaderTemplate>
Keyword Position</HeaderTemplate>
<ContentTemplate>
<table>
<tr>
<td>
<asp:Label ID="lbl_Project" runat="server" Text="Project"></asp:Label>
</td>
<td>
<asp:DropDownList ID="ddlProject" runat="server" OnSelectedIndexChanged="ddlProject_SelectedIndexChanged"
AutoPostBack="true">
</asp:DropDownList>
<asp:RequiredFieldValidator Display="Dynamic" ID="RequiredFieldValidator3" runat="server"
ErrorMessage="*" ControlToValidate="ddlProject" ValidationGroup="ValPos"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblLkeyword" runat="server" Text="Keyword"></asp:Label>
</td>
<td>
<asp:DropDownList ID="ddlKeyword" runat="server" OnSelectedIndexChanged="ddlKeyword_SelectedIndexChanged"
AutoPostBack="true">
</asp:DropDownList>
<asp:RequiredFieldValidator Display="Dynamic" ID="RequiredFieldValidator2" runat="server"
ErrorMessage="*" ControlToValidate="ddlKeyword" ValidationGroup="ValPos"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblPos" runat="server" Text="Position"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtPostion" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator Display="Dynamic" ID="RequiredFieldValidator1" runat="server"
ErrorMessage="*" ControlToValidate="txtPostion" ValidationGroup="ValPos"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtPostion"
ValidationExpression="^[0-9]{0,3}$" ErrorMessage="*" ValidationGroup="ValPos"
ToolTip="Enter only numeric values" Display="Dynamic"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lbl_Date" runat="server" Text="Date"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtDate" runat="server"></asp:TextBox>
<cc1:CalendarExtender ID="Ajax_Calend" runat="server" TargetControlID="txtDate">
</cc1:CalendarExtender>
<asp:RequiredFieldValidator Display="Dynamic" ID="Valid_Req_DtFrm" runat="server"
ErrorMessage="*" ControlToValidate="txtDate" ValidationGroup="ValPos"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
</td>
<td align="left">
<asp:Button ID="btn_Submit" runat="server" Text="Submit" ValidationGroup="ValPos"
OnClick="btn_Submit_Click" CssClass="button" />
</td>
</tr>
<tr>
<td>
</td>
<td align="left">
<asp:Label ID="LblMsg" runat="server" Font-Bold="true"></asp:Label>
</td>
</tr>
</table>
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="Tab_Update" runat="server">
<HeaderTemplate>
Traffic</HeaderTemplate>
<ContentTemplate>
<asp:UpdatePanel ID="update12" runat="server">
<ContentTemplate>
<table>
<tr>
<td>
<asp:Label ID="lblProject" runat="server" Text="Project"></asp:Label>
</td>
<td>
<asp:DropDownList ID="ddl_Project" runat="server">
</asp:DropDownList>
<asp:RequiredFieldValidator Display="Dynamic" ID="RequiredFieldValidator4" runat="server"
ErrorMessage="*" ControlToValidate="ddl_Project" ValidationGroup="ValTraffic"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblTraffic" runat="server" Text="Traffic"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtTarffic" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator Display="Dynamic" ID="RequiredFieldValidator5" runat="server"
ErrorMessage="*" ControlToValidate="txtTarffic" ValidationGroup="ValTraffic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtTarffic"
ValidationExpression="^[0-9]{0,5}$" ErrorMessage="*" ToolTip="Enter only numeric values"
ValidationGroup="ValTraffic" Display="Dynamic"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label1" runat="server" Text="Date"></asp:Label>
</td>
<td>
<asp:TextBox ID="Txt_Date" runat="server"></asp:TextBox>
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="Txt_Date">
</cc1:CalendarExtender>
<asp:RequiredFieldValidator Display="Dynamic" ID="RequiredFieldValidator6" runat="server"
ErrorMessage="*" ControlToValidate="Txt_Date" ValidationGroup="ValTraffic"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
</td>
<td align="left">
<asp:Button ID="btnSave" runat="server" ValidationGroup="ValTraffic" Text="Submit"
OnClick="btnSave_Click" CssClass="button" />
</td>
</tr>
<tr>
<td>
</td>
<td align="left">
<asp:Label ID="lbl_Msg" runat="server" Font-Bold="true"></asp:Label>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>

hide textbox by onselectIndexChange event

In my website I have a dropdown list with 2 values. I am trying to write this code to hide textbox by onselectIndexChange event without refreshing the page.
for this goal I used Update panel but on dropDownList select there is no change in textboxs visibility.
my codes:
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<table dir="rtl">
<tr>
<td>
<asp:Label ID="Label1" runat="server" Text="شخص :"></asp:Label></td>
<td>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="DropDownList1" EnableViewState="true" AutoPostBack="true" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem Selected="True">حقیقی</asp:ListItem>
<asp:ListItem>حقوقی</asp:ListItem>
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="DropDownList1" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
</td>
</tr>
<asp:Panel ID="pnlname" runat="server">
<tr>
<td>
<asp:Label ID="Label2" runat="server" Text="نام و نام خانوادگی : "></asp:Label>
</td>
<td>
<asp:TextBox ID="txtname" runat="server" Width="415px"></asp:TextBox>
</td>
</tr>
</asp:Panel>
<asp:Panel ID="pnlMname" runat="server">
<tr>
<td>
<asp:Label ID="Label3" runat="server" Text="نام و نام خانوادگی مسئول : "></asp:Label>
</td>
<td>
<asp:TextBox ID="txtmname" Width="415px" runat="server"></asp:TextBox>
</td>
</tr>
</asp:Panel>
<tr>
<td>
<asp:Label ID="Label4" runat="server" Text="شماره قرارداد : "></asp:Label>
</td>
<td>
<asp:TextBox ID="txtIdgharardad" Width="415px" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label7" runat="server" Text="علت درخواست اعزام کارشناس : "></asp:Label>
</td>
<td>
<asp:TextBox ID="txtellat" Width="415px" runat="server" Height="194px" TextMode="MultiLine"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label5" runat="server" Text="شماره همراه : "></asp:Label>
</td>
<td>
<asp:TextBox ID="txtNumber" Width="415px" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label6" runat="server" Text="شماره ثابت : "></asp:Label>
</td>
<td>
<asp:TextBox ID="txtSnumber" Width="415px" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="ثبت درخواست" />
</td>
<td> </td>
</tr>
</table>
.cs file:
protected void Page_Load(object sender, EventArgs e)
{
pnlMname.Visible = false;
}
protected void Button1_Click(object sender, EventArgs e)
{
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (DropDownList1.SelectedValue == "حقیقی")
{
pnlMname.Visible = false;
pnlname.Visible = true;
}
else if (DropDownList1.SelectedValue == "حقوقی")
{
pnlname.Visible = false;
pnlMname.Visible = true;
}
}
Try Like This:
Use your All code Inside Update Panels
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
// All Controls Placed Here
</ContentTemplate><Triggers>
</Triggers> </asp:UpdatePanel>
By default it will use Asynchronous postback
Code:
<asp:Label ID="Label1" runat="server" Text="شخص :"></asp:Label></td>
<td>
<asp:DropDownList ID="DropDownList1" EnableViewState="true" AutoPostBack="true" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem Selected="True">حقیقی</asp:ListItem>
<asp:ListItem>حقوقی</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<asp:Panel ID="pnlname" runat="server">
<tr>
<td>
<asp:Label ID="Label2" runat="server" Text="نام و نام خانوادگی : "></asp:Label>
</td>
<td>
<asp:TextBox ID="txtname" runat="server" Width="415px"></asp:TextBox>
</td>
</tr></asp:Panel>
<asp:Panel ID="pnlMname" runat="server">
<tr>
<td>
<asp:Label ID="Label3" runat="server" Text="نام و نام خانوادگی مسئول : "></asp:Label>
</td>
<td>
<asp:TextBox ID="txtmname" Width="415px" runat="server"></asp:TextBox>
</td>
</tr></asp:Panel>
<tr>
<td>
<asp:Label ID="Label4" runat="server" Text="شماره قرارداد : "></asp:Label>
</td>
<td>
<asp:TextBox ID="txtIdgharardad" Width="415px" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label7" runat="server" Text="علت درخواست اعزام کارشناس : "></asp:Label>
</td>
<td>
<asp:TextBox ID="txtellat" Width="415px" runat="server" Height="194px" TextMode="MultiLine"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label5" runat="server" Text="شماره همراه : "></asp:Label>
</td>
<td>
<asp:TextBox ID="txtNumber" Width="415px" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label6" runat="server" Text="شماره ثابت : "></asp:Label>
</td>
<td>
<asp:TextBox ID="txtSnumber" Width="415px" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="ثبت درخواست" />
</td>
<td>
</td>
</tr>
</table>
</ContentTemplate><Triggers>
</Triggers> </asp:UpdatePanel>

dhtmlxScheduler for ASP.NET lightbox and server side controller

We have problem with custom lightbox in dhtmlxScheduler because in your example you used the HTML controller. can we use server side controller in our custom lightbox By the way did you place custome form in side User Controller
<%# Control Language="C#" AutoEventWireup="true" CodeBehind="uc_taskFrom.ascx.cs" Inherits="Compudata_ProjectManager.userController.uc_taskFrom" %>
<div>
<!-- begin of Content Create TaskForm -->
<!-- Script manager-->
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<!-- Validation Summary msg vs_TaskForm-->
<asp:ValidationSummary ID="vs_TaskForm" runat="server" ForeColor="#CC0000" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<!-- begin of Content Create TaskForm -->
<asp:Panel ID="Panel1" runat="server" GroupingText="Create New Task">
<table>
<tr>
<td>
<label>
Project:</label>
</td>
<td>
<asp:DropDownList ID="ddl_projectsList" runat="server" DataSourceID="SqlDataSourceProjectList"
DataTextField="projectName" DataValueField="projectID" AppendDataBoundItems="True"
OnSelectedIndexChanged="ddl_projectsList_SelectedIndexChanged" AutoPostBack="True">
<asp:ListItem Value="-1">Select Project</asp:ListItem>
</asp:DropDownList>
<asp:CompareValidator ID="cv_projectList" runat="server" ControlToValidate="ddl_projectsList"
ErrorMessage="Select Project" ForeColor="#FC0000" Operator="NotEqual" ValueToCompare="-1">*</asp:CompareValidator>
<asp:SqlDataSource ID="SqlDataSourceProjectList" runat="server" ConnectionString="<%$ ConnectionStrings:Compudata_ProjectManagerConnection %>"
SelectCommand="SELECT [projectID], [projectName] FROM [Projects] ORDER BY [projectName]">
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td>
<label>
Task Name:</label><em>*</em>
</td>
<td>
<asp:TextBox ID="txtb_taskName" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfv_taskName" runat="server" ControlToValidate="txtb_taskName"
ErrorMessage="Enter Task Name" ForeColor="#F60000">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Default Tech:
</td>
<td>
<asp:Literal ID="lit_dafaultTech" runat="server"></asp:Literal>
</td>
</tr>
<tr>
<td>
<label>
Assigned To :</label><em>*</em>
</td>
<td>
<asp:DropDownList ID="ddl_usersList" runat="server" AppendDataBoundItems="True" DataSourceID="SqlDataSourceUserList"
DataTextField="UserName" DataValueField="UserId">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddl_usersList"
CssClass="Validator" ErrorMessage="select Tech" InitialValue="-1">*</asp:RequiredFieldValidator>
<asp:SqlDataSource ID="SqlDataSourceUserList" runat="server" ConnectionString="<%$ ConnectionStrings:Compudata_ProjectManagerConnection %>"
SelectCommand="SELECT [UserId], [UserName] FROM [vw_aspnet_Users]"></asp:SqlDataSource>
</td>
</tr>
<tr>
<td>
<label>
Status :</label><em>*</em>
</td>
<td>
<asp:DropDownList ID="ddl_status" runat="server" AppendDataBoundItems="True">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="ddl_status"
ErrorMessage="select Status" InitialValue="-1" CssClass="Validator">*</asp:RequiredFieldValidator>
<asp:SqlDataSource ID="status_sqlDS" runat="server" ConnectionString="<%$ ConnectionStrings:Compudata_ProjectManagerConnection %>"
SelectCommand="GetAllStatus" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
</td>
</tr>
<tr>
<td>
<label>
Priorty:</label><em>*</em>
</td>
<td>
<asp:DropDownList ID="ddl_priority" runat="server" AppendDataBoundItems="True">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="ddl_priority"
ErrorMessage="Select one" CssClass="Validator" InitialValue="-1">*</asp:RequiredFieldValidator>
<asp:SqlDataSource ID="priority_sqlDC" runat="server" ConnectionString="<%$ ConnectionStrings:Compudata_ProjectManagerConnection %>"
SelectCommand="GetAllPriority" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
</td>
</tr>
<tr>
<td>
<label>
Estimate Time eg(1.50):</label>
</td>
<td>
<asp:TextBox ID="txtb_estTime" runat="server" Style="direction: ltr"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<label>
Description:</label><em>*</em>
</td>
<td>
<asp:TextBox ID="txtb_Description" runat="server" TextMode="MultiLine"
Width="600px" Height="300px"></asp:TextBox>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td colspan="2">
<label>
Send Email:
</label>
<asp:CheckBox ID="ch_sendEmail" runat="server" Text="Send Email to assigned Tech"
Checked="True" />
</td>
</tr>
<tr>
<td>
<label>Start Date: </label>
</td>
<td>
<asp:TextBox ID="txtb_startDate" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<label>End Date: </label>
</td>
<td>
<asp:TextBox ID="txtb_endDate" runat="server" CssClass=".datetimepicker"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<label>show on Calendar </label>
</td>
<td>
<asp:CheckBox ID="chb_calendar" runat="server" Text="show on Calendar"></asp:CheckBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblMessage" runat="server"></asp:Label>
</td>
<td>
<asp:Button ID="btn_createTask" runat="server" Text="Create Task" OnClick="createTask_Click" />
<asp:Button ID="Button2" runat="server" Text="Cancel" />
</td>
</tr>
</table>
<br />
<!-- begin of Web template option -->
<table class="style1">
<tr>
<td>
<asp:LinkButton ID="lnkb_clientRMA" runat="server"
onclick="lnkb_clientRMA_Click"
>CLIENT RMA RETURN</asp:LinkButton> </td>
<td>
<asp:LinkButton ID="lnkb_LG_SERVICE" runat="server"
onclick="lnkb_LG_SERVICE_Click">LG SERVICE</asp:LinkButton> </td>
<td>
<asp:LinkButton ID="lnkb_PHONE_REMOTESUPPORT" runat="server"
onclick="lnkb_PHONE_REMOTESUPPORT_Click">PHONE/REMOTE SUPPORT</asp:LinkButton> </td>
<td>
<asp:LinkButton ID="lnkb_SEAGATE_RMA_RETURN" runat="server"
onclick="lnkb_SEAGATE_RMA_RETURN_Click">SEAGATE RMA RETURN</asp:LinkButton> </td>
<td>
<asp:LinkButton ID="lnkb_ON_SITE_SERVICE" runat="server"
onclick="lnkb_ON_SITE_SERVICE_Click"> ON-SITE SERVICE</asp:LinkButton></td>
<td>
<asp:LinkButton ID="lnkb_ZEISS_RMA_DIAGNOSTIC" runat="server"
onclick="lnkb_ZEISS_RMA_DIAGNOSTIC_Click">ZEISS RMA AND DIAGNOSTIC</asp:LinkButton> </td>
</tr>
<tr>
<td>
<asp:LinkButton ID="lnkb_LENOVO_SERVICE" runat="server"
onclick="lnkb_LENOVO_SERVICE_Click">LENOVO SERVICE</asp:LinkButton></td>
<td>
<asp:LinkButton ID="lnkb_MONTHLY_SERVICE" runat="server"
onclick="lnkb_MONTHLY_SERVICE_Click">MONTHLY SERVICE</asp:LinkButton> </td>
<td>
<asp:LinkButton ID="lnkb_Power_Supply_RMA" runat="server"
onclick="lnkb_Power_Supply_RMA_Click">Power Supply RMA</asp:LinkButton></td>
<td>
<asp:LinkButton ID="lnkb_IN_SHOP_SERVICE" runat="server"
onclick="lnkb_IN_SHOP_SERVICE_Click" >IN-SHOP SERVICE</asp:LinkButton></td>
<td>
<asp:LinkButton ID="lnkb_VENDOR_RMA_RETURN" runat="server"
onclick="lnkb_VENDOR_RMA_RETURN_Click">VENDOR RMA RETURN</asp:LinkButton></td>
<td>
</td>
</tr>
</table>
<!-- end of Web template option -->
</asp:Panel>
<!-- end of Content Create TaskForm -->
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddl_projectsList" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
</div>
you can place your web form in .aspx page and use this function this line will create iframe window
Scheduler.Lightbox.SetExternalLightboxForm("formName.aspx")

Button Control No Engaging After Calender Selector Is Used

I have a calender selector that looks like
<asp:ImageButton ID="calStartImage" runat="server" ImageUrl="../images/SmallCalendar.gif"
AlternateText="Please select start date" />
<ajaxToolkit:CalendarExtender ID="calStartDate" runat="server" TargetControlID="txtStartDate"
Format="MM/dd/yyyy" PopupButtonID="calStartImage" />
And A search button that look like this
<asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click"
CausesValidation="false" />
When I select a date from the calender and press Search..The first time btnSearch_Click doesnt fire..If I click Search again it works fine. So I have to click the Search button twice before the click event works. This only happens if I select a date from the calender control.
Here is the full control:
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</ajaxToolkit:ToolkitScriptManager>
<table>
<tr>
<td class="SearchBox">
<table>
<tr>
<td colspan="2">
<b>Enter name to filter results</b>
<asp:TextBox ID="txtProjectName" runat="server"></asp:TextBox><br />
<br />
</td>
</tr>
<tr>
<td valign="middle">
<b>From:</b>
<asp:TextBox ID="txtStartDate" runat="server"></asp:TextBox>
<asp:ImageButton ID="calStartImage" runat="server" ImageUrl="../images/SmallCalendar.gif"
AlternateText="Please select start date" />
<ajaxToolkit:CalendarExtender ID="calStartDate" runat="server" TargetControlID="txtStartDate"
Format="MM/dd/yyyy" PopupButtonID="calStartImage" />
<b>Thru:</b>
<asp:TextBox ID="txtEndDate" runat="server"></asp:TextBox>
<asp:ImageButton runat="server" ID="calEndImage" ImageUrl="../images/SmallCalendar.gif"
AlternateText="Please select end date" />
<ajaxToolkit:CalendarExtender ID="calEndDate" runat="server" TargetControlID="txtEndDate"
Format="MM/dd/yyyy" PopupButtonID="calEndImage" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="From Date is Required"
ControlToValidate="txtStartDate" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Thru Date is Required"
ControlToValidate="txtEndDate" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="Invalid From Date"
ControlToValidate="txtStartDate" Display="Dynamic" MaximumValue="1/1/2099" MinimumValue="1/1/2006"
SetFocusOnError="True" Type="Date"></asp:RangeValidator>
<asp:RangeValidator ID="RangeValidator2" runat="server" ControlToValidate="txtEndDate"
ErrorMessage="Invalid Thru Date" SetFocusOnError="True" Type="Date" Display="Dynamic"
MaximumValue="1/1/2999" MinimumValue="1/1/2006"></asp:RangeValidator>
<br />
</td>
</tr>
<tr>
<td align="left">
<asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click"
CausesValidation="false" />
</td>
</tr>
</table>
</td>
<td align="right" style="width:560px">
Guide
</td>
</tr>
</table>
Here is more from the page....
<ajaxToolkit:ModalPopupExtender ID="mdlPopupExtender" runat="server" TargetControlID="btnShowPopup"
PopupControlID="pnlProject" BackgroundCssClass="modalBackground" Drag="true"
DropShadow="true" CancelControlID="btnClose" PopupDragHandleControlID="TitleBar">
</ajaxToolkit:ModalPopupExtender>
<asp:Button ID="btnShowPopup" runat="server" Style="display: none" />
<asp:Panel ID="pnlProject" runat="server" BackColor="WhiteSmoke">
<asp:Panel ID="TitleBar" runat="server" CssClass="modalPopupTitleBar">
Add/Edit Project
</asp:Panel>
<asp:UpdatePanel ID="upPopList" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnAddNew" EventName="Click" />
</Triggers>
<ContentTemplate>
<table cellspacing="10">
<tr>
<td colspan="2">
</td>
</tr>
<tr>
<td>
<b>Project Name:</b>
</td>
<td>
<asp:TextBox ID="txtProject" runat="server" Width="200px"></asp:TextBox>
<asp:RequiredFieldValidator ID="reqProject" runat="server" ErrorMessage="Required!"
Display="Dynamic" ControlToValidate="txtProject"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<b>Field Office:</b>
</td>
<td>
<asp:TextBox ID="txtFieldOffice" runat="server" Width="200px"></asp:TextBox>
<asp:RequiredFieldValidator ID="reqFieldOffice" runat="server" ErrorMessage="Required!"
Display="Dynamic" ControlToValidate="txtFieldOffice"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<b>Created By:</b>
</td>
<td>
<asp:Label ID="lblCreatedBy" runat="server"></asp:Label>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<table>
<tr>
<td>
<br />
<asp:Button ID="btnSubmit" runat="server" Text="Save" OnClick="btnSubmit_Click" />
<asp:Button ID="btnClose" runat="server" Text="Close" CausesValidation="false" />
<br />
</td>
</tr>
</table>
</asp:Panel>
Any Ideas?
You need to add ValidationGroup to your validation controls so that each validation group can perform validation independently from other validation group on a specific page. more you can read here Specifying Validation Groups
Here is your code with group validation. you can change it as your environment.
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<table>
<tr>
<td>
<table>
<tr>
<td colspan="2">
<b>Enter name to filter results</b>
<asp:TextBox ID="txtProjectName" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td valign="middle">
<b>From:</b>
<asp:TextBox ID="txtStartDate" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="formDateRequiredValidator" ValidationGroup="Date"
runat="server" ErrorMessage="Enter From Date." ControlToValidate="txtStartDate"></asp:RequiredFieldValidator>
<asp:RangeValidator ID="RangeValidator1" runat="server" ValidationGroup="Date" ErrorMessage="Invalid From Date"
ControlToValidate="txtStartDate" Display="Dynamic" MaximumValue="1/1/2099" MinimumValue="1/1/2006"
SetFocusOnError="True" Type="Date"></asp:RangeValidator>
<asp:ImageButton ID="calStartImage" runat="server" AlternateText="Please select start date" />
<asp:CalendarExtender ID="calStartDate" runat="server" TargetControlID="txtStartDate"
Format="MM/dd/yyyy" PopupButtonID="calStartImage" />
<b>Thru:</b>
<asp:TextBox ID="txtEndDate" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="endDateRequiredValidator" ValidationGroup="Date"
runat="server" ErrorMessage="Enter Thru Date." ControlToValidate="txtEndDate"></asp:RequiredFieldValidator>
<asp:RangeValidator ID="RangeValidator2" ValidationGroup="Date" runat="server" ErrorMessage="Invalid From Date"
ControlToValidate="txtStartDate" Display="Dynamic" MaximumValue="1/1/2099" MinimumValue="1/1/2006"
SetFocusOnError="True" Type="Date"></asp:RangeValidator>&nbsp
<asp:ImageButton runat="server" ID="calEndImage" ImageUrl="../images/SmallCalendar.gif"
AlternateText="Please select end date" />
<asp:CalendarExtender ID="calEndDate" runat="server" TargetControlID="txtEndDate"
Format="MM/dd/yyyy" PopupButtonID="calEndImage" />
</td>
</tr>
<tr>
<td align="left">
<asp:Button ID="btnSearch" runat="server" Text="Search" ValidationGroup="Date" CausesValidation="false" />
</td>
</tr>
</table>
</td>
<td align="right">
Guide
</td>
</tr>
</table>
<asp:ModalPopupExtender ID="mdlPopupExtender" runat="server" TargetControlID="btnShowPopup"
PopupControlID="pnlProject" BackgroundCssClass="modalBackground" Drag="true"
DropShadow="true" CancelControlID="btnClose" PopupDragHandleControlID="TitleBar">
</asp:ModalPopupExtender>
<asp:Button ID="btnShowPopup" runat="server" Style="display: none" />
<asp:Panel ID="pnlProject" runat="server" BackColor="WhiteSmoke">
<asp:Panel ID="TitleBar" runat="server">
Add/Edit Project
<%-- I have added this Button you can replace with yours becaus specified in Triggers to run the code i need to add this(btnAddNew) Button--%>
<asp:Button ID="btnAddNew" runat="server" Text="AddNew" />
</asp:Panel>
<asp:UpdatePanel ID="upPopList" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnAddNew" />
</Triggers>
<ContentTemplate>
<table>
<tr>
<td colspan="2">
</td>
</tr>
<tr>
<td>
<b>Project Name:</b>
</td>
<td>
<asp:TextBox ID="txtProject" runat="server" Width="200px"></asp:TextBox>
<asp:RequiredFieldValidator ID="reqProject" ValidationGroup="ProjectInfo" runat="server"
ErrorMessage="Required!" Display="Dynamic" ControlToValidate="txtProject"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<b>Field Office:</b>
</td>
<td>
<asp:TextBox ID="txtFieldOffice" runat="server" Width="200px"></asp:TextBox>
<asp:RequiredFieldValidator ID="reqFieldOffice" ValidationGroup="ProjectInfo" runat="server"
ErrorMessage="Required!" Display="Dynamic" ControlToValidate="txtFieldOffice"></asp:RequiredFieldValidator>
</td>
</tr>
</td> </tr>
<tr>
<td>
<b>Created By:</b>
</td>
<td>
<asp:Label ID="lblCreatedBy" runat="server"></asp:Label>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<table>
<tr>
<td>
<br />
<asp:Button ID="btnSubmit" runat="server" Text="Save" OnClick="btnSubmit_Click" />
<asp:Button ID="btnClose" runat="server" Text="Close" CausesValidation="false" ValidationGroup="ProjectInfo"
OnClick="btnClose_Click" />
<br />
</td>
</tr>
</table>
</asp:Panel>
Hope this helps.
I don't know why but your problem can be solved by setting the CausesValidation property of btnSearch to true
<asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click"
CausesValidation="true" />

Categories