By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,306 Members | 1,639 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,306 IT Pros & Developers. It's quick & easy.

Problem Loading Data in to a Textbox located in MultiView that is in a Login View

P: n/a
Once the user logs in I want to have the users switch from the Roster
View to the Profile View and enter their profile infomation and save
it. Then the next time they login and go to the Profile View I want
the form populated from there profile on the sql server. The code to
save the profile works fine. But when the user logs back in they data
doesn't load back to the form. The multiview is located inside the
LoginView's Logged-In View . You can look at the site at www.pack743.org/default.aspx
user: test password: test@pack743 . The code is as follows let me know
if you gave any suggestions.Thanks in advace.
Jacob

PS
Sorry for the code formating. I Copyed the Default.aspx ,
Default.aspx.cs , and the Web.Config to this post.

Default.aspx

<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- InstanceBegin template="/Templates/ASPMaster.dwt"
codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>CUB SCOUTS - PACK 743</title>
<!-- InstanceEndEditable --><!-- InstanceBeginEditable name="head" --
><!-- InstanceEndEditable -->
<style type="text/css">
<!--
..style1 { font-size: 36px;
font-weight: bold;
}
..style2 {font-size: 18px}
..style3 {color: #015496}
-->
</style>
<link href="MAIN_COLORS.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link {
color: #015496;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #0099CC;
}
a:hover {
color: #0099CC;
text-decoration: underline;
}
a:active {
text-decoration: none;
}
body {
background-image: url(Img/bk_b1.png);
}
-->
</style>
<script type="text/javascript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if
((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!
=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j+
+].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
if (event == "init" && args.length 2) {
if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
if ((nbArr = document[grpName]) == null) nbArr =
document[grpName] = new Array();
nbArr[nbArr.length] = img;
for (i=4; i < args.length-1; i+=2) if ((img =
MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
} else if (event == "over") {
document.MM_nbOver = nbArr = new Array();
for (i=1; i < args.length-1; i+=3) if ((img =
MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])?
args[i+1] : img.MM_up);
nbArr[nbArr.length] = img;
}
} else if (event == "out" ) {
for (i=0; i < document.MM_nbOver.length; i++) {
img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn :
img.MM_up; }
} else if (event == "down") {
nbArr = document[grpName];
if (nbArr)
for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src =
img.MM_up; img.MM_dn = 0; }
document[grpName] = nbArr = new Array();
for (i=2; i < args.length-1; i+=2) if ((img =
MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
nbArr[nbArr.length] = img;
} }
}
//-->
</script>
</head>
<body topmargin="0" onload="MM_preloadImages('Img/
button_r2_c1_f3.png','Img/button_r2_c1_f2.png','Img/
button_r2_c1_f4.png','Library/PastEvents_r2_c1_f3.png','Library/
PastEvents_r2_c1_f2.png','Library/PastEvents_r2_c1_f4.png','Library/
Calendar_r2_c1_f3.png','Library/Calendar_r2_c1_f2.png','Library/
Calendar_r2_c1_f4.png','Library/Home_r2_c1_f3.png','Library/
Home_r2_c1_f2.png','Library/Home_r2_c1_f4.png','Library/
Tigerden_r2_c1_f3.png','Library/Tigerden_r2_c1_f2.png','Library/
Tigerden_r2_c1_f4.png','Library/Wolfden_r2_c1_f3.png','Library/
Wolfden_r2_c1_f2.png','Library/Wolfden_r2_c1_f4.png','Library/
Bearden_r2_c1_f3.png','Library/Bearden_r2_c1_f2.png','Library/
Bearden_r2_c1_f4.png','Library/Webelosden_r2_c1_f3.png','Library/
Webelosden_r2_c1_f2.png','Library/Webelosden_r2_c1_f4.png','Library/
Leaders_r2_c1_f3.png','Library/Leaders_r2_c1_f2.png','Library/
Leaders_r2_c1_f4.png','Library/Corner_r2_c1_f3.png','Library/
Corner_r2_c1_f2.png','Library/Corner_r2_c1_f4.png')">
<div align="center">
<table width="802" border="2" cellpadding="0" cellspacing="0"
bordercolor="#015496" class="CS_COLORS">
<tr>
<td width="100" height="110" align="center" valign="top"><img
src="Img/cs_c.png" width="100" height="100" /></td>
<td width="565" align="center" valign="top" ><span
class="style1">CUB SCOUTS</span><strong><br />
<span class="style2">PACK 743 - ALLEN SCHOOL <br />
<img src="Img/Dens_c.png" width="250" height="50" /></span></
strong></td>
<td width="100" align="center" valign="middle"><img src="Img/
header_right.gif" width="100" height="56" /></td>
</tr>
</table>
<table width="800" border="1" cellpadding="0" cellspacing="0"
bordercolor="#FFD401">
<tr>
<td bordercolor="#FFD401"><table width="799" border="1"
align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
<tr>
<td width="150" align="center" valign="top"
bgcolor="#FFD401"><table width="100%" border="1" cellpadding="0"
cellspacing="0" bordercolor="#FFD401">
<tr>
<td class="style3"><div align="center"><!--
#BeginLibraryItem "/Library/Home.lbi" -->
<table align="left" border="0" cellpadding="0" cellspacing="0"
width="170">
<!-- fwtable fwsrc="Button_temp.png" fwbase="Home.png" -->
<tr>
<td><img src="Library/spacer.gif" width="169" height="1"
border="0" /></td>
<td><img src="Library/spacer.gif" width="1" height="1" border="0" /
></td>
<td><img src="Library/spacer.gif" width="1" height="1" border="0" /
></td>
</tr>
<tr>
<td colspan="2"><img src="Library/Home_r1_c1.png" width="170"
height="3" border="0" id="Home_r1_c1" /></td>
<td><img src="Library/spacer.gif" width="1" height="3" border="0" /
></td>
</tr>
<tr>
<td><a href="index.html" target="_self"
onmouseout="MM_nbGroup('out');"
onmouseover="MM_nbGroup('over','Homer2c1','Library/
Home_r2_c1_f2.png','Library/Home_r2_c1_f4.png',1)"
onclick="MM_nbGroup('down','navbar1','Homer2c1','L ibrary/
Home_r2_c1_f3.png',1)" ><img src="Library/Home_r2_c1.png"
name="Homer2c1" width="169" height="19" border="0" id="Home_r2_c1" /></
a></td>
<td rowspan="2"><img src="Library/Home_r2_c2.png" width="1"
height="22" border="0" id="Home_r2_c2" /></td>
<td><img src="Library/spacer.gif" width="1" height="19" border="0" /
></td>
</tr>
<tr>
<td><img src="Library/Home_r3_c1.png" width="169" height="3"
border="0" id="Home_r3_c1" /></td>
<td><img src="Library/spacer.gif" width="1" height="3" border="0" /
></td>
</tr>
</table>
<!-- #EndLibraryItem --></div></td>
</tr>
<tr>
<td class="style3"><div align="center"><!--
#BeginLibraryItem "/Library/Calendar.lbi" -->
<table align="left" border="0" cellpadding="0" cellspacing="0"
width="170">
<!-- fwtable fwsrc="Button_temp.png" fwbase="Calendar.png" -->
<tr>
<td><img src="Library/spacer.gif" width="169" height="1"
border="0" /></td>
<td><img src="Library/spacer.gif" width="1" height="1" border="0" /
></td>
<td><img src="Library/spacer.gif" width="1" height="1" border="0" /
></td>
</tr>
<tr>
<td colspan="2"><img src="Library/Calendar_r1_c1.png" width="170"
height="3" border="0" id="Calendar_r1_c1" /></td>
<td><img src="Library/spacer.gif" width="1" height="3" border="0" /
></td>
</tr>
<tr>
<td><a href="CoE.html" target="_self"
onmouseout="MM_nbGroup('out');"
onmouseover="MM_nbGroup('over','Calendarr2c1','Lib rary/
Calendar_r2_c1_f2.png','Library/Calendar_r2_c1_f4.png',1)"
onclick="MM_nbGroup('down','navbar1','Calendarr2c1 ','Library/
Calendar_r2_c1_f3.png',1)" ><img src="Library/Calendar_r2_c1.png"
name="Calendarr2c1" width="169" height="19" border="0"
id="Calendar_r2_c1" /></a></td>
<td rowspan="2"><img src="Library/Calendar_r2_c2.png" width="1"
height="22" border="0" id="Calendar_r2_c2" /></td>
<td><img src="Library/spacer.gif" width="1" height="19" border="0" /
></td>
</tr>
<tr>
<td><img src="Library/Calendar_r3_c1.png" width="169" height="3"
border="0" id="Calendar_r3_c1" /></td>
<td><img src="Library/spacer.gif" width="1" height="3" border="0" /
></td>
</tr>
</table>
<!-- #EndLibraryItem --></div></td>
</tr>
<tr>
<td height="21" class="style3"><div
align="center"><!-- #BeginLibraryItem "/Library/PastEvents.lbi" -->
<table align="left" border="0" cellpadding="0" cellspacing="0"
width="170">
<!-- fwtable fwsrc="Button_temp.png" fwbase="PastEvents.png" -->
<tr>
<td><img src="Library/spacer.gif" width="169" height="1"
border="0" /></td>
<td><img src="Library/spacer.gif" width="1" height="1" border="0" /
></td>
<td><img src="Library/spacer.gif" width="1" height="1" border="0" /
></td>
</tr>
<tr>
<td colspan="2"><img src="Library/PastEvents_r1_c1.png" width="170"
height="3" border="0" id="PastEvents_r1_c1" /></td>
<td><img src="Library/spacer.gif" width="1" height="3" border="0" /
></td>
</tr>
<tr>
<td><a href="PastEvents.html" target="_self"
onmouseout="MM_nbGroup('out');"
onmouseover="MM_nbGroup('over','PastEventsr2c1','L ibrary/
PastEvents_r2_c1_f2.png','Library/PastEvents_r2_c1_f4.png',1)"
onclick="MM_nbGroup('down','navbar1','PastEventsr2 c1','Library/
PastEvents_r2_c1_f3.png',1)" ><img src="Library/PastEvents_r2_c1.png"
name="PastEventsr2c1" width="169" height="19" border="0"
id="PastEvents_r2_c1" /></a></td>
<td rowspan="2"><img src="Library/PastEvents_r2_c2.png" width="1"
height="22" border="0" id="PastEvents_r2_c2" /></td>
<td><img src="Library/spacer.gif" width="1" height="19" border="0" /
></td>
</tr>
<tr>
<td><img src="Library/PastEvents_r3_c1.png" width="169" height="3"
border="0" id="PastEvents_r3_c1" /></td>
<td><img src="Library/spacer.gif" width="1" height="3" border="0" /
></td>
</tr>
</table>
<!-- #EndLibraryItem --></div></td>
</tr>
<tr>
<td height="27" class="style3"><div
align="center"><!-- #BeginLibraryItem "/Library/Tigerden.lbi" -->
<table align="left" border="0" cellpadding="0" cellspacing="0"
width="170">
<!-- fwtable fwsrc="Button_temp.png" fwbase="Tigerden.png" -->
<tr>
<td><img src="Library/spacer.gif" width="169" height="1"
border="0" /></td>
<td><img src="Library/spacer.gif" width="1" height="1" border="0" /
></td>
<td><img src="Library/spacer.gif" width="1" height="1" border="0" /
></td>
</tr>
<tr>
<td colspan="2"><img src="Library/Tigerden_r1_c1.png" width="170"
height="3" border="0" id="Tigerden_r1_c1" /></td>
<td><img src="Library/spacer.gif" width="1" height="3" border="0" /
></td>
</tr>
<tr>
<td><a href="Tigerden.html" target="_self"
onmouseout="MM_nbGroup('out');"
onmouseover="MM_nbGroup('over','Tigerdenr2c1','Lib rary/
Tigerden_r2_c1_f2.png','Library/Tigerden_r2_c1_f4.png',1)"
onclick="MM_nbGroup('down','navbar1','Tigerdenr2c1 ','Library/
Tigerden_r2_c1_f3.png',1)" ><img src="Library/Tigerden_r2_c1.png"
name="Tigerdenr2c1" width="169" height="20" border="0"
id="Tigerden_r2_c1" /></a></td>
<td rowspan="2"><img src="Library/Tigerden_r2_c2.png" width="1"
height="22" border="0" id="Tigerden_r2_c2" /></td>
<td><img src="Library/spacer.gif" width="1" height="20" border="0" /
></td>
</tr>
<tr>
<td><img src="Library/Tigerden_r3_c1.png" width="169" height="2"
border="0" id="Tigerden_r3_c1" /></td>
<td><img src="Library/spacer.gif" width="1" height="2" border="0" /
></td>
</tr>
</table>
<!-- #EndLibraryItem --></div></td>
</tr>
<tr>
<td bordercolor="#FFD401" class="style3"><div
align="center"><a href="WolfDen.html"></a><!-- #BeginLibraryItem "/
Library/Wolfden.lbi" -->
<table align="left" border="0" cellpadding="0" cellspacing="0"
width="170">
<!-- fwtable fwsrc="Button_temp.png" fwbase="Wolfden.png" -->
<tr>
<td><img src="Library/spacer.gif" width="169" height="1"
border="0" /></td>
<td><img src="Library/spacer.gif" width="1" height="1" border="0" /
></td>
<td><img src="Library/spacer.gif" width="1" height="1" border="0" /
></td>
</tr>
<tr>
<td colspan="2"><img src="Library/Wolfden_r1_c1.png" width="170"
height="3" border="0" id="Wolfden_r1_c1" /></td>
<td><img src="Library/spacer.gif" width="1" height="3" border="0" /
></td>
</tr>
<tr>
<td><a href="Wolfden.html" target="_self"
onmouseout="MM_nbGroup('out');"
onmouseover="MM_nbGroup('over','Wolfdenr2c1','Libr ary/
Wolfden_r2_c1_f2.png','Library/Wolfden_r2_c1_f4.png',1)"
onclick="MM_nbGroup('down','navbar1','Wolfdenr2c1' ,'Library/
Wolfden_r2_c1_f3.png',1)" ><img src="Library/Wolfden_r2_c1.png"
name="Wolfdenr2c1" width="169" height="19" border="0"
id="Wolfden_r2_c1" /></a></td>
<td rowspan="2"><img src="Library/Wolfden_r2_c2.png" width="1"
height="22" border="0" id="Wolfden_r2_c2" /></td>
<td><img src="Library/spacer.gif" width="1" height="19" border="0" /
></td>
</tr>
<tr>
<td><img src="Library/Wolfden_r3_c1.png" width="169" height="3"
border="0" id="Wolfden_r3_c1" /></td>
<td><img src="Library/spacer.gif" width="1" height="3" border="0" /
></td>
</tr>
</table>
<!-- #EndLibraryItem --></div></td>
</tr>
<tr>
<td class="style3"><div align="center"
class="style3"><a href="Bearden.html"></a><!-- #BeginLibraryItem "/
Library/Bearden.lbi" -->
<table align="left" border="0" cellpadding="0" cellspacing="0"
width="170">
<!-- fwtable fwsrc="Button_temp.png" fwbase="Bearden.png" -->
<tr>
<td><img src="Library/spacer.gif" width="169" height="1"
border="0" /></td>
<td><img src="Library/spacer.gif" width="1" height="1" border="0" /
></td>
<td><img src="Library/spacer.gif" width="1" height="1" border="0" /
></td>
</tr>
<tr>
<td colspan="2"><img src="Library/Bearden_r1_c1.png" width="170"
height="3" border="0" id="Bearden_r1_c1" /></td>
<td><img src="Library/spacer.gif" width="1" height="3" border="0" /
></td>
</tr>
<tr>
<td><a href="Bearden.html" target="_self"
onmouseout="MM_nbGroup('out');"
onmouseover="MM_nbGroup('over','Beardenr2c1','Libr ary/
Bearden_r2_c1_f2.png','Library/Bearden_r2_c1_f4.png',1)"
onclick="MM_nbGroup('down','navbar1','Beardenr2c1' ,'Library/
Bearden_r2_c1_f3.png',1)" ><img src="Library/Bearden_r2_c1.png"
name="Beardenr2c1" width="169" height="19" border="0"
id="Bearden_r2_c1" /></a></td>
<td rowspan="2"><img src="Library/Bearden_r2_c2.png" width="1"
height="22" border="0" id="Bearden_r2_c2" /></td>
<td><img src="Library/spacer.gif" width="1" height="19" border="0" /
></td>
</tr>
<tr>
<td><img src="Library/Bearden_r3_c1.png" width="169" height="3"
border="0" id="Bearden_r3_c1" /></td>
<td><img src="Library/spacer.gif" width="1" height="3" border="0" /
></td>
</tr>
</table>
<!-- #EndLibraryItem --></div></td>
</tr>
<tr>
<td><div align="center" class="style3"><a
href="Webelos.html"></a><!-- #BeginLibraryItem "/Library/
Webelosden.lbi" -->
<table align="left" border="0" cellpadding="0" cellspacing="0"
width="170">
<!-- fwtable fwsrc="Button_temp.png" fwbase="Webelosden.png" -->
<tr>
<td><img src="Library/spacer.gif" width="169" height="1"
border="0" /></td>
<td><img src="Library/spacer.gif" width="1" height="1" border="0" /
></td>
<td><img src="Library/spacer.gif" width="1" height="1" border="0" /
></td>
</tr>
<tr>
<td colspan="2"><img src="Library/Webelosden_r1_c1.png" width="170"
height="3" border="0" id="Webelosden_r1_c1" /></td>
<td><img src="Library/spacer.gif" width="1" height="3" border="0" /
></td>
</tr>
<tr>
<td><a href="Webelos.html" target="_self"
onmouseout="MM_nbGroup('out');"
onmouseover="MM_nbGroup('over','Webelosdenr2c1','L ibrary/
Webelosden_r2_c1_f2.png','Library/Webelosden_r2_c1_f4.png',1)"
onclick="MM_nbGroup('down','navbar1','Webelosdenr2 c1','Library/
Webelosden_r2_c1_f3.png',1)" ><img src="Library/Webelosden_r2_c1.png"
name="Webelosdenr2c1" width="169" height="19" border="0"
id="Webelosden_r2_c1" /></a></td>
<td rowspan="2"><img src="Library/Webelosden_r2_c2.png" width="1"
height="22" border="0" id="Webelosden_r2_c2" /></td>
<td><img src="Library/spacer.gif" width="1" height="19" border="0" /
></td>
</tr>
<tr>
<td><img src="Library/Webelosden_r3_c1.png" width="169" height="3"
border="0" id="Webelosden_r3_c1" /></td>
<td><img src="Library/spacer.gif" width="1" height="3" border="0" /
></td>
</tr>
</table>
<!-- #EndLibraryItem --></div></td>
</tr>
<tr>
<td><div align="center"><a href="Leaders.html"></
a><!-- #BeginLibraryItem "/Library/Leaders.lbi" -->
<table align="left" border="0" cellpadding="0" cellspacing="0"
width="170">
<!-- fwtable fwsrc="Button_temp.png" fwbase="Leaders.png" -->
<tr>
<td><img src="Library/spacer.gif" width="169" height="1"
border="0" /></td>
<td><img src="Library/spacer.gif" width="1" height="1" border="0" /
></td>
<td><img src="Library/spacer.gif" width="1" height="1" border="0" /
></td>
</tr>
<tr>
<td colspan="2"><img src="Library/Leaders_r1_c1.png" width="170"
height="3" border="0" id="Leaders_r1_c1" /></td>
<td><img src="Library/spacer.gif" width="1" height="3" border="0" /
></td>
</tr>
<tr>
<td><a href="Leaders.html" target="_self"
onmouseout="MM_nbGroup('out');"
onmouseover="MM_nbGroup('over','Leadersr2c1','Libr ary/
Leaders_r2_c1_f2.png','Library/Leaders_r2_c1_f4.png',1)"
onclick="MM_nbGroup('down','navbar1','Leadersr2c1' ,'Library/
Leaders_r2_c1_f3.png',1)" ><img src="Library/Leaders_r2_c1.png"
name="Leadersr2c1" width="169" height="19" border="0"
id="Leaders_r2_c1" /></a></td>
<td rowspan="2"><img src="Library/Leaders_r2_c2.png" width="1"
height="22" border="0" id="Leaders_r2_c2" /></td>
<td><img src="Library/spacer.gif" width="1" height="19" border="0" /
></td>
</tr>
<tr>
<td><img src="Library/Leaders_r3_c1.png" width="169" height="3"
border="0" id="Leaders_r3_c1" /></td>
<td><img src="Library/spacer.gif" width="1" height="3" border="0" /
></td>
</tr>
</table>
<!-- #EndLibraryItem --></div></td>
</tr>
<tr>
<td align="center" valign="top"><div
align="center"><!-- #BeginLibraryItem "/Library/Corner.lbi" -->
<table align="left" border="0" cellpadding="0" cellspacing="0"
width="170">
<!-- fwtable fwsrc="Button_temp.png" fwbase="Corner.png" -->
<tr>
<td><img src="Library/spacer.gif" width="169" height="1"
border="0" /></td>
<td><img src="Library/spacer.gif" width="1" height="1" border="0" /
></td>
<td><img src="Library/spacer.gif" width="1" height="1" border="0" /
></td>
</tr>
<tr>
<td colspan="2"><img src="Library/Corner_r1_c1.png" width="170"
height="3" border="0" id="Corner_r1_c1" /></td>
<td><img src="Library/spacer.gif" width="1" height="3" border="0" /
></td>
</tr>
<tr>
<td><a href="CubCorner.html" target="_self"
onmouseout="MM_nbGroup('out');"
onmouseover="MM_nbGroup('over','Cornerr2c1','Libra ry/
Corner_r2_c1_f2.png','Library/Corner_r2_c1_f4.png',1)"
onclick="MM_nbGroup('down','navbar1','Cornerr2c1', 'Library/
Corner_r2_c1_f3.png',1)" ><img src="Library/Corner_r2_c1.png"
name="Cornerr2c1" width="169" height="19" border="0"
id="Corner_r2_c1" /></a></td>
<td rowspan="2"><img src="Library/Corner_r2_c2.png" width="1"
height="22" border="0" id="Corner_r2_c2" /></td>
<td><img src="Library/spacer.gif" width="1" height="19" border="0" /
></td>
</tr>
<tr>
<td><img src="Library/Corner_r3_c1.png" width="169" height="3"
border="0" id="Corner_r3_c1" /></td>
<td><img src="Library/spacer.gif" width="1" height="3" border="0" /
></td>
</tr>
</table>
<!-- #EndLibraryItem --></div></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table></td>
<td align="center" valign="top" bordercolor="#FFD401"
bgcolor="#FFFFFF" ><table width="100%" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td align="center" valign="top"><!--
InstanceBeginEditable name="Content" -->
<table width="100%" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td><div align="center">
<form id="login" runat="server">

