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")
Related
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>
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>
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> 
<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" />
I'm trying to implement validation in my ASP.NET Webforms application. Right now, the only validator that works is for the Date of Birth (DOB) field. It is a custom field.
ASPX Code
<table>
<tr> <td align="center" colspan="2">
<asp:Label ID="RegisterTitleID" runat="server">Register here for your New Account </asp:Label></td>
</tr>
<tr>
<td align="right"> <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="EmailTextBox">E-mail:</asp:Label> </td>
<td> <asp:TextBox ID="EmailTextBox" runat="server" Height="25px" Width="200px"
CausesValidation="True"></asp:TextBox></td>
<asp:RequiredFieldValidator ID="EmailRequired" runat="server"
ControlToValidate="EmailTextBox" ErrorMessage="E-mail is required."
ToolTip="E-mail is required." ValidationGroup="RegistrationWizard"
Display="Dynamic">*</asp:RequiredFieldValidator> </tr>
<tr>
<td align="right"> <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="PasswordTextBox">Password:</asp:Label> </td>
<td> <asp:TextBox ID="PasswordTextBox" runat="server" TextMode="Password"
Height="25px" Width="200px" CausesValidation="True"></asp:TextBox></td>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server"
ControlToValidate="PasswordTextBox" ErrorMessage="Password is required."
ToolTip="Password is required." ValidationGroup="RegistrationWizard"
Display="Dynamic">*</asp:RequiredFieldValidator> </tr>
<tr>
<td align="right"> <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPasswordTextBox">Confirm Password:</asp:Label> </td>
<td> <asp:TextBox ID="ConfirmPasswordTextBox" runat="server" TextMode="Password" Height="25px" Width="200px"></asp:TextBox></td>
<asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server"
ControlToValidate="ConfirmPasswordTextBox" ErrorMessage="Confirm Password is required."
ToolTip="Confirm Password is required." ValidationGroup="RegistrationWizard">*</asp:RequiredFieldValidator> </tr>
<tr>
<td align="center" colspan="2">
<asp:CompareValidator ID="PasswordCompare" runat="server"
ControlToCompare="PasswordTextBox" ControlToValidate="ConfirmPasswordTextBox"
Display="Dynamic"
ErrorMessage="The Password and Confirmation Password must match."
ValidationGroup="RegistrationWizard"> </asp:CompareValidator> </td> </tr>
<tr>
<td align="right"> <asp:Label ID="TitleLabel" runat="server" AssociatedControlID="TitleTextBox">Title:</asp:Label> </td>
<td> <asp:TextBox ID="TitleTextBox" runat="server" Height="25px" Width="200px"></asp:TextBox></td>
<asp:RequiredFieldValidator ID="TitleRequired" runat="server"
ControlToValidate="TitleTextBox" ErrorMessage="Title is required."
ToolTip="Title is required." ValidationGroup="RegistrationWizard">*</asp:RequiredFieldValidator> </tr>
<tr>
<td align="right"> <asp:Label ID="FirstNameLabel" runat="server" AssociatedControlID="FirstNameTextBox">First Name:</asp:Label> </td>
<td> <asp:TextBox ID="FirstNameTextBox" runat="server" Height="25px" Width="200px"></asp:TextBox></td>
<asp:RequiredFieldValidator ID="FirstNameRequired" runat="server"
ControlToValidate="FirstNameTextBox" ErrorMessage="First Name is required."
ToolTip="First Name is required." ValidationGroup="RegistrationWizard">*</asp:RequiredFieldValidator> </tr>
<tr>
<td align="right"> <asp:Label ID="SurnameLabel" runat="server" AssociatedControlID="SurnameTextBox">Surname:</asp:Label> </td>
<td> <asp:TextBox ID="SurnameTextBox" runat="server" Height="25px" Width="200px"></asp:TextBox></td>
<asp:RequiredFieldValidator ID="SurnameRequired" runat="server"
ControlToValidate="SurnameTextBox" ErrorMessage="Surname is required."
ToolTip="Surname is required." ValidationGroup="RegistrationWizard">*</asp:RequiredFieldValidator> </tr>
<tr>
<td align="right"> <asp:Label ID="DOBLabel" runat="server" AssociatedControlID="DOBTextBox">Date of Birth:</asp:Label> </td>
<td> <asp:TextBox ID="DOBTextBox" runat="server" Height="25px" Width="200px">dd/mm/yyyy</asp:TextBox>
</td>
<asp:RequiredFieldValidator ID="DOBRequired" runat="server"
ControlToValidate="DOBTextBox" ErrorMessage="Date of birth is required."
ToolTip="Date of birth is required." ValidationGroup="RegistrationWizard">*</asp:RequiredFieldValidator>
<asp:CustomValidator runat="server"
ID="DateRangeCustomValidator"
ControlToValidate="DOBTextBox"
onservervalidate="valDateRange_ServerValidate"
ErrorMessage="Enter a valid date. " />
</tr>
<tr>
<td align="right"> <asp:Label ID="GenderLabel" runat="server" AssociatedControlID="GenderDropDownList">Gender:</asp:Label> </td>
<td> <asp:DropDownList ID="GenderDropDownList" runat="server" AppendDataBoundItems="true" Height="27px" Width="205px">
<asp:ListItem Value="-1">Select</asp:ListItem>
<asp:ListItem>Male</asp:ListItem>
<asp:ListItem>Female</asp:ListItem>
</asp:DropDownList> </td>
<asp:RequiredFieldValidator ID="GenderRequired" runat="server"
ControlToValidate="GenderDropDownList" ErrorMessage="Gender is required."
ToolTip="Gender is required." ValidationGroup="RegistrationWizard">*</asp:RequiredFieldValidator>
</tr>
<tr>
<td align="right"> <asp:Label ID="PhoneNumberLabel" runat="server" AssociatedControlID="PhoneNumberTextBox">PhoneNumber:</asp:Label> </td>
<td> <asp:TextBox ID="PhoneNumberTextBox" runat="server" Height="25px" Width="200px"></asp:TextBox></td></tr>
<tr>
<td align="right"> <asp:Label ID="FavouriteTeamLabel" runat="server" AssociatedControlID="FavouriteTeamDropDownList">Favourite Team:</asp:Label> </td>
<td>
<asp:DropDownList ID="FavouriteTeamDropDownList" runat="server" DataSourceID="Team"
DataTextField="Team" DataValueField="Team" Height="27px" Width="205px">
</asp:DropDownList>
<asp:SqlDataSource ID="Team" runat="server"
ConnectionString="<%$ ConnectionStrings:RocoSportsDBConnectionString %>"
SelectCommand="SELECT [Team] FROM [Team]"></asp:SqlDataSource>
</td>
</tr>
<tr>
<td align="right"> <asp:Label ID="MaritialStatusLabel" runat="server" AssociatedControlID="MaritialStatusDropDownList">Maritial Status:</asp:Label> </td>
<td> <asp:DropDownList ID="MaritialStatusDropDownList" runat="server" AppendDataBoundItems="true" Height="27px" Width="205px">
<asp:ListItem Value="-1">Select</asp:ListItem>
<asp:ListItem>Single</asp:ListItem>
<asp:ListItem>Married</asp:ListItem>
<asp:ListItem>Separated</asp:ListItem>
<asp:ListItem>Unmarried Relationship</asp:ListItem>
<asp:ListItem>Domestic Partnership</asp:ListItem>
</asp:DropDownList> </td>
</tr>
<tr>
<td align="right"> <asp:Label ID="EducationLabel" runat="server" AssociatedControlID="EducationDropDownList">Education:</asp:Label> </td>
<td> <asp:DropDownList ID="EducationDropDownList" runat="server" AppendDataBoundItems="true" Height="27px" Width="205px">
<asp:ListItem Value="-1">Select</asp:ListItem>
<asp:ListItem>None</asp:ListItem>
<asp:ListItem>Primary School</asp:ListItem>
<asp:ListItem>Secondary School</asp:ListItem>
<asp:ListItem>College</asp:ListItem>
<asp:ListItem>Undergrad</asp:ListItem>
<asp:ListItem>Postgrad</asp:ListItem>
</asp:DropDownList> </td>
</tr>
<tr>
<td align="right"> <asp:Label ID="ProfessionLabel" runat="server" AssociatedControlID="ProfessionDropDownList">Profession:</asp:Label> </td>
<td> <asp:DropDownList ID="ProfessionDropDownList" runat="server" AppendDataBoundItems="true" Height="27px" Width="205px">
<asp:ListItem Value="-1">Select</asp:ListItem>
<asp:ListItem>None</asp:ListItem>
<asp:ListItem>Management</asp:ListItem>
<asp:ListItem>Professional</asp:ListItem>
<asp:ListItem>Armed Forces</asp:ListItem>
<asp:ListItem>Sales</asp:ListItem>
<asp:ListItem>Adminstrative</asp:ListItem>
<asp:ListItem>Farming</asp:ListItem>
<asp:ListItem>Construction</asp:ListItem>
</asp:DropDownList> </td>
</tr>
<tr>
<td align="right"> <asp:Label ID="SalaryLabel" runat="server" AssociatedControlID="SalaryDropDownList">Salary:</asp:Label> </td>
<td> <asp:DropDownList ID="SalaryDropDownList" runat="server" AppendDataBoundItems="true" Height="27px" Width="205px">
<asp:ListItem Value="-1">Select</asp:ListItem>
<asp:ListItem>None</asp:ListItem>
<asp:ListItem>5000</asp:ListItem>
<asp:ListItem>10000</asp:ListItem>
<asp:ListItem>20000</asp:ListItem>
<asp:ListItem>30000</asp:ListItem>
<asp:ListItem>50000</asp:ListItem>
<asp:ListItem>100000</asp:ListItem>
</asp:DropDownList> </td>
</tr>
<tr>
<td align="right"> <asp:Label ID="EmploymentStatusLabel" runat="server" AssociatedControlID="EmploymentStatusDropDownList">EmploymentStatus:</asp:Label> </td>
<td> <asp:DropDownList ID="EmploymentStatusDropDownList" runat="server" AppendDataBoundItems="true" Height="27px" Width="205px">
<asp:ListItem Value="-1">Select</asp:ListItem>
<asp:ListItem>Unemployed</asp:ListItem>
<asp:ListItem>Employed</asp:ListItem>
<asp:ListItem>Self-employed</asp:ListItem>
<asp:ListItem>Volunteer</asp:ListItem>
</asp:DropDownList> </td>
</tr>
<tr>
<td align="right"> <asp:Label ID="InterestsLabel" runat="server" AssociatedControlID="InterestsCheckBox">Interests:</asp:Label> </td>
<td>
<asp:CheckBoxList ID="InterestsCheckBox" runat="server"
onselectedindexchanged="InterestsCheckBox_SelectedIndexChanged">
<asp:ListItem>Reading</asp:ListItem>
<asp:ListItem>Football</asp:ListItem>
<asp:ListItem>Swimming</asp:ListItem>
<asp:ListItem>Basketball</asp:ListItem>
<asp:ListItem>Cooking</asp:ListItem>
<asp:ListItem>Music</asp:ListItem>
<asp:ListItem>Philosophy</asp:ListItem>
<asp:ListItem>Programming</asp:ListItem>
</asp:CheckBoxList>
</td>
</tr>
<tr> <td align="center" colspan="2" style="color:Red;"> <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal> </td> </tr>
<tr> <td align="center" colspan="2"> <asp:Button ID="RegisterButton" runat="server" Text="Register" onclick="registerbutton_Click"/> </td> </tr>
</table>
What could be the problem that's causing this code not to work, yet is not throwing any errors? Also, I'd like to position the validators better, and add color to them?
You are using a ValidationGroup for all your validators except the DOB Custom validator.
Add it to your custom validator and also the Register Button.
<asp:CustomValidator runat="server"
ID="DateRangeCustomValidator"
ControlToValidate="DOBTextBox"
onservervalidate="valDateRange_ServerValidate"
ErrorMessage="Enter a valid date. "
ValidationGroup="RegistrationWizard"/>
<asp:Button ID="RegisterButton" runat="server" Text="Register"
ValidationGroup="RegistrationWizard" onclick="registerbutton_Click"/>
You have ValidationGroup set on your validators but not on your button.
I got a table with 2 nested tables inside that display my two repeaters. My repeaters display Home and office addresses respectively. The problem is that whenever I add a new record in one repeater, the other repeater table's display gets messed up. Like if I add a record in rpt1 , then table for rpt1 moves up and table for rpt2 goes down..ie the headers do not display in one single line . They move up and down when records are added or deleted. WHat I want is these headers to be fixed so if I add new records or delete records, the headings of both repeaters display on the same line...How do I fix this ? Hope its not confusing.
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="50%">
<asp:Panel ID="pnlAddAddress" runat="server">
<asp:Repeater ID="rpt1" OnItemCommand="rpt1_ItemCommand" runat="server" OnItemDataBound="rpt1_OnItemDataBound">
<HeaderTemplate>
<table width="99%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="5" class="linegrey">
</td>
</tr>
<tr class="lgrey">
<td>
Address1
</td>
<td>
City
</td>
<td>
State
</td>
<td>
IsDefault
</td>
<td>
Actions
</td>
</tr>
<tr>
<td colspan="5" class="dots">
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:LinkButton ID="lnkAddressB" runat="server" Text='<%# Eval("Address1")%>' CommandName="DisplayAddressB" CommandArgument='<%#Eval("AddID") %>' CausesValidation=false></asp:LinkButton>
</td>
<td>
<%# Eval("City")%>
</td>
<td>
<%# Eval("State")%>
</td>
<td>
<%-- Visible='<%# Eval("IsDefault")%>'--%>
<asp:LinkButton ID="lnkDefaultB" Text="Set as Default" CommandName="SetDefaultB" runat="server" CommandArgument='<%# Eval("AddID") + "," + Eval("IsB") %>'
CausesValidation="false" Visible='<%# Eval("IsDefault")%>'></asp:LinkButton>
<asp:Label ID="labelDefaultB" Text="Yes" runat="server" Visible='<%# Eval("IsDefault")%>'></asp:Label>
</td>
<td>
<asp:ImageButton ID="lnkAdd" CommandArgument='<%#Eval("AddID") %>'
CausesValidation="false" CommandName="Edit" runat="server" ImageUrl="~/images/Edit.gif" Width="14" Height="14" ToolTip="Edit"></asp:ImageButton>
<asp:ImageButton ID="lnkDel" Text="Delete" CommandArgument='<%#Eval("AddID") %>'
CausesValidation="false" CommandName="Delete" runat="server" ImageUrl="~/images/Delete.gif" Width="14" Height="14" ToolTip="Delete"></asp:ImageButton>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</asp:Panel>
</td>
<td>
<asp:Panel ID="pnlSping" runat="server">
<asp:Repeater ID="rpt12" OnItemCommand="rpt12_ItemCommand" runat="server" OnItemDataBound="rptSpping_OnItemDataBound">
<HeaderTemplate>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="5" class="linegrey">
</td>
</tr>
<tr class="lgrey">
<td>
Address1
</td>
<td>
City
</td>
<td>
State
</td>
<td>
IsDefault
</td>
<td>
Actions
</td>
</tr>
<tr>
<td colspan="5" class="dots">
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:LinkButton ID="lnkAddressS" runat="server" Text='<%# Eval("Address1")%>' CommandArgument='<%#Eval("AddID") %>' CommandName="DisplayAddressS" CausesValidation="false"></asp:LinkButton>
</td>
<td>
<%# Eval("City")%>
</td>
<td>
<%# Eval("State")%>
</td>
<td>
<asp:LinkButton ID="lnkDefaultS" Text="Set as Default" CommandName="SetDefaultS" runat="server" Visible=true CommandArgument='<%# Eval("AddID") + "," + Eval("IsS") %>'
CausesValidation="false"></asp:LinkButton>
<asp:Label ID="labelDefaultS" Text="Yes" runat="server" Visible=true></asp:Label>
</td>
<td>
<asp:ImageButton ID="lnkAdd" Text="Edit" CommandArgument='<%#Eval("AddID") %>'
CausesValidation="false" CommandName="Edit" runat="server" ImageUrl="~/images/Edit.gif" Width="14" Height="14" ToolTip="Edit"></asp:ImageButton>
<asp:ImageButton ID="lnkDel" Text="Delete" CommandArgument='<%#Eval("AddID") %>'
CausesValidation="false" CommandName="Delete" runat="server" ImageUrl="~/images/Delete.gif" Width="14" Height="14" ToolTip="Delete"></asp:ImageButton>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</asp:Panel>
</td>
</tr>
</table>
Use css attribute valign and set its value to top like this <td width="50%" valign="top">.
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="50%" valign="top">
<asp:Panel ID="pnlAddAddress" runat="server">
......
</asp:Panel>
</td>
<td valign="top">
<asp:Panel ID="pnlSping" runat="server">
......
</asp:Panel>
</td>
</tr>
</table>
For headers look to use the <th> element, this will keep them at the top of the table.
Put the <table> tags you do have outside your repeater controls, make sure the repeater only renders a single row and the same for the header.
Unless you have good reason consider just wrapping the two tables in <div> tags as nested tables really don't work ideally for layout.