c# - Nullref Exc. on label detected by intellisense? -


OK, I'm fairly new to the ASP.NET and MasterPage concept and there is an error that I can not know.

This is a part of my default.aspx:

  & lt; Asp: Content ID = "ContentLoginContent" ContentPlaceHolderID = "LoginContentPlaceHolder" runat = "server" & gt; & Lt; Div id = "contentloginDiv" & gt; You have & lt; Asp: Label ID = "MemberCreditLabel" runat = "server" text = "0" & ​​gt; & Lt; / Asp: Label & gt; Credit & Lt; / Div & gt;  

This is the relevant part of my default.aspx.cs:

  Public Partial Class _Default: System.Web. UI.Page {Secure Zero Page_init (Object Sender, EventArgse E) {} Secure Zero Page_load (Object Sender, EventErgus E) {if (UserIsinol ("Authentic")) {Member CreditLabel. Text = "hello"; }}}  

I get a null exception on member credit labels. It has been detected with intelliSense. I think the problem may be that content placeholder "contentalcontent content" is entered only if Happens when it is logged in. This is a part of my master page:

  & lt; Asp: LoginView ID = "MemberLoginView" runat = "server" & gt; & Lt; AnonymousTemplate & gt; & Lt; ASP: Login ID = "Login Inbox" Runat = "Server" height = "137 PX" style = "margin-left: 0px" width = "16px" & gt; & Lt; / ASP: Login & gt; & Lt; / AnonymousTemplate & gt; & Lt; LoggedInTemplate & gt; Welcome & lt; Asp: LoginName ID = "MemberLoginName" runat = "server" / & gt; ! & Lt; Asp: LoginStatus id = "Member login status" runat = "server" /> & Lt; Asp: ContentPlaceHolder id = "login content playhead" runat = "server" & gt; // Is this a problem? & Lt; / ASP: ContentPlaceHolder & gt; & Lt; / LoggedInTemplate & gt; & Lt; / ASP: LoginView & gt;  

What I want to do to show the stored amount in a database is the work I want to retrieve the data. I currently take the username of the logged-in user and want to get the credit amount associated with the user. But this strange error with the label stops me altogether. Maybe it is to do with a masterpace concept which I have not yet crossed. any idea?

It is apparently:

This is by design content Control content changes the contents of the placeholder control which is inside a template. Thus the text box actually gets instatiated into a template and thus should be seen using FindControl - Direct access will not be available.

Thank you,

Although the webplate and device team, using a recursive gate control, I was not really able to hold control inside the logged enamel - in fact the page In the markup of the, Reisher was complaining that it can not be done to solve the symbol "login content pleases" - that is, the content placeholder can not get it correctly on the masterpiece.

Is there any way that you can show credits on all certified pages?

Or, you can only log in with a log-in instance, count the credentials in the login string, and drop it inside the content placeholder.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -