[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

06/23/2008 at 01:50PM PDT, ID: 23509074
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.2

Page_Load event executing twice, after Login

Asked by allanmark in Programming for ASP.NET

Tags: MS, VWD, 2005; Express, ASP.NET

Greetings all

I have a somewhat strange scenario. I have a page with a login control on it. in my Page_Load event I am calling a small routine tahts ets various button states. I placed a breakpoint within that routine, in order to do some checking. What I noticed was that after entering user name and password and clicking the LogIn button, my breakpoint was reached twice!

Any explanations?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
342:
343:
344:
345:
346:
347:
348:
<%@ Page Language="C#" MasterPageFile="~/Scribble01.master" AutoEventWireup="true" CodeFile="Members.aspx.cs" Inherits="Pages_Member_Members" Title="Member Page" %>
<%@ MasterType VirtualPath="~/Scribble01.master" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 
<div id = "membershipTop">
 
    <div id="memberLog">
    
        <center>
        <asp:LoginStatus ID="loginMember" runat="server" CssClass="loginStatus" OnLoggedOut="loginMember_LoggedOut" />       &nbsp;<!-- Start: Login control (converted to Template) -->    
        
       <asp:Login ID="logMember" runat="server" CssClass="login" TitleText="Membership Login"
        FailureText="Login attempt was unsuccessful."  UserNameLabelText="Member:"
        PasswordLabelText= "Password:" UserNameRequiredErrorMessage="Member is required." >
        <TitleTextStyle BackColor="CornflowerBlue" Font-Bold="True" />
     <LayoutTemplate>
         <table border="0" cellpadding="1" cellspacing="0" style="border-collapse: collapse">
             <tr>
                 <td>
                     <table border="0" cellpadding="0">
                         <tr>
                             <td align="center" colspan="2" style="font-weight: bold; background-color: cornflowerblue">
                                 Membership Login</td>
                         </tr>
                         <tr>
                             <td align="right">
                                 <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Member:</asp:Label></td>
                             <td>
                                 <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
                                 <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                                     ErrorMessage="Member is required." ToolTip="Member is required." ValidationGroup="logDefault">*</asp:RequiredFieldValidator>
                             </td>
                         </tr>
                         <tr>
                             <td align="right">
                                 <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label></td>
                             <td>
                                 <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
                                 <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                                     ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="logDefault">*</asp:RequiredFieldValidator>
                             </td>
                         </tr>
                         <tr>
                             <td colspan="2">
                                 <asp:CheckBox ID="RememberMe" runat="server" Text="Remember me next time." />
                             </td>
                         </tr>
                         <tr>
                             <td align="center" colspan="2" style="color: red">
                                 <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
                             </td>
                         </tr>
                         <tr>
                             <td align="right" colspan="2">
                                 <asp:Button ID="btnForgot" runat="server" Text="Forgot Password" ValidationGroup="logForgot" OnClick="btnForgot_Click" />
                                 <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In" ValidationGroup="logDefault" />
                             </td>
                         </tr>
                     </table>
                 </td>
             </tr>
         </table>
     </LayoutTemplate>
    </asp:Login>
        <!-- End: Login control (converted to Template) -->    
        </center>    
    
    <!-- end <div id="memberLog"> -->    
    </div>
    
    <asp:LoginView ID="logViewTop" runat="server"  >        
    
    <AnonymousTemplate>
    <div style ="position: relative; top: opx; width: 76%;">
        <h3>Welcome to our membership page!</h3>
        <p>Please complete the membership application, below, as completely as possible, before submitting.</p>
        <p>Applications are reviewed on a weekly basis. You will be notified via email (sent to the address provided in your application - please ensure that this is correct).</p>
        <p class="smallerFontSize">Note: Membership decisions are, at all times, the prerogative of the committee, whose decision shall be final.</p>              
    </div>
    </AnonymousTemplate>
            
    <LoggedInTemplate>
    <div style ="position: relative; top: opx; width: 76%;">    
        <h3>Welcome!</h3>
        <p>As a logged in member you can use this page to:</p>
        <ul id="memberOptions" type="circle">
            <li>Change your password</li>
            <li>Change your email address</li>
        </ul>
    </div>
    </LoggedInTemplate>
    
    </asp:LoginView>
    <!-- End <LoginView id="logViewTop"> -->
     
<!-- end <div id="membershipTop"> -->        
</div>
 
    
<div id = "membershipBody">
 
     <asp:LoginView ID="logViewBody" runat="server" >
     
        <AnonymousTemplate>
        <center>
        <asp:Panel ID="pnlNonMembership" runat="server" CssClass="membershipPanel" Width="85%">
    
        <!-- Table to sort out the membership application info. -->
        <table id="membershipApp" style="position: relative" >
                <tr>            
                <!-- Row: Name -->
                <td>
	            	<asp:Label ID="lblName" runat="server" CssClass="smallerFontSize" AssociatedControlID="txtName">Name:</asp:Label>
	            </td>
                <td colspan="4">
                    <asp:TextBox ID="txtName" runat="server" Width="140px"></asp:TextBox>		
                    <asp:RequiredFieldValidator ID="rfvName" runat="server" ControlToValidate="txtName"
                        ErrorMessage="*" SetFocusOnError="True" Style="position: relative" ValidationGroup="UserApply"></asp:RequiredFieldValidator></td>            
    	    <!-- End: Row: Name -->
            </tr>
        
    	    <tr>	    
	        <!-- Row: Surname  -->
                <td>
                    <asp:Label ID="lblSurname" runat="server" CssClass="smallerFontSize" AssociatedControlID="txtSurname">Surame:</asp:Label>
                </td>
                <td colspan="4">
                <asp:TextBox ID="txtSurname" runat="server" Width="180px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvSurname" runat="server" ControlToValidate="txtSurname"
                        ErrorMessage="*" SetFocusOnError="True" Style="position: relative" ValidationGroup="UserApply"></asp:RequiredFieldValidator></td>            
    	    <!-- End: Row: Surname -->
            </tr>
       
            <tr>        
        	<!-- Row: Blank -->
                <td colspan="5" height="12"></td>
            </tr>
        
            <tr>                
    	    <!-- Row: DOB -->
                <td>
		            <asp:Label ID="lblDob" runat="server" CssClass="smallerFontSize" AssociatedControlID="txtDob">BirthDate:</asp:Label>
                </td>
                <td colspan="4">
	    	        <asp:TextBox ID="txtDob" runat="server" Width="75px"></asp:TextBox>
                    <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender1" runat="server" Mask="9999/99/99" MaskType="Date" CultureName="en-za" TargetControlID="txtDob">
                    </ajaxToolkit:MaskedEditExtender>
                    <ajaxToolkit:MaskedEditValidator ID="MaskedEditValidator1" runat="server" ControlExtender="MaskedEditExtender1"
                        ControlToValidate="txtDob" EmptyValueMessage="Required" InvalidValueMessage="Wrong" 
                        IsValidEmpty="False" ></ajaxToolkit:MaskedEditValidator><!-- End: Row: DOB --></tr>
 
            <tr>                
	        <!-- Row: Blank -->
                <td colspan="5" height="12"></td>
	        </tr>
 
            <tr>        
	        <!-- Row: User1 -->
                <td>
		            <asp:Label ID="lblUser1" runat="server" CssClass="smallerFontSize" AssociatedControlID="txtUser1">Username (preferred):</asp:Label>
                </td>
                <td colspan="4">
		            <asp:TextBox ID="txtUser1" runat="server" Width="120px"></asp:TextBox>
		            <asp:RequiredFieldValidator ID="rfvUser1" runat="server" ControlToValidate="txtUser1"
                        ErrorMessage="*" SetFocusOnError="True" Style="position: relative" ValidationGroup="UserApply"></asp:RequiredFieldValidator></td>            
	        <!-- End: Row" User1 -->
            </tr>
 
            <tr>        
	        <!-- Row: User2 -->
                <td>
    		<asp:Label ID="lblUser2" runat="server" CssClass="smallerFontSize" AssociatedControlID="txtUser2">Username (alternate):</asp:Label>
                </td>
                <td colspan="4">
		            <asp:TextBox ID="txtUser2" runat="server" Width="120px"></asp:TextBox>
		            <asp:RequiredFieldValidator ID="rfvUser2" runat="server" ControlToValidate="txtUser2"
                        ErrorMessage="*" SetFocusOnError="True" Style="position: relative" ValidationGroup="UserApply"></asp:RequiredFieldValidator></td>            
	        <!-- End: Row: User2 -->
            </tr>
        
            <tr>                
	        <!-- Row: Blank  -->
                <td colspan="5" height="12"></td>
            </tr>
        
            <tr>                
	        <!-- Row: Email -->
                <td>
		            <asp:Label ID="lblEmail" runat="server" CssClass="smallerFontSize" AssociatedControlID="txtEmail">Email:</asp:Label>
                </td>
                <td colspan="4">
	    	        <asp:TextBox ID="txtEmail" runat="server" Width="200px"></asp:TextBox>
	    	        <asp:RequiredFieldValidator ID="rfvEmail" runat="server" ControlToValidate="txtEmail"
                        ErrorMessage="*" SetFocusOnError="True" Style="position: relative" ValidationGroup="UserApply"></asp:RequiredFieldValidator></td>            
    	    <!-- End: Row: Email -->
            </tr>
        
            <tr>                
	        <!-- Row: ConfirmEmail -->
                <td>
		            <asp:Label ID="lblConfEmail" runat="server" CssClass="smallerFontSize" AssociatedControlID="txtConfEmail">Confirm Email:</asp:Label>
                </td>
                <td colspan="4">
		            <asp:TextBox ID="txtConfEmail" runat="server" Width="200px" Style="position: relative"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvConfEmail" runat="server" ControlToValidate="txtConfEmail"
                        ErrorMessage="*" SetFocusOnError="True" ValidationGroup="UserApply"></asp:RequiredFieldValidator>
                    <asp:CompareValidator ID="cmpvEmail" runat="server" ControlToCompare="txtEmail" ControlToValidate="txtConfEmail"
                        ErrorMessage="Must match email!" SetFocusOnError="True" Style="position: relative"
                        ValidationGroup="UserApply"></asp:CompareValidator></td>            		                                
    	    <!-- End: Row: ConfirmEmail -->
            </tr>
        
            <tr>                
	        <!-- Row: Blank -->
                <td colspan="5" height="12"></td>
            </tr>
        
            <tr>                
	        <!-- Row: Message -->
                <td>
    		        <asp:Label ID="lblMessage" runat="server" CssClass="smallerFontSize" AssociatedControlID="txtMessage">Message:</asp:Label>
                </td>
                <td colspan="4">
		            <asp:TextBox ID="txtMessage" runat="server" TextMode="MultiLine" Width="620px" Height="200px"></asp:TextBox>
                </td>
	        <!-- End: Row: Message -->
            </tr>
 
            <tr>                
	        <!-- Row: Blank  -->
                <td colspan="5" height="12"></td>
            </tr>
              
            <tr>                
	        <!-- Row: Sample -->
                <td>
		            <asp:Label ID="lblSample" runat="server" CssClass="smallerFontSize" AssociatedControlID="txtSample">Sample of your writing:</asp:Label>
                </td>
                <td>
	    	        <asp:TextBox ID="txtSample" runat="server" TextMode="MultiLine" Width="620px" Height="350px"></asp:TextBox>
	    	        <asp:RequiredFieldValidator ID="rfvSample" runat="server" ControlToValidate="txtSample"
                        ErrorMessage="*" SetFocusOnError="True" Style="position: relative" ValidationGroup="UserApply"></asp:RequiredFieldValidator></td>            
                <td colspan="3">
                    <center>
                   <asp:FileUpload id="uplSelect" runat="server" Width="140px"  />
                    <asp:Button ID="btnUpLoad" runat="server" Text="Upload text file" Tooltip="Currently only text files accepted"/>&nbsp;
                    <br/>           
                    <br/>           
                    <asp:Button ID="btnClear" runat="server" Text="Clear sample" ToolTip="Clears all text from the sample"/>                
                    </center>
                </td>            
	        <!-- End: Row: Sample -->
            </tr>              
              
            <tr>                
	        <!-- Row: Blank -->
                <td colspan="5" style="height: 10px"></td>
            </tr>
    
        <!-- End: table id="membershipApp". -->
        </table>     
    
        <asp:Button ID="btnSubmitApp" runat="server" Text="Submit Application" ValidationGroup="UserApply" Font-Bold="True" Font-Size="Larger" ForeColor="Red" />
    
        </asp:Panel>
 
     
        </center>       
        <!-- end - AnonymousTemplate for LoginView: logViewBody -->
        </AnonymousTemplate>                        
        
        <LoggedInTemplate>        
 
        <center>
        <asp:Panel ID="pnlMembership" runat="server" CssClass="membershipPanel" Width="400px">
 
        <table id="tblLoggedIn"   style="position: relative">
            <tr>
                <td style="width: 110px">
                <asp:Label ID="lblUser" runat="server" CssClass="smallerFontSize" >Username: </asp:Label>
                </td>
                <td style="width: 240px">
                <asp:Label ID="lblUsername" runat="server" CssClass="labelHighlighted"></asp:Label>
                </td>
            </tr>
            <tr>
                <td colspan="2" height="12px"></td>
            </tr>            
            <tr>
                <td style="width: 110px; height: 30px;">
                <asp:Label ID="lblPassword" runat="server" AssociatedControlId="txtPassword" CssClass="smallerFontSize" >New password: </asp:Label>
                </td>
                <td style="width: 240px; height: 30px;">
                <asp:TextBox ID="txtPassword" runat="server" Width="110px" TextMode="Password"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="width: 110px">
                <asp:Label ID="lblPassConf" runat="server" AssociatedControlId="txtPassConfirm" CssClass="smallerFontSize">Comfirm password:</asp:Label>
                </td>
                <td style="width: 240px">
                <asp:TextBox ID="txtPassConfirm" runat="server" Width="110px" TextMode="Password"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td colspan="2" height="12px"></td>
            </tr>            
            <tr>
                <td style="width: 110px">
                <asp:Label ID="lblEmail" runat="server" AssociatedControlId="txtEmail" CssClass="smallerFontSize">Email: </asp:Label>
                </td>
                <td style="width: 240px">
                <asp:TextBox ID="txtEmail" runat="server" Width="240px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="width: 110px">
                <asp:Label ID="lblConfEmail" runat="server" AssociatedControlId="lblConfEmail" CssClass="smallerFontSize">Confirm Email: </asp:Label>
                </td>
                <td style="width: 240px">
                <asp:TextBox ID="txtConfirmEmail" runat="server" Width="240px"></asp:TextBox>
                </td>
            </tr>
            <tr>
            <!-- Row: Blank -->
            <td colspan="2" style="height: 10px"></td>
            </tr>
        </table>
        
        <asp:Button ID="btnSubmitChanges" runat="server" Text="Submit Changes" Font-Bold="True" Font-Size="Larger" ForeColor="Red"  />        
        
        </asp:Panel>
        </center>
        
         <!-- end - LoggedInTemplate for LoginView: logViewBody -->
        </LoggedInTemplate>
     
 
     </asp:LoginView>
     <!-- End <LoginView id="logViewBody"> -->     
     
 
 
<!-- end <div id="membershipTop"> -->        
</div>
 
</asp:Content>
[+][-]06/23/08 01:57 PM, ID: 21850293

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Programming for ASP.NET
Tags: MS, VWD, 2005; Express, ASP.NET
Sign Up Now!
Solution Provided By: prairiedog
Participating Experts: 2
Solution Grade: A
 
 
[+][-]06/23/08 05:07 PM, ID: 21851492

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/23/08 11:19 PM, ID: 21852872

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/23/08 11:24 PM, ID: 21852886

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/24/08 04:38 AM, ID: 21854526

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06/24/08 04:59 AM, ID: 21854679

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/24/08 06:25 AM, ID: 21855422

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/27/08 08:57 AM, ID: 21885092

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/27/08 09:26 AM, ID: 21885380

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91 / EE_QW_2_20070628