473,833 Members | 2,144 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I perform some form actions on a seperate page?

Hi all,

I've got a form which lists all members of a club, with checkboxes to
select them. The form offers functions to delete selected members,
send email, etc.

Now I want write some code to perform complex analyses on the selected
members. I'd prefer to keep this code seperated from the basic form
processing, opening a new page with the results.

How should I go about doing this? I have a whole line of buttons for
the functions, and one of them should open a new page, how do I do
that? And how do I get the selection information from the overview
page to the analysis page?

Thanks, Peter

May 31 '07 #1
4 1534
store the data in sesson, and do a redirect to the new page.

-- bruce (sqlwork.com)

Peter Bremer wrote:
Hi all,

I've got a form which lists all members of a club, with checkboxes to
select them. The form offers functions to delete selected members,
send email, etc.

Now I want write some code to perform complex analyses on the selected
members. I'd prefer to keep this code seperated from the basic form
processing, opening a new page with the results.

How should I go about doing this? I have a whole line of buttons for
the functions, and one of them should open a new page, how do I do
that? And how do I get the selection information from the overview
page to the analysis page?

Thanks, Peter
May 31 '07 #2
Careful here - don't mistake server functionality (i.e. analysing the
members) with client functionality (i.e. opening a new browser
window).

I would suggest you use some javascript to create a querystring of the
members you wish to analyse, then use the onclick event of the button
to execute it. Note: you'll get a warning if the button is set as
runat="server" but if you run it like a normal HTML button, it'll work
fine.

Off the top of my head (so excuse any typos or syntactical errors)
something like:

<head>
<script type="text/javascript">
function AnalyseMembers( ) {
// Get an array of all Checkboxes of a certain name on the page
var cbArray = document.getEle mentsByName("ch kUserID");

// get comma seperated list of all selected user IDs
for (var i = 0; i < cbArray.lenght; i+) {
if (cbArray[i].checked) {
qs += cbArray[i].value + ",";
}
}

// remove trailing comma
if (qs != '') {
qs = qs.subString(0, qs.length - 1)
}

window.open('an alysemembers.as px?UserList=' + qs);
}
</script>
</head>
<body>
<form>
<input type="button" name="btnAnalys eMembers" value="Analyse Members"
onclick="Analys eMembers();" />
</form>
</body>
If you really want to run it as an asp button, you should do the
btnAnalyseMembe rs.Attributes.A dd("onclick", "AnalyseMembers ();"); in
your Page_Load -!Page.IsPostBac k

Hope that helps,

D

On 31 May, 14:30, Peter Bremer <peter.bre...@g mail.comwrote:
Hi all,

I've got a form which lists all members of a club, with checkboxes to
select them. The form offers functions to delete selected members,
send email, etc.

Now I want write some code to perform complex analyses on the selected
members. I'd prefer to keep this code seperated from the basic form
processing, opening a new page with the results.

How should I go about doing this? I have a whole line of buttons for
the functions, and one of them should open a new page, how do I do
that? And how do I get the selection information from the overview
page to the analysis page?

Thanks, Peter

May 31 '07 #3
What if a user has more than one window open?

D

On 31 May, 16:09, bruce barker <nos...@nospam. comwrote:
store the data in sesson, and do a redirect to the new page.

-- bruce (sqlwork.com)

Peter Bremer wrote:
Hi all,
I've got a form which lists all members of a club, with checkboxes to
select them. The form offers functions to delete selected members,
send email, etc.
Now I want write some code to perform complex analyses on the selected
members. I'd prefer to keep this code seperated from the basic form
processing, opening a new page with the results.
How should I go about doing this? I have a whole line of buttons for
the functions, and one of them should open a new page, how do I do
that? And how do I get the selection information from the overview
page to the analysis page?
Thanks, Peter- Hide quoted text -

- Show quoted text -

May 31 '07 #4
ASP.NET implements a new server-side page cache object, that has a
different life line than the session object. Using both, you can
persist data between pages for indefinite amounts of time, even if the
session object gets destroyed because of timeouts.

Assign each user a GUID (or any unique identifier) and store this
value in a session object with a well known key:

Session["USERGUID"]=new System.Guid(str UsersGUID)

then, you use the GUID to identify a particular page cache which holds
the data:

dim xmlDoc as XmlDocument=nul l
if not session["USERGUID"] is nothing then
dim strUserGUID as System.String=s ession["USERGUID"] 'get the key
to access the page cache
dim xml as System.String = Page.Cache[strUserGUID].ToString()
'retrieve your data from the page cache
XmlDocument.Loa dXml(xml) 'instantiate your data
endif

