Senator Guerra Souty original series calendar,replica hublot blue steel peach pointer collocation of rolex replica Rome digital scale, track type minute replica watches scale shows that the classical model is swiss replica watches incomparable, wearing elegant dress highlights.
mr-ponna.com

 

YOU ARE HERE: HOME Questions How to provide IE 7 0 Compatibility viewfrom IE8 0 in NET



IE Compatibility View

View(s): 6835

How to provide IE 7.0 Compatibility viewfrom IE8.0 in .NET?

Answer 1)

You can add the meta tag in the OnInit event of the page as shown in the below code:

protected override void OnInit(EventArgs e)
{
    //Always do the check before adding the meta tag
    if (CheckBrowser("IE", 8))
    {
        HtmlMeta meta = new HtmlMeta();

        meta.HttpEquiv = "X-UA-Compatible";
        meta.Content = "IE=EmulateIE7";

        this.Page.Header.Controls.AddAt(0, meta);
    }
}

/// <summary>
/// Checks the browser.
/// </summary>
/// <param name="browserName">Name of the browser.</param>
/// <param name="browserMajorVersion">The browser major version.</param>
/// <returns></returns>
public static bool CheckBrowser(string browserName, int browserMajorVersion)
{
    HttpBrowserCapabilities br = HttpContext.Current.Request.Browser;

    if (br.Browser.ToUpper().Equals(browserName) && (br.MajorVersion == browserMajorVersion))
        return true;
    else
        return false;
}


  Asked in:  SemanticSpace Technologies   Expertise Level:  Experienced
  Last updated on Friday, 01 March 2013
5/5 stars (2 vote(s))

Register Login Ask Us Write to Us Help