locked
How to change Master page direction from left to right RRS feed

  • Question

  • User-775697465 posted

    How to change Master page direction from left to right when press buttonA, and from left ot right when press button B

    here the buttons code

    protected void RequestLanguageChange_Click(object sender, EventArgs e)
    {
    LinkButton senderLink = sender as LinkButton;

    if (Session["LangID"].ToString() != senderLink.CommandArgument)
    {
    Session["LangID"] = senderLink.CommandArgument;

    HttpContext.Current.Server.Transfer(Request.Url.AbsolutePath);

    Server.Transfer(Request.Url.LocalPath);
    }

    }

    on page load

    if 

    MasterBody.Attributes.Add("float", "right");
    MasterBody.Attributes.Add("dir", "rtl");

    the code work fine , but when login and then logOut and change language then the error

    Error executing child request for /Account/Login. because of 
    Server.Transfer(Request.Url.LocalPath);

    Thursday, May 2, 2013 4:07 PM

Answers

  • User1508394307 posted

    Instead of Server.Transfer() you can try to use

    HttpContext.Current.RewritePath("somefile.aspx");

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 2, 2013 5:58 PM

All replies