In this example I show that how easily we can create User Control and then use it in asp.net. Here first I create a User Control name CalendarUserControl.ascx, then place it Default.aspx web form. Here is the source code of both files.
Infolink
Search This Blog
Showing posts with label reference. Show all posts
Showing posts with label reference. Show all posts
Oct 14, 2012
Aug 26, 2012
Improve reference efficiency in JavaScript files inside a web project
In Visual Studio 2010 you can reference other JavaScript files inside
current JavaScript file like the following, to get the IntelliSense.
/// <reference path="YourScript.js" />
What if you have many JavaScript files and you have to reference many project wide JavaScript files inside each file? You can put the following block in each of the JavaScript files that need the reference like following:
/// <reference path="YourScript1.js" />
/// <reference path="YourScript2.js" />
/// <reference path="YourScript3.js" />
/// <reference path="YourScript4.js" />
But this would not be efficient especially some referencing file name is going to change, such as when JQuery library version changes. The trick is to create a project wide reference JavaScript file, and explicitly reference this file from other JavaScript files. For example, we can create a file called reference.js which contains the above code. Then for other JavaScript files, we can reference it by dragging and drop the reference.js file into the JavaScript editor, which will generate the following:
/// <reference path="Scripts/AppJsReference.js" />
Basically, Visual Studio 2010 recursively check the references included in the referenced JavaScript files to find the current JavaScript file's references. I hope this can ease some pain in the development.
/// <reference path="YourScript.js" />
What if you have many JavaScript files and you have to reference many project wide JavaScript files inside each file? You can put the following block in each of the JavaScript files that need the reference like following:
/// <reference path="YourScript1.js" />
/// <reference path="YourScript2.js" />
/// <reference path="YourScript3.js" />
/// <reference path="YourScript4.js" />
But this would not be efficient especially some referencing file name is going to change, such as when JQuery library version changes. The trick is to create a project wide reference JavaScript file, and explicitly reference this file from other JavaScript files. For example, we can create a file called reference.js which contains the above code. Then for other JavaScript files, we can reference it by dragging and drop the reference.js file into the JavaScript editor, which will generate the following:
/// <reference path="Scripts/AppJsReference.js" />
Basically, Visual Studio 2010 recursively check the references included in the referenced JavaScript files to find the current JavaScript file's references. I hope this can ease some pain in the development.
Labels:
Data Grid C#,
improve,
JavaScript,
reference,
Tip,
web
Subscribe to:
Posts (Atom)