DEV Community

Cover image for Migration to .NET Core. Mission Complete
elanatframework
elanatframework

Posted on

Migration to .NET Core. Mission Complete

By using Code-Behind, Elanat managed to migrate from .NET Standard version 4.5 to .NET Core version 7.0 in a very short time.

Elanat is the largest .NET system that migrates from .NET Standard to .NET Core.
It is interesting to know that the duration of Elanat's migration from .NET Standard version 4.5 to .NET Core 7.0 was completed in less than 2 weeks, and this is an extraordinary record and a unique success for Elanat.

We maintain the Elanat source repository of the standard .NET version so that its comparison with the Elanat source repository of the .NET Core version is an important resource for computer systems researchers.

In addition to the advantages that .NET Core has over standard .NET (such as cross-platform), what benefits did the transition to .NET Core bring to Elanat?

  • The complexity of the add-on-oriented structure was reduced
  • Complete control over requests and the possibility of changing incoming requests from the client side
  • Increased server-side independence
  • The system became more agile and faster

We went through a lot of pains to create a add-on-oriented structure at Elanat. But by using the Code-Behind infrastructure, we left all the complications to bypass the loop (which existed in standard .NET).

Fortunately, all the data remained unchanged and the source code of the server side also had minor changes
For example, the App_Data directory remains as a relic of the .NET standard

Changes:

  • Ionic.Zip.dll was removed
  • ZipFileConnector.dll was removed
  • PathHandlersLoader.aspx was removed
  • PageHandlersLoader.aspx was removed
  • Added a ListItem class

We created some methods that were in standard .NET but not in .NET using Extension methods and the codes remained intact.
Example of SaveAs method on IFormFile

public static void SaveAs(this IFormFile PostedFile, string FilePath)
{
         using (Stream TmpFileStream = new FileStream(FilePath, FileMode.Create, FileAccess.ReadWrite))
         {
                  PostedFile.CopyTo(TmpFileStream);
         }
}
Enter fullscreen mode Exit fullscreen mode

Code-Behind creates the least load on the server, and setting the IgnoreViewAndModel attribute to false makes even the Model and View not be called.

Currently, Elanat is fully implemented on .NET Core version 7.0 and is undergoing software testing.

In August 2023, a new version ready to be installed and the source code of Elanat will be provided.

The codes below show the differences between model, view and controller in Elanat .NET standard version and Elanat .NET Core version.
These are login page codes and they are a bit long and are provided for computer system researchers and programming lovers.

Controller in .NET Standard

using System;
using System.Collections.Generic;

namespace elanat
{
    public partial class SiteLogin : System.Web.UI.Page
    {
        public SiteLoginModel model = new SiteLoginModel();

        protected void Page_Load(object sender, EventArgs e)
        {
            // Login Redirect
            CurrentClientObjectClass ccoc = new CurrentClientObjectClass();

            if (ccoc.RoleDominantType == "member")
                Response.Redirect(StaticObject.SitePath + "page_content/member/");

            if (ccoc.RoleDominantType == "admin")
                Response.Redirect(StaticObject.AdminPath);

            // Set Login Delay
            int LoginDelay = int.Parse(ElanatConfig.GetNode("delay/login").Attributes["value"].Value);
            System.Threading.Thread.Sleep(LoginDelay * 1000);


            if (!string.IsNullOrEmpty(Request.Form["btn_Login"]))
                btn_Login_Click(sender, e);


            if (!string.IsNullOrEmpty(Request.QueryString["el_return_url"]))
                model.ReturnUrlValue = Request.QueryString["el_return_url"];


            model.SetValue();
        }

