I am using asp .net 2.0. I have a hyperlink asp control on my web page
page1.aspx.
On clicking this hyper;link, I would like to open page2.aspx (which is
in the same web application) in a new IE window without scrollbars,
status bar, tool bar and with specified height and width.
Can it be done on "onload" event of the page2.aspx in javascript? 9 2862
You need to open the page with a javascript call to window.showModa lDialog
function. Look up the MSDN info on this function, you will find how to
specify the scrollbars and other parameters.
For the hyperlink, specify url as javascript :show ModalDialog(... )
Eliyahu
"loga123" <vd**********@c ovansys.com> wrote in message
news:11******** *************@u 72g2000cwu.goog legroups.com... I am using asp .net 2.0. I have a hyperlink asp control on my web page page1.aspx. On clicking this hyper;link, I would like to open page2.aspx (which is in the same web application) in a new IE window without scrollbars, status bar, tool bar and with specified height and width. Can it be done on "onload" event of the page2.aspx in javascript?
Hi,
Eliyahu Goldin wrote: You need to open the page with a javascript call to window.showModa lDialog function. Look up the MSDN info on this function, you will find how to specify the scrollbars and other parameters.
For the hyperlink, specify url as javascript:show ModalDialog(... )
Eliyahu
Using javascript : is a bad idea and can lead to problems on some
platforms. It's much more elegant to use the following construct:
<a href="nojs.html " onclick="doSome thing();return false;">Click</a>
The advantage of this is that the onclick even won't be executed if
JavaScript is not present or deactivated, and the link will degrade
gracefully and lead the use to a page (nojs.html) explaining why the
experience would be better with JavaScript.
Besides, showModalDialog is IE only, so using window.open() with a set
of chosen features is a better choice. Since the OP doesn't need the
window to stay in front (modal), the window.open method is enough.
More info here: http://developer.mozilla.org/en/docs/DOM:window.open
and http://msdn.microsoft.com/workshop/a...ods/open_0.asp
HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Hi,
loga123 wrote: I am using asp .net 2.0. I have a hyperlink asp control on my web page page1.aspx. On clicking this hyper;link, I would like to open page2.aspx (which is in the same web application) in a new IE window without scrollbars, status bar, tool bar and with specified height and width. Can it be done on "onload" event of the page2.aspx in javascript?
No, a page cannot modify it's own features for security reasons. You
must specifiy the features when you open the window. See my reply to
Eliyahu in this same thread for details.
HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Laurent,
I can only wish you luck in programming in asp.net without javascript. Can I
ask if you are aware of any non-javascript asp.net project that would
satisfy the customers?
The OP's requirements made me think of a dialog window.
Eliyahu
"Laurent Bugnion" <lb******@bluew in.ch> wrote in message
news:44******** **@news.bluewin .ch... Hi,
Eliyahu Goldin wrote: You need to open the page with a javascript call to window.showModa lDialog function. Look up the MSDN info on this function, you will find how to specify the scrollbars and other parameters.
For the hyperlink, specify url as javascript:show ModalDialog(... )
Eliyahu
Using javascript: is a bad idea and can lead to problems on some platforms. It's much more elegant to use the following construct:
<a href="nojs.html " onclick="doSome thing();return false;">Click</a>
The advantage of this is that the onclick even won't be executed if JavaScript is not present or deactivated, and the link will degrade gracefully and lead the use to a page (nojs.html) explaining why the experience would be better with JavaScript.
Besides, showModalDialog is IE only, so using window.open() with a set of chosen features is a better choice. Since the OP doesn't need the window to stay in front (modal), the window.open method is enough.
More info here: http://developer.mozilla.org/en/docs/DOM:window.open and http://msdn.microsoft.com/workshop/a...ods/open_0.asp
HTH, Laurent -- Laurent Bugnion, GalaSoft Software engineering: http://www.galasoft-LB.ch Private/Malaysia: http://mypage.bluewin.ch/lbugnion Support children in Calcutta: http://www.calcutta-espoir.ch
Hi,
Eliyahu Goldin wrote: Laurent,
I can only wish you luck in programming in asp.net without javascript. Can I ask if you are aware of any non-javascript asp.net project that would satisfy the customers?
The OP's requirements made me think of a dialog window.
Eliyahu
Oh no, believe me, I love JavaScript and use it often. I didn't say you
shouldn't use JavaScript, I said you shouldn't use "javascript :" as in
the javascript : pseudo protocol. Sorry I was not being clear.
The OP's requirement are for a pop-up with specific features. This is
fulfilled by a modal window, but when ever possible, I try to show the
browser compatible way to do things in JavaScript. showModelDialog being
IE only, I wanted to indicate a more compatible way to do things.
HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Thanks for the reply.
I am using server side (as.net control, not just the anchor tag from
html) hyperlink control in my application.
And...."navigat eURL" property for this hyperlink is set dynamically in
my code behind page.
In such scenario....how can I open a new window w/o scroll bars,
toolbar, status bar etc...?
Laurent Bugnion wrote: Hi,
Eliyahu Goldin wrote: You need to open the page with a javascript call to window.showModa lDialog function. Look up the MSDN info on this function, you will find how to specify the scrollbars and other parameters.
For the hyperlink, specify url as javascript:show ModalDialog(... )
Eliyahu
Using javascript: is a bad idea and can lead to problems on some platforms. It's much more elegant to use the following construct:
<a href="nojs.html " onclick="doSome thing();return false;">Click</a>
The advantage of this is that the onclick even won't be executed if JavaScript is not present or deactivated, and the link will degrade gracefully and lead the use to a page (nojs.html) explaining why the experience would be better with JavaScript.
Besides, showModalDialog is IE only, so using window.open() with a set of chosen features is a better choice. Since the OP doesn't need the window to stay in front (modal), the window.open method is enough.
More info here: http://developer.mozilla.org/en/docs/DOM:window.open and http://msdn.microsoft.com/workshop/a...ods/open_0.asp
HTH, Laurent -- Laurent Bugnion, GalaSoft Software engineering: http://www.galasoft-LB.ch Private/Malaysia: http://mypage.bluewin.ch/lbugnion Support children in Calcutta: http://www.calcutta-espoir.ch
Hi,
loga123 wrote: Thanks for the reply.
I am using server side (as.net control, not just the anchor tag from html) hyperlink control in my application. And...."navigat eURL" property for this hyperlink is set dynamically in my code behind page. In such scenario....how can I open a new window w/o scroll bars, toolbar, status bar etc...?
<asp:HyperLin k
Runat="server"
ID="lnkOpenWind ow"
Text="Open window" />
and then on Page_Load
lnkOpenWindow.N avigateUrl = "nojs.html" ;
lnkOpenWindow.A ttributes[ "onclick" ]
= "window.ope n( 'http://www.galasoft-lb.ch', 'popUpName', "
+ "'width=500,hei ght=300,screenX =50,screenY=100 ,left=50,top=10 0');"
+ "return false;";
This will open a new window without any chromes if JavaScript is
enabled. screenX and screenY are for Mozilla, left and top are for IE,
so both must be set.
If JavaScript is disabled, this navigates to a page named nojs.html
where you can explain why the user experience is so much better with
JavaScript ;-)
Also: this works because the default value for chromes (status bar,
location bar, etc...) is set to "no". If you want to show only the
status bar, for example, you must set it explicitly to "yes".
See http://developer.mozilla.org/en/docs/window.open
for details.
HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Hi Laurent ,
Thanks for your reply.
I tried with the solution you have. It gives me an error when I click
on the hyperlink.
Error says " Invalid argument".
And arguments for manipulating window features do not seem to work.
I am using IE.
Can you help me on this? It's really urgent for me.
Laurent Bugnion wrote: Hi,
loga123 wrote: Thanks for the reply.
I am using server side (as.net control, not just the anchor tag from html) hyperlink control in my application. And...."navigat eURL" property for this hyperlink is set dynamically in my code behind page. In such scenario....how can I open a new window w/o scroll bars, toolbar, status bar etc...?
<asp:HyperLin k Runat="server" ID="lnkOpenWind ow" Text="Open window" />
and then on Page_Load
lnkOpenWindow.N avigateUrl = "nojs.html" ; lnkOpenWindow.A ttributes[ "onclick" ] = "window.ope n( 'http://www.galasoft-lb.ch', 'popUpName', " + "'width=500,hei ght=300,screenX =50,screenY=100 ,left=50,top=10 0');" + "return false;";
This will open a new window without any chromes if JavaScript is enabled. screenX and screenY are for Mozilla, left and top are for IE, so both must be set.
If JavaScript is disabled, this navigates to a page named nojs.html where you can explain why the user experience is so much better with JavaScript ;-)
Also: this works because the default value for chromes (status bar, location bar, etc...) is set to "no". If you want to show only the status bar, for example, you must set it explicitly to "yes".
See http://developer.mozilla.org/en/docs/window.open for details.
HTH, Laurent -- Laurent Bugnion, GalaSoft Software engineering: http://www.galasoft-LB.ch Private/Malaysia: http://mypage.bluewin.ch/lbugnion Support children in Calcutta: http://www.calcutta-espoir.ch
Hi Laurent,
Thanks a bunch....it works like a charm :-)
I was having ")" after " return false;" and that was causing problem.
I corrected it now.
Thanks again
loga123 wrote: Hi Laurent ,
Thanks for your reply. I tried with the solution you have. It gives me an error when I click on the hyperlink. Error says " Invalid argument". And arguments for manipulating window features do not seem to work. I am using IE.
Can you help me on this? It's really urgent for me. Laurent Bugnion wrote: Hi,
loga123 wrote: Thanks for the reply.
I am using server side (as.net control, not just the anchor tag from html) hyperlink control in my application. And...."navigat eURL" property for this hyperlink is set dynamically in my code behind page. In such scenario....how can I open a new window w/o scroll bars, toolbar, status bar etc...?
<asp:HyperLin k Runat="server" ID="lnkOpenWind ow" Text="Open window" />
and then on Page_Load
lnkOpenWindow.N avigateUrl = "nojs.html" ; lnkOpenWindow.A ttributes[ "onclick" ] = "window.ope n( 'http://www.galasoft-lb.ch', 'popUpName', " + "'width=500,hei ght=300,screenX =50,screenY=100 ,left=50,top=10 0');" + "return false;";
This will open a new window without any chromes if JavaScript is enabled. screenX and screenY are for Mozilla, left and top are for IE, so both must be set.
If JavaScript is disabled, this navigates to a page named nojs.html where you can explain why the user experience is so much better with JavaScript ;-)
Also: this works because the default value for chromes (status bar, location bar, etc...) is set to "no". If you want to show only the status bar, for example, you must set it explicitly to "yes".
See http://developer.mozilla.org/en/docs/window.open for details.
HTH, Laurent -- Laurent Bugnion, GalaSoft Software engineering: http://www.galasoft-LB.ch Private/Malaysia: http://mypage.bluewin.ch/lbugnion Support children in Calcutta: http://www.calcutta-espoir.ch This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Paul |
last post by:
I link to a web site from an Excel spreadsheet. The page i link to is
getCookie.asp which sets a cookie then returns back some html which opens a
new window, to the same site but a different page (same folder).
The cookie is not received. Can someone explain why?
I worked around this by adding a cache-control header with a value of
no-cache. This fixes the problem. Unfortunately that causes another
problem with Internet Explorer...
|
by: Anna |
last post by:
Hi all.
I have a (hopefully) pretty simple question.
I open a link in a new window:
<a href="http://www.somewhere.com/some.hml"
onclick="window.open(url,null,'resizable=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,width=600,height=400');">Link</a>
The page I am opening is not mine.
I want to edit the content of the page I am opening, adding text
"This page is opened in a new window" as a first thing...
|
by: venkatesh |
last post by:
Hi Members,
I have used the below mentioned code to open a html page in a new
browser. The window size is 200 x 300. In that browser, I've given
code to open another browser of the same size. However, this is not
happening in IE 5. Can anyone help me solve this problem?
Code:
Script:
|
by: KenG |
last post by:
Hi:
I have a datagrid that builds a hyperling which uses javascript to
open a new window. The new window opens and displays fine, however,
the original window that has the grid, is now blank with only
"" displayed in an otherwise empty window. To restore the
datagrid in that window, I have to use the browsers "back" button.
How can I stop the parent window from changing?
|
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, "DataItem.name") %>'
NavigateUrl='<%# "site.aspx?id=" + DataBinder.Eval
(Container.DataItem,"id").ToString()%>' Target="_blank">
</asp:HyperLink>
| |
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 script below which
does open a new window, but not in a centred position.
Here is the link to the url:
|
by: Vinutha |
last post by:
Hi,
How to open small window when i click Command Button or Command link in a webpage.
Thanks,
Vinutha.
|
by: jonniethecodeprince |
last post by:
Hey guys,
I've been poking through w3schools using their online code tryout pages. I started having fun manipulating browser pages in new windows. I figured out how to open a new window with a button.
Surely you can do the same with a hyperlink however i'm finding this very difficult. Can anyone help? Thank you.
<html>
<head>
<script type="text/javascript">
function open_win()
|
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...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
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();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| | |