Ajax UpdatePanel not working in IE9 - asp.net

I am using updatepanel to avoid the postback and the code is working fine in IE8 and firefox but not in IE9. I also tried installing latest ajax toolkit from codeplex but it did not help me either.Please help me with this. My code is something like below/....
<table width="800px">
<tr>
<asp:UpdatePanel runat="server" ID="upCountry">
<ContentTemplate>
<td class="TextLabelForHeader" width="300px">
Country:
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="ddlCountry"
ErrorMessage="*" InitialValue="Select.." ValidationGroup="VGHeader"></asp:RequiredFieldValidator>
</td>
<td align="left">
<asp:DropDownList ID="ddlCountry" runat="server" OnSelectedIndexChanged="ddlCountry_SelectedIndexChanged"
AutoPostBack="true" OnDataBound="ddlCountry_DataBound" onchange="SelectCurrency(this);"
ValidationGroup="VGHeader">
</asp:DropDownList>
</td>
<td align="left">
</td>
</ContentTemplate>
</asp:UpdatePanel>
</tr>
<tr>
<asp:UpdatePanel runat="server" ID="upCurrency">
<ContentTemplate>
<td class="TextLabelForHeader" width="300px">
Currency:
</td>
<td align="left">
<asp:DropDownList ID="ddlCurrency" runat="server" ValidationGroup="VGHeader">
</asp:DropDownList>
</td>
<td align="left">
</td>
</ContentTemplate>
</asp:UpdatePanel>
</tr>
<tr>
<td class="TextLabelForHeader" width="300px">
Client:
<%--<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
ControlToValidate="ddlClient" ErrorMessage="*" InitialValue="Select.."
ValidationGroup="VGHeader"></asp:RequiredFieldValidator>--%>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtClient"
ErrorMessage="*" ValidationGroup="VGHeader"></asp:RequiredFieldValidator>
</td>
<td align="left">
<%-- <asp:DropDownList ID="ddlClient" runat="server" Height="16px" Width="143px" Enabled="false"
OnDataBound="ddlClient_DataBound" onchange="DisplayTextbox(this);" ValidationGroup="VGHeader">
</asp:DropDownList>--%>
<asp:TextBox ID="txtClient" runat="server" Width="143px" ReadOnly="true" ValidationGroup="VGHeader"></asp:TextBox>
<%--<div id="form_ProductContainer" style="display: none;">
<asp:TextBox ID="txtNewClientName" runat="server"></asp:TextBox>
</div>--%>
</td>
<td class="TextLabelForHeader" style="text-align: left;">
<asp:Button ID="btnContinue" runat="server" OnClick="btnContinue_Click" Text="Continue"
ValidationGroup="VGHeader" />
</td>
</tr>
</table>

Discussion: Is it vital that it uses IE9 as is? If it isn't then you could just force it to render as IE8 with the following code inserted in the head section of the page or master page.
Possible Solution:
<meta http-equiv="X-UA-Compatible" content="IE=IE8" />
Updated Response
Identified Issue: I had a look at your code and you have no update Panel inside the last TR element. I imagine now that the code originally worked in IE8 because you probably had another update panel that covered the entire table.

Related

Update panel with each row in repeater

I have repeater and when i put update panel in each row its still loading all other update panels is there any reason for this?
It should only update that part only that is i want to achieve.
<asp:Repeater runat="server" ID="grd" >
<HeaderTemplate>
<table class=" table-serviceline table table-hover table-bordered">
</HeaderTemplate>
<ItemTemplate>
<tr class="service-line-item" id="<%#"serviceline"+ Eval("ClaimServiceID") %>">
<td class="fw65">
<table class="table-small-pad">
<tr>
<td>
<asp:Label ID="lblID" ClientIDMode="Static" Text='<%#Container.ItemIndex+1 %>' runat="server"></asp:Label>
</td>
</tr>
</table>
</td>
<td class="fw150">
<table class="table-small-pad">
<tr>
<td>
<asp:UpdatePanel ID="upd" runat="server">
<ContentTemplate>
<div class="input-group">
<asp:TextBox ID="txtCODE" runat="server" CssClass="form-control" Text='<%# Bind("Code") %>' ToolTip="Code" MaxLength="15" />
<span class="input-group-addon"></span>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
I believe that the combo of
UpdateMode="Conditional"
and
ChildrenAsTriggers="True"
in the UpdatePanel is what you are looking for. If you don't set the first parameter, UpdatePanels update on any postback.

