function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sfdcvirajsfdcviraj 

How do I comment the Apex code?

I'm a newbie at SFDC. 

I was trying to comment the code as
<! -- <apex:pageBlockSection>
            <p>{! IF( CONTAINS('salesforce.com','force.com'), 'Yep', 'Nope') }</p>
            <p>{! IF( DAY(TODAY())
                < 15, 'Before the 15th', 'The 15th or after') }</p>
        </apex:pageBlockSection>
-->
It shows as if its commented in the developer console, but it doesn't reflect on preview. 

Am I doing something wrong? Please suggest. 
Thanks!
 
Best Answer chosen by sfdcviraj
Ajay K DubediAjay K Dubedi
Hi Viraj,
        You are just doing a mistake by providing gap between <! and -- so just remove that space and put <!-- in the starting part of page this will
       help you in commenting out the page.

All Answers

Krishna SambarajuKrishna Sambaraju
There is nothing wrong. That is how you comment the code in the Visualforce Page.
Ajay K DubediAjay K Dubedi
Hi Viraj,
        You are just doing a mistake by providing gap between <! and -- so just remove that space and put <!-- in the starting part of page this will
       help you in commenting out the page.
This was selected as the best answer
Krishna SambarajuKrishna Sambaraju
Yes. I didn't notice that.
sfdcvirajsfdcviraj
Was surprised to know that the gaps matter while commenting. 
Anyway, thank you Ajay K Dubedi. its working.