before you unload your page, you can save your data in the page.cache
(and optionally destroy the session object):

Page.Cache[strUserGUID]=xmlDoc.OuterXm l 'save your data to the page
cache
session["USERGUID"]=null 'destroying the session still preserves your
page cache
response.redire ct("newpage.asp x")

and have the new page repeat the steps to get the page.cache in its
page_load function.

The page.cache persists using a different timer than the session
object, and if you re-establish the session you can get a reference to
an existing page cache. So, you can set the session to timeout in 5
minutes of inactivity and have the page cache timeout after one hour
of inactivity. The page cache cannot be accessed without the key in
the session object, so the session object provides security against
the user being inattentive and the page cache provides a mechanisim to
preserve the data between pages regardless of how long transmission
takes or the time between transations.

B.T.W. You don't have to use an XML document to store data in the page
cache, but it sure makes it easier to store and deliniate an arbitrary
number of fields simultaneously without passing them around in posts
or the hidden viewstate field in ASP.NET

May 31 '07 #5

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

Similar topics

2
2113
by: Matt | last post by:
The ASP page has multiple buttons, and when the user clicks different buttons, it will submit the form data to different URLs. My first approach was to use BUTTON type, and triggers javascript function to submit the form data. However, it didn't work properly and I changed to use SUBMIT type. <INPUT TYPE="BUTTON" NAME="action1" VALUE="Return to Main Search Page" onClick="action1()">
1
1736
by: Sophisticado | last post by:
Hi Newbie here. I am trying to have two form actions on submission using a javascript. The first calls a php class (http://www.blah.org/test.php) and the second adds data to a mySQL database via a php function call (<? php echo $editFormAction; ?>. Both actions work; however, only the second action in the fucntion runs. Here is the code: <script language=javascript> <!--
2
6124
by: Noozer | last post by:
The following javascript code generates an "Access denied" error at the indicated line. This sample should allow the user to click "Browse" and choose a file. Once the user has selected a file the form is automatically submitted. I'm trying to avoid having seperate browse and submit actions. Can someone explain why I'm getting the error and how I can accomplish this task?
4
5337
by: Lee Chapman | last post by:
Hi, Can anyone tell me why in the code below, the call to ClearChildViewState() has no effect? To paraphrase the code: I'm using view state. I have a textbox and a submit button (and a label that can be ignored). When I press the button the first time, the click handler hides the textbox. Pressing the button a second time unhides the textbox. The text box is maintaining its value when hidden via view state. (The value is NOT being...
7
4271
by: | last post by:
Hello, I would like to do the following from a asp.net button click: <form method="POST" action="https://www.1234.com/trans_center/gateway/direct.cgi"> <input type="hidden" name="Merchant" value="Merchant Name"> <input type="hidden" name="OrderID" value="Unique OrderID value"> <input type="hidden" name="email" value="Customers email address (OPTIONAL)">
2
2451
by: JohnGates | last post by:
In VB.net, I have win form programs that do database update operations that take several minutes or longer. Several actions such as switching windows or clicking a control during these operations leave me with a blank form (all white space inside the form borders) or with a frozen form that will not display refreshed controls. When the db operations are done, the forms repaint just fine. What’s happening and what can I do about it?...
17
3868
by: stathis gotsis | last post by:
Hello everyone, I am tying to come up with an elegant way to process some input data that come from a form. When the user hits the 'Submit' button, i want the form to appear again with the already entered valid data filled in and prompt the user to re-enter the non-valid data. If all data is valid, i will forward to an other .php page which enters the data into a database. I tried to do this in the following way: the form always hits...
11
7432
by: newbie | last post by:
i have a form in which a hidden field (initial value as '0', and my javascript set it to '1' when an event is trigged). In the same form, i have a reset field. But I realized that the hidden field is not reset to '0' when i push the reset button. If I simply change the node from "<input type="hidden" id='IsChanged' value='0'>" to "<input type="text" id='IsChanged' value='0'>" Everything is working as expected (the value is reset to '0'...
5
2766
by: inepu | last post by:
I have 3 tables, Actions, Objects and AO, where "AO" a table that relates Actions and Objects, each row is a pair the other tables' keys) I have a form that is generated with values from Objects, each form page only shows info on one Object. What I would like to do is to add a list box that shows what Actions are available for this Object. I would guess that the listbox would have to be populated by the query "select Actions.* from...
0
10782
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
10500
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...
0
9323
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
7753
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
6951
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
5624
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...
1
4422
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
3972
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3078
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.