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.getElementsByName("chkUserID");
// 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('analysemembers.aspx?UserList=' + qs);
}
</script>
</head>
<body>
<form>
<input type="button" name="btnAnalyseMembers" value="Analyse Members"
onclick="AnalyseMembers();" />
</form>
</body>
If you really want to run it as an asp button, you should do the
btnAnalyseMembers.Attributes.Add("onclick", "AnalyseMembers();"); in
your Page_Load -!Page.IsPostBack
Hope that helps,
D
On 31 May, 14:30, Peter Bremer <peter.bre...@gmail.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