T
Tony Johansson
Hello!
If I do the following I get compile error says It's not possible to implicit
convert the type string to bool
Label4.Text = "Browser support cookies : " + Request.Browser.Cookies ?
"true" : "false";
Can I write in another way so I can remove the s string in this code.
protected void Page_Load(object sender, EventArgs e)
{
string s;
Label1.Text = "Application path is : " + Request.Path;
Label2.Text = "OS platform is : " + Request.Browser.Platform;
Label3.Text = "Browser type is : " + Request.Browser.Type;
s = Request.Browser.Cookies ? "true" : "false";
Label4.Text = "Browser support cookies : " + s;
s = Request.Browser.VBScript ? "true" : "false";
Label5.Text = "Browser support VBScript : " + s;
s = Request.Browser.JavaScript ? "true" : "false";
Label6.Text = "Browser support JavaScript : " + s;
Label7.Text = "Browser is using :" + Request.HttpMethod + " data
transfer method";
}
//Tony
If I do the following I get compile error says It's not possible to implicit
convert the type string to bool
Label4.Text = "Browser support cookies : " + Request.Browser.Cookies ?
"true" : "false";
Can I write in another way so I can remove the s string in this code.
protected void Page_Load(object sender, EventArgs e)
{
string s;
Label1.Text = "Application path is : " + Request.Path;
Label2.Text = "OS platform is : " + Request.Browser.Platform;
Label3.Text = "Browser type is : " + Request.Browser.Type;
s = Request.Browser.Cookies ? "true" : "false";
Label4.Text = "Browser support cookies : " + s;
s = Request.Browser.VBScript ? "true" : "false";
Label5.Text = "Browser support VBScript : " + s;
s = Request.Browser.JavaScript ? "true" : "false";
Label6.Text = "Browser support JavaScript : " + s;
Label7.Text = "Browser is using :" + Request.HttpMethod + " data
transfer method";
}
//Tony