Here is an example of how to do this based on your needs:
1st: the example code for the .aspx page:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<script type="text/javascript">
//Closes the browser window
function CloseWindow()
{
window.opener = 'x';
window.close();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtInput" runat="server"></asp:TextBox>
<asp:Button ID="brnSubmit" runat="server" Text="Submit" />
</div>
</form>
</body>
</html>
2nd, the code for the .vb behind the page:
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSubmit.Click
'See if the word 'close' was input by the user:
'(converting user input to lower case to handle for case differences which we do not care about)
If Me.txtInput.Text.Trim().ToLower() = "close" Then
'Automatically close the page using JavaScript
ClientScript.RegisterStartupScript(Me.GetType(), "script", "CloseWindow();", True)
End If
End Sub
Hope this helps! 