Using two Contentplaceholders and two Updatepanels

Hey all,

I have created a masterpage with two contentplaceholders and updatepanels. In a derived page I want to update one of these updatepanels if a dropdownlist located in the other updatepanel changes it's values. But if I add a trigger with referenceing a control which is sitting in the other contentplaceholder I get the exception 

The ControlID property of the trigger must reference a valid control

It works fine, if both updatepanels are in the same contentplaceholder. Any idea how to access a control for a trigger which is located in another contentplaceholder?

 

regards

Andreas

0
starzl
3/30/2006 9:06:03 AM
asp.net.ajax-discussion 13973 articles. 1 followers. Follow

3 Replies
718 Views

Similar Articles

[PageSpeed] 37

i have the same problem :(
Chicago Web Design
NMG Easy Site - professional site faster than ever !
ASP.net hosting - the best way to find good, reliable ASP.net hosting.
0
TOMCIO
4/4/2006 3:50:41 PM

hello.

here's a possible solution (it uses a simple button to perform an atlas postback, but you can change another server control):

MASTER PAGE

<%

@ Master Language="C#" %>

<!

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<

script runat="server">

public UpdatePanel Panel

{

get

{

return panel;

}

}

</

script>

<

html xmlns="http://www.w3.org/1999/xhtml" >

<

head runat="server">

<title>Untitled Page</title>

</

head>

<

body>

<form id="form1" runat="server">

<div>

<atlas:ScriptManager runat="server" ID="manager" EnablePartialRendering="true">

</atlas:ScriptManager>

<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">

</asp:contentplaceholder>

<atlas:UpdatePanel runat="server" ID="panel">

<ContentTemplate>

<div style="border: solid 1px red">

<%

= DateTime.Now.ToString() %>

</div>

</ContentTemplate>

</atlas:UpdatePanel>

</div>

</form>

</

body>

</

html>

ASP pAGE:

<%

@ Page Language="C#" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %>

<%

@ MasterType VirtualPath="~/MasterPage.master" %>

<

script runat="server">

protected override void OnInit(EventArgs args)

{

base.OnInit(args);

Microsoft.Web.UI.

ControlEventTrigger trigger = new Microsoft.Web.UI.ControlEventTrigger();

trigger.ControlID = bt.UniqueID;

trigger.EventName =

"Click";

this.Master.Panel.Triggers.Add(trigger);

}

</

script>

<

asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<asp:Button runat="server" ID="bt" Text="refrehs panel" />

Page time: <%

= DateTime.Now.ToString() %>

</

asp:Content>

--
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
0
Luis
4/4/2006 6:03:16 PM

Thanks i did play it with it and found different solution (not perfect but works too) . when i set triggers for updatepanel (in contentplaceholder1) i set controlID to "ctl00$ContentPlaceHolder2$Button1" not button1 - and works just fine

Let me know what you think - is this a good way ( i know it work:)


Chicago Web Design
NMG Easy Site - professional site faster than ever !
ASP.net hosting - the best way to find good, reliable ASP.net hosting.
0
TOMCIO
4/4/2006 6:13:26 PM
Reply:

Similar Artilces:

testing two three two three two two
Test ...

Using UpdatePanel with two ContentPlaceHolders inside the MasterPage
Hi,I have the following situation: I have a Master Page with two content place holders.In my child page, in the first Content holder I have a formview and and update panel.In the second Content holder I have a gridview.I want the formview to refersh with the details of the record which is selected in the gridview.So inside my updatepanel i have given the controlid of gridview and the event name as "SelectedIndexChanged"But since the UpdatePanel and the GridView are in different Content PlaceHolders, the UpdatePanel is not able to find my GridView control. Can someone plea...

Can I use one webservice two update two country controls with associated images in ajax.
 [WebMethod]    [System.Web.Script.Services.ScriptMethod]     public AjaxControlToolkit.CascadingDropDownNameValue[] GetCountries(string knownCategoryValues, string category)    {        List<CascadingDropDownNameValue> countryList = new List<CascadingDropDownNameValue>();        DataSet dsCountry = Country.GetCountries();        foreach (DataRow row in dsCountry.Tables[0].Rows)        {            countryList.Add(new CascadingDropDownNa...

Two UpdatePanels and Two UpdateProgress controls
I have a page with two seperate Update Panels and I would like to have an Update progress Control for each.I have placed each of the respective UpdateProgress controls in the UpdatePanel Template, however when I reload either of the Panels both the UpdateProgress controls are displayed, is there a way to bind the UpdateProgress controls to a single UpdatePanel?RegardsMike From what I saw, I didn't see any mechanisms for associating an UpdateProgress control with any particular UpdatePanel...Anyone else know if I'm wrong, here?Andyhttp://www.fboweb.com   Atlas isn't set up to do tha...

Using Two UpdatePanels?
I have two updatepanels on my page and about 5 buttons. I am trying to get all 5 buttons to do a PartialRendering of just one updatepanel and 2 of the buttons to update both updatepanels. It looks like once I set a Trigger (click) of a updatepanel all updatapanels get updated. Is there a way to have more then one ScriptManager to fix this? Anyone have any ideas.   Thanks Hi, you can't have more than one ScriptManager per page. Regarding your requirements, what you could do is set the Mode property of each UpdatePanel to "Conditional" and then go with triggers.  Alessandr...

Using two graphics cards and two monitors?
Is it possible to use two graphics cards each with its own monitor? I have spent considerable effort trying to make this work with a Intel 865 / Vizio 37 monitor as well as a ATI Rage XL / 19" VESA 1280 x 1024 without success. I can use each monitor/card combination individually, by setting my machine to boot from that card, but cannot get Suse 11.1 to recognize both simultaneously (even though the "Hardware Information" from Yast recognizes both graphics cards). Incidentally, Windows XP recognizes and uses both cards and monitors simultaneously. sax2 -r only re...

using two arrays for two different fields
I'm trying to extract all the dates from a db table and load them in an array(seems the most logical).  However I keep getting the following error: Index was outside the bounds of the array. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.Source Error: Line 130: For Each row In DsVacationData1.RequestDataManager Line 131: ...

Are two ajax updatepanels Safe???
I am using two ajax updatepanels. One updates the other actually. So one will change a field on the page, then panel.update(), etc.This all works well without full page postback. Wonderful. Now...I am about to release this page out to a few thousand of our customers. Before I do that.... Can anyone tell me if there is Any danger in compatibility or performance or server load, etc. when using updatepanels?As far as compatibility, these pages need to work with "Anything normal". Meaning, fairly recent versions of IE, Firefox, and Safari. Nothing crazy like IE from 10 years ...

Using ADO: two Excel files and two ADOConnections Simultaneously
Windows 7, Delphi XE2. I am using ADO to access two separate excel spreadsheets. They have identical structure. Thus, I have set up two ADOConnections, two ADOQueries, and two TDatasets and connected them all together in a data module. I also have two dbgrids on the main form, one for each spreadsheet. I have prelinked the ADOConnections to the ADOQueries and the datasets and grids. The settings for each connection chain are connected identically except for the files pointed to. The object is to display each spreadsheet in a grid. OK, so I am making the connections dyna...

Two UpdatePanel and two SqlDatasource with FormParameters: too many database requests
Hi, i have a aspx-page with two UpdatePanels. In each of the UpdatePanels I have a GridView and a Textbox to specify a search expression. For each GridView I have defined a SqlDataSource. The SqlDataSource contains a SelectParameter connected with the TextBox. Addionally I have two Buttons as trigger to refresh the UpdatePanel. Only one button is registered to one UpdatePanel, that means Button "A" refreshs UpdatePanel "A" and button "B" refreshs UpdatePanel "B". The Problem: Not only one SqlDataSource is selecting data when I try to refresh only on...

Two websites using the same .net application
I am running a .net application for two websites hosted on the same server.  The idea is that it shares the info whether it's updated on either directory (it uses files instead of a database).  Site A is running the .net application its own sub directory.  Site B is running the .net applcation in a virtual directory.  But once I started I realized that if I created pages from either site it would only update on the site that I updated.  So if I created a page through a form on Site B, then the new or edited page will only display o...

Using two UpdatePanels, a DataList and a TextBox
Hello Everybody, I finally come here since I can't find any solution to solve my issue.I am actually coding an intranet page in which users can create job offers. To do so, they have to choose a contact by clicking in a datalist which updates a textbox with the name of the chosen contact.This is how this should work, but...All of these controls are in a first UpdatePanel.MyDatalist is in a second UpdatePanel since I have to give the user two types of list ordering (so i need an asyncpostback). This datalist appears in a ModalPopupExtender.I have set the Datalist's selectIndexCha...

How do you insert into two tables from one insert? Or even how would you using two inserts?
I currently insert into one table with:                 SqlCommand comm = new SqlCommand("INSERT INTO UsersTable (UserName, Password, Email) VALUES (@person, @pass, @email)", sqlConnection);                comm.Parameters.AddWithValue("@person", usrnmeLbl.Text);                comm.Parameters.AddWithValue("@pass", hiddenpassLbl.Text);     &n...

Loading the two datatables from a dataset in to two different excel sheets using OleDbAdapter
Hi,   I have a problem now, I just created two excel sheets and I loading the data to a datatable in a dataset. If the rows are greater than 65536, then I load the remaining in the second datatable of a dataset. But while calling the update method of OledbAdapter after the first sheet get filled it throws error as "Spreadsheet is full". OledbAdapter.Update(dataset) or even I tried OledbAdapter.Update(datatable). Since i m not using insert query to insert in to the datatable. I have a dataset which I got from someother data and using that dataset i want to fill another ...

Web resources about - Using two Contentplaceholders and two Updatepanels - asp.net.ajax-discussion

ASP.NET - Wikipedia, the free encyclopedia
ASP.NET is a server-side Web application framework designed for Web development to produce dynamic Web pages . It was developed by Microsoft ...

Issues - nhaml - A .NET implementation of the Haml templating engine - Google Project Hosting
My favorites ▼ - Sign in nhaml A .NET implementation of the Haml templating engine Project Home Downloads Wiki Issues Source New issue Search ...

Archive
Articles Blog Videos Archive The Good, The Bad, and Everything In Between May 2014 Building Multiple Filters with Lo-Dash and AngularJS Compile, ...

What is ContentPlaceHolder control? A Webopedia Definition
This page describes the term ContentPlaceHolder control and lists other pages on the Web where you can find additional information.

Archive
Articles Blog Videos Archive The Good, The Bad, and Everything In Between Sep 2014 Features Of ES6 Part 5: The Spread Aug 2014 Karma Is Not Just ...

Resources last updated: 1/8/2016 5:40:29 AM