Server side events not firing the first time when asp validator used into the page

I am created a page with update panel and used Asp.net validation controls to be
validated the page is making an issue is "i am straightly going to submit the page
and page gets validated properly then, i am going to click/select any controls on
the page is not get post back"
The below code i am used
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<div id="divMyDataManualEntry" runat="server">
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<td style="width: 5%;" valign="top">
<asp:Label ID="lblGeo" Font-Bold="true" runat="server" Text="Geography"></asp:Label><span
class="redtext">*</span>
</td>
<td valign="top" style="width: 15%">
<asp:DropDownList ID="ddlgeo" TabIndex="1" runat="server" CssClass="textbox" Width="100%"
OnSelectedIndexChanged="ddlgeo_SelectedIndexChanged" AutoPostBack="true">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="ddlgeo"
ValidationGroup="Submit" InitialValue="-1" ErrorMessage="Select Geography"></asp:RequiredFieldValidator>
</td>
</tr> </table>
<table width="100%" id="BtnContainer" runat="server">
<tr>
<td align="center">
<asp:Button ID="btnSubmit" runat="server" OnClientClick="javascript:return IsValidated();"
ValidationGroup="Submit" CssClass="Keybutton" TabIndex="14" Text="Submit" OnClick="btnSubmit_Click" />
<asp:Button ID="btnreset" runat="server" Text="Reset" CssClass="Keybutton" TabIndex="15"
OnClick="btnReset_click" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>

Dynamic TabPanels with nested listviews (having dynamic items) asp.net

I have TabControl(AjaxToolKit) having 2 Nested ListViews.
code:
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:TabContainer ID="tcQuestions" runat="server" ActiveTabIndex="0" OnDemand="true" AutoPostBack="false" TabStripPlacement="Top" ScrollBars="None" UseVerticalStripPlacement="false">
<asp:TabPanel ID="tpFirst" runat="server" HeaderText="Page 1" Enabled="true" ScrollBars="Auto"
OnDemandMode="Once">
<ContentTemplate>
<asp:Panel ID="pnlNoData" runat="server">
<asp:LinkButton ID="lbQuestionsAdd" Text="Add Question" runat="server" />
</asp:Panel>
<asp:Panel ID="pnlListView" runat="server">
<asp:ListView ID="lsvQuestions" runat="server" ItemPlaceholderID="phItemPlaceHoler">
<EmptyDataTemplate>
<em>NO RECORD WAS FOUND</em>
</EmptyDataTemplate>
<ItemTemplate>
<tr>
<td>
<asp:Label ID="lblQuestionID" Text='<%#Eval("intQuesId") %>' Visible="false" runat="server" />
<asp:Label ID="lblQuestionTitle" Text='<%#Eval("strQuesTitle") %>' runat="server" />
<%--1.Are you doing job?--%>
</td>
</tr>
<%--Inner Listview--%>
<asp:ListView ID="lsvAnswers" runat="server" ItemPlaceholderID="phItemPlaceHolerAnswers">
<LayoutTemplate>
<table runat="server" id="table1">
<tr runat="server" id="phItemPlaceHolerAnswers">
</tr>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr>
<td>
<asp:PlaceHolder ID="plControl" runat="server" />
</td>
</tr>
</ItemTemplate>
<EmptyDataTemplate>
<em>NO RECORD WAS FOUND</em>
</EmptyDataTemplate>
</asp:ListView>
</ItemTemplate>
<LayoutTemplate>
<table class="tblAll">
<tbody>
<tr>
<td style="width: 125px">
<asp:LinkButton ID="lbtnAddQuestions" runat="server">Add Questions</asp:LinkButton>
</td>
<td style="width: 316px">
<asp:LinkButton ID="lbtnDesignTools" runat="server">Design Tools</asp:LinkButton>
</td>
<td class="formTopLinks">
<img class="imgicons" src="../Layout/images/edit.png" />
<asp:LinkButton ID="lbEditProperties" runat="server" CssClass="lnkbuttonText">Edit Properties</asp:LinkButton>
</td>
<td class="formTopLinks">
<img class="imgicons" src="../Layout/images/Delete.png" />
<asp:LinkButton ID="lbCopyPage" runat="server" CssClass="lnkbuttonText">Copy Page</asp:LinkButton>
</td>
<td class="formTopLinks">
<img class="imgicons" src="../Layout/images/Copy.png" />
<asp:LinkButton ID="lbDeletePage" runat="server" CssClass="lnkbuttonText">Delete Page</asp:LinkButton>
</td>
<td style="width: 20px;">
<img class="imgicons" src="../Layout/images/left.png" />
</td>
<td style="width: 64px;">
<asp:Label ID="Label1" runat="server" CssClass="lnkbuttonText" Text="Move Page" />
</td>
<td style="width: 20px;">
<img class="imgicons" src="../Layout/images/right.png" />
</td>
<td>
 
