473,748 Members | 2,471 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

showModalDialog and TreeView problem

Hi all,

I am opening a webform with showModalDialog . This appears to pop-up fine,
though I have a problem...

Inside the webform is a treeview control.

When the treeview is populated, I am setting the treenode navigateurl to
javascript:Clic k('test')

This does not work. It opens a new window with javascript:Clic k('test') as
the address.

However, if I open the window with window.open, the javascript works fine.

Anyone any ideas on how I can get it to work?
Further notes...
I was trying to see if it was a general issue with JS, so I create an a href
tag with exactly the same javascript. This worked as expected, so it appears
to be a conflict with the treeview when inside a showModalDialog .

Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
Feb 18 '08 #1
6 2619
"David" <da************ *****@revilloc. REMOVETHIS.comw rote in message
news:Os******** ******@TK2MSFTN GP05.phx.gbl...
I am opening a webform with showModalDialog . This appears to pop-up fine,
though I have a problem...

Inside the webform is a treeview control.

When the treeview is populated, I am setting the treenode navigateurl to
javascript:Clic k('test')

This does not work. It opens a new window with javascript:Clic k('test') as
the address.

However, if I open the window with window.open, the javascript works fine.

Anyone any ideas on how I can get it to work?
Firstly, I would advise you not to use showModalDialog because it is
non-standard and available only in IE and Safari. There are much better
solutions available, especially if you are using AJAX...

However, if you must use showModalDialog , you could try putting

<base target="_self" />

in the <headersectio n of the page:
http://www.google.co.uk/search?sourc...og+base+target
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Feb 19 '08 #2
"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
"David" <da************ *****@revilloc. REMOVETHIS.comw rote in message
news:Os******** ******@TK2MSFTN GP05.phx.gbl...
>I am opening a webform with showModalDialog . This appears to pop-up fine,
though I have a problem...

Inside the webform is a treeview control.

When the treeview is populated, I am setting the treenode navigateurl to
javascript:Cli ck('test')

This does not work. It opens a new window with javascript:Clic k('test')
as the address.

However, if I open the window with window.open, the javascript works
fine.

Anyone any ideas on how I can get it to work?

Firstly, I would advise you not to use showModalDialog because it is
non-standard and available only in IE and Safari. There are much better
solutions available, especially if you are using AJAX...

However, if you must use showModalDialog , you could try putting

<base target="_self" />

in the <headersectio n of the page:
http://www.google.co.uk/search?sourc...og+base+target
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Hi Mark,

I have that, when I first found the problem, I searched and found the base
tag, so tried it. It doesn't work. :-(

(Something I also noted was that the showModalDialog appears to use cached
pages, I had to open the page in a normal window first before the
showModalDialog would accept the changed page)

I thought showModalDialog may not be standards compliant, but I did try it.
I will probably have to come up with another solution.

Have I actually found a bug? Can anyone confirm?
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available

Feb 19 '08 #3
You may also want to try use frame(s)...
i.e., let's say your main page is opener.aspx, and the page with
treeview is child.apsx. Then, create a new page child_frame.asp x, that
will host child.aspx in iframe element. From your main page,
opener.aspx, you need to open ShowModalDialog ('child_frame.a spx')...

HTH,

.....more at Siccolo Articles http://www.siccolo.com/articles.asp
Feb 19 '08 #4
Thanks,

I may use this method as a treeview can get quite large and if I am keeping
the page the same size, a frame will help.

However, I have abandoned the showModalDialog for the time being and the
page is working fine using window.open. However, I need to somehow make the
page modal (not critical, but a nice to have... )

Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"siccolo" <al******@hotma il.comwrote in message
news:3e******** *************** ***********@o10 g2000hsf.google groups.com...
You may also want to try use frame(s)...
i.e., let's say your main page is opener.aspx, and the page with
treeview is child.apsx. Then, create a new page child_frame.asp x, that
will host child.aspx in iframe element. From your main page,
opener.aspx, you need to open ShowModalDialog ('child_frame.a spx')...

