Binding placeholder dynamically
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > Binding placeholder dynamically




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Binding placeholder dynamically  
Charlie


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-28-04 11: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?









[ Post a follow-up to this message ]



    Re: Binding placeholder dynamically  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-28-04 11: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...>
MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...nagement+Server
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?
>
>
>
>







[ Post a follow-up to this message ]



    Re: Binding placeholder dynamically  
Charlie


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-28-04 11: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] 
>
>
>.
>





[ Post a follow-up to this message ]



    Re: Binding placeholder dynamically  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-28-04 11: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...>
MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...nagement+Server
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"; 







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:19 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register