C# 从chrome或safari浏览器打开应用程序时如何停止
在.cs页面中,我正在检查用于运行应用程序的浏览器类型:C# 从chrome或safari浏览器打开应用程序时如何停止,c#,asp.net,.net-2.0,C#,Asp.net,.net 2.0,在.cs页面中,我正在检查用于运行应用程序的浏览器类型: #region CheckBrowserType /// <summary> /// Check for the browser type used in TDB application /// </summary> void CheckBrowserType() { if ((Request.Browser.Browser == "IE")||(Request
#region CheckBrowserType
/// <summary>
/// Check for the browser type used in TDB application
/// </summary>
void CheckBrowserType()
{
if ((Request.Browser.Browser == "IE")||(Request.Browser.Browser == "Firefox"))
{
IntBrowserType = 1;
}
else
{
IntBrowserType = 2;
}
}
#endregion
#区域检查浏览器类型
///
///检查TDB应用程序中使用的浏览器类型
///
void CheckBrowserType()
{
if((Request.Browser.Browser==“IE”)| |(Request.Browser.Browser==“Firefox”))
{
IntBrowserType=1;
}
其他的
{
IntBrowserType=2;
}
}
#端区
在页面加载时,我调用函数:
CheckBrowserType();
if (IntBrowserType == 1)
{
//here i wil be showing the login page tetx boxes
}
else if (IntBrowserType == 2)
{
Response.Write(@"<script language='javascript'>alert('Please re-open application in either Firefox or Internet Explorer')</script>");
}
CheckBrowserType();
如果(IntBrowserType==1)
{
//这里我将显示登录页面tetx框
}
else if(IntBrowserType==2)
{
响应。写入(@“警报('请在Firefox或Internet Explorer中重新打开应用程序”);
}
如果用户使用chrome浏览器登录,我将显示警告消息。单击警报消息中的“确定”后,我仍然可以看到显示的登录页面控件
如何停止(如果用户在chrome或safari中打开应用程序)
我应该停止显示登录页面
我正在使用vs2005、c#、asp.NET2.0
任何关于如何解决这个问题的帮助都将是巨大的
谢谢
prince使用以下命令代替警报:
window.location = 'errorpage.html'
并创建包含错误的新页面。替换您的响应。编写如下内容
Response.Clear();
Response.ContentType = "text/javascript";
Response.Write("alert('Please re-open application in either Firefox or Internet Explorer');");
Response.End();
return; //for good measure!
与其让Chrome和Safari的用户停滞不前,不如好好编写你的应用程序,让它与浏览器无关?它是2006年开发的一个老应用程序,所以现在我不能这么做,@prince23:很抱歉听到这个消息。祝你好运