473,699 Members | 2,266 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 1525
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
2104
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
1728
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
6116
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
5322
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
4257
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
2447
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
3856
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
7413
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
2762
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
8689
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8618
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
9035
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
8916
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
8885
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...
1
6534
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
5875
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();...
2
2348
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2010
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.