asp and ajax

Posted on 2012-08-17
Last Modified: 2012-08-17
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?

Question by:rutledgj
    LVL 18

    Accepted Solution

    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


    Author Comment

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

    The codebehind doesn't recognize cphPageContent.

    Author Comment

    Never mind. I had temporarily removed the update panel to see if that would work. I put it back and it is ok.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Suggested Solutions

    Title # Comments Views Activity
    json example 39 76
    Problem to Popup 37 60
    varchar (max) 5 17
    Is there any Easy way to copy CSV to SQL Server using C# 3 24
    User art_snob ( encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
    OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now