Switch my website layout : case of the language

Hi,
i'm developing a website that support  two languages (french , arab);
As you know arabic language is from the right to left.
My problem is with this arabic version,
how can i do?
keviin55Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ALaRivaCommented:
You can use the [dir] attribute of either the html or body tag, and set it to 'rtl' (RIGHT-TO-LEFT/Arabic) or 'ltr' (LEFT-TO-RIGHT/French).

<body dir="rtl">...yourcontent...</body>

Your divs and other controls can also be changed on an individual basis, but if you want it across the entire page, then the html or body tag would be best.

hth

- Anthony
0
keviin55Author Commented:

thank you It can help me,
but how can i change the value of "dir" attribute as the user's choice?
0
ALaRivaCommented:
How are you keeping track of their choice?
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

keviin55Author Commented:
the user will choose the language by clicking a button.
I do not know what to do if I made ¿¿a variable and I put in the url, or I do two differen folder:
tmysite/ar and mysite/fr yours it is to you to help me
0
ALaRivaCommented:
What I meant is how are you keeping track of their selection of language?

Are you storing it in a Session Variable?

*** Question needed for later ***
Are you using master page with the site?
0
keviin55Author Commented:
I dont not know yet how to keep track of their selection of language.
you can offer me some ideas.
yes I use a master page for my asp site .
0
ALaRivaCommented:
You can use a session variable for the language selection.

UNLESS, if they log in to the site then you might want to store their preference in whatever database you are using, that way they don't need to reselect their language each time.

Let me know which method you decide to go with and I can finish up the original question.
0
keviin55Author Commented:
the user will not login so i will use session .
0
ALaRivaCommented:
OK, so what you can do is set a default when the session begins (French or Arabic, you choose), and then in the master page you can do this at the top...

<%
if Session("siteLanguage") = "Arabic" Then
  strDirection = "rtl"
      else
  strDirection = "ltr"
End If
%>

... other code you may have...

<html dir="<% =strDirection %>">
______________________________________________


You might need to play with that, but that is the concept.

hth

- Anthony
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
keviin55Author Commented:
Thank you,
I tried this code to redirect the user but it dont works
 
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class façade : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Session("lang") = "ar";
        Response.Redirect("test.aspx");
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Session("lang") = "fr";
        Response.Redirect("test.aspx");

    }
}

Open in new window

0
ALaRivaCommented:
What happens when you click the button? Does it error?
0
keviin55Author Commented:
this is the error:
Compiler Error Message: CS0118: 'System.Web.UI.Page.Session'is a 'property' but is used as a 'method'
0
keviin55Author Commented:
Thank you fo your help it is solved .
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.