<asp:LoginView runat="server" id="LoginView1"
OnPreRender="LoginView1_PreRender"
OnViewChanged="LoginView1_ViewChanged" OnInit="LoginView1_Init">
<LoggedInTemplate>
<table style="width: 100%">
<tr>
<td height="450" align="left" valign="top" style="width:
610px">
<table width="600">
<tr>
<td id="LogedBanner" style="width: 486px; height:
26px;">Welcome
<asp:LoginName runat="server" id="LoginName1" />
<asp:Label ID="FullName" runat="server" Text="Label">
</asp:Label>
</td>
<td id="LogedBanner" align="center" style="height: 26px">
<asp:LoginStatus runat="server" id="LoginStatus1"
ForeColor="#FFD401" />
</td>
</tr>
<tr>
<td bgcolor="#ffffff" colspan="2">
<table style="width: 100%">
<tr>
<td align="left">
<asp:DropDownList runat="server" id="ViewSelector"
AutoPostBack="True"
OnSelectedIndexChanged="ViewSelector_SelectedIndex Changed">
<asp:ListItem Value="0 ">Roster
</asp:ListItem>
<asp:ListItem Value="1 ">Achevments
</asp:ListItem>

<asp:ListItem>Profile</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td align="center">
<asp:MultiView runat="server" id="LeaderViews"
ActiveViewIndex="0"
OnActiveViewChanged="LeaderViews_ActiveViewChanged ">
<asp:View runat="server" id="Roster">
<asp:GridView ID="GridView1" runat="server"
AllowPaging="True" AutoGenerateColumns="False" CellPadding="4"
DataSourceID="SqlDataSource1" EmptyDataText="There are no data records
to display." ForeColor="#333333" GridLines="None" Width="600px"
AllowSorting="True" DataKeyNames="Member_ID">
<FooterStyle BackColor="#5D7B9D" Font-Bold="True"
ForeColor="White" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#E2DED6" Font-
Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White"
HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True"
ForeColor="White" />
<AlternatingRowStyle BackColor="White"
ForeColor="#284775" />

