473,725 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Referencing an object in another browser instance. Possible?

Hello Group

I'm having a bit of trouble figuring this out. I'm grateful for any
hints.

Let's assume I'm have a webapplication with two .aspx pages, Page A
and Page B.

Page A consists of a textbox (textbox1) and a HTML Button control.
Page B consists of a datagrid control.

When the button on Page A is clicked, Page B is opened in a new
browser window
displaying a list of values. (Page A stays open in the background)

When I select one of the values in Page B, I would like that the
textbox on Page A displays the value I selected.

It works if I save the value from Page B in a Session and then put a
server control button on Page A which updates the textbox once
clicked.
But how can I update the textbox directly from Page B? E.g. when
clicking on the datagrid run code like this:

Dim PageA as Page
PageA.textbox1. text = datagridvalue

It comes back as 'An object reference is not set to an instance of
this object.'

I've tried
PageA = CType(Context.H andler, PageA)
PageA.textbox1. text = datagridvalue
but I think it fails because Page B has been opened in a new browser
instance and was not called with the Server.Transfer method.

I also have made textbox1 Public to see whether that helps.

Please let me know whether it is possible to refer to textbox1 of Page
A in the background from Page B. If I save the value in a session and
switch to Page A and update the textbox with the session value it
works so there must be a way to do this directly on Page B??

One more theorie I have why it fails is that Page A has alredy been
rendered. But in this case I still could store the datagrid value in a
session and then have a script to refresh Page A with a statement in
the Page_Load event that assigns the session value to textbox1 if it's
not empty. Any hints how I can force Page A to reload from Page B?

Thanks for your efforts!

Martin
Nov 18 '05 #1
1 1301
Hi Martin,

client-side scripting in javascript will help you.

In pageB, you can access it parent page with the javascript object "opener".
So, handle onchange event of dropdown in PageB on the clientside and set the
value as opener.<FormNam eInPageA>.<Text BoxName>.value.

Hope this helps.

--
Cheers!
Rajiv. R
Rajspace.Org

"Martin" <th************ @hotmail.com> wrote in message
news:72******** *************** ***@posting.goo gle.com...
Hello Group

I'm having a bit of trouble figuring this out. I'm grateful for any
hints.

Let's assume I'm have a webapplication with two .aspx pages, Page A
and Page B.

Page A consists of a textbox (textbox1) and a HTML Button control.
Page B consists of a datagrid control.

When the button on Page A is clicked, Page B is opened in a new
browser window
displaying a list of values. (Page A stays open in the background)

When I select one of the values in Page B, I would like that the
textbox on Page A displays the value I selected.

It works if I save the value from Page B in a Session and then put a
server control button on Page A which updates the textbox once
clicked.
But how can I update the textbox directly from Page B? E.g. when
clicking on the datagrid run code like this:

Dim PageA as Page
PageA.textbox1. text = datagridvalue

It comes back as 'An object reference is not set to an instance of
this object.'

I've tried
PageA = CType(Context.H andler, PageA)
PageA.textbox1. text = datagridvalue
but I think it fails because Page B has been opened in a new browser
instance and was not called with the Server.Transfer method.

I also have made textbox1 Public to see whether that helps.

Please let me know whether it is possible to refer to textbox1 of Page
A in the background from Page B. If I save the value in a session and
switch to Page A and update the textbox with the session value it
works so there must be a way to do this directly on Page B??

One more theorie I have why it fails is that Page A has alredy been
rendered. But in this case I still could store the datagrid value in a
session and then have a script to refresh Page A with a statement in
the Page_Load event that assigns the session value to textbox1 if it's
not empty. Any hints how I can force Page A to reload from Page B?

Thanks for your efforts!

Martin

Nov 18 '05 #2

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

Similar topics

0
1252
by: Walter G | last post by:
I have a VB.Net application that can be executed with parameters. If parameters are received, the I execute a function that will open a form within the application. On top of that, I'd like to detect if there's another instance of this application already running, so I don't have to start another one, but I need to execute that function that opens a form (on the executing instance), and here's where I'm stuck. This is the code:...
6
22530
by: Martin | last post by:
I'd like to be able to get the name of an object instance from within a call to a method of that same object. Is this at all possible? The example below works by passing in the name of the object instance (in this case 'myDog'). Of course it would be better if I could somehow know from within write() that the name of the object instance was 'myDog' without having to pass it as a parameter. //////////////////////////////// function...
12
1960
by: Mark Broadbent | last post by:
Hi guys, just going through remoting at the moment and a couple of questions relating to .net in general has surfaced. Firstly I have seen in the designer that for the namespace and many of its associated classes of System.Runtime.Remoting are available, but certain ones are not. A reference to System.Runtime.Remoting needs to be added to make available all the unavailable ones. Now although I (think) understand the concept that an...
15
6748
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use javascript or vbscript it works. I will appreciate any help. I do the following (C#):
6
11296
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header" Src="WebControls/Header.ascx" %> The web user control contains the following server controls
11
3838
by: Kevin Prichard | last post by:
Hi all, I've recently been following the object-oriented techiques discussed here and have been testing them for use in a web application. There is problem that I'd like to discuss with you experts. I would like to produce Javascript classes that can be "subclassed" with certain behaviors defined at subclass time. There are plenty of ways to do this through prototyping and other techniques, but these behaviors need to be static and...
2
2653
by: Ralph | last post by:
Hi I don't understand why it's not working: function schedule(imTop){ this.tdImagesTop = imTop; } schedule.prototype.selectEl = function() { alert(this.tdImagesTop);
3
157
by: H. S. Lahman | last post by:
Responding to siddharthkhare... Ignore Topmind and frebe. They are anti-OO P/R guys. Let's not confuse things with specific 3GL syntax. At the OOA/D level the model looks like: | 1
2
6924
by: Andrus | last post by:
I need compile in-memory assembly which references to other in-memory assembly. Compiling second assembly fails with error Line: 0 - Metadata file 'eed7li9m, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' could not be found Saving assembly to Windows temp directory for referencing only creates huge amout of temporary
0
9401
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
9257
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
9176
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
8097
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
6702
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
4519
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...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3221
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
2
2635
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.