0

I have a new HTML helper, SelectionOtherTextBoxFor. It is a textbox linked to a <select> element1 for capturing the actual other value if the user selects 'Other' in the select list.

It has some JavaScript, HtmlHelper code, and some attribute code.

How do I package this so that other developers can just install and use it, without a list of files and where to put them? I suspect Nuget, but maybe there is a simpler way.

Otherwise, please may I turn this into how do I go about doing this in NuGet?

4

1 回答 1

0

The easiest would probably be to package the code in a class library that other developers could reference in their projects. As far as the javascript part is concerned, you could ship it alongside the class library.

If you want to automate the process, NuGet is definitely the way to go. You should read the Creating and Publishing a NuGet package guide which contains very detailed instructions on how you could create a NuGet package and include dependencies in it. In this case you will have the assembly containing the custom helper and attribute and javascript file as a content to the package. The javascript file could then by default be deployed in ~/Scripts when some developer installs the NuGet.

Personally I have always used NuGet for those kind of things as it offers lots of flexibilities.

于 2013-03-08T08:00:16.773 回答