<Columns>

<asp:CommandField ShowDeleteButton="True" ShowEditButton="True"
ShowSelectButton="True" />

<asp:BoundField DataField="Member_ID" HeaderText="Member_ID"
ReadOnly="True" SortExpression="Member_ID" />

<asp:BoundField DataField="First_Name" HeaderText="First_Name"
SortExpression="First_Name" />

<asp:BoundField DataField="Last_Name" HeaderText="Last_Name"
SortExpression="Last_Name" />

<asp:BoundField DataField="Den" HeaderText="Den" SortExpression="Den" /
>
</
Columns>
</asp:GridView>
&nbsp;

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConflictDetection="CompareAllValues"

ConnectionString="<%$ ConnectionStrings:Pack743ASPConnectionString1
%>" DeleteCommand="DELETE FROM [Roster] WHERE [Member ID] =
@original_Member_ID AND [First Name] = @original_First_Name AND [Last
Name] = @original_Last_Name AND [Email Address] =
@original_Email_Address AND [Den] = @original_Den"

InsertCommand="INSERT INTO [Roster] ([First Name], [Last Name], [Email
Address], [Den], [Member ID]) VALUES (@First_Name, @Last_Name,
@Email_Address, @Den, @Member_ID)"

OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT
[First Name] AS First_Name, [Last Name] AS Last_Name, [Email Address]
AS Email_Address, [Den], [Member ID] AS Member_ID FROM [Roster]"

