Shqiptar
Shqiptar

Reputation: 65

Multi language website ASP.NET

i was create multilanguage website in asp.net but i want to get only english data from db but now all data comes my about.aspx page. Pls help me??

 public partial class About : System.Web.UI.Page
    {
        protected override void InitializeCulture()
        {
            string strLang;
            if (Session["lang"] == null)
            {
                strLang = "en-GB";
            }
            else
            {
                strLang = Session["langl"].ToString();
            }

            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(strLang);
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(strLang);
            base.InitializeCulture();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            rpAbout.DataSource = DataAccesLayer.About.GetAbout();
            rpAbout.DataBind();
        }
    }

Stored Procedure

SELECT About.[AboutID],

     Languages.Name as LangCode

      ,[About].[AboutUs],[About].[AboutUs],[About].[Mission],[About].[Vision],[About].[AboutPhoto],


      case when About.IsActive='True' then 'Active' else 'Passive'end as Statu


  FROM [dbo].[About]
  INNER JOIN Languages on About.LangCode = Languages.Code
  Where About.Statu='True' Order by Statu,Languages.Name 

Upvotes: 0

Views: 649

Answers (1)

Lajos Arpad
Lajos Arpad

Reputation: 76424

Your stored procedure loads all records. You need to pass an l parameter and to add a condition to your where to select only the records where Languages.Code matches enter code herel.

Upvotes: 2

Related Questions