473,671 Members | 2,229 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help with Page Interaction using ASP.Net 2.0

In my design, page 1 is a web-based dashboard used to assign resources to an
organization. The dashboard includes information about the organization as
well as a list of all assigned resources. Included on page 1 is a lookup
button that will open a search menu to find additional resources to assign to
the orgaization. When I press the lookup button on page 1, I want to leave
page 1 open and open a new search page. On the search page, I want to
perform a search and get a list of resources to choose from to assign to the
organization on the first page. When I select the resource, I want to
automatically update tje listed of assigned resources on page 1. The key
here is that I want to keep both pages open at the same time as part of my
workflow.

Cross-page postbacks don't seem to work because it closes the submitting
page. Any recommendations ? Any examples?

Thank you!
--
Tim Meagher
Jan 9 '06 #1
3 1675
I use Javascript to get cross-page callbacks working. All this
server-side stuff gets on my wick.

On your pop-up page, in an init function called from body.onload you
can do something like

var CallHome;
function init()
{
this.CallHome = this.opener.get CallbackFunctio n(this);
}
and in your opening page
function getCallbackFunc tion(caller)
{
// add your own logic based on caller.name if you're
// going to have several control windows open
return updateResourceL ist;
}

function updateResourceL ist(resource)
{
// do what you have to do to update your list
// with the value(s) from resource
}

now, when the user selects a resource in your popup window you can call
CallHome() and pass the value that they've selected. The nice thing
about doing it this way is that neither page really cares about the
other, you can mix and match pages with callback functions as you
please. If your popup refreshes, or does a postback, it will
automagically dial home again to get the callback function.
AAOMTim wrote:
In my design, page 1 is a web-based dashboard used to assign resources to an
organization. The dashboard includes information about the organization as
well as a list of all assigned resources. Included on page 1 is a lookup
button that will open a search menu to find additional resources to assign to
the orgaization. When I press the lookup button on page 1, I want to leave
page 1 open and open a new search page. On the search page, I want to
perform a search and get a list of resources to choose from to assign to the
organization on the first page. When I select the resource, I want to
automatically update tje listed of assigned resources on page 1. The key
here is that I want to keep both pages open at the same time as part of my
workflow.

Cross-page postbacks don't seem to work because it closes the submitting
page. Any recommendations ? Any examples?

Thank you!
--
Tim Meagher


Jan 9 '06 #2
Thank you for your recommendation. I'd like to try that approach but I'm
wondering if you have any fuller examples including the aspx source for both
the primary web page and the popup? I'm somewhat of a novice when it comes
to javascript.

Thx - Tim

--
Tim
"Flinky Wisty Pomm" wrote:
I use Javascript to get cross-page callbacks working. All this
server-side stuff gets on my wick.

On your pop-up page, in an init function called from body.onload you
can do something like

var CallHome;
function init()
{
this.CallHome = this.opener.get CallbackFunctio n(this);
}
and in your opening page
function getCallbackFunc tion(caller)
{
// add your own logic based on caller.name if you're
// going to have several control windows open
return updateResourceL ist;
}

function updateResourceL ist(resource)
{
// do what you have to do to update your list
// with the value(s) from resource
}

now, when the user selects a resource in your popup window you can call
CallHome() and pass the value that they've selected. The nice thing
about doing it this way is that neither page really cares about the
other, you can mix and match pages with callback functions as you
please. If your popup refreshes, or does a postback, it will
automagically dial home again to get the callback function.
AAOMTim wrote:
In my design, page 1 is a web-based dashboard used to assign resources to an
organization. The dashboard includes information about the organization as
well as a list of all assigned resources. Included on page 1 is a lookup
button that will open a search menu to find additional resources to assign to
the orgaization. When I press the lookup button on page 1, I want to leave
page 1 open and open a new search page. On the search page, I want to
perform a search and get a list of resources to choose from to assign to the
organization on the first page. When I select the resource, I want to
automatically update tje listed of assigned resources on page 1. The key
here is that I want to keep both pages open at the same time as part of my
workflow.

Cross-page postbacks don't seem to work because it closes the submitting
page. Any recommendations ? Any examples?

Thank you!
--
Tim Meagher


Jan 9 '06 #3
Sorry for the delay, I've been snowed under.

For ASPX, you'll have to work something out yourself - if you need to
post on the opener page, call the __doPostback__( ) function added by
ASP.Net. For extra slickness points, try using Ajax to do the refresh
for the opener. Look up Client Callbacks for ASP.Net 2.0 or look at one
of the open libraries like Ajax.Net which is much nicer.

Here's the source for a quick and dirty demo of the javascript
technique, you can tidy this up immensely. I use a hashtable of window
names on opener pages and look up the function from that, but this will
work for one page.

<code>
<!-- 1.htm is the parent file -->
<html>
<head>
<script type="text/javascript">
var myChild;
function getCallback(win dow)
{
// note: no brackets - we want to return the function, not call
it
return updateReceiverB ox;
}

