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

  • 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>

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

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?

  • 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 
end if 

Open in new window

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

The codebehind doesn't recognize cphPageContent.
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.

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