UpdateCommand="UPDATE [Roster] SET [First Name] = @First_Name, [Last
Name] = @Last_Name, [Email Address] = @Email_Address, [Den] = @Den
WHERE [Member ID] = @original_Member_ID AND [First Name] =
@original_First_Name AND [Last Name] = @original_Last_Name AND [Email
Address] = @original_Email_Address AND [Den] = @original_Den">

<DeleteParameters>

<asp:Parameter Name="original_Member_ID" Type="String" />

<asp:Parameter Name="original_First_Name" Type="String" />

<asp:Parameter Name="original_Last_Name" Type="String" />

<asp:Parameter Name="original_Email_Address" Type="String" />

<asp:Parameter Name="original_Den" Type="String" />
</
DeleteParameters>

<UpdateParameters>

<asp:Parameter Name="First_Name" Type="String" />

<asp:Parameter Name="Last_Name" Type="String" />

<asp:Parameter Name="Email_Address" Type="String" />

<asp:Parameter Name="Den" Type="String" />

<asp:Parameter Name="original_Member_ID" Type="String" />

<asp:Parameter Name="original_First_Name" Type="String" />

<asp:Parameter Name="original_Last_Name" Type="String" />

<asp:Parameter Name="original_Email_Address" Type="String" />

<asp:Parameter Name="original_Den" Type="String" />
</
UpdateParameters>

