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
Ratheven SivarajahRatheven Sivarajah 

How to avoid ?isdtp=p1 parameter getting appended to an URL

I have created a VF page which has a command link that take me to my desired link but there is istdp p1 at the end of the URL which I dont want. Thank you in advance.

<apex:page controller="TechnologyProduct"  lightningStylesheets="true" showHeader="false" sidebar="false" applyBodyTag="false" applyHtmlTag="false">

    <div id="wrapper">
     <apex:repeat value="{!TechnologyProduct}" var="res" id="repeat">
            <apex:outputPanel rendered="{!res.Detail_Link__c != null}" layout='none'>
                    <apex:outputlink value="{!res.Detail_Link__c}" styleClass="btn" id="button"> {!res.Detailed_Product_Name__c} </apex:outputlink>                  
            </apex:outputPanel>
     </apex:repeat>
    </div>
</apex:page>
Shri RajShri Raj

You can modify the value of the apex:outputLink to exclude the isdtp parameter. For example:
<apex:outputlink value="{!LEFT(res.Detail_Link__c, FIND('isdtp', res.Detail_Link__c) - 1)}" styleClass="btn" id="button"> {!res.Detailed_Product_Name__c} </apex:outputlink>


This code uses the LEFT and FIND functions to exclude the isdtp parameter from the URL. The LEFT function returns the first part of the string, up to the position specified by the FIND function. The FIND function returns the position of the isdtp parameter in the URL, and subtracting 1 from that position gives us the length of the URL without the isdtp parameter.
Shri RajShri Raj

To avoid the "?isdtp=p1" parameter from being appended to the URL, you can add the "isdtp" parameter as part of the URL and set it to "null". Here's an example:
<apex:page controller="TechnologyProduct" lightningStylesheets="true" showHeader="false" sidebar="false" applyBodyTag="false" applyHtmlTag="false">
<div id="wrapper">
<apex:repeat value="{!TechnologyProduct}" var="res" id="repeat">
<apex:outputPanel rendered="{!res.Detail_Link__c != null}" layout='none'>
<apex:outputlink value="{!res.Detail_Link__c}?isdtp=null" styleClass="btn" id="button"> {!res.Detailed_Product_Name__c} </apex:outputlink>
</apex:outputPanel>
</apex:repeat>
</div>
</apex:page>