문제

My ASP.net server control is giving me error: "Error Rendering Control". Below is the screenshot. enter image description here

Runtime it is working as expected but at design time I am getting above error.

올바른 솔루션이 없습니다

다른 팁

Here I have written a small function to determine whether control is loaded in Design View or Run time. Accordingly We can take decision whether to use HTTPContext or not.

public bool IsInDesignMode()
    {
        if (HttpContext.Current == null)
            return true;
        else
            return false;
    }

-- Thanks Deepak Rai

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top