Hi Abhishek,
Thanks for the reply. I tried your sample but no luck. I guess there is something to do with the Login control, which is like this:
<asp:Login ID="LoginAdmin" runat="server" BackColor="White"
BorderColor="#CCCC99" BorderStyle="Solid" BorderWidth="1px"
EnableTheming="True" EnableViewState="True"
Font-Names="Verdana" Font-Size="10pt"
TitleText="Admin Log In" Font-Bold="False"
Width="340px" DestinationPageUrl="~/WebPages/Welcome.aspx"
onloggedin="LoginAdmin_LoggedIn" VisibleWhenLoggedIn="False">
<LoginButtonStyle Font-Bold="False" Font-Names="Verdana" Font-Size="Small" />
<LayoutTemplate>
<table border="0" cellpadding="1" cellspacing="0"
style="border-collapse:collapse;">
<tr>
<td>
<table border="0" cellpadding="0" style="width:530px;">
<tr>
<td align="center" colspan="2"
style="color:White;background-color:#6B696B;font-weight:bold;">
Admin Log In</td>
</tr>
<tr>
<td align="right" style="font-weight:normal;" class="style1">
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User
Name:</asp:Label>
</td>
<td align="left">
<asp:TextBox ID="UserName" runat="server" Width="170px"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server"
ControlToValidate="UserName" ErrorMessage="User Name is required."
ToolTip="User Name is required." ValidationGroup="LoginAdmin">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right" style="font-weight:normal;" class="style1">
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
</td>
<td align="left">
<asp:TextBox ID="Password" runat="server" TextMode="Password" Width="170px"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server"
ControlToValidate="Password" ErrorMessage="Password is required."
ToolTip="Password is required." ValidationGroup="LoginAdmin">*</asp:RequiredFieldValidator>
</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="center" colspan="2">
<asp:Button ID="LoginButton" runat="server" CommandName="Login"
Font-Bold="False" Font-Names="Verdana" Font-Size="Small" Text="Log In"
ValidationGroup="LoginAdmin" onclick="LoginButton_Click" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</LayoutTemplate>
<LabelStyle Font-Bold="False" />
<TitleTextStyle BackColor="#6B696B" Font-Bold="True" ForeColor="#FFFFFF" />
</asp:Login>