</td>
</tr>
</tbody>
</table>
<br />
<table class="tblAll">
<tbody>
<asp:PlaceHolder ID="phItemPlaceHoler" runat="server"></asp:PlaceHolder>
</tbody>
</table>
</LayoutTemplate>
</asp:ListView>
</asp:Panel>
</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>
Where, I am getting Question from Table "Question", and its answers from another table "Answers". Each Question is linked with a PageNumber.
so, i have to create TabPanels according to PageNumber from Question, Then Bind Question Label with that Question, and fill 2nd ListView with Answers of that Question.
These answers are dynamic controls based on db entries e.g textbox, checkboxlists, radiobutton lists and may vary for every question.
Now what i am doing is copying tabPanel 1 to new TabPanel and adding question and answers according to db values, but when i am creating 2nd TabPanel, it give me error that
Cannot unregister UpdatePanel with ID 'ContentPlaceHolder1_tcQuestions_tpFirst_updatePanel' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported.
What is the best approach to handle this scenerio.
something like SurverMonkey except i am using tabs for new page.

asp.net (Visual Studio 2010) form validation controls

Afternoon All,
I have a web form that i wish my user to fill out. On the form i have three fields that i wish to set validation on. One of these is a normal textbox, the other a textbox associated with a calendar icon and my last field is a drop down list that has data held in it populated from an Enum list.
Im not too worried about my dropdown list yet, but i am getting slightly frustrated with my other two textboxes. I have used a 'Required Filed Validator' on both of these and only want the validation to kick in when the users clicks the submit button. At the moment if you tab or click between these two fields the validation kicks in.
Here is my web form....
<table id="table-3">
<tr>
<td style="width: 385px">
<asp:Label ID="lblOrganiser" runat="server" Text="Meeting Organiser:">
</asp:Label></td>
<td class="style4" style="width: 23px">
<asp:TextBox ID="txtOrganiser" runat="server" >
</asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldVal0"
ControlToValidate="txtOrganiser"
ErrorMessage="Meeting Organiser"
Text="*"
runat="server"/>
</td>
<td>
<asp:Label ID="lblDate" runat="server" Width="40px" Text="Date:">
</asp:Label>
</td>
<td class="style5">
<asp:TextBox ID="txtAgendaDate" runat="server" ForeColor="Black" >
</asp:TextBox>
<asp:ImageButton runat="Server" ID="ImageButton1" ImageUrl="~/images/contact_date_SM3.png"
AlternateText="Click here to display calendar" ImageAlign="AbsMiddle" />
<asp:calendarextender ID="CalendarExtender3" runat="server"
TargetControlID="txtAgendaDate" PopupButtonID="ImageButton1" Format="dd/MM/yyyy"></asp:calendarextender>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldVal1"
ControlToValidate="txtAgendaDate"
ErrorMessage="Date"
Text="*"
runat="server"/>
</td>
</tr>
<tr>
<td style="width: 385px"><asp:Label ID="lblAgendaTypeDescription" runat="server" Text="Type Of Meeting:"></asp:Label></td>
<td class="style4" style="width: 23px">
<asp:TextBox ID="txtAgendaTypeDescription" runat="server" Text="Monthly" BackColor="#F4F4F4" ReadOnly="True"></asp:TextBox>
</td>
<td></td>
<td class="style7" style="width: 24px"><asp:Label ID="lblTime" runat="server" Text="Time"></asp:Label></td>
<td><asp:TextBox ID="txtTime" runat="server"
Text="4pm" style="margin-top: 2px"></asp:TextBox></td>
<td></td>
</tr>
<tr>
<td style="width: 385px">
<asp:Label ID="lblVenue" runat="server" Text="Venue"></asp:Label>
</td>
<td class="style4" colspan="6"><asp:TextBox ID="txtVenue" runat="server"
Text="Room 1" Width="550px" TextMode="SingleLine" ></asp:TextBox></td>
</tr>
<tr>
<td style="width: 385px"><asp:Label ID="lblRead" runat="server" Text="Please Read:"></asp:Label></td>
<td class="style4" colspan="6">
<asp:TextBox ID="txtRead" runat="server"
Width="550px" TextMode="SingleLine" Font-Names="Verdana" ></asp:TextBox></td>
</tr>
<tr>
<td style="width: 385px"><asp:Label ID="lblBring" runat="server" Text="Please Bring:"></asp:Label></td>
<td class="style4" colspan="6">
<asp:TextBox ID="txtBring" runat="server"
Width="550px" TextMode="SingleLine" Font-Names="Verdana" ></asp:TextBox></td>
</tr>
<tr>
<td style="width: 385px"><asp:Label ID="lblAgendaStatus" runat="server" Text = "Agenda Status" ></asp:Label></td>
<td class="style4" style="width: 23px">
<asp:DropDownList ID="AgendaStatus"
runat="server" Height="24px" Width="125px"> </asp:DropDownList>
</td>
<td> <asp:RequiredFieldValidator ID="RequiredFieldVal2"
ControlToValidate="AgendaStatus"
ErrorMessage="Agenda Status"
Text="*"
runat="server"/>
</td>
</tr>
</table>
<br />
<asp:ValidationSummary ID="ValidationSummary2"
HeaderText="You must enter a value in the following fields:"
DisplayMode="BulletList"
EnableClientScript="true"
runat="server"/>
<br />
<div style="text-align: right;">
<asp:ImageButton runat="Server" ID="btnAddMonthlyTemplate" ImageUrl="~/images/Addbutton.png"
AlternateText="Add Weekly Template" />
</div>
If anyone cant point me in the right direction that would be great. Many thanks in advance.
Betty
You can set the EnableClientScript property of the RequiredFieldValidator to false:
<asp:RequiredFieldValidator ID="RequiredFieldVal1"
ControlToValidate="txtAgendaDate"
ErrorMessage="Date"
Text="*"
EnableClientScript="false"
runat="server"/>
that way the validation will accur only after the user posts the form.
Hope this helps,
Shai.

