+ Start a Discussion
romschnromschn 

Using Anchor tag in Pagereference

Hi,

I have one select list, Based on the value I select from this list and click a commandbutton besides it, I need to query one of my custom object which returns me an anchor tag <a href-"www.google.com"> and I have to navigate to this anchor tag returned.

However, Using PageReference(anchorTag), I am not able to do so.

Any ideas please.
Tejpal KumawatTejpal Kumawat
Hello Ramesh,

Try following snippt using variable anchorTag:
public PageReference redirect(){
        PageReference pageRef = new PageReference('http://www.google.com');
        pageRef.setRedirect(true);
        return pageRef;
    }

If this answers your question mark Best Answer it as solution and then hit Like!