• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 418
  • Last Modified:

Visual Studio 2008 Add Toolbox Item

I have a couple of lines of JavaScript, how can I create a toolbox add-in to be able to insert the text in my code?
0
jonatec
Asked:
jonatec
  • 7
  • 5
1 Solution
 
13598Commented:
Wouldn't just saving it as a code snippet work?
All you want to do is be able to paste it easily in your code, correct?
0
 
13598Commented:
You would just open the code Snippets Manager under Tools, click on Add and point to where the text file is.
0
 
jonatecAuthor Commented:
Interesting. Never used the Code Snippet Manager before.

Just tried and my file is called insert1.js  do I need to rename this with a particular file extension ?

0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
13598Commented:
0
 
13598Commented:
0
 
jonatecAuthor Commented:
I have written a few lines of code in JavaScript. I want to insert this code into a <script block client-side. In my html code the Insert Snippet menu item does not appear in the right-click intellisense. Can I write a Code Snippet in JavaScript ?
0
 
13598Commented:
It has been a while since I created a snippet but I used this free tool that makes it very easy.
http://snippetdesigner.codeplex.com/Wikipage
0
 
jonatecAuthor Commented:
Hi.

Followed the steps in your last link and this is my code file that I'm trying to create as a snippet:

<reference path="file://C:/PROJECTS/jQuery Recipes/MyExamples/MyExamples/script/insert1.js" />

  <script type="text/javascript" src="script/jquery-1.4.2.js"></script>

  <script type="text/javascript">
    $(document).ready(function() {
    });
  </script>

However after holding Ctrl+Shift J to update the JavaScript references, the code snippet doesn't appear in the JS right-click intellisense? What do I do next ?


0
 
jonatecAuthor Commented:
I managed to select a few lines of code then drag this onto the toolbox tab, fine this works. Problem now is that after closing then re-opening VS the new toolbox tab I created, together with the code snippet has dissapeared. Is this a known problem or what am I doing wrong?
0
 
13598Commented:
C:/PROJECTS/jQuery Recipes/MyExamples/MyExamples/script/insert1.js is there and you have permissions to it?
0
 
jonatecAuthor Commented:
Yes.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

  • 7
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now