How to get name and id of the user, who is logged into the system

Hi!
I want to display the name on the dashboard who is logged into the system and store the registration id of the user who is logged into the system

1 Reply

SP Sowmiya Padmanaban Syncfusion Team March 12, 2020 07:16 AM UTC

Hi Ishan,  
 
Greetings from Sycnfusion support. 
 
We have checked your reported query and assume that your requirement is to display some text(User Name) inside the DashboardLayout component. Yes, it is achievable in DashboardLayout component. You can display the text  or any other component (chart, grid) inside the DashboardLayout component based on your requirement using ContentTemplate. 
 
Refer the below code snippet. 
@Html.EJS().DashboardLayout("defaultLayout").Columns(6).Panels(Panel => 
{ 
  Panel.SizeX(1).SizeY(1).Row(0).Col(0).ContentTemplate(@<div> 
                                                        <div class="e-panel-header"> Customer Details </div> 
                                                        <div class="e-panel-content"> 
                                                            <div style="height:20px">UserName - @username</div> 
                                                            <div>Registration id - @RegistrationID</div> 
                                                        </div></div>).Add(); 
}).Render() 
 
Refer the sample link below. 
 
To know more about the DashboardLayout component. Refer the below links. 
 
 
 
Dashboard Layout is layout component to display content in grid structured panels with rich features. We suggest you to check with public forums to know how to get user name who logged in your application. Similar to the below links. 
 
 
 
 
Please get back to us if you need any assistance related to Syncfusion controls. We will be happy to assist you. 
 
Regards,  
Sowmiya.P 


Loader.
Up arrow icon