0

I'm working on a project that follows the asp.net mvc architecture. I create a static class " Constante.cs " in which I defined all the attributes and methods that will be called later in different files of my application.

Constante.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;
using System.Net;
using System.Data.SqlClient;
using System.Data;
using System.Web;

using System.Web.Mvc;
using System.IO;
using System.Collections;
using System.Xml;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Security.Cryptography;
using System.ComponentModel;
using ClinicManagement.Models;
using System.Web.Script.Serialization;
using Newtonsoft.Json;
using System.Xml.Linq;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.Objects;
using System.CodeDom.Compiler;
using Microsoft.CSharp;
using System.Reflection;
using System.Configuration;
using System.Drawing;
using System.Web.WebPages;

//using NextGrH.Areas.GrH;


using ClinicManagement.OurTypeBatch;
using ClinicManagement.Manager.CaseManager;
using ClinicManagement.Areas.Accounting.Models;
namespace ClinicManagement
{
    public class Constante
    {
        private static Constante instance;
        public static Constante Instance
        {
            get
            {
                Object lok = new object();
                lock (lok)
                {
                    if (instance == null)
                        instance = new Constante();
                    return instance;
                }
            }
        }
        public static NXT_USER CurrentUser
        {
            get
            {
                return GetCurrentUser();
            }
        }

        //age Patient assurant
        public static int AgePatient = 18;
        public static int GridViewRowHeight = 25;
        public static int FilterBarHeight = 27; // Table: la Hauteur FiltreRow
        public static int GroupPanelHeight = 25; // Table : Group By 
        public static int GroupPanelMargin = 15; // Table : Margin Group By 
        public static int HeadHeight = 30;
        public static int HeightSearch = 21; // Table : Search In Grid

        //added k.c
        public static int groupage = 6;
        public static decimal TIMBRE = 0.5M;
        //added k.c
        //public static int MenuHeight = 30;//them standard
        public static int MenuHeight = 30;

        public static int MenuButtonHeight = 39; //Toolbar : la Hauteur du Menu
        public static int MenuButtonMargin = 20; //Toolbar : la Hauteur du Menu
        public static int FooterHeight = 30;
        private static int margin = 250;
        public static string path = System.AppDomain.CurrentDomain.BaseDirectory;
        public static string nxtDemiLine = "<div class='DemiLine'></div>";
        public static string nxtLine = "<div class='Line'></div>";
        public static string nxtLine10 = "<div class='Line10'></div>";
        public static string nxtLine25 = "<div class='Line25'></div>";
        public static string nxtLine50 = "<div class='Line50'></div>";
        public static string nxtHRgreen = "<hr width='100%' noshade size='2' style='border-color:green'>";
        public static string nxtHRred = "<hr width='100%' noshade size='1' style='border-color:red'>";
        public static string nxtEspace = "&nbsp;";
private static object[] GetParamsPassedOpservation()
        {
            object[] paramsPassedOpservation = new object[2];
            VAR_OPER_REQ[0] = "add";
            VAR_OPER_REQ[1] = "s_grid_12";
            paramsPassedOpservation[0] = FORM_OBSERVATION;
            paramsPassedOpservation[1] = VAR_OPER_REQ;
            return paramsPassedOpservation;
        }
        private static string GetCurrentLanguage()
        {
            if (HttpContext.Current.Session["CurrentLanguage"] != null)

                return HttpContext.Current.Session["CurrentLanguage"].ToString();
            else
                return "";
        }
        private static int GetWidthScreen()
        {
            if (HttpContext.Current.Session["WidthScreen"] != null)

                return int.Parse(HttpContext.Current.Session["WidthScreen"].ToString());
            else
                return 0;
        }
        private static int GetHeightScreen()
        {
            if (HttpContext.Current.Session["HeightScreen"] != null)

                return int.Parse(HttpContext.Current.Session["HeightScreen"].ToString());
            else
                return 0;
        }
        private static NXT_USER GetCurrentUser()
        {
            if (HttpContext.Current.Session["CurrentUser"] != null)

                return (NXT_USER)HttpContext.Current.Session["CurrentUser"];
            else
                return new NXT_USER();
        }
}
}

For now everything is fine, but when I deploy my application on a remote server and someone try to access through a fixed IP address , an exception is thrown

This is usually a temporary error that occurs during the resolution of the host name and means that the local server did not receive a response from an authoritative server

And this is the place of my error:

Ligne 193 :  @{
Ligne 194 :      WriteLiteral(Constante.nxtDemiLine);
Ligne 195 :   WriteLiteral(Constante.nxtLine);
Ligne 196 :  }
Rowland Shaw
  • 37,700
  • 14
  • 97
  • 166
Zied CHAARI
  • 269
  • 4
  • 14

1 Answers1

0

This looks like your webserver is failing to look up the hostname of the client (or an intermediate proxy) - if you turn off host name resolution, it should be more responsive.

Rowland Shaw
  • 37,700
  • 14
  • 97
  • 166