how to open a new window with no toolbar after login

Discussion in 'ASP .Net' started by chirakg21, Nov 8, 2003.

  1. chirakg21

    chirakg21 Guest

    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(txtUserName.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.
     
    chirakg21, Nov 8, 2003
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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(txtUserName.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.
     
    Chris Jackson, Nov 10, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gordon
    Replies:
    3
    Views:
    323
    Steven Burn
    Apr 16, 2004
  2. PC HUA
    Replies:
    2
    Views:
    436
    PC HUA
    May 19, 2004
  3. yawnmoth
    Replies:
    1
    Views:
    103
    Randy Webb
    Aug 29, 2004
  4. pcouas
    Replies:
    0
    Views:
    266
    pcouas
    Feb 19, 2007
  5. Replies:
    1
    Views:
    254
Loading...

Share This Page