473,786 Members | 2,571 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Opening a new window

Hi!

How do I open a new window (webpage) without closing the current webpage in
C# ASP.NET? The new window (webpage) will be smaller and centered on the
screen and it will contain a DataGrid.

Thanks,
newbie
Nov 16 '05 #1
6 7141
Newbie,

AFAIK, you cannot.

By the way, this "Popup" way is very much reglemented by the new XP SP2.

I hope this helps,

Cor
Nov 16 '05 #2
This is all still client side javascript.

"Newbie" <Ne****@discuss ions.microsoft. com> wrote in message
news:27******** *************** ***********@mic rosoft.com...
Hi!

How do I open a new window (webpage) without closing the current webpage
in
C# ASP.NET? The new window (webpage) will be smaller and centered on the
screen and it will contain a DataGrid.

Thanks,
newbie

Nov 16 '05 #3
What client side javascript code should I use?

"Marina" wrote:
This is all still client side javascript.

"Newbie" <Ne****@discuss ions.microsoft. com> wrote in message
news:27******** *************** ***********@mic rosoft.com...
Hi!

How do I open a new window (webpage) without closing the current webpage
in
C# ASP.NET? The new window (webpage) will be smaller and centered on the
screen and it will contain a DataGrid.

Thanks,
newbie


Nov 16 '05 #4
Hi Newbie,

You could do this:

<code>
private void Button_Click(Sy stem.Object sender, System.EventArg s e)
{
string script = "<script language=\"java script\">";
script += "var winOptions =
'scrollbars=yes ,resizable=no,f ullscreen=no,ch annelmode=no,st atus=no,toolbar =no,menubar=no, location=no,dir ectories=no,hei ght=200';";
script += "var target = '_blank';";
script +=
window.open('my datagridpage.as px?query=blah', target,winOptio ns);";
script += "</script>";
Page.RegisterSt artupScript("wi nOpen", script);
Response.Redire ct("thispage.as px");
}
</code>

There are other ways to do it also, but this is probably the most
straight-forward for an example.

HTH,
~d

Marina wrote:
This is all still client side javascript.

"Newbie" <Ne****@discuss ions.microsoft. com> wrote in message
news:27******** *************** ***********@mic rosoft.com...
Hi!

How do I open a new window (webpage) without closing the current webpage
in
C# ASP.NET? The new window (webpage) will be smaller and centered on the
screen and it will contain a DataGrid.

Thanks,
newbie


Nov 16 '05 #5
Well, normally it would be window.open.

You can find an excellent javascript reference here:
http://www.devguru.com/Technologies/...ipt_intro.html

"Newbie" <Ne****@discuss ions.microsoft. com> wrote in message
news:B2******** *************** ***********@mic rosoft.com...
What client side javascript code should I use?

"Marina" wrote:
This is all still client side javascript.

"Newbie" <Ne****@discuss ions.microsoft. com> wrote in message
news:27******** *************** ***********@mic rosoft.com...
> Hi!
>
> How do I open a new window (webpage) without closing the current
> webpage
> in
> C# ASP.NET? The new window (webpage) will be smaller and centered on
> the
> screen and it will contain a DataGrid.
>
> Thanks,
> newbie


Nov 16 '05 #6
Don't about ASP.Net but for normal html You can set the target propertyof
the control to _blank. So that it will open in a new window.

"Newbie" <Ne****@discuss ions.microsoft. com> wrote in message
news:27******** *************** ***********@mic rosoft.com...
Hi!

How do I open a new window (webpage) without closing the current webpage in C# ASP.NET? The new window (webpage) will be smaller and centered on the
screen and it will contain a DataGrid.

Thanks,
newbie

Nov 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
7043
by: Dena Leiter | last post by:
I want to send people to a new page using a redirect but I want a new window to open. Is this possible? I've tried this: <meta http-equiv="refresh" content="0;url=http://search.epnet.com/direct.asp?jn=HBR&db=bch target=_blank"> but it doesn't open a new browser window. Is there a way to do this?
44
4744
by: Carlos Andr?s | last post by:
Hi everybody. I've got a problem. I'd like to avoid opening a new window when you have pressed the shift key and you click in the left button of the mouse. I've tried the next solution, in the body of the page I put the next code: <BODY onkeydown='notOpenNewWindow();'>
14
11097
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a window.open function? I would prefer not to create a separate HTML page. So far all I have is the basic var cwin = window.open('images/KJV-THANKS.gif', 'Thanks', 'width=243,height=420,'); cwin.focus();
2
1791
by: Keshav Gadia | last post by:
Hi, I am an ASP.net newbie. I am writing a user control that is made up of datagrid with one of the columns opening a new window to display some details on click of the set image. I have basically used ImageButton server control. The problem is because I have used a server control with runat="server",the parent page is posted back and even though the window opens up,the focus gets set to the parent window. What I want is,the new window...
5
2164
by: Roger Withnell | last post by:
This is a framed webpage with the navigation bar in "NavBar" and the main window in "Main". When opening a new page in "Main" from "NavBar" with: function OpenFrameWindow(src) { var NewWindow = window.open(src, "Main"); NewWindow.focus(); }
3
2138
by: Larry Bud | last post by:
Wanting to use a technology I saw for one of our apps. We have several apps that a user logs in at on the same page. The app is determined by a drop down. User credentials are checked, response.redirect to the application. The user ID is stored in a session variable which determines if the user is logged in. When the session var goes blank, the user is redirected to the login page. A header on each page checks this. Now, some...
3
2666
by: Bonzol | last post by:
Vb.Net 2003, 1.1. Web application. Hey there I have this, Response.Redirect("FileFiew.aspx") to go to a new page, but how do I open that page in a new window? So I will have 2 pages open,, the original page, and the page I opened.
1
11077
by: sandy21380 | last post by:
Hello, Is there a way of opening an Access form without opening the Access window? Right now when I open the form, the Access window is a lot bigger than the form so I have to resize the Access window so it doesn't take up my whole screen (the form is about 2" x 3"). If there is no way to open only the form without the Access window opening, is there a way to automatically set the size of the Access window and close the menu bar?\ Thanks!
1
1764
by: coolsidsin | last post by:
I have a apsx form (Form A), which on submiting does a time consuming task. So i want to open a new aspx window (Form B) in which I want do do that time consuming task and show progress to the user and while that task is being completed I want Form A to redirect to Form C. I opened form B in a new javascript window and updated the progress through ajax but Form A doesn't let me redirect to Form C unless Form B's processing is Completed. ...
0
2025
by: bbrewder | last post by:
I am struggling with some MSAccess automation issues. Basically, we have a .Net application that uses MSAccess for reporting (legacy code). We are able to launch MSAccess fine and even work with the MSAccess COM objects to run our reports (using GetObject(<MDB Path>) - see http://support.microsoft.com/default.aspx?scid=kb;en-us;317113&Product=vbNET for info on how to do this). The problem that we are running into is that if our Access...
0
9650
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10164
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8992
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7515
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6748
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.