.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 7th, 2008, 10:54 PM
M_Dec M_Dec is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2008
Posts: 6 M_Dec User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 55 sec
Reputation Power: 0
ASP.Net/C# - How to resize the web browser and hide the menu bar when opening a web page

Hi,

I’m using ASP .Net 2.0 and C# language to develop a web page.

I have an issue of opening a new web page through my login page because of the following functionality. I would really appreciate if someone could help me with it.

I have added some validations to be done in my “btnLogIn_Click” event in my Login.aspx page, and only if the validations are successful I need to redirect to the other page. These validations are server-side validations. But, I also need to resize the browser of the new page so that it will fit the contents of the web page.

My two web pages are named as Login.aspx and NewPage.aspx. Please note that I do NOT want my NewPage.aspx to be a pop up window. It should be a normal web page that I call through my Login.aspx page.

I have tried two methods to fulfil this requirement.

Method 1

I added the following code to my NewPage.aspx so that it will resize the browser when it is loaded according to the size specified. This code works fine, but I need to hide the toolbars and the menu bars of the browser.

Does anyone know how to hide the toolbars and the menu bars on the browser?

[code]
<script language="JavaScript" type="text/javascript" >
window.resizeTo(500,750);
window.moveTo(200,100);
</script>


Method 2

I have written the following javascript to open a window without toolbars etc and this will redirect to the next page as well.

[code]
<script language="JavaScript" type="text/javascript" >
function OpenNewWP()
{
newWin = window.open('OnlinePayments.aspx','form1','toolbar =no,status=no,menubar=no,location=center,scrollbar s=no,resizable=no,height=500,width=350');
newWin.opener = top;
}
</script>


The issue that I’m facing is that in my page load event of the Login.aspx page I have the following code:

[code]
btnLogIn.Attributes.Add("onclick", "disableLoginButton();" +
this.GetPostBackEventReference(btnLogIn));

The “disableLoginButton()” is a javascript function that I use to disable the login button as soon as it is clicked. The “this.GetPostBackEventReference(btnLogIn)” will next fire the “btnLogIn_Click” event.

I tried writing the code as follows to see whether the javascript gets fired. This code does fire the OpenNewWP() and redirects to the NewPage.aspx as a normal web page (not a popup window. I came to this conclusion because I have blocked popups in my browser) but, irrespective of the conditions in the btnLogIn_Click event handler because it does not fire before redirection.

[code]
btnLogIn.Attributes.Add("onclick", "disableLoginButton();OpenNewWP()" + this.GetPostBackEventReference(btnLogIn));


Can someone please tell my how to call the “OpenNewWP()” javascript function depending on a condition in “btnLogIn_Click” event handler code? Also, how can I close my Login.aspx page when I load the NewPage.aspx?


Thanks!

Reply With Quote
  #2  
Old September 8th, 2008, 03:30 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,722 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 5 h 24 m 45 sec
Reputation Power: 1914

Reply With Quote
  #3  
Old September 10th, 2008, 11:02 PM
M_Dec M_Dec is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2008
Posts: 6 M_Dec User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 55 sec
Reputation Power: 0
Hi,

Thanks for your reply.

I'm new to the model window concept. But, this is to open a pop up window right?

But, I do not want a pop up window. I just want to open a new web page but with a resized height and width.

Do you know how I can do this?

Thanks!

Reply With Quote
  #4  
Old September 11th, 2008, 03:06 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,722 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 5 h 24 m 45 sec
Reputation Power: 1914
you mean resize the current window?

Reply With Quote
  #5  
Old September 11th, 2008, 03:14 AM
M_Dec M_Dec is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2008
Posts: 6 M_Dec User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 55 sec
Reputation Power: 0
Yes. For example, I need to call Page2.aspx from my Login Page. So when Page2.aspx is loaded it should be resized to the width and height that I set. This is because that page has little contents and looks ugly in a large normal size web page.

Also, needs to remove the title bar, menu bar etc from that page.

Thanks!

Reply With Quote
  #6  
Old September 11th, 2008, 03:35 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,722 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 5 h 24 m 45 sec
Reputation Power: 1914
so call Page2.aspx as Dialog window. this way it's possible to both define desired
width and height, and have no bars like you want.

Reply With Quote
  #7  
Old September 11th, 2008, 03:39 AM
M_Dec M_Dec is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2008
Posts: 6 M_Dec User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 55 sec
Reputation Power: 0
Dialog window will act like a popup window right? Please correct me if I'm wrong.

I dont like to call a popup window because if the user has blocked the popups it will not show him.

Reply With Quote
  #8  
Old September 11th, 2008, 04:59 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,722 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 5 h 24 m 45 sec
Reputation Power: 1914
well, you can resize the current window using window.resizeTo() JavaScript
function, but you can't remove the title, menu or toolbars.

Reply With Quote
  #9  
Old September 11th, 2008, 08:59 PM
M_Dec M_Dec is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2008
Posts: 6 M_Dec User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 55 sec
Reputation Power: 0
Thanks.

I have tried that. But was wondering if there was any other way of implementing this functionality. Which calls a normal window (not a popup) with a given width and height and also without any toolbars etc.

Reply With Quote
  #10  
Old September 14th, 2008, 01:44 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,722 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377762 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 5 h 24 m 45 sec
Reputation Power: 1914
Quote:
Originally Posted by M_Dec
Thanks.

I have tried that. But was wondering if there was any other way of implementing this functionality. Which calls a normal window (not a popup) with a given width and height and also without any toolbars etc.
nope, no such other way.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > ASP.Net/C# - How to resize the web browser and hide the menu bar when opening a web page


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |