Click here to Skip to main content
15,887,477 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a web application. asp:LoginName control is used in it.

It is working fine locally.

but, when i deploy it on the server the control is unaccessible in the code behind and through exception
I have installed .Net framework 4.0 and 4.5 on the server as well
but the result is same.

Windows server 2008 R2 is installed on the server

Please guide.

XML
<asp:LoginView ID="LoginView1" runat="server">
   <LoggedInTemplate>
       <asp:LoginName ID="LoginName1" runat="server" FormatString=" | " />
       <asp:LoginStatus ID="LoginStatus1" runat="server" ForeColor="White" Font-Bold="true"
           OnLoggingOut="LoginStatus1_LoggingOut" />
   </LoggedInTemplate>
</asp:LoginView>

C#
LoginName loginName1 = (LoginName)LoginView1.FindControl("LoginName1");
loginName1.FormatString = "Welcome " + Session["LOGIN_EMP_NAME"] + " | ";
Posted
Updated 23-Apr-13 21:32pm
v2
Comments
bbirajdar 24-Apr-13 3:06am    
And the error message is .... ???
xprtguro 24-Apr-13 3:35am    
Error Message:"Object reference not set to an instance of an object."

When try to look into the page "View source", found nohting with LoginView1 or LoginView1_ ...
rahulhamdapurkar 28-May-13 7:00am    
facing same problem, did you get any solution?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900