473,883 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Asp.net with Javascript Problem

Below is the code.

language = asp.net/vb.net

private sub openW()

sResult = sResult & "<script language=javasc ript> mywindow = window.open('ht tp://localhost/mohsaic/default.aspx?tc =Client/Manage'); "

sResult = sResult & "mywindow.paren t.frames[1].location = 'http://localhost/treeview/treeview.aspx?m =c&pid=36682670 6'; "

sResult = sResult & "mywindow.paren t.frames[0].location = 'http://localhost/mohsaic/default.aspx?tc =Client/Manage'; </script>"

Response.Write( sResult)

End Sub

I am calling this in LinkButton(asp. net servercontrol) Click event

it opens the new window and the new window has got the frames with in frames and frames with in those frames.

the above code works fine on local boxes and once the code is pushed to server(testing box), it works for 1st time and then on it stops working and i get a message "mywindow.paren t.frames.1 is null or not a object error".

while pushing the localhost is made to the respective box name.

i cannot imagine a reason for working once and not working again., if anyone recall the same error before and have fixed please let me know?

any help is appriciated

Kshoot
Nov 18 '05 #1
3 1422
First of all, are you sure you want the 'localhost' hard coded in there?
After, 'localhost' is different for every user - most of whom won't have a
web server.

The only other idea, is that this is a timing issue, that your code attempts
to set the frame's location before the window has fully opened and loaded.

"krishna" <kr*****@discus sions.microsoft .com> wrote in message
news:BE******** *************** ***********@mic rosoft.com...
Below is the code.

language = asp.net/vb.net

private sub openW()

sResult = sResult & "<script language=javasc ript> mywindow = window.open('ht tp://localhost/mohsaic/default.aspx?tc =Client/Manage'); "
sResult = sResult & "mywindow.paren t.frames[1].location = 'http://localhost/treeview/treeview.aspx?m =c&pid=36682670 6'; "
sResult = sResult & "mywindow.paren t.frames[0].location = 'http://localhost/mohsaic/default.aspx?tc =Client/Manage'; </script>"
Response.Write( sResult)

End Sub

I am calling this in LinkButton(asp. net servercontrol) Click event

it opens the new window and the new window has got the frames with in frames and frames with in those frames.
the above code works fine on local boxes and once the code is pushed to server(testing box), it works for 1st time and then on it stops working and
i get a message "mywindow.paren t.frames.1 is null or not a object error".
while pushing the localhost is made to the respective box name.

i cannot imagine a reason for working once and not working again., if anyone recall the same error before and have fixed please let me know?
any help is appriciated

Kshoot

Nov 18 '05 #2
I don't know, that was just a guess. It would mean that sometimes it work,
sometimes not - though I wouldnt expect it to work just once and then not at
all.

What I would do is have the child window, in its onload event, call a
function in the parent window to get the location for its frames.

Also, if the error persists, try using the debugger to see what values
various variables have, to help you figure out what the problem is.

"krishna" <kr*****@discus sions.microsoft .com> wrote in message
news:BC******** *************** ***********@mic rosoft.com...
Marina,

Thankx for your reply, i am getting the url from webconfig, i have submitted the code after it is formatted, copied from the debug window, so
that it would be easier to understand in the post.
so you sid timeout issue, what would be the solution you think, do i need to add any other code into javascript block, if so what is that ???
Krishna
"Marina" wrote:
First of all, are you sure you want the 'localhost' hard coded in there?
After, 'localhost' is different for every user - most of whom won't have a web server.

The only other idea, is that this is a timing issue, that your code attempts to set the frame's location before the window has fully opened and loaded.
"krishna" <kr*****@discus sions.microsoft .com> wrote in message
news:BE******** *************** ***********@mic rosoft.com...
Below is the code.

language = asp.net/vb.net

private sub openW()

sResult = sResult & "<script language=javasc ript> mywindow =

window.open('ht tp://localhost/mohsaic/default.aspx?tc =Client/Manage'); "

sResult = sResult & "mywindow.paren t.frames[1].location =

'http://localhost/treeview/treeview.aspx?m =c&pid=36682670 6'; "

sResult = sResult & "mywindow.paren t.frames[0].location =

'http://localhost/mohsaic/default.aspx?tc =Client/Manage'; </script>"

Response.Write( sResult)

End Sub

I am calling this in LinkButton(asp. net servercontrol) Click event

it opens the new window and the new window has got the frames with in

frames and frames with in those frames.

the above code works fine on local boxes and once the code is pushed to
server(testing box), it works for 1st time and then on it stops working and i get a message "mywindow.paren t.frames.1 is null or not a object

