Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 464
  • Last Modified:

asp and ajax

I have a main page that looks like the below:

<%@ Page Title="" Language="VB"  ValidateRequest="false" MasterPageFile="~/EHR/master/Desktop.master" AutoEventWireup="false" CodeFile="ClientServices.aspx.vb" Inherits="EHR_clientservices_ClientServices" %>
<%@ Register Src="~/EHR/clientservices/usercontrols/HIEReport.ascx" TagName="hiereport" TagPrefix="uchie" %>
<%@ Register Src="~/EHR/clientservices/usercontrols/ProfileMaintenance.ascx" TagName="profilemaintenance" TagPrefix="ucprofile" %>
<%@ MasterType TypeName="EHR.Application.Master" %>

<asp:Content ID="Content3" ContentPlaceHolderID="cphContentFrameMenuBarLeft" Runat="Server">

<div id="itemselector">
    Menu: &nbsp <asp:DropDownList runat="server" ID="ddlItemSelector" AutoPostBack="true" EnableViewState="true"></asp:DropDownList>
</div>

</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="cphPageContent" Runat="Server" Visible="true">
    <asp:UpdatePanel ID="upPageContent" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
        <ContentTemplate>
            <uchie:hiereport runat="server" ID="ucHieReportControl" />   
            <ucprofile:profilemaintenance runat="server" ID="ucProfileMaintenance" />                                       
        </ContentTemplate>
    </asp:UpdatePanel>
       
</asp:Content>

Open in new window




As you can see I have two user controls inside an update panel. I need a way to show/hide the controls based on the dropdown selection for ddlItemSelector (which is not in the same update panel).

I'm working within the constraints of this template page and can't really change it. I assume I need some type of trigger or something to communicate to the update panel that the ddl has changed.

Can someone get me some vb code that will make this work?

Thanks
0
rutledgj
Asked:
rutledgj
  • 2
1 Solution
 
Rajar AhmedConsultantCommented:
try this ,
onselectionchange  event of dropdown
if ddlItemSelector.selectedvalue = "1" then 'Your matching criteria 
  ucHieReportControl.visible = true
elseif ddlItemSelector.selectedvalue = "2" then 
 ucProfileMaintenance.visible=true
end if 
upPageContent.update()

Open in new window

0
 
rutledgjAuthor Commented:
I'm assume you mean, in my case, cphPageContent.update()?

The codebehind doesn't recognize cphPageContent.
0
 
rutledgjAuthor Commented:
Never mind. I had temporarily removed the update panel to see if that would work. I put it back and it is ok.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now