How to access controls within MSIB placeholders (info)
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Commerce Server > Commerce Server General > How to access controls within MSIB placeholders (info)




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

    How to access controls within MSIB placeholders (info)  
Matthew


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


 
07-12-04 10:51 PM

This post contains information regarding how to access both the
presentation and authoring controls within an MSIB ebizcontent
ProductPropertyPlaceholderControl.  This logic comes in handy if you
need to modify the values within ebizcontent
ProductPropertyPlaceholderControls using some way other than the
authoring textbox.  Modifying the CS product properties or CS tables
directly will get the product out of sync with the CMS template.  This
logic will ensure that the CMS approval workflow is kept intact for
your app.

*** To access the ProductPropertyPresentationControl ***

Private Sub Page_UnLoad(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Unload

If (WebAuthorContext.Current.Mode =
WebAuthorContextMode.PresentationUnpublished) Then

Dim ph As ProductPropertyPlaceholderControl =
CType(FindControl("PlaceholderControl_A"),
ProductPropertyPlaceholderControl)

Dim ph_LiteralControl As System.Web.UI.LiteralControl =
CType(ph.Controls(0).Controls(0).Controls(0),
System.Web.UI.LiteralControl)

End If

End Sub



*** To access the ProductPropertyAuthoringControl ***

If ((WebAuthorContext.Current.Mode =
WebAuthorContextMode.AuthoringNew) Or (WebAuthorContext.Current.Mode =
WebAuthorContextMode.AuthoringReedit)) Then

Dim ph As ProductPropertyPlaceholderControl =
CType(FindControl("PlaceholderControl_A"),
ProductPropertyPlaceholderControl)

Dim ebizKeywordValues_Textbox As TextBox =
CType(ph.Controls(0).Controls(0).Controls(0), TextBox)

End If

*** End Example ***

NOTES:
-- The ProductPropertyPresentationControl only seems to be accessible
during the UnLoad event in the CMS PresentationUnpublished context.

-- Setting "ph.Visible = False" will not allow the control to render

-- Setting "ph.EnableAuthoring = False" will render the control, but
will not allow the control to be written to.

-- There seems to be an error in the MSIB documentation re: the
namespace for the ProductPropertyPlaceholderControl.  It is
Microsoft.Solutions.Framework.WebControls rather than
Microsoft.Solutions.Framework





[ Post a follow-up to this message ]



    RE: How to access controls within MSIB placeholders (info)  
David Messner [MSFT]


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


 
07-15-04 10:51 PM

Thanks for the post!
--
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2004 Microsoft Corporation.  All rights
reserved.

--------------------
From: clemmonsm@yahoo.com (Matthew)
Newsgroups:
microsoft.public.cmserver.general,microsoft.public.commerceserver.general
Subject: How to access controls within MSIB placeholders (info)
Date: 12 Jul 2004 13:51:34 -0700
Organization: http://groups.google.com
Lines: 62
Message-ID: <a0cb7688.0407121251.5920cb32@posting.google.com>
NNTP-Posting-Host: 169.146.191.10
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1089665524 28884 127.0.0.1 (12 Jul 2004
20:52:04 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 12 Jul 2004 20:52:04 +0000 (UTC)
Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXS01.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
8.phx.gbl!news-out.cwix.com!newsfeed.cwix.com!prodigy.com!prodigy.com!news.g
lorb.com!postnews2.google.com!not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.commerceserver.general:14233
microsoft.public.cmserver.general:36714
X-Tomcat-NG: microsoft.public.commerceserver.general

This post contains information regarding how to access both the
presentation and authoring controls within an MSIB ebizcontent
ProductPropertyPlaceholderControl.  This logic comes in handy if you
need to modify the values within ebizcontent
ProductPropertyPlaceholderControls using some way other than the
authoring textbox.  Modifying the CS product properties or CS tables
directly will get the product out of sync with the CMS template.  This
logic will ensure that the CMS approval workflow is kept intact for
your app.

*** To access the ProductPropertyPresentationControl ***

Private Sub Page_UnLoad(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Unload

If (WebAuthorContext.Current.Mode =
WebAuthorContextMode.PresentationUnpublished) Then

Dim ph As ProductPropertyPlaceholderControl =
CType(FindControl("PlaceholderControl_A"),
ProductPropertyPlaceholderControl)

Dim ph_LiteralControl As System.Web.UI.LiteralControl =
CType(ph.Controls(0).Controls(0).Controls(0),
System.Web.UI.LiteralControl)

End If

End Sub



*** To access the ProductPropertyAuthoringControl ***

If ((WebAuthorContext.Current.Mode =
WebAuthorContextMode.AuthoringNew) Or (WebAuthorContext.Current.Mode =
WebAuthorContextMode.AuthoringReedit)) Then

Dim ph As ProductPropertyPlaceholderControl =
CType(FindControl("PlaceholderControl_A"),
ProductPropertyPlaceholderControl)

Dim ebizKeywordValues_Textbox As TextBox =
CType(ph.Controls(0).Controls(0).Controls(0), TextBox)

End If

*** End Example ***

NOTES:
-- The ProductPropertyPresentationControl only seems to be accessible
during the UnLoad event in the CMS PresentationUnpublished context.

-- Setting "ph.Visible = False" will not allow the control to render

-- Setting "ph.EnableAuthoring = False" will render the control, but
will not allow the control to be written to.

-- There seems to be an error in the MSIB documentation re: the
namespace for the ProductPropertyPlaceholderControl.  It is
Microsoft.Solutions.Framework.WebControls rather than
Microsoft.Solutions.Framework






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:13 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