<InsertParameters>

<asp:Parameter Name="First_Name" Type="String" />

<asp:Parameter Name="Last_Name" Type="String" />

<asp:Parameter Name="Email_Address" Type="String" />

<asp:Parameter Name="Den" Type="String" />

<asp:Parameter Name="Member_ID" Type="String" />
</
InsertParameters>
</
asp:SqlDataSource>
</asp:View>
<asp:View ID="Achevments" runat="server">
</asp:View>
<asp:View ID="Profile" runat="server"
OnPreRender="Profile_PreRender">
<table style="border: 2px double #284775; width: 100%;
">
<tr bgcolor="#015496" style="color: #ffd401">
<td width="33.33%">First
Name</td>
<td width="33.33%">Last Name</td>
<td>Den</td>
</tr>
<tr>
<td width="33%" style="height: 19px" align="center">

<asp:TextBox ID="FirstName" runat="server" Width="170px"></
asp:TextBox></td>
<td style="height: 19px">

<asp:TextBox ID="LastName" runat="server" Width="170px"></
asp:TextBox></td>
<td width="33.33%" style="height: 19px">

<asp:DropDownList ID="Den" runat="server" Width="170px">

<asp:ListItem>Tiger Den 1</asp:ListItem>

<asp:ListItem>Tiger Den 2</asp:ListItem>