HTH,

....more at Siccolo Articles http://www.siccolo.com/articles.asp

Feb 19 '08 #5
"David" <da************ *****@revilloc. REMOVETHIS.comw rote in message
news:uE******** ******@TK2MSFTN GP06.phx.gbl...
However, I have abandoned the showModalDialog for the time being
That's good.
However, I need to somehow make the page modal (not critical, but a nice
to have... )
As I mentioned, this is very easy with AJAX:
http://www.asp.net/AJAX/AjaxControlT...odalPopup.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Feb 19 '08 #6
However, I have abandoned the showModalDialog for the time being and the
page is working fine using window.open. However, I need to somehow make the
page modal (not critical, but a nice to have... )
well, you can still use iframe element - but on/within the same page -
just set style.display to none when you need to hide iframe. Or you
can use <divelement and "host" tree view within div element, and set
style.display to none...

.... more at http://www.siccolo.com/articles.asp
Feb 19 '08 #7

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

Similar topics

6
5406
by: Scott Lee | last post by:
I am displaying an ASP.Net generated form in a popup opened with window.showModalDialog. The form contains DropDownList controls. The first ddl is populated via databinding to a datatable, has its AutoPostBack set to true and has its SelectedIndexChanged event being handled in codebehind. The event fires as it should populating two more ddls. The problem is, the two ddls appear empty. I have used a javascript alert to look at the...
3
1599
by: John | last post by:
Hi all, My web app makes use of the ShowModalDialog in a couple of places. In certain instances, the user may click on a "Cancel" image button (there is no code-behind for this) at which point a Javascript runs which does a window.close() The problem is that the parent page still posts to the server when there is clearly no need to. How can I prevent the parent from posting to the server?
4
808
by: MW de Jager | last post by:
I want to call ShowModalDialog(...) from my C# code in the code behind page of my aspx page. I do not want to link this to a button, since I want to first do some checking myself before I call the showModalDialog. I also want to receive a result back from the ShowModalDialog when it is closed. My problems are currently these: (1) If I call the showModalDialog using RegisterClientScriptBlock, then I have no way of receiving a return...
1
3574
by: John | last post by:
Hi, I'm having a problem opening / downloading csv files when called from a page opened with window.showModalDialog( ). To isolate this problem, I've written 3 files (see below). 1. main.htm allows the user to open the page containing the link in a regular window or one opened via window.showModalDialog( ) 2. modal.htm provides a link to the aspx which generates the csv 3. csv.aspx generates a csv file
2
4395
by: John | last post by:
Hi, I posted this earlier in microsoft.public.dotnet.framework.aspnet, but didn't get a response, so I thought I'd try here. Basically, I'm having a problem opening / downloading csv files when generated from within a page opened with window.showModalDialog( ) ( IE6 ). To isolate this problem, I've written 3 files (see below). 1. main.htm allows the user to open the page containing the link in a
1
1710
by: Ben Schumacher | last post by:
I keep getting a script error (Expected end of statement) when I try to add the following attribute to a <asp:Button server control. My vb.net looks as follows ... Dim sUrl As String = "../popup/newfolder.aspx" Dim vArguments As String = "document.all('" & cmdNew.ClientID & "')" Dim sfeatures As String = String.Empty
4
8369
by: Ralf | last post by:
Here is my scenerio and what I am doing. I am open to other ways of doing this is it makes sense. I have a cell withing a row within a datagrid. When this cell is clicked (its a date field), I want a calendar to pop up to change the date. So, I had to added an onclick event to the cell, which runs a javascript function when it the click happens. The javascript function does the showModalDialog to open the Calendar.aspx page and pass...
0
8984
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
8823
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,...
0
9530
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
9363
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
9312
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
9238
tracyyun
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...
1
6793
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...
1
3300
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
3
2206
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.