Im an ATLAS newbie and I've come across an issue with using several dropdownlists within an UpdatePanel. I'm using the OnSelectedIndexChanged event of the dropdownlist to fire a subroutine, which checkes the SelectedValue and determines what additional fields (if any) to display.
When I debug the application in VS2005, I can see that the CreateCriteriaField subroutine does fire when the value of dropFID1 changes. The CreateCriteriaField subroutine then sets the visibility of dropComparison1a to true. dropComparison1a, however, does not render to the screen. I'm having the same issue with any field which has its visibility set to "false". Since the partial postback does occur, I'm guessing this some sort of a javascript or rendering issue and not an Atlas config issue.
Some notes: I am using a master page in a frameset, and Cassini as my webserver. Code excerpts are below. Any ideas would be most appreciated. (I apologize for the formatting of the code, but I had trouble pasting it in here.)
Content Page
*****************************************************************
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"
<atlas:ScriptManager ID="scriptmanager1" EnablePartialRendering="true" runat="server" /
<atlas:UpdatePanel ID="updatepanel1" runat="server"
<ContentTemplate
<table>
<tr id="row1" visible="true" runat="server" style="vertical-align: top;">
<td><asp:DropDownList ID="dropFID1" runat="server" OnSelectedIndexChanged="CreateCriteriaField" AutoPostBack="true" CssClass="advancedsearchcriteria" /></td>
<td width="100">
<asp:DropDownList ID="dropComparison1a" runat="server" CssClass="advancedsearchcriteria" Width="100" Visible="false" AutoPostBack="true" OnSelectedIndexChanged="CheckTextFields"><asp:ListItem text="=" Value="=" /><asp:ListItem text="<>" Value="<>" /><asp:ListItem text="Begins With" Value="begins" /><asp:ListItem text="Includes" Value="includes" /><asp:ListItem text="<> Begins With" Value="not begins" /><asp:ListItem text="<> Include" Value="not includes" /><asp:ListItem text="Is Null" Value="IS NULL" /><asp:ListItem text="Is Not Null" Value="IS NOT NULL" /></asp:DropDownList> <asp:DropDownList ID="dropComparison1b" runat="server" CssClass="advancedsearchcriteria" Width="100" Visible="false" AutoPostBack="true" OnSelectedIndexChanged="CheckCalendarFields"><asp:ListItem text="=" Value="=" /><asp:ListItem text="<>" Value="<>" /><asp:ListItem text=">" Value=">" /><asp:ListItem text="<" Value="<" /><asp:ListItem text="Between" Value="between" /><asp:ListItem text="Is Null" Value="IS NULL" /><asp:ListItem text="Is Not Null" Value="IS NOT NULL" /></asp:DropDownList> </td>
<td width="300"> <asp:TextBox ID="txtCriteria1" Visible="false" runat="server" CssClass="advancedsearchcriteria"/><asp:HyperLink id="linkCalendar1" visible="false" runat="server" ImageUrl="/images/calendar.gif" alt="Select Date" href="javascript:show_calendar('all.ctl00$ContentPlaceHolder1$txtCriteria1');" /> <asp:Label ID="lblBetween1" runat="server" text="AND" cssclass="betweenlabel" Visible="false"/> <asp:TextBox ID="txtCriteria1b" Visible="false" runat="server" CssClass="advancedsearchcriteria"/><asp:HyperLink id="linkCalendar1b" visible="false" runat="server" ImageUrl="/images/calendar.gif" alt="Select Date" href="http://links.10026.com/?link=javascript:show_calendar('all.ctl00$ContentPlaceHolder1$txtCriteria1b');" /> <asp:DropDownList ID="dropCriteria1" runat="server" Visible="false" CssClass="advancedsearchcriteria" OnSelectedIndexChanged="CreateTSField" AutoPostBack = "true" width="250"/><br /><asp:DropDownList ID="dropTransactionStatus1" runat="server" cssclass="advancedsearchcriteria" Visible="false" Width="250"/> </td> <td ><asp:DropDownList ID="dropOperator1" runat="server" OnSelectedIndexChanged="checkOperator" AutoPostBack="True" CssClass="advancedsearchcriteria"><asp:ListItem text="" Value="" /><asp:ListItem text="And" Value="and" /><asp:ListItem text="Or" Value="or" /></asp:DropDownList></td> </tr></table></ContentTemplate></atlas:UpdatePanel>
</asp:Content>
Master Page
**************************************************************
<%
@dotnet.itags.org.MasterLanguage="VB"CodeFile="main.master.vb"Inherits="main" %><%
@dotnet.itags.org.RegisterSrc="~/includes/controls/topmenu.ascx"TagName="topmenu"TagPrefix="ucTopMenu" %><?
xmlversion="1.0"encoding="UTF-8"?><!
DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><
htmlxmlns="http://www.w3.org/1999/xhtml"><
headid="Head1"runat="server"><title>Untitled Page</title><linkhref="/style.css"rel="stylesheet"type="text/css"/><scripttype="text/javascript"src="/includes/javascript/date-picker.js"/></
head><
bodystyle="background-color: #5A6E9F"><formid="form1"runat="server"><divid="maindiv"><divid="topmenudiv"><ucTopMenu:topmenuID="Topmenu1"runat="server"enableviewstate="false"/><ahref="javascript:PrintFrame()"><imgsrc="/images/print1.gif"alt="Print"style="position: absolute; right: 10px; top: 2px; border: none;"/></a></div><divid="pageheadingdiv"><asp:labelID="lblPageHeading"runat="server"Text="Page Heading"enableviewstate="false"/></div><divid="maincontentdiv"><asp:contentplaceholderid="ContentPlaceHolder1"runat="server"/></div></div></form></
body></
html>Content Page Code Behind Excerpt
************************************************************
Sub CreateCriteriaField(ByVal s As Object, ByVal e As EventArgs)
Dim dropFID As DropDownList
dropFID = s
'Retrieve number from FID dropdown
Dim strDropDownList As String = Right(dropFID.ID, 1)
Dim Content2 As ContentPlaceHolder = Page.Form.FindControl("ContentPlaceHolder1")
Dim dropComparisonA As DropDownList
dropComparisonA = Content2.FindControl("dropComparison" & strDropDownList & "a")
dropComparisonA.Visible = True
End Sub
IMHO, you should put your second dropdownlist at another updatePanel and put trigger in second updatePanel from first dropdownlist.
Hope this helps.
That is an idea I considered, but since this one page makes use of about 30 dropdownlists and textboxes, I don't know how practical that would be. Additionally, I have other pages with multiple dropdowns within a single update panel and those work as expected. I'm still trying to figure out what isn't working with this, but I'm just about out of ideas...
No comments:
Post a Comment