By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,659 Members | 911 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,659 IT Pros & Developers. It's quick & easy.

how to open a new window with no toolbar after login

P: n/a
I have a one single login page with two textbox of
Username(txtUsername) and password (txtPassword) and two buttons with
one Login(cmdLogin) and Cancel(cmdCancel).

Now in the code behind I have code like

Private Sub cmdLogin_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdLogin.Click
Dim CAPSsystem As CAPS.WebUserDB = New CAPS.WebUserDB()
Dim webUserID As String = CAPSsystem.Login(txtUserName.Text,
txtPassword.Text)
If Not (webUserID Is Nothing) And webUserID <> "" Then

Dim userDetails As CAPS.WebUserDetails =
CAPSsystem.GetWebUserDetails(webUserID)
Session("ssnUserName") = txtUserName.Text
FormsAuthentication.RedirectFromLoginPage(txtUserN ame.Text, 0)
Response.Clear()

Response.Redirect("CAPSFrameset.htm")

Else
lblMsg.Text = "Incorrect Username or Pasword"
End If

End Sub

which is checking credentials from Database.

Now instead of Response.Redirect("CAPSFrameset.htm"), I want to open
CAPSFrameset.htm in new window which I need to be without Toolbar and
hide the orignal Login window.

I tried using Javascript code
function CallScript(){
window.open ('CAPSFrameset.htm','test','top=0,left=0,scrollbar =0,toolbar=0');
} in HEAD

and cmdLogin.Attributes.Add("onClick", "CallScript()") in page-load of
the form

but it isn't working for me i think because I already have serverside
code for that button.
Nov 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You are exactly right - if you have server side code, the runtime will
inject a javascript function in what it renders, and your javascript code
will not be called. Change that button to an <input type=button>, without
runat=server, and it should work as you expect.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Shell/UI
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"chirakg21" <ch*******@yahoo.com> wrote in message
news:4e**************************@posting.google.c om...
I have a one single login page with two textbox of
Username(txtUsername) and password (txtPassword) and two buttons with
one Login(cmdLogin) and Cancel(cmdCancel).

Now in the code behind I have code like

Private Sub cmdLogin_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdLogin.Click
Dim CAPSsystem As CAPS.WebUserDB = New CAPS.WebUserDB()
Dim webUserID As String = CAPSsystem.Login(txtUserName.Text,
txtPassword.Text)
If Not (webUserID Is Nothing) And webUserID <> "" Then

Dim userDetails As CAPS.WebUserDetails =
CAPSsystem.GetWebUserDetails(webUserID)
Session("ssnUserName") = txtUserName.Text
FormsAuthentication.RedirectFromLoginPage(txtUserN ame.Text, 0)
Response.Clear()

Response.Redirect("CAPSFrameset.htm")

Else
lblMsg.Text = "Incorrect Username or Pasword"
End If

End Sub

which is checking credentials from Database.

Now instead of Response.Redirect("CAPSFrameset.htm"), I want to open
CAPSFrameset.htm in new window which I need to be without Toolbar and
hide the orignal Login window.

I tried using Javascript code
function CallScript(){
window.open ('CAPSFrameset.htm','test','top=0,left=0,scrollbar =0,toolbar=0'); } in HEAD

and cmdLogin.Attributes.Add("onClick", "CallScript()") in page-load of
the form

but it isn't working for me i think because I already have serverside
code for that button.

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.