﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace P02_CompanySite
{
    public partial class Site : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void EnglishButton_Click(object sender, EventArgs e)
        {            
            Response.Redirect(string.Format("/ContentPages/English/{0}", GetPage()));
        }

        protected void BulgarianButton_Click(object sender, EventArgs e)
        {
            Response.Redirect(string.Format("/ContentPages/Bulgarian/{0}", GetPage()));
        }

        private string GetPage()
        {
            var url = HttpContext.Current.Request.RawUrl.Split('/');
            var page = url[url.Length - 1];

            return page;
        }
    }
}