It works in IE but not in firefox and chrome..........check my code below :
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim host As System.Net.IPHostEntry
host = System.Net.Dns.GetHostByAddress(Request.ServerVariables.Item("REMOTE_HOST"))
strHostName = host.HostName.ToLower()
strHostIP = System.Net.Dns.GetHostEntry(strHostName).AddressList(0).ToString()
If Not (strHostName = "ved1" Or strHostName = "amit" Or strHostName = "deepak" Or strHostName = "santos" Or strHostName = "shafeeq1") Then
'Page.ClientScript.RegisterStartupScript(Me.[GetType](), "asr4", "alert('Dear " + strHostName.ToUpper() + " you dont have permission to access this page');var win=window.open('','_self');win.close();", True)
Page.ClientScript.RegisterStartupScript(Me.[GetType](), "asr4", "window.close();", True)
txtedit.Visible = False
Exit Sub
End If
First dark/highlighted portion works in Chrome and IE and second one work's only in IE
user.Text = "Welcome " + strHostName
user.Visible = True
If Not IsPostBack Then
bindgrid()
End If
End Sub