Microsoft Content Management Server - Binding placeholder dynamically

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > July 2004 > Binding placeholder dynamically





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Binding placeholder dynamically
Charlie

2004-07-28, 6:10 pm

Can the placeholder control binds placeholder at run time?
I want to bind different placeholder according to the
language the user choose.

switch(CheckChannelName)
{
case "english":
HtmlPlaceholderChannelBased.ID = "HtmlPlaceholderEnglish";
HtmlPlaceholderChannelBased.PlaceholderToBind
= "EnglishPlchldr";
break;
case "japanese":
HtmlPlaceholderChannelBased.ID = "HtmlPlaceholderJapanese";
HtmlPlaceholderChannelBased.PlaceholderToBind
= "JapanesePlchldr";
break;
}

I had such placeholder definitions in the template
already. But simply it's doesn't work..What's wrong with
it?




Stefan [MSFT]

2004-07-28, 6:10 pm

Hi Charlie,

yes it is possible using the following code:

HtmlPlaceholderControl test;
test = new HtmlPlaceholderControl();
test.PlaceholderToBind = "Ph1";
test.ID = "MyDynPhControl";
test.DataBind();

So you need to add the DataBind() method call to your code.

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

MCMS FAQ:
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...t+S
erver

MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
--------------------------------


"Charlie" <charlieskc@gmail.com> wrote in message
news:577401c47473$44ace8a0$a601280a@phx.gbl...
> Can the placeholder control binds placeholder at run time?
> I want to bind different placeholder according to the
> language the user choose.
>
> switch(CheckChannelName)
> {
> case "english":
> HtmlPlaceholderChannelBased.ID = "HtmlPlaceholderEnglish";
> HtmlPlaceholderChannelBased.PlaceholderToBind
> = "EnglishPlchldr";
> break;
> case "japanese":
> HtmlPlaceholderChannelBased.ID = "HtmlPlaceholderJapanese";
> HtmlPlaceholderChannelBased.PlaceholderToBind
> = "JapanesePlchldr";
> break;
> }
>
> I had such placeholder definitions in the template
> already. But simply it's doesn't work..What's wrong with
> it?
>
>
>
>



Charlie

2004-07-28, 6:10 pm

Thanks Stefan, but the placeholder didn't change still.
the placeholdercontrol just keep binding to the old one.
How do I know the current binding of a placeholdercontrol
by coding?

Moreover, what's the differences between
PlaceholderToBind and BoundPlaceholder??

Thanks!!!


>-----Original Message-----
>Hi Charlie,
>
>yes it is possible using the following code:
>
> HtmlPlaceholderControl test;
> test = new HtmlPlaceholderControl();
> test.PlaceholderToBind = "Ph1";
> test.ID = "MyDynPhControl";
> test.DataBind();
>
>So you need to add the DataBind() method call to your

code.
>
>Cheers,
>Stefan.
>
>--
>This posting is provided "AS IS" with no warranties, and

confers no rights.
>
>MCMS FAQ:
>http://download.microsoft.com/download/4/2/5/4250f79a-

c3a1-4003-9272-2404e92bb76a/MCMS+2002+-+(complete)+FAQ.htm
>MCMS Blog:

http://blogs.msdn.com/stefan_gossner/category/4983.aspx
>MCMS Sample Code:
>http://www.gotdotnet.com/community/...les/Default.asp

x? ProductDropDownList=Content+Management+S
erver
>MCMS Whitepapers and other docs:
>http://blogs.msdn.com/stefan_gossne...e/2003/12/07/41

859.aspx
>--------------------------------
>
>
>"Charlie" <charlieskc@gmail.com> wrote in message
>news:577401c47473$44ace8a0$a601280a@phx.gbl...
time?[vbcol=seagreen]
= "HtmlPlaceholderEnglish";[vbcol=seagreen]
= "HtmlPlaceholderJapanese";[vbcol=seagreen]
>
>
>.
>

Stefan [MSFT]

2004-07-28, 6:10 pm

Hi Charlie,

BoundPlaceholder will give you the info about the current binding. This
property is read-only.
PlaceholderToBind is the property exposed to VS.NET where this value can be
set.

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

MCMS FAQ:
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...t+S
erver

MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
--------------------------------


"Charlie" <charlieskc@gmail.com> wrote in message
news:585301c47484$ad93b4a0$a601280a@phx.gbl...[vbcol=seagreen]
> Thanks Stefan, but the placeholder didn't change still.
> the placeholdercontrol just keep binding to the old one.
> How do I know the current binding of a placeholdercontrol
> by coding?
>
> Moreover, what's the differences between
> PlaceholderToBind and BoundPlaceholder??
>
> Thanks!!!
>
>
> code.
> confers no rights.
> c3a1-4003-9272-2404e92bb76a/MCMS+2002+-+(complete)+FAQ.htm
> http://blogs.msdn.com/stefan_gossner/category/4983.aspx
> x? ProductDropDownList=Content+Management+S
erver
> 859.aspx
> time?
> = "HtmlPlaceholderEnglish";
> = "HtmlPlaceholderJapanese";


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com