Tuesday, 28 October 2014

UserName movement in ep page in ax 2012

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.DataVisualization.Charting;
using System.Web.UI.WebControls;
using Microsoft.Dynamics.Framework.Portal.UI.WebControls;
using Microsoft.Dynamics.Framework.Portal.UI.WebControls.WebParts;
using Microsoft.Dynamics.Framework.BusinessConnector.Session;
using Microsoft.Dynamics.AX.Framework.Portal.Data;
using System.Data;
using System.Data.SqlClient;
using Microsoft.Dynamics.Framework.BusinessConnector.Adapter;
using System.Collections;
using Microsoft.Dynamics.Framework.Portal.UI;

public partial class HomeSceenDivisionDisplay : System.Web.UI.UserControl
{   
    private ISession AxSession
    {
        get
        {
            AxBaseWebPart webpart = AxBaseWebPart.GetWebpart(this);
            return webpart == null ? null : webpart.Session;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string userName = AxSession.AxaptaAdapter.CallStaticRecordMethod("UserAuthenticationTable", "userName", AxSession.SessionInfo.UserId.ToString()).ToString();
        string innerHTML = "<strong>";
        innerHTML += "Welcome, " + userName;
        innerHTML += "</strong>";
        WelcomeText.InnerHtml = innerHTML;
    }
   
}

------
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="HomeSceenDivisionDisplay.ascx.cs" Inherits="HomeSceenDivisionDisplay" %>
<marquee id="WelcomeText" runat="server" direction="left" scrollamount="2"></marquee>

if you getting the validation error : select Maqruee and select Internet Explorer 6.0
http://www.beansoftware.com/ASP.NET-FAQ/Moving-Text-ASP.NET.aspx
-----
    http://learnerzpage.com/learnerz/Course/Microsoft/Microsoft-Dynamics-AX-Technical


No comments:

Post a Comment