3 of 3 Update answer

You can write code in Helper/Data.php to get store url and using data helper call that method in admin page

for example


public function getStoreUrl(){
    $storeId = $this->_storeManager->getDefaultStoreView()->getStoreId();
    $url = $this->_storeManager->getStore($storeId)->getUrl("sample/index/test");
return $url;


In admin page In block

public function __construct(
    \Namespace\Modulename\Helper\Data $_dataHelper
) {
    $this->_dataHelper = $_dataHelper;

get url - $this->_dataHelper->getStoreUrl();

In phtml


For Magento 2.1

in block or phtml

echo $this->getBaseUrl().'sample/test/test';