Question : asp.net: How to determine if a when a user login. is an Admin Account, * the menu is selected to show admin pages  & reports.

I  have included in the code block my main.master page -> how do to determine if a when a user login is an Admin Account the menu is selected to show admin pages  & reports.
right now every login is going to this view LoginView2
 what i need is a way to detect a admin User an divert that admin user to  LoginView3
------------------------
      <asp:LoginView ID="LoginView2" runat="server">
                            <LoggedInTemplate>
                                <p class="style26">
                                    <span lang="en-us">
                                    <span class="style25"><a href="../User/updateprofile.aspx">Update Profile</a></span><br class="style25" />
                                    <span class="style25"><a href="../User/resetpassword.aspx">Change Password</a></span><br
                                        class="style25" />
                                    <span class="style25"><a href="../User/newequipment.aspx">New Equipment</a></span><br
                                        class="style25" />
                                    <span class="style25"><a href="../User/UpdateEquipment.aspx">Update Equipment</a></span><br
                                        class="style25" />
                                    <span class="style25"><a href="../User/SummaryRpt.aspx">Sales Report</a></span><br
                                        class="style25" />
                                   
                                    </span>
                                   
                                </p>
                                     
                            </LoggedInTemplate>
                        </asp:LoginView>
                          <br />

________________
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:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Master Language="VB" %>

<script runat="server">

 
    
</script>

<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 1</title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<style type="text/css">
    .style1 {
	text-align: right;
}
.style8 {
	margin-left: 0px;
}
.style9 {
	border-width: 0;
}
.style12 {
	border-collapse: collapse;
}
.style13 {
	text-align: left;
}
.style15 {
	font-size: x-small;
	font-family: Arial, Helvetica, sans-serif;
}
.style16 {
	border-color: #FFFFFF;
	border-width: 0;
	background-color: #FFFFFF;
	border-collapse: collapse;
}
.style19 {
	text-align: center;
	font-size: x-small;
	font-family: Arial, Helvetica, sans-serif;
	background-color: #F0F0F0;
}
.style21 {
	text-align: left;
	background-color: #F0F0F0;
}
.style22 {
	text-align: left;
    }

    .style24
    {
        text-align: center;
    }

    .style25
    {
        font-family: Arial, Helvetica, sans-serif;
        font-size: small;
    }
    .style26
    {
        line-height: 150%;
        text-align: center;
    }

    </style>
<script type="text/javascript">
<!--
function FP_preloadImgs() {//v1.0
 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
 for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
}

function FP_swapImgRestore() {//v1.0
 var doc=document,i; if(doc.$imgSwaps) { for(i=0;i<doc.$imgSwaps.length;i++) {
  var elm=doc.$imgSwaps[i]; if(elm) { elm.src=elm.$src; elm.$src=null; } } 
  doc.$imgSwaps=null; }
}

function FP_swapImg() {//v1.0
 var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
 n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
 elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}

function FP_goToURL(url) {//v1.0
 window.location=url;
}
// -->
</script>
</head>

