/// <summary> /// Generate page URL /// </summary> /// <param name="controller"></param> /// <param name="action"></param> /// <param name="parameter"></param> /// <returns></returns> public static string GenerateURL(string controller, string action, string parameter = null) { string url = string.Format("/{0}/{1}/{2}", CommonUtil.GetCurrentLanguageURL(), controller, action); if (parameter != null) { url += "?" + parameter; } return(url); }
/// <summary> /// Generate full URL address /// </summary> /// <param name="controller"></param> /// <param name="action"></param> /// <param name="parameter"></param> /// <returns></returns> public static string GenerateCompleteURL(string controller, string action, string parameter = null, string strLanguage = null) //Add strLanguage by Jutarat A. on 28092012 { //Add by Jutarat A. on 28092012 if (strLanguage == null) { strLanguage = CommonUtil.GetCurrentLanguageURL(); } //End Add string url = string.Format("{0}{1}/{2}/{3}", GetCurrentHostURL(), strLanguage, //CommonUtil.GetCurrentLanguageURL(), //Modify by Jutarat A. on 28092012 controller, action); if (parameter != null) { url += "?" + parameter; } return(url); }