Newbie - html helpers - Html.RenderPartial("LogOnUserControl")

Z

Zalek Bloom

1. I created a web project using MVC2. On the Maste Page I see a code:
<% Html.RenderPartial("LogOnUserControl"); %>

My question - where I can find a definition of "LogOnUserControl"? The
value displayed on the page is:
"Welcome zaleki!" - zalek is my my userid I used to logon, but where
is a code which concatinate "Welcome" "zalek" and "!"

2. where I can find a manual with explanations of existing html
helpers?

Thanks,

Zalek
 
Z

Zalek Bloom

1. I created a web project using MVC2. On the Maste Page I see a code:
<% Html.RenderPartial("LogOnUserControl"); %>

My question - where I can find a definition of "LogOnUserControl"? The
value displayed on the page is:
"Welcome zaleki!" - zalek is my my userid I used to logon, but where
is a code which concatinate "Welcome" "zalek" and "!"

2. where I can find a manual with explanations of existing html
helpers?

Thanks,

Zalek

Well - I found the answer.
I am writing it in case I will forgot the answer, or if another poor
soul will have the same problem:

html helper - Html.RenderPartial - just renders partial html.
"LogOnUserControl" - an user control defined in /shared folder as
LogOnUserControl.ascx

Definition of LogOnUserControl.ascx is:


<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%
if (Request.IsAuthenticated) {
%>
Welcome <b><%: Page.User.Identity.Name %></b>!
[ <%: Html.ActionLink("Log Off", "LogOff", "Account") %> ]
<%
}
else {
%>
[ <%: Html.ActionLink("Log On", "LogOn", "Account") %> ]
<%
}
%>


Zalek
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top