Thursday, October 12, 2017

* operator has higher precedence than +

// The * operator has higher precedence than + so this expression evaluates to 7:

1 + 2 * 3

// (See book for operator precedence table)

// T4 code generation is enabled for model 'c:\users\scala\documents\visual studio 2013\Projects\entityFramework\entityFramework\EntityModel.edmx'. // To enable legacy code generation, change the value of the 'Code Generation Strategy' designer // property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model // is open in the designer. // If no context and entity classes have been generated, it may be because you created an empty model but // have not yet chosen which version of Entity Framework to use. To generate a context class and entity // classes for your model, open the model in the designer, right-click on the designer surface, and // select 'Update Model from Database...', 'Generate Database from Model...', or 'Add Code Generation // Item...'

To generate a context class and entity classes for your model, open the model in the designer, right-click on the designer surface, and select 'Update Model from Database...', 'Generate Database from Model...', or 'Add Code Generation Item...'.
'Add Code Generation Item...' will do the trick. You should basically choose and add one or more T4 templates to actually generate the entities. More info here. Also take a look at this answer. It might help to make things clear.

browser close event

Trying to detect browser close event
------------------------------------------
window.onbeforeunload = function (event) {
    var message = 'Important: Please click on \'Save\' button to leave this page.';
    if (typeof event == 'undefined') {
        event = window.event;
    }
    if (event) {
        event.returnValue = message;
    }
    return message;
};

$(function () {
    $("a").not('#lnkLogOut').click(function () {
        window.onbeforeunload = null;
    });
    $(".btn").click(function () {
        window.onbeforeunload = null;
});
});
================================================
How to capture the browser window close event?
----------------------------
var inFormOrLink;
$('a').on('click', function() { inFormOrLink = true; });
$('form').on('submit', function() { inFormOrLink = true; });

$(window).on("beforeunload", function() {
    return inFormOrLink ? "Do you really want to close?" : null;
})
For jQuery versions older than 1.7, try this:

var inFormOrLink;
$('a').live('click', function() { inFormOrLink = true; });
$('form').bind('submit', function() { inFormOrLink = true; });

$(window).bind("beforeunload", function() {
    return inFormOrLink ? "Do you really want to close?" : null;
})

Request.QueryString in view

 if ('@string.IsNullOrEmpty(Request.QueryString["sprtPlan"])'=='False') {
                $('#ChangePlan').toggle();//toggle based on request query string
        }

A network-related or instance-specific error occurred whereas establishing an association with SQL Server. The server wasn't found or wasn't accessible. Verify that the instance name is correct which SQL Server is organized to permit remote connections. (provider: SQL Network Interfaces, error: twenty-six — Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)

TITLE: Connect to Server
------------------------------
Cannot connect to \SQLEXPRESS.
------------------------------
ADDITIONAL INFORMATION:

A network-related or instance-specific error occurred whereas establishing a affiliation to SQL Server.
The server wasn't found or wasn't accessible.
Verify that the instance name is correct which SQL Server is organized to permit remote connections.
(provider: SQL Network Interfaces, error: twenty six - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft SQL Server&EvtSrc=MSSQLServer&EvtID=-1&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
Solution : Type Start-- Sql Server Configuration Manager run as Admin...(Sql Configuration Manager)
under Sql services -- Start Sql Server

fonts/opensans-light-webfont.woff2 errors in console

fonts/opensans-light-webfont.woff2 errors in console
<system.webServer>

         <staticContent>
      <remove fileExtension=".woff" />
         <!-- In case IIS already has this mime type -->
         <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
         <remove fileExtension=".woff2" />
         <!-- In case IIS already has this mime type -->
         <mimeMap fileExtension=".woff2" mimeType="application/x-font-woff2" />
       </staticContent>
   

  </system.webServer>

Failed to load resource: the server responded with a status of 404 (Not Found) Uncaught ReferenceError: jQuery is not defined

Failed to load resource: the server responded with a standing of 404 (Not Found) /socket.io/socket.io.js

Uncaught ReferenceError: jQuery is not defined
Solution:
replace
jQuery(function($){
with
$(document).ready(function($)


The configuration section 'log4net' cannot be read because it is missing a section declaration

 The configuration section 'log4net' cannot be read because it is missing a section declaration
Solution: inside <configSections>---Add

 <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />

increase the json size limit

Add In Web.config..

<add key="aspnet:MaxJsonDeserializerMembers" value="200000"/>