|
Home > Archive > Microsoft Content Management Server > October 2005 > Updating HtmlPlaceholder Content in code behind
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 |
Updating HtmlPlaceholder Content in code behind
|
|
|
| Hi,
I have a hyperlink as part of the html placeholder content which needs to
get one of its querysting values using a Java script function. I can think of
two ways to do this.
1.Assign the value to a hidden variable in Java script and appending this
hidden variable value to the query string parameter of the hyperlink in the
codebehind. using the following code for the same..
((HtmlPlaceholder)CmsHttpContext.Current.Posting.Placeholders["pldMain"]).Text.Replace("VisitId","VisitId=" + hdnVisitorId.Value);
CmsHttpContext.Current.CommitAll();
I have tried using Html property of the placeholder in the above code, but
neither of these seem to be working...
2. ability to use javascript function directly in the HTML placeholder
content.
Could someone throw some light on this...
Thanks
| |
| Stefan [MSFT] 2005-10-04, 5:53 pm |
| Hi Raj,
seems you are trying to update the placeholder content rather than
populating the change to the javascript file.
I don't think this is what you need.
I assume you need to ensure that the javascript function in the destination
of the hyperlink can read the content correctly, right?
And the value in the querystring is dynamic? Then I would suggest to
implement a custom placeholder control, to override the
LoadPlaceholderContentForPresentation method and to do the modification to
the retrieved content here.
Cheers,
Stefan
--
This posting is provided "AS IS" with no warranties, and confers no rights
New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------
"Raj" <Raj@discussions.microsoft.com> wrote in message
news:6A3744C0-3D92-439A-9EA1-D886D315A6FC@microsoft.com...
> Hi,
> I have a hyperlink as part of the html placeholder content which needs to
> get one of its querysting values using a Java script function. I can think
> of
> two ways to do this.
> 1.Assign the value to a hidden variable in Java script and appending this
> hidden variable value to the query string parameter of the hyperlink in
> the
> codebehind. using the following code for the same..
>
> ((HtmlPlaceholder)CmsHttpContext.Current.Posting.Placeholders["pldMain"]).Text.Replace("VisitId","VisitId="
> + hdnVisitorId.Value);
> CmsHttpContext.Current.CommitAll();
>
> I have tried using Html property of the placeholder in the above code, but
> neither of these seem to be working...
>
> 2. ability to use javascript function directly in the HTML placeholder
> content.
>
> Could someone throw some light on this...
>
> Thanks
>
>
|
|
|
|
|