asp.net Update Panel capturing Button clicks

I have a page that has an ASP.NET UpdatePanel on it. The UpdatePanel contains a repeater, and within the repeater is a command button. (please see the code example below)
When I click on the button the first time, nothing happens. But the second time I click on the same button, then I get the event I was expecting triggered. I am at a loss as to why this is, though I am sure there is a simple explanation. Any advice would be helpful.
<!-- Drivers Table -->
<asp:UpdatePanel runat="server" ID="DriverUpdatePanel" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:HiddenField runat="server" ID="DriverErrors" />
<asp:Repeater ID="DriverRepeater" runat="server" OnItemDataBound="DriverRepeater_ItemDataBound" OnItemCommand="DriverRepeater_ItemCommand">
<HeaderTemplate>
<table cellspacing="0" class="section-table">
<tr>
<td class="bg_mid" colspan="7"><img src="/images/sections/drivers.png" alt="Drivers" /></td>
</tr>
<tr>
<td class="text_1 left-cell">#</td>
<td class="text_1">Name</td>
<td class="text_1">Date Of Birth</td>
<td class="text_1">Gender</td>
<td class="text_1">License #</td>
<td class="text_1">Relationship</td>
<td class="text_1" align="right"> </td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr id="DriverRow" runat="server">
<td class="text_2 required left-cell"><asp:Label ID="DriverNumber" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "DriverNumber")%>'></asp:Label></td>
<td class="text_2 required"><asp:Label ID="DriverName" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "FirstName")%>'></asp:Label></td>
<td class="text_2 required"><asp:Label ID="BirthDate" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "BirthDate")%>'></asp:Label></td>
<td class="text_2 required"><asp:Label ID="Gender" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "Gender").ToString() == "F" ? "Female" : "Male" %>'></asp:Label></td>
<td class="text_2 required"><asp:Label ID="DriversLicenseNumber" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "LicenseInformation.DriversLicenseNumber")%>'></asp:Label></td>
<td class="text_2 required"><asp:Label ID="RelationshipToApplicant" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "RelationshipToApplicant")%>'></asp:Label></td>
<td class="text_2 right-cell" align="right"><asp:ImageButton runat="server" ID="DriverEditButton"
ImageUrl="/images/edit.jpg" AlternateText="Edit" CommandName="Edit" CausesValidation="false" /></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</ContentTemplate>
</asp:UpdatePanel>
make UpdatePanel Mode="Conditional" and enableviewstate="true"
you not need to defined trigger and you work is done without it.

Resources