// here's the function that handles the child response.
function updateReceiverB ox(text)
{
document.getEle mentById("recei verBox1").value = text;
alert("got text:" +text);
}

function openChild()
{
myChild = window.open("2. htm");
// you can close or refresh or generally jiggle about with your
child window with the reference returned from window.open.
}
</script>
</head>

<body>
<input type="text" id="receiverBox 1" />
<input type="button" id="btnOpenWind ow" onclick="openCh ild()"
text="open child window" />
</body>
</html>
</code>
<code>
<html>
<head>
<script type="text/javascript">
// sendValue gets the return value from the page and passes it to the
function CallHome
//which is assigned by the opener. If you need to pass multiple values,
build a javascript
//object instead like
// var myobject = new object()
// myObject.SomeFi eld = someValue;
// myObject.SomeOt herField = someOtherValue;
// CallHome(myObje ct);

function sendValue()
{
var text = document.getEle mentById("sende rBox1").value;
CallHome(text);
}

// handshake sets the value of CallHome. Make sure this is called from
body.onload
// doing it from the child window means that your child can do
postbacks or refreshes
// and it will re-handshake when it loads again.
function Handshake()
{
this.CallHome = this.opener.get Callback(this);
}
</script>
</head>
<body onload="Handsha ke()">

<input type="text" id="senderBox1 " />
<input type="button" onclick="sendVa lue()" value="send value" />
</body>
</html>
</code>
Hope that's some use to you. It's nice little tricks like this that
make me love javascript. Closures and first-class functions without
that whole Delegate mess. Bliss.

Jan 13 '06 #4

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

Similar topics

4
3237
by: Irene | last post by:
Hi, I have an asp page that allows a user to search for info in a DB and add info to a DB. The search uses "ADODB.Connection" objects in the page, but the add will use a call to an isapi dll via the "Microsoft.XMLHTTP" object. The results of the isapi dll will be displayed to the user without refreshing the asp page. I have a code snippet below for the isapi call. WHat is happening is that the xmlhttp.responseText from the snippet...
2
2381
by: David Hearn | last post by:
I have a webform that I am creating. I need for the user to be able to pass it the path and name of a file on his/her local machine without any interaction. I don't want to have to use the file upload control. This will be an automated process on their end. They should only have to type the url with a path/file name and let it upload the file that they specify (example: They type http://www.mysite.com?FileName=C:\Test\Test.txt and it will...
1
1320
by: Remco | last post by:
Hello, What is the best way for the following issue? After clicking the submit button of an aspx page, an order will be placed. I would like to display info to the user during processing the order (sending emails, saving into DB etc...) Is possible to pass info from an server-side process to an existing html popup page to show interaction?
0
1104
by: J Li | last post by:
I am using iCalendar item, it sort of work either have the user browser hit a ..ics file on the web server or email a .ics item to user email address. However, both of these require user interaction, user needs to click the "Save and Close" button on Outlook. What I am looking for is a way of "silently' get the iCalendar item into client machine's outlook without user interaction.
4
23363
by: fniles | last post by:
I have an ActiveX control in my web page that I tried to access using intranet. I have implemented IObjectSafety in the ActiveX control, and when I created the CAB file using VB Pakage and Deployment Wizard, under "Safety Settings" I selected "Yes" for "Safe for Scripting" and "Yes" for "Safe for Initialization". I also have signed the CAB file. In IE, the option 'Script ActiveX controls marked Safe for Scripting' is already set to...
2
6889
by: deko | last post by:
When to use a privileged user thread rather than a windows service? That's the question raised in a previous post . It was suggested that if the service needs to interact with a WinForms app (which is the UI used to adjust the actions taken by, and the schedule of the service), then a privileged user thread should be used in the UI - no service required. But... "A windows service enables the creation of long-running executable
2
1789
by: py.adriano | last post by:
Hi folks, I'm trying to use the nmap runtime interaction feature while using it with the subprocess module. For those not familiar with nmap, the runtime interaction feature allow users to get informations about the scan stats during the nmap execution. More at: http://www.insecure.org/nmap/man/man-runtime-interaction.html If someone want to try, just run nmap and try to type some keys to see what happens. This only works with nmap 4.00...
2
8919
by: =?Utf-8?B?bXIgcGVhbnV0?= | last post by:
I want to activate an application (Excel) in code. If I reference microsoft.visualbasic, I could use: Interaction.AppActivate("Microsoft Excel"); But I wold rather use a native C# approach. I know that Interaction.MsgBox has a native analog: MessageBox.Show. Is there one for AppActivate?
3
3944
by: mmm | last post by:
I am looking for advice on Python Editors and IDEs I have read other posts and threads on the subject and my two questions at this time are mainly about the IDLE-like F5-run facilities. While I am fairly happy using IDLE, the debugger is unintuitive to me and I wanted a project manager and a better variable/ class browser and also the potential to edit/run other languages such as R and Tex/Latex. Windows and LINUX compatibility is...
0
8820
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
8598
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
8670
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
7433
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
6223
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
4406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2810
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
2051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1809
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.