473,705 Members | 6,532 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 1679
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
3258
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
2390
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
1322
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
1105
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
23365
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
6893
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
1791
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
8926
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
3948
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
8690
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
9274
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
9139
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
9034
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
7895
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...
0
5933
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4440
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
4704
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3138
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

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.