error".
while pushing the localhost is made to the respective box name.

i cannot imagine a reason for working once and not working again., if

anyone recall the same error before and have fixed please let me know?

any help is appriciated

Kshoot


Nov 18 '05 #3
There is no reason not to be able to debug client side javascript when the
server is located elsewhere. You just get the debugger prompt and you say
yes.

"krishna" <kr*****@discus sions.microsoft .com> wrote in message
news:16******** *************** ***********@mic rosoft.com...
at the first place i have written the functions as u said, there was a problem and i was trying all kinds of ways to resolve this, as i said it was
working without hastles in the my box(all ways - function call and
response.write etc), it gives the problem once it is pushed into testing
box, there is noway we can use the debugger in the testing or production box
any more thoughts are welcome

Krishna

"Marina" wrote:
I don't know, that was just a guess. It would mean that sometimes it work, sometimes not - though I wouldnt expect it to work just once and then not at all.

What I would do is have the child window, in its onload event, call a
function in the parent window to get the location for its frames.

Also, if the error persists, try using the debugger to see what values
various variables have, to help you figure out what the problem is.

"krishna" <kr*****@discus sions.microsoft .com> wrote in message
news:BC******** *************** ***********@mic rosoft.com...
Marina,

Thankx for your reply, i am getting the url from webconfig, i have

submitted the code after it is formatted, copied from the debug window, so that it would be easier to understand in the post.

so you sid timeout issue, what would be the solution you think, do i need
to add any other code into javascript block, if so what is that ???

Krishna
"Marina" wrote:

> First of all, are you sure you want the 'localhost' hard coded in
there? > After, 'localhost' is different for every user - most of whom won't

have a
> web server.
>
> The only other idea, is that this is a timing issue, that your code

attempts
> to set the frame's location before the window has fully opened and

loaded.
>
> "krishna" <kr*****@discus sions.microsoft .com> wrote in message
> news:BE******** *************** ***********@mic rosoft.com...
> > Below is the code.
> >
> > language = asp.net/vb.net
> >
> > private sub openW()
> >
> > sResult = sResult & "<script language=javasc ript> mywindow =
> window.open('ht tp://localhost/mohsaic/default.aspx?tc =Client/Manage'); " > >
> > sResult = sResult & "mywindow.paren t.frames[1].location =
> 'http://localhost/treeview/treeview.aspx?m =c&pid=36682670 6'; "
> >
> > sResult = sResult & "mywindow.paren t.frames[0].location =
> 'http://localhost/mohsaic/default.aspx?tc =Client/Manage'; </script>"
> >
> > Response.Write( sResult)
> >
> > End Sub
> >
> > I am calling this in LinkButton(asp. net servercontrol) Click event
> >
> > it opens the new window and the new window has got the frames with in > frames and frames with in those frames.
> >
> > the above code works fine on local boxes and once the code is pushed to
> server(testing box), it works for 1st time and then on it stops
working and
> i get a message "mywindow.paren t.frames.1 is null or not a object

error".
> >
> > while pushing the localhost is made to the respective box name.
> >
> > i cannot imagine a reason for working once and not working again.,

if > anyone recall the same error before and have fixed please let me know? > >
> > any help is appriciated
> >
> > Kshoot
>
>
>


Nov 18 '05 #4

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

Similar topics

13
9476
by: Kai Grossjohann | last post by:
It seems that Ctrl-N in Mozilla opens a new empty browser window. That's fine, I don't need to do anything about it. But Ctrl-N in IE appears to clone the current window. Is there a way to intercept the key so that I can do stuff on the server side to make the new window behave correctly? (We have a JSP-based webapp which stores state in the session. Now if two windows access (and modify!) the same session, then madness will result....
53
5772
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is difficult to know what is going on. One of these Order Forms you can see here... http://www.cardman.co.uk/orderform.php3
6
2286
by: Alex Rast | last post by:
First of all, this is not a programming question. I'm a user, not programming in JavaScript. I'm not, however, a novice user or even a power user - I certainly know programming intimately as well as computer hardware, configuration, etc... down to the lowest level (e.g. BIOS, assembly language, etc). Anyway, I've obviously got something wrong with JavaScript configuration, files, etc. in Windows 2000, Service Pack 3, because on sites...
136
9498
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their code was littered with document.all and eval, for example, and I wanted to create a practical list of best practices that they could easily put to use. The above URL is version 1.0 (draft) that resulted. IMO, it is not a replacement for the FAQ,...
0
9943
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
11151
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
10750
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
10858
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
10419
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...
0
9577
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
7974
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
5804
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...
3
3237
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.