ASP.NET (UserControl) Syntax Error for server-side variable

时间:2017-08-04 12:10:48

标签: javascript c# asp.net syntax

I have two different variable which are defined in Server-side, Visual studio says me "The name 'PopupShowDelay' does not exist in the current context" and "The name 'QuotedTimeOutUrl' does not exist in the current context"

Javascript:

var schedulePopup = function() {       
        stopTimers();
        var myVar = '<%= PopupShowDelay %>';
        _popupTimer = window.setTimeout(showPopup, myVar);
    };

Server-Side:

public int PopupShowDelay
    {
        get { return 60000 * (Session.Timeout - 2); }
    }

    public string QuotedTimeOutUrl
    {
        get { return '"' + GetEntry().BasarSettings.Where(a => a.Ad == "WebApplication").Select(a => a.Deger).FirstOrDefault() + '"'; }
    }

Ps: Code is working well, problem is just VS gives me an error.

1 个答案:

答案 0 :(得分:0)

Microsoft has been release 15.4.2 version of visual studio for solve thi issue.