473,386 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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.Handler, 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 1285
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.<FormNameInPageA>.<TextBoxName>.value.

Hope this helps.

--
Cheers!
Rajiv. R
Rajspace.Org

"Martin" <th************@hotmail.com> wrote in message
news:72**************************@posting.google.c om...
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.Handler, 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
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...
6
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...
12
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...
15
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...
6
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"...
11
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...
2
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
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
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,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
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...

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.