        protected void btn_Login_Click(object sender, EventArgs e)
        {
            model.UserNameOrUserEmailValue = Request.Form["txt_UserNameOrUserEmail"];
            model.PasswordValue = Request.Form["txt_Password"];
            model.CaptchaTextValue = Request.Form["txt_Captcha"];
            model.LanguageOptionSelectedListValue = Request.Form["ddlst_Language"];
            model.SecretKeyValue = Request.Form["txt_SecretKey"];
            model.ReturnUrlValue = Request.Form["hdn_ReturnUrl"];


            if (!model.CaptchaTextValue.MatchByCaptcha())
            {
                model.CaptchaIncorrectErrorView();
                return;
            }

            CurrentClientObjectClass ccoc = new CurrentClientObjectClass();

            // Set User Admin Language
            DataUse.Language dul = new DataUse.Language();

            string CurrentLanguageId = model.LanguageOptionSelectedListValue;

            dul.FillCurrentLanguage(CurrentLanguageId);

            ccoc.AdminLanguageId = dul.LanguageId;
            ccoc.AdminLanguageGlobalName = dul.LanguageGlobalName;
            ccoc.AdminLanguageIsRightToLeft = dul.LanguageIsRightToLeft;


            if (string.IsNullOrEmpty(model.UserNameOrUserEmailValue) || string.IsNullOrEmpty(model.PasswordValue))
                ResponseForm.WriteLocalAlone(Language.GetAddOnsLanguage("you_should_fill_all_options", StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/"), "problem");


            // Check Secret Key
            if (ElanatConfig.GetNode("security/use_secret_key_for_login").Attributes["active"].Value == "true")
                if (model.SecretKeyValue != Security.GetCodeIni("secret_key"))
                    ResponseForm.WriteLocalAlone(Language.GetAddOnsLanguage("you_should_fill_secret_key", StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/"), "problem");


            if (!Security.LoginActiveCheck())
                ResponseForm.WriteLocalAlone(Language.GetAddOnsLanguage("login_is_inactive", StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/"), "problem");


            Security se = new Security();

            DataBaseSocket db = new DataBaseSocket();
            DataBaseDataReader dbdr = new DataBaseDataReader();
            dbdr.dr = db.GetProcedure("user_login_check", new List<string>() { "@user_name_or_user_email", "@password" }, new List<string>() { model.UserNameOrUserEmailValue.ToLower(), se.GetHash(model.PasswordValue) });

            if (dbdr.dr == null || !dbdr.dr.HasRows)
            {
                db.Close();

                ResponseForm.WriteLocalAlone(Language.GetAddOnsLanguage("the_information_you_entered_is_incorrect", StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/"), "problem");
            }

            dbdr.dr.Read();

            string UserId = dbdr.dr["user_id"].ToString();

            db.Close();

            DataUse.User duu = new DataUse.User();
            duu.FillCurrentUser(UserId);

            if (string.IsNullOrEmpty(duu.UserId))
                ResponseForm.WriteLocalAlone(Language.GetAddOnsLanguage("user_is_not_existed", StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/"), "problem");

            if (!duu.UserActive.ZeroOneToBoolean())
                ResponseForm.WriteLocalAlone(Language.GetAddOnsLanguage("user_is_inactive", StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/"), "problem");

            DataUse.Group dug = new DataUse.Group();
            if (!dug.GroupActiveCheck(duu.GroupId))
                ResponseForm.WriteLocalAlone(Language.GetAddOnsLanguage("your_group_is_inactive", StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/"), "problem");

            DataUse.Role dur = new DataUse.Role();
            if (!dur.RoleActiveCheckByGroupId(duu.GroupId))
                ResponseForm.WriteLocalAlone(Language.GetAddOnsLanguage("your_role_is_inactive", StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/"), "problem");


            if (ElanatConfig.GetNode("security/registered_user_after_accept_active_email").Attributes["active"].Value == "true")
            {
                // If Email Is Not Confirmed
                if (!duu.UserEmailIsConfirm.ZeroOneToBoolean())
                    ResponseForm.WriteLocalAlone(Language.GetAddOnsLanguage("user_email_is_not_confirm", StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/"), "problem");
            }


            model.Login(UserId);


            model.SuccessView();
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

Controller in .NET Core

using CodeBehind;

namespace Elanat
{
    public partial class SiteLoginController : CodeBehindController
    {
        public SiteLoginModel model = new SiteLoginModel();

        public void PageLoad(HttpContext context)
        {
            // Login Redirect
            CurrentClientObjectClass ccoc = new CurrentClientObjectClass();

            if (ccoc.RoleDominantType == "member")
                context.Response.Redirect(StaticObject.SitePath + "page_content/member/");

            if (ccoc.RoleDominantType == "admin")
                context.Response.Redirect(StaticObject.AdminPath);

            // Set Login Delay
            int LoginDelay = int.Parse(ElanatConfig.GetNode("delay/login").Attributes["value"].Value);
            Thread.Sleep(LoginDelay * 1000);

            if (!string.IsNullOrEmpty(context.Request.Form["btn_Login"]))
            {
                btn_Login_Click(context);
                return;
            }

            if (!string.IsNullOrEmpty(context.Request.Query["el_return_url"]))
                model.ReturnUrlValue = context.Request.Query["el_return_url"];


            model.SetValue();

            View(model);
        }

        protected void btn_Login_Click(HttpContext context)
        {
            model.UserNameOrUserEmailValue = context.Request.Form["txt_UserNameOrUserEmail"];
            model.PasswordValue = context.Request.Form["txt_Password"];
            model.CaptchaTextValue = context.Request.Form["txt_Captcha"];
            model.LanguageOptionSelectedListValue = context.Request.Form["ddlst_Language"];
            model.SecretKeyValue = context.Request.Form["txt_SecretKey"];
            model.ReturnUrlValue = context.Request.Form["hdn_ReturnUrl"];


            if (!model.CaptchaTextValue.MatchByCaptcha())
            {
                Write(model.CaptchaIncorrectErrorView());
                IgnoreViewAndModel = true;

                return;
            }

            CurrentClientObjectClass ccoc = new CurrentClientObjectClass();

            // Set User Admin Language
            DataUse.Language dul = new DataUse.Language();

            string CurrentLanguageId = model.LanguageOptionSelectedListValue;

            dul.FillCurrentLanguage(CurrentLanguageId);

            ccoc.AdminLanguageId = dul.LanguageId;
            ccoc.AdminLanguageGlobalName = dul.LanguageGlobalName;
            ccoc.AdminLanguageIsRightToLeft = dul.LanguageIsRightToLeft;


            if (string.IsNullOrEmpty(model.UserNameOrUserEmailValue) || string.IsNullOrEmpty(model.PasswordValue))
            {
                Write(GlobalClass.Alert(Language.GetAddOnsLanguage("you_should_fill_all_options", StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/"), "problem"));
                IgnoreViewAndModel = true;

                return;
            }


            // Check Secret Key
            if (ElanatConfig.GetNode("security/use_secret_key_for_login").Attributes["active"].Value == "true")
                if (model.SecretKeyValue != Security.GetCodeIni("secret_key"))
                {
                    Write(GlobalClass.Alert(Language.GetAddOnsLanguage("you_should_fill_secret_key", StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/"), "problem"));
                    IgnoreViewAndModel = true;

                    return;
                }

            if (!Security.LoginActiveCheck())
            {
                Write(GlobalClass.Alert(Language.GetAddOnsLanguage("login_is_inactive", StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/"), "problem"));
                IgnoreViewAndModel = true;

                return;
            }

            Security se = new Security();

            DataBaseSocket db = new DataBaseSocket();
            DataBaseDataReader dbdr = new DataBaseDataReader();
            dbdr.dr = db.GetProcedure("user_login_check", new List<string>() { "@user_name_or_user_email", "@password" }, new List<string>() { model.UserNameOrUserEmailValue.ToLower(), se.GetHash(model.PasswordValue) });

            if (dbdr.dr == null || !dbdr.dr.HasRows)
            {
                db.Close();

                Write(GlobalClass.Alert(Language.GetAddOnsLanguage("the_information_you_entered_is_incorrect", StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/"), "problem"));
                IgnoreViewAndModel = true;

                return;
            }

            dbdr.dr.Read();

            string UserId = dbdr.dr["user_id"].ToString();

            db.Close();

            DataUse.User duu = new DataUse.User();
            duu.FillCurrentUser(UserId);

            if (string.IsNullOrEmpty(duu.UserId))
            {
                Write(GlobalClass.Alert(Language.GetAddOnsLanguage("user_is_not_existed", StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/"), "problem"));
                IgnoreViewAndModel = true;

                return;
            }

            if (!duu.UserActive.ZeroOneToBoolean())
            {
                Write(GlobalClass.Alert(Language.GetAddOnsLanguage("user_is_inactive", StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/"), "problem"));
                IgnoreViewAndModel = true;

                return;
            }

            DataUse.Group dug = new DataUse.Group();
            if (!dug.GroupActiveCheck(duu.GroupId))
            {
                Write(GlobalClass.Alert(Language.GetAddOnsLanguage("your_group_is_inactive", StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/"), "problem"));
                IgnoreViewAndModel = true;

                return;
            }

            DataUse.Role dur = new DataUse.Role();
            if (!dur.RoleActiveCheckByGroupId(duu.GroupId))
            {
                Write(GlobalClass.Alert(Language.GetAddOnsLanguage("your_role_is_inactive", StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/"), "problem"));
                IgnoreViewAndModel = true;

                return;
            }


            if (ElanatConfig.GetNode("security/registered_user_after_accept_active_email").Attributes["active"].Value == "true")
            {
                // If Email Is Not Confirmed
                if (!duu.UserEmailIsConfirm.ZeroOneToBoolean())
                {
                    Write(GlobalClass.Alert(Language.GetAddOnsLanguage("user_email_is_not_confirm", StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/"), "problem"));
                    IgnoreViewAndModel = true;

                    return;
                }
            }


            model.Login(UserId);


            model.SuccessView();

            View(model);
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

Model in .NET Standard

using System.Web;

namespace elanat
{
    public class SiteLoginModel
    {
        public string LoginLanguage { get; set; }
        public string LoginToSiteLanguage { get; set; }
        public string UserNameOrUserEmailLanguage { get; set; }
        public string PasswordLanguage { get; set; }
        public string SecretKeyLanguage { get; set; }
        public string LanguageLanguage { get; set; }
        public string ForgetPasswordLanguage { get; set; }
        public string ConfirmEmailLanguage { get; set; }
        public string SignUpLanguage { get; set; }

        public string UserNameOrUserEmailValue { get; set; }
        public string PasswordValue { get; set; }
        public string CaptchaTextValue { get; set; }
        public string LanguageOptionListValue { get; set; }
        public string LanguageOptionSelectedListValue { get; set; }
        public string SecretKeyValue { get; set; }
        public string ReturnUrlValue { get; set; }

        public string SecretKeyCssClass { get; set; }

        public void SetValue()
        {
            // Set Language
            AddOnsLanguage aol = new AddOnsLanguage(StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/");
            LoginLanguage = aol.GetAddOnsLanguage("login");
            LoginToSiteLanguage = aol.GetAddOnsLanguage("login_to_site");
            LanguageLanguage = aol.GetAddOnsLanguage("language");
            PasswordLanguage = aol.GetAddOnsLanguage("password");
            UserNameOrUserEmailLanguage = aol.GetAddOnsLanguage("user_name_or_user_email");
            SignUpLanguage = aol.GetAddOnsLanguage("sign_up");
            ForgetPasswordLanguage = aol.GetAddOnsLanguage("forget_password");
            ConfirmEmailLanguage = aol.GetAddOnsLanguage("confirm_email");


            // Check Secret Key
            if (ElanatConfig.GetNode("security/use_secret_key_for_login").Attributes["active"].Value == "true")
                SecretKeyLanguage = aol.GetAddOnsLanguage("secret_key");
            else
                SecretKeyCssClass = SecretKeyCssClass.AddHtmlClass(" el_hidden");


            string TmpCurrentSiteLanguageId = string.IsNullOrEmpty(LanguageOptionSelectedListValue) ? StaticObject.GetCurrentSiteLanguageId() : LanguageOptionSelectedListValue;

            // Set Language Item
            ListClass lc = new ListClass();
            lc.FillActiveLanguageListItem(StaticObject.GetCurrentSiteGlobalLanguage());
            LanguageOptionListValue += lc.ActiveLanguageListItem.HtmlInputToOptionTag(TmpCurrentSiteLanguageId);
        }

        public void Login(string UserId)
        {
            CurrentClientObjectClass ccoc = new CurrentClientObjectClass();

            // Set Current Client Object
            ccoc.FillUserClientSetting(UserId, false);


            // Increase Visit Statistics
            if (StaticObject.RoleSubmitVisitCheck())
            {
                DataUse.VisitStatistics duvs = new DataUse.VisitStatistics();
                duvs.IncreaseVisit();
            }


            DataUse.User duu = new DataUse.User();
            duu.SetUserLastLogin(UserId);

            StaticObject.OnlineUser++;


            // Set Secure Value
            Security sc = new Security();
            sc.SetUserLogin(UserId);


            // Add Reference
            ReferenceClass rc = new ReferenceClass();
            rc.StartEvent("login", UserId);
        }

        public void CaptchaIncorrectErrorView()
        {
            ResponseForm.WriteLocalAlone(Language.GetAddOnsLanguage("the_captcha_you_entered_is_incorrect", StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/"), "problem");
        }

        public void SuccessView()
        {
            if (!string.IsNullOrEmpty(ReturnUrlValue))
                ReturnUrlValue = "&el_return_url=" + ReturnUrlValue;

            HttpContext.Current.Response.Redirect(StaticObject.SitePath + "page/login/action/SuccessMessage.aspx?use_retrieved=true" + ReturnUrlValue, false);
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

Model in .NET Core

using CodeBehind;

namespace Elanat
{
    public partial class SiteLoginModel : CodeBehindModel
    {
        public string LoginLanguage { get; set; }
        public string LoginToSiteLanguage { get; set; }
        public string UserNameOrUserEmailLanguage { get; set; }
        public string PasswordLanguage { get; set; }
        public string SecretKeyLanguage { get; set; }
        public string LanguageLanguage { get; set; }
        public string ForgetPasswordLanguage { get; set; }
        public string ConfirmEmailLanguage { get; set; }
        public string SignUpLanguage { get; set; }

        public string UserNameOrUserEmailValue { get; set; }
        public string PasswordValue { get; set; }
        public string CaptchaTextValue { get; set; }
        public string LanguageOptionListValue { get; set; }
        public string LanguageOptionSelectedListValue { get; set; }
        public string SecretKeyValue { get; set; }
        public string ReturnUrlValue { get; set; }

        public string SecretKeyCssClass { get; set; }

        public void SetValue()
        {
            // Set Language
            AddOnsLanguage aol = new AddOnsLanguage(StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/");
            LoginLanguage = aol.GetAddOnsLanguage("login");
            LoginToSiteLanguage = aol.GetAddOnsLanguage("login_to_site");
            LanguageLanguage = aol.GetAddOnsLanguage("language");
            PasswordLanguage = aol.GetAddOnsLanguage("password");
            UserNameOrUserEmailLanguage = aol.GetAddOnsLanguage("user_name_or_user_email");
            SignUpLanguage = aol.GetAddOnsLanguage("sign_up");
            ForgetPasswordLanguage = aol.GetAddOnsLanguage("forget_password");
            ConfirmEmailLanguage = aol.GetAddOnsLanguage("confirm_email");


            // Check Secret Key
            if (ElanatConfig.GetNode("security/use_secret_key_for_login").Attributes["active"].Value == "true")
                SecretKeyLanguage = aol.GetAddOnsLanguage("secret_key");
            else
                SecretKeyCssClass = SecretKeyCssClass.AddHtmlClass(" el_hidden");


            string TmpCurrentSiteLanguageId = string.IsNullOrEmpty(LanguageOptionSelectedListValue) ? StaticObject.GetCurrentSiteLanguageId() : LanguageOptionSelectedListValue;

            // Set Language Item
            ListClass lc = new ListClass();
            lc.FillActiveLanguageListItem(StaticObject.GetCurrentSiteGlobalLanguage());
            LanguageOptionListValue += lc.ActiveLanguageListItem.HtmlInputToOptionTag(TmpCurrentSiteLanguageId);
        }

        public void Login(string UserId)
        {
            CurrentClientObjectClass ccoc = new CurrentClientObjectClass();

            // Set Current Client Object
            ccoc.FillUserClientSetting(UserId, false);


            // Increase Visit Statistics
            if (StaticObject.RoleSubmitVisitCheck())
            {
                DataUse.VisitStatistics duvs = new DataUse.VisitStatistics();
                duvs.IncreaseVisit();
            }


            DataUse.User duu = new DataUse.User();
            duu.SetUserLastLogin(UserId);

            StaticObject.OnlineUser++;


            // Set Secure Value
            Security sc = new Security();
            sc.SetUserLogin();


            // Add Reference
            ReferenceClass rc = new ReferenceClass();
            rc.StartEvent("login", UserId);
        }

        public string CaptchaIncorrectErrorView()
        {
            return GlobalClass.Alert(Language.GetAddOnsLanguage("the_captcha_you_entered_is_incorrect", StaticObject.GetCurrentSiteGlobalLanguage(), StaticObject.SitePath + "page/login/"), "problem");
        }

        public void SuccessView()
        {
            if (!string.IsNullOrEmpty(ReturnUrlValue))
                ReturnUrlValue = "&el_return_url=" + ReturnUrlValue;

            new HttpContextAccessor().HttpContext.Response.Redirect(StaticObject.SitePath + "page/login/action/SuccessMessage.aspx?use_retrieved=true" + ReturnUrlValue, false);
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

View in .NET Standard

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="elanat.SiteLogin" %><!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" dir="<%=elanat.AspxHtmlValue.CurrentSiteLanguageDirection()%>">
<head>
    <title><%=model.LoginLanguage%></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="shortcut icon" href="<%=elanat.AspxHtmlValue.SitePath()%>page/login/favicon.ico" />
    <!-- Start Client Variant -->
    <%=elanat.AspxHtmlValue.CurrentSiteClientVariant()%>
    <!-- End Client Variant --> 
    <script src="<%=elanat.AspxHtmlValue.SitePath()%>client/script/global.js"></script>
    <script type="text/javascript" src="<%=elanat.AspxHtmlValue.SitePath()%>client/script/site/site.js"></script>
    <%=elanat.AspxHtmlValue.CurrentSiteStyleTag()%>
    <link rel="stylesheet" type="text/css" href="<%=elanat.AspxHtmlValue.SitePath()%>client/style/global.css" />
    <link rel="stylesheet" type="text/css" href="<%=elanat.AspxHtmlValue.SitePath()%>client/style/site_global.css" />
</head>
<body onload="el_PartPageLoad(); el_LoadCaptcha();">

    <div class="el_page_center">
        <div class="el_head">
            <%=model.LoginLanguage%>
        </div>

        <form id="frm_SiteLogin" method="post" action="<%=elanat.AspxHtmlValue.SitePath()%>page/login/Default.aspx" defaultbutton="btn_Login">

            <div class="el_part_row">
                <div id="div_LoginTitle" class="el_title" onclick="el_HidePart(this); el_SetIframeAutoHeight()">
                    <%=model.LoginToSiteLanguage%>
                    <div class="el_dash"></div>
                </div>
                <div class="el_item">
                    <%=model.UserNameOrUserEmailLanguage%>
                </div>
                <div class="el_item">
                    <input id="txt_UserNameOrUserEmail" name="txt_UserNameOrUserEmail" type="text" value="<%=model.UserNameOrUserEmailValue%>" class="el_text_input el_important_field" />
                </div>

                <div class="el_item">
                    <%=model.PasswordLanguage%>
                </div>
                <div class="el_item">
                    <input id="txt_Password" name="txt_Password" type="password" class="el_text_input el_important_field" />
                </div>

                <div id="pnl_SecretKey">
                    <div class="el_item">
                        <%=model.SecretKeyLanguage%>
                    </div>
                    <div class="el_item">
                        <input id="txt_SecretKey" name="txt_SecretKey" type="password" autocomplete="off" readonly="true" onfocus="this.removeAttribute('readonly');" class="el_text_input<%=model.SecretKeyCssClass%>" />
                    </div>
                </div>

                <div class="el_item">
                    <div class="el_captcha_value"></div>
                </div>

                <div class="el_item">
                    <%=model.LanguageLanguage%>
                </div>
                <div class="el_item">
                    <select id="ddlst_Language" name="ddlst_Language" class="el_alone_select_input">
                        <%=model.LanguageOptionListValue %>
                    </select>
                    <input id="btn_Login" name="btn_Login" type="submit" class="el_button_input" value="<%=model.LoginLanguage%>" onclick="el_AjaxPostBack(this, true)" />
                </div>
            </div>

            <div class="el_part_row">
                <div class="el_item">
                    <a href="<%=elanat.AspxHtmlValue.SitePath()%>page_content/forget_password/">
                        <%=model.ForgetPasswordLanguage%>
                    </a>
                </div>
                <div class="el_item">
                    <a href="<%=elanat.AspxHtmlValue.SitePath()%>page_content/confirm_email/">
                        <%=model.ConfirmEmailLanguage%>
                    </a>
                </div>
                <div class="el_item">
                    <a href="<%=elanat.AspxHtmlValue.SitePath()%>page_content/sign_up/">
                        <%=model.SignUpLanguage%>
                    </a>
                </div>
            </div>

            <input id="hdn_ReturnUrl" name="hdn_ReturnUrl" type="hidden" value="<%=model.ReturnUrlValue%>" />

        </form>

    </div>

</body>
</html>
Enter fullscreen mode Exit fullscreen mode

View in .NET Core

<%@ Page Controller="Elanat.SiteLoginController" Model="Elanat.SiteLoginModel" %><!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" dir="<%=Elanat.AspxHtmlValue.CurrentSiteLanguageDirection()%>">
<head>
    <title><%=model.LoginLanguage%></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="shortcut icon" href="<%=Elanat.AspxHtmlValue.SitePath()%>page/login/favicon.ico" />
    <!-- Start Client Variant -->
    <%=Elanat.AspxHtmlValue.CurrentSiteClientVariant()%>
    <!-- End Client Variant --> 
    <script src="<%=Elanat.AspxHtmlValue.SitePath()%>client/script/global.js"></script>
    <script type="text/javascript" src="<%=Elanat.AspxHtmlValue.SitePath()%>client/script/site/site.js"></script>
    <%=Elanat.AspxHtmlValue.CurrentSiteStyleTag()%>
    <link rel="stylesheet" type="text/css" href="<%=Elanat.AspxHtmlValue.SitePath()%>client/style/global.css" />
    <link rel="stylesheet" type="text/css" href="<%=Elanat.AspxHtmlValue.SitePath()%>client/style/site_global.css" />
</head>
<body onload="el_PartPageLoad(); el_LoadCaptcha();">

    <div class="el_page_center">
        <div class="el_head">
            <%=model.LoginLanguage%>
        </div>

        <form id="frm_SiteLogin" method="post" action="<%=Elanat.AspxHtmlValue.SitePath()%>page/login/Default.aspx" defaultbutton="btn_Login">

            <div class="el_part_row">
                <div id="div_LoginTitle" class="el_title" onclick="el_HidePart(this); el_SetIframeAutoHeight()">
                    <%=model.LoginToSiteLanguage%>
                    <div class="el_dash"></div>
                </div>
                <div class="el_item">
                    <%=model.UserNameOrUserEmailLanguage%>
                </div>
                <div class="el_item">
                    <input id="txt_UserNameOrUserEmail" name="txt_UserNameOrUserEmail" type="text" value="<%=model.UserNameOrUserEmailValue%>" class="el_text_input el_important_field" />
                </div>

                <div class="el_item">
                    <%=model.PasswordLanguage%>
                </div>
                <div class="el_item">
                    <input id="txt_Password" name="txt_Password" type="password" class="el_text_input el_important_field" />
                </div>

                <div id="pnl_SecretKey">
                    <div class="el_item">
                        <%=model.SecretKeyLanguage%>
                    </div>
                    <div class="el_item">
                        <input id="txt_SecretKey" name="txt_SecretKey" type="password" autocomplete="off" readonly="true" onfocus="this.removeAttribute('readonly');" class="el_text_input<%=model.SecretKeyCssClass%>" />
                    </div>
                </div>

                <div class="el_item">
                    <div class="el_captcha_value"></div>
                </div>

                <div class="el_item">
                    <%=model.LanguageLanguage%>
                </div>
                <div class="el_item">
                    <select id="ddlst_Language" name="ddlst_Language" class="el_alone_select_input">
                        <%=model.LanguageOptionListValue %>
                    </select>
                    <input id="btn_Login" name="btn_Login" type="submit" class="el_button_input" value="<%=model.LoginLanguage%>" onclick="el_AjaxPostBack(this, true)" />
                </div>
            </div>

            <div class="el_part_row">
                <div class="el_item">
                    <a href="<%=Elanat.AspxHtmlValue.SitePath()%>page_content/forget_password/">
                        <%=model.ForgetPasswordLanguage%>
                    </a>
                </div>
                <div class="el_item">
                    <a href="<%=Elanat.AspxHtmlValue.SitePath()%>page_content/confirm_email/">
                        <%=model.ConfirmEmailLanguage%>
                    </a>
                </div>
                <div class="el_item">
                    <a href="<%=Elanat.AspxHtmlValue.SitePath()%>page_content/sign_up/">
                        <%=model.SignUpLanguage%>
                    </a>
                </div>
            </div>

            <input id="hdn_ReturnUrl" name="hdn_ReturnUrl" type="hidden" value="<%=model.ReturnUrlValue%>" />

        </form>

    </div>

</body>
</html>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)