473,385 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to open a new window with no toolbar after login

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
1 2046
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: alanstew | last post by:
With the body tag calling out 'window onload', a function with a 'window.open' fails at the 'window.open' line. If I cut out the body tag, the function executes as normal. At first I thought it...
29
by: wayne | last post by:
Hey there... I'm having some problems passing url parameters with an open.window command. I'm not terribly familiar with java script but here is the code below. When executed it opens the...
9
by: dana lees | last post by:
Hello, I am using asp:HyperLink in a c# asp.net application to open a new window in the following way: <asp:HyperLink ID="lnkSiteName" runat="server" Text='<%# DataBinder.Eval(Container,...
5
by: John Scott | last post by:
Ok..this a rather odd question/problem. I haven't really found a straight forward answer to how to handle this scenario, so I hope someone here can help. Here it is: I have an application...
11
by: Dave | last post by:
For some reason, the below lines only work on select machines. All machines are running IE6. IE SP's and OS's vary. When it doesn't work, default.aspx (the page that this code is in) opens and...
1
by: Socrates | last post by:
Hi - Have tried for half and hour to get this script to work: I am trying to close the parent window while opening a centred new child window I would be grateful if someone could correct the...
5
by: Nicholas | last post by:
Hello, i need to pass an argument to window.open but it seems it wont work. What am i doing wrong? This in in head: <SCRIPT LANGUAGE="JavaScript"> <!-- function nw(a,b){ myWindow =...
2
Gyanchand
by: Gyanchand | last post by:
Using window.open, I am opening an htm page in popup window. I am just allowing the window to have the toolbar. Is there any setting by which I can allow only the "Print button" instead of the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.