<asp:ListItem>Wolf Den 1</asp:ListItem>

<asp:ListItem>Wolf Den 2</asp:ListItem>

<asp:ListItem>Bear Den 1</asp:ListItem>

<asp:ListItem>Bear Den 2</asp:ListItem>

<asp:ListItem>Webelos Den 1</asp:ListItem>

<asp:ListItem>Webelos Den 2</asp:ListItem>

<asp:ListItem>2nd Yr Webelos Den 1</asp:ListItem>

<asp:ListItem>2nd Yr Webelos Den 2</asp:ListItem>

<asp:ListItem>Pack 743</asp:ListItem>

</asp:DropDownList></td>
</tr>
<tr bgcolor="#015496" style="color: #ffd401">
<td width="33%" bgcolor="#015496">Mother's Name</td>
<td>Father's Name</td>
<td width="33.33%">Phone Number</td>
</tr>
<tr >
<td width="33%" >

<asp:TextBox ID="Mother" runat="server" Width="170px"></asp:TextBox></
td>
<td align="center">

<asp:TextBox ID="Father" runat="server" Width="170px"></asp:TextBox>

</td>
<td width="33.33%">

<asp:TextBox ID="PhoneNumber" runat="server" Width="170px"></
asp:TextBox></td>
</tr>
<tr bgcolor="#015496" style="color: #ffd401">
<td width="33%" bgcolor="#015496">Position</td>

<td colspan="2">

E-Mail</td>

</tr>

<tr >

<td width="33%" style="height: 26px">

<asp:DropDownList ID="Position" runat="server" Width="170px">

<asp:ListItem>Tiger Den 1 Leader</asp:ListItem>

<asp:ListItem>Tiger Den 2 Leader</asp:ListItem>

<asp:ListItem>Wolf Den 1 Leader</asp:ListItem>

<asp:ListItem>Wolf Den 2 Leader</asp:ListItem>

<asp:ListItem>Bear Den 1 Leader</asp:ListItem>

<asp:ListItem>Bear Den 2 Leader</asp:ListItem>

<asp:ListItem>Webelos Den 1 Leader</asp:ListItem>

<asp:ListItem>Webelos Den 2 Leader</asp:ListItem>

<asp:ListItem>2nd Yr Webelos Den 1 Leader</asp:ListItem>

<asp:ListItem>2nd Yr Webelos Den 2 Leader</asp:ListItem>

<asp:ListItem>Committee</asp:ListItem>

<asp:ListItem>Committee Chairman</asp:ListItem>

<asp:ListItem>User</asp:ListItem>

</asp:DropDownList></td>

<td colspan="2" style="height: 26px">

