473,324 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Need to make control equal to control

I have a situation where I need to make PlaceHolderA equal to
PlaceHolderB
and keep the contents of PlaceHolderB after PlaceHolderA has been destroyed.

is this possible seeing that it is a referenced copy of PlaceHolderA?
Thanks,
--
Ron Vecchi

Nov 18 '05 #1
3 1148
Hi Ron,

I apologize for it if there is any misunderstanding.

As I understand, what you want is getting the content of the placeholder.
Please refer to the following code snippet.

...
private void Button2_Click(object sender, System.EventArgs e)
{
foreach(Control b in PlaceHolder1.Controls)
{
if(b.GetType().ToString() =="System.Web.UI.WebControls.TextBox")
{
PlaceHolder2.Controls.Add ( b );
((TextBox)(b)).Attributes.Add("style",@"Z-INDEX: 103; LEFT: 116px;
POSITION: absolute; TOP: 128px");
}
}
}
...

Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 18 '05 #2
What im tring to do is have a clone of a placeholder.
It would be great if there was a WebControl.Clone() method.

My situation is that I have a custom control that has two child PlaceHolder
Controls.
In most situations both placeholders will need to have the identical child
control structure.

Sorry for the bad questioning but what I should have asked is that is there
a WebControl.Clone method or something similar?


"Jacob Yang [MSFT]" <ji***@online.microsoft.com> wrote in message
news:7N**************@cpmsftngxa07.phx.gbl...
Hi Ron,

I apologize for it if there is any misunderstanding.

As I understand, what you want is getting the content of the placeholder.
Please refer to the following code snippet.

..
private void Button2_Click(object sender, System.EventArgs e)
{
foreach(Control b in PlaceHolder1.Controls)
{
if(b.GetType().ToString() =="System.Web.UI.WebControls.TextBox")
{
PlaceHolder2.Controls.Add ( b );
((TextBox)(b)).Attributes.Add("style",@"Z-INDEX: 103; LEFT: 116px;
POSITION: absolute; TOP: 128px");
}
}
}
..

Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 18 '05 #3
Hi Ron,

Based on my research and experience, there is not such a WebControl.Clone()
method for the PlaceHolder. I think that we can try to use the following
code:

...
private void Button2_Click(object sender, System.EventArgs e)
{

PlaceHolder2 = PlaceHolder1;
PlaceHolder1.Dispose();
foreach(Control b in PlaceHolder2.Controls)
{
if(b.GetType().ToString() =="System.Web.UI.WebControls.TextBox")
{
Response.Write("b.GetType().ToString()");
PlaceHolder2.Controls.Add ( b );
((TextBox)(b)).Attributes.Add("style",@"Z-INDEX: 103; LEFT: 116px;
POSITION: absolute; TOP: 128px");
}

}

}
...

I hope it helps.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: mitch-co2 | last post by:
What I am trying to do is when someone clicks on the YES radio button I want the text field called MYTEXT to equal the text field named DATE. The below code works as long as I do NOT UN-COMMENT...
2
by: Tony Williams | last post by:
I have a form with a tabcontrol which has a number of pages. I want to check the value of a calculated control on one page with a calculated control on another page. The calculated control...
1
by: Dune | last post by:
Saw a post a about hiding a panel using javascript a while back and that got me curious and i tried it out. I have a Panel control with id equal to PanelId and it is nested inside a form tag...
10
by: HK | last post by:
With VB.NET 2005, and a Windows Form, running on a dual CPU box, I need to take a recordset (e.g. 100,000 records) and spawn a thread to handle an internet XML transaction routine for each of the...
0
by: Marek | last post by:
I have DetialsView control and DropDownList control on the same page. I use DropDownList.SelectedVlue as key for DetailsView control. I use SELECT ... FROM table WHERE id_kont = @id_kont where...
3
by: chessitguy | last post by:
I have a simple Wizard page.aspx <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" > <WizardSteps> <asp:WizardStep ID="WizardStep1" runat="server" Title="Main"> <Acme:Main...
2
by: wing ver ka gundam | last post by:
THanks~ this is the example and my quote are below Write a program in JAVA that allows the user to input 5 ints. The program will then output these five values in reverse order. The program will...
28
by: jverri01 | last post by:
First, I am relatively new to working with variables. Most of my experience has been with interface design. i am using ACCESS ver. 2003, running in Windows XP. Second, I spent an hour searching...
12
by: =?Utf-8?B?S2plbGw=?= | last post by:
Hello I've taken a four days training in C#, very good training, experienced teacher and all that, very positive. Went home spent a week making my first application, slightly more than the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.