Apex Code:
public class PageReferenceRedirect {
public pageReference Redirect() {
PageReference pageRef = new PageReference('http://www.google.com');
pageRef.setRedirect(true);
return pageRef;
}
}
Visualforce Page:
<apex:page controller="PageReferenceRedirect" >
<apex:form >
<apex:pageblock > Here underline is removed from Command Link Button.
<apex:commandlink action="{!Redirect}" target="_blank" style="text-decoration: none;">
<apex:commandButton value="Redirect"/>
</apex:commandLink>
</apex:pageblock>
</apex:form>
</apex:page>
Output:
public class PageReferenceRedirect {
public pageReference Redirect() {
PageReference pageRef = new PageReference('http://www.google.com');
pageRef.setRedirect(true);
return pageRef;
}
}
Visualforce Page:
<apex:page controller="PageReferenceRedirect" >
<apex:form >
<apex:pageblock > Here underline is removed from Command Link Button.
<apex:commandlink action="{!Redirect}" target="_blank" style="text-decoration: none;">
<apex:commandButton value="Redirect"/>
</apex:commandLink>
</apex:pageblock>
</apex:form>
</apex:page>
Output:
I didn't know you could change the appearance of the link button. Thank you so much.
ReplyDelete