<body onload="FP_preloadImgs(/*url*/'../images1/homebtndown.png',/*url*/'../images1/advertisebtndown.png',/*url*/'../images1/aboutusbtndown.png',/*url*/'../images1/contactusbtndown.png')" 
    background="../images1/bkgrnd.jpg" bgcolor="White">

	<form id="form1" runat="server">

	<table cellspacing="0" cellpadding="0" align="center" id="table1" style="width: 1000px" class="style12">
		<tr>
			<td colspan="7" class="style13" valign="bottom" style="height: 50px">
	<asp:Image ID="Logo" runat="server" imageUrl="~/images1/logo.png" width="607" height="51" /><br />
			</td>
		</tr>
		<tr>
			<td class="style1" colspan="7" valign="bottom" style="height: 19px">
                <asp:LoginView ID="LoginView1" runat="server">
                    <LoggedInTemplate>
                        <span lang="en-us" 
                            style="font-family: Arial, Helvetica, sans-serif; font-size: medium; color:Gray">
                        Welcome Back
                        </span>
                        <asp:LoginName ID="LoginName1" runat="server" Font-Names="Arial" 
                            Font-Size="Medium" ForeColor="#000099" />
                    </LoggedInTemplate>
                    <AnonymousTemplate>
                        <span style="font-family:Arial; font-size:medium; font-weight:normal; color:Gray">
                        Welcome Guest</span>
                    </AnonymousTemplate>
                </asp:LoginView>
                <span lang="en-us">
                &nbsp;&nbsp;</span><br />
            </td>
		</tr>
		<tr>
			<td class="style9" valign="top">
			    <asp:Image ID="Image1" runat="server" ImageUrl="~/images1/leftmenubar.png" ImageAlign="Left" />
                </td>
			<td valign="top">
			    <img src="../images1/homebtn.png" id="img1" onmouseout="FP_swapImgRestore()" onmouseover="FP_swapImg(1,1,/*id*/'img1',/*url*/'../images1/homebtndown.png')" style="float: left" align="top" onclick="FP_goToURL(/*href*/'../Annonymous/index.aspx')" /></td>
			<td valign="top">
			    <img src="../images1/subscribebtn.png" id="img3" onmouseout="FP_swapImgRestore()" onmouseover="FP_swapImg(1,1,/*id*/'img3',/*url*/'../images1/subscribebtndown.png');" style="float: left" align="top" onclick="FP_goToURL(/*href*/'../Newsletter/subscribe.aspx');" /></td>
			<td valign="top">
			    <img src="../images1/advertisebtn.png" id="img2" onmouseout="FP_swapImgRestore()" onmouseover="FP_swapImg(1,1,/*id*/'img2',/*url*/'../images1/advertisebtndown.png');" style="float: left" class="style8" align="top" onclick="FP_goToURL(/*href*/'../Annonymous/rates.aspx');" /></td>
			<td valign="top">
			    <img src="../images1/aboutusbtn.png" id="img4" onmouseout="FP_swapImgRestore()" onmouseover="FP_swapImg(1,1,/*id*/'img4',/*url*/'../images1/aboutusbtndown.png');" style="float: left" align="top" onclick="FP_goToURL(/*href*/'../Annonymous/aboutus.aspx');" /></td>
			<td valign="top">
			    <img src="../images1/contactusbtn.png" id="img5" onmouseout="FP_swapImgRestore()" onmouseover="FP_swapImg(1,1,/*id*/'img5',/*url*/'../images1/contactusbtndown.png');" style="float: right" align="top" onclick="FP_goToURL(/*href*/'../Annonymous/contactus.aspx');" /></td>
			<td valign="top">
			    <asp:Image ID="Image2" runat="server" ImageUrl="../images1/rightmenubar.png" ImageAlign="Right" /></td>
		</tr>
		</table>
		<table style="width: 1005px" cellspacing="0" cellpadding="10" align="center" id="table2" class="style16">
			<tr>
				<td style="width: 150px" valign="top" class="style21">
			<asp:ContentPlaceHolder runat="server" id="ContentPlaceHolder1">
			<p>&nbsp;</p>
			</asp:ContentPlaceHolder>
				</td>
				<td valign="top" class="style22">
				<asp:ContentPlaceHolder runat="server" id="ContentPlaceHolder2">
					<asp:ContentPlaceHolder ID="ContentPlaceHolder4" runat="server">		    
					</asp:ContentPlaceHolder>
					</asp:ContentPlaceHolder>
				</td>
				<td style="width: 150px" valign="top" class="style24" bgcolor="#F0F0F0">
                <span lang="en-us">
                <asp:LoginStatus ID="LoginStatus1" runat="server" Font-Names="Arial" 
                    ForeColor="Blue" LogoutAction="Redirect" 
                    LogoutPageUrl="~/Annonymous/index.aspx" LoginText="" />
                </span>
                    <br />
                    <div>
				    <asp:Login ID="Login1" runat="server" TextLayout="TextOnTop" 
                            DisplayRememberMe="False" Font-Names="Arial" Font-Size="Small" 
                            VisibleWhenLoggedIn="False" BorderStyle="None">
                        <LayoutTemplate>
                            <table border="0" cellpadding="0" cellspacing="0" 
                                style="border-collapse:collapse;">
                                <tr>
                                    <td>
                                        <table border="0" cellpadding="-1" >
                                            <tr>
                                                <td class="style24">
                                                    <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User 
                                                    Name:</asp:Label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="style24">
                                                    <asp:TextBox ID="UserName" runat="server" Font-Size="X-Small" Height="15px" 
                                                        Width="100px"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" 
                                                        ControlToValidate="UserName" ErrorMessage="User Name is required." 
                                                        ToolTip="User Name is required." ValidationGroup="ctl00$Login1">*</asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="style24">
                                                    <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="style24">
                                                    <asp:TextBox ID="Password" runat="server" Font-Size="X-Small" Height="15px" 
                                                        TextMode="Password" Width="100px"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" 
                                                        ControlToValidate="Password" ErrorMessage="Password is required." 
                                                        ToolTip="Password is required." ValidationGroup="ctl00$Login1">*</asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="center" style="color:Red;">
                                                    <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="style24">
                                                    <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In" 
                                                        ValidationGroup="ctl00$Login1" />
                                                    <br /> 
                                                    <br />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="style24">
                                                    <span lang="en-us"><a href="../Annonymous/forgotpassword.aspx">Forgot Password?</a></span></td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </LayoutTemplate>
                    </asp:Login>
			        </div>
			        <div class="style24">
                        <asp:LoginView ID="LoginView2" runat="server">
                            <LoggedInTemplate>
                                <p class="style26">
                                    <span lang="en-us">
                                    <span class="style25"><a href="../User/updateprofile.aspx">Update Profile</a></span><br class="style25" />
                                    <span class="style25"><a href="../User/resetpassword.aspx">Change Password</a></span><br 
                                        class="style25" />
                                    <span class="style25"><a href="../User/newequipment.aspx">New Equipment</a></span><br 
                                        class="style25" />
                                    <span class="style25"><a href="../User/UpdateEquipment.aspx">Update Equipment</a></span><br 
                                        class="style25" />
                                    <span class="style25"><a href="../User/SummaryRpt.aspx">Sales Report</a></span><br 
                                        class="style25" />
                                    
                                    </span>
                                    
                                </p>
                                     
                            </LoggedInTemplate>
                        </asp:LoginView>
			        <br />
			        </div>
			<asp:ContentPlaceHolder runat="server" id="ContentPlaceHolder3">
			
			</asp:ContentPlaceHolder>
				</td>
			</tr>
			<tr>
				<td colspan="3" class="style19">
			<a href="../Annonymous/terms.aspx"><span class="style15">Terms &amp; Conditions</span></a><span class="style15">&nbsp; 
                    |&nbsp; 				</span>
			<a href="../Annonymous/contactus.aspx"><span class="style15">Contact Us</span></a><span class="style15">&nbsp; 
                    |&nbsp;
				<a href="../Annonymous/index.aspx">Home</a>&nbsp; |&nbsp;
                    <a href="../Annonymous/reportingspam.aspx">Report Spam</a></span><br />
                    <br />
			                            © 2009-2010 Used Vocational Trucks.com&nbsp; - All rights reserved</td>
			</tr>
	</table>
	
	</form>
</body>

</html>

Answer : asp.net: How to determine if a when a user login. is an Admin Account, * the menu is selected to show admin pages  & reports.

Open the aspx file in design view and then try. you will be able to access the variables
Random Solutions  
 
programming4us programming4us