<asp:TextBox ID="Email" runat="server" Width="360px"></asp:TextBox></
td>
</
tr>
</table>

<asp:Button ID="Btn_Save" runat="server" OnClick="Btn_Save_Click"
Text="Save Profile" />

<asp:Button ID="btn_restore" runat="server" Text="Restore Profile"
OnClick="btn_restore_Click" /></asp:View>
</asp:MultiView>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</LoggedInTemplate>
<AnonymousTemplate>
<asp:Login runat="server" id="Login1" Width="250px"
Height="133px" BackColor="#F7F6F3" BorderColor="#E6E2D8"
BorderPadding="4" BorderStyle="Solid" BorderWidth="1px" Font-
Names="Verdana" Font-Size="0.8em" ForeColor="#333333"
TextLayout="TextOnTop">
<TitleTextStyle
BackColor="#015496" Font-Bold="True" Font-Size="0.9em"
ForeColor="White" />
<InstructionTextStyle Font-
Italic="True" ForeColor="Black" />
<TextBoxStyle Font-Size="0.8em" />
<LoginButtonStyle
BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"
BorderWidth="1px"
Font-Names="Verdana" Font-
Size="0.8em" ForeColor="#284775" />
</asp:Login>
&nbsp;
</AnonymousTemplate>
</asp:LoginView>

</form>

</div></td>
</tr>
</table>
<!-- InstanceEndEditable --></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<br />
</div>
</body>
<!-- InstanceEnd --></html>

Default.aspx.cs

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}

protected void RosterSource_Selecting(object sender,
SqlDataSourceSelectingEventArgs e)
{

}
protected void LeaderViews_ActiveViewChanged(object sender,
EventArgs e)
{

}
protected void ViewSelector_SelectedIndexChanged(object sender,
EventArgs e)
{
MultiView mv = new MultiView();
DropDownList dl =
(DropDownList)LoginView1.FindControl("ViewSelector ");
mv = (MultiView)LoginView1.FindControl("LeaderViews");
mv.ActiveViewIndex = dl.SelectedIndex;
}
protected void LoginView1_PreRender(object sender, EventArgs e)
{
MultiView mv =
(MultiView)LoginView1.FindControl("LeaderViews");
View vw = (View)mv.FindControl("Profile");
TextBox first = (TextBox)vw.FindControl("FirstName");
TextBox last = (TextBox)vw.FindControl("LastName");
DropDownList den = (DropDownList)vw.FindControl("Den");
TextBox mother = (TextBox)vw.FindControl("Mother");
TextBox father = (TextBox)vw.FindControl("Father");
TextBox phone = (TextBox)vw.FindControl("PhoneNumber");
DropDownList position =
(DropDownList)vw.FindControl("Position");
TextBox email = (TextBox)vw.FindControl("Email");
first.Text = Profile.FirstName;
last.Text = Profile.LastName;
switch (Profile.Den)
{
case "Tiger Den 1":
den.SelectedIndex = 0;
break;
case "Tiger Den 2":
den.SelectedIndex = 1;
break;
case "Wolf Den 1":
den.SelectedIndex = 2;
break;
case "Wolf Den 2":
den.SelectedIndex = 3;
break;
case "Bear Den 1":
den.SelectedIndex = 4;
break;
case "Bear Den 2":
den.SelectedIndex = 5;
break;
case "Webelos Den 1":
den.SelectedIndex = 6;
break;
case "Webelos Den 2":
den.SelectedIndex = 7;
break;
case "2nd Yr Webelos Den 1":
den.SelectedIndex = 8;
break;
case "2nd Yr Webelos Den 2":
den.SelectedIndex = 9;
break;
default:
den.SelectedIndex = 10;
break;
}
mother.Text = Profile.MotherName;
father.Text = Profile.FatherName;
phone.Text = Profile.PhoneNumber;
switch (Profile.Posistion)
{
case "Tiger Den 1 Leader":
position.SelectedIndex = 0;
break;
case "Tiger Den 2 Leader":
position.SelectedIndex = 0;
break;
case "Wolf Den 1 Leader":
position.SelectedIndex = 2;
break;
case "Wolf Den 2 Leader":
position.SelectedIndex = 3;
break;
case "Bear Den 1 Leader":
position.SelectedIndex = 4;
break;
case "Bear Den 2 Leader":
position.SelectedIndex = 5;
break;
case "Webelos Den 1 Leader":
position.SelectedIndex = 6;
break;
case "Webelos Den 2 Leader":
position.SelectedIndex = 7;
break;
case "2nd Yr Webelos Den 1 Leader":
position.SelectedIndex = 8;
break;
case "2nd Yr Webelos Den 2 Leader":
position.SelectedIndex = 9;
break;
case "Committee":
position.SelectedIndex = 10;
break;
case "Comittee Charman":
position.SelectedIndex = 11;
break;
default:
position.SelectedIndex = 12;
break;
}
email.Text = Profile.Email;

}
protected void Btn_Save_Click(object sender, EventArgs e)
{
MultiView mv =
(MultiView)LoginView1.FindControl("LeaderViews");
View vw = (View)mv.FindControl("Profile");
TextBox first = (TextBox)vw.FindControl("FirstName");
TextBox last = (TextBox)vw.FindControl("LastName");
DropDownList den = (DropDownList)vw.FindControl("Den");
TextBox mother = (TextBox)vw.FindControl("Mother");
TextBox father = (TextBox)vw.FindControl("Father");
TextBox phone = (TextBox)vw.FindControl("PhoneNumber");
DropDownList position =
(DropDownList)vw.FindControl("Position");
TextBox email = (TextBox)vw.FindControl("Email");
Profile.FirstName = first.Text;
Profile.LastName = last.Text;
Profile.FullName = first.Text + " " + last.Text;
Profile.Den = den.SelectedValue;
Profile.MotherName = mother.Text;
Profile.FatherName = father.Text;
Profile.PhoneNumber = phone.Text;
Profile.Posistion = position.SelectedValue;
Profile.Email = email.Text;

}
protected void Profile_PreRender(object sender, EventArgs e)
{

}

protected void LoginView1_ViewChanged(object sender, EventArgs e)
{

}
protected void LoginView1_Init(object sender, EventArgs e)
{

}
protected void btn_restore_Click(object sender, EventArgs e)
{
MultiView mv =
(MultiView)LoginView1.FindControl("LeaderViews");
View vw = (View)mv.FindControl("Profile");
TextBox first = (TextBox)vw.FindControl("FirstName");
TextBox last = (TextBox)vw.FindControl("LastName");
DropDownList den = (DropDownList)vw.FindControl("Den");
TextBox mother = (TextBox)vw.FindControl("Mother");
TextBox father = (TextBox)vw.FindControl("Father");
TextBox phone = (TextBox)vw.FindControl("PhoneNumber");
DropDownList position =
(DropDownList)vw.FindControl("Position");
TextBox email = (TextBox)vw.FindControl("Email");
first.Text = Profile.FirstName;
last.Text = Profile.LastName;
switch (Profile.Den)
{
case "Tiger Den 1":
den.SelectedIndex = 0;
break;
case "Tiger Den 2":
den.SelectedIndex = 1;
break;
case "Wolf Den 1":
den.SelectedIndex = 2;
break;
case "Wolf Den 2":
den.SelectedIndex = 3;
break;
case "Bear Den 1":
den.SelectedIndex = 4;
break;
case "Bear Den 2":
den.SelectedIndex = 5;
break;
case "Webelos Den 1":
den.SelectedIndex = 6;
break;
case "Webelos Den 2":
den.SelectedIndex = 7;
break;
case "2nd Yr Webelos Den 1":
den.SelectedIndex = 8;
break;
case "2nd Yr Webelos Den 2":
den.SelectedIndex = 9;
break;
default:
den.SelectedIndex = 10;
break;
}
mother.Text = Profile.MotherName;
father.Text = Profile.FatherName;
phone.Text = Profile.PhoneNumber;
switch (Profile.Posistion)
{
case "Tiger Den 1 Leader":
position.SelectedIndex = 0;
break;
case "Tiger Den 2 Leader":
position.SelectedIndex = 0;
break;
case "Wolf Den 1 Leader":
position.SelectedIndex = 2;
break;
case "Wolf Den 2 Leader":
position.SelectedIndex = 3;
break;
case "Bear Den 1 Leader":
position.SelectedIndex = 4;
break;
case "Bear Den 2 Leader":
position.SelectedIndex = 5;
break;
case "Webelos Den 1 Leader":
position.SelectedIndex = 6;
break;
case "Webelos Den 2 Leader":
position.SelectedIndex = 7;
break;
case "2nd Yr Webelos Den 1 Leader":
position.SelectedIndex = 8;
break;
case "2nd Yr Webelos Den 2 Leader":
position.SelectedIndex = 9;
break;
case "Committee":
position.SelectedIndex = 10;
break;
case "Comittee Charman":
position.SelectedIndex = 11;
break;
default:
position.SelectedIndex = 12;
break;
}
email.Text = Profile.Email;

}
}

Web.Config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="Pack743ASPConnectionString1" connectionString="Data
Source=pack743.org;Initial Catalog=Pack743ASP;Persist Security
Info=True;User ID=pack743org;Password=*******"
providerName="System.Data.SqlClient" />
<add name="LocalSqlServer" connectionString="Data
Source=pack743.org;Initial Catalog=Pack743ASP;Persist Security
Info=True;User ID=pack743org;Password=*******"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<profile enabled ="true" defaultProvider ="Scout_Profiles" >
<providers>
<add name ="Scout_Profiles"
type="System.Web.Profile.SqlProfileProvider, System.Web,
Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="LocalSqlServer"
applicationName="Scout_Profiles_App"/>
</providers>
<properties>
<add name ="FullName" defaultValue="Cub Scout" />
<add name ="FirstName" defaultValue ="Cub"/>
<add name ="LastName" defaultValue ="Scout"/>
<add name ="Den" defaultValue ="Pack743"/>
<add name ="PhoneNumber" defaultValue ="999-999-9999"/>
<add name ="MotherName" defaultValue ="Mother"/>
<add name ="FatherName" defaultValue ="Father"/>
<add name ="Email" defaultValue ="Cu*@pack743.org"/>
<add name ="Posistion" defaultValue ="User"/>
</properties>
</profile>
<compilation
defaultLanguage="c#"
debug="true"
/>
<customErrors
mode="Off"
/>
<authentication mode="Forms" />
<authorization>
<allow users="*" />
</authorization>
<trace
enabled="false"
requestLimit="10"
pageOutput="false"
traceMode="SortByTime"
localOnly="true"
/>
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
/>

</system.web>

</configuration>

Mar 7 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.