I have an html helper in MVC3 that renders a custom section of html that is being used as a search control. The issue is that there is javascript (jquery) that has been written to interact with the control (it really should be used JUST for this control). Is there a way to make the javascript embedded so that the control continues to have the javascript functionality. (With creating the helper, we can control how the html is structured and make it easier to write the javascript. This would standardize the use of the control across out app).
ex.
<div>
@Html.SearchControl("searchControlSelector")
</div>
<script>
$("searchControlSelector").timeout();
<script>
I want to be able to set the 'timeout' functionality when calling the @Html.SearchControl([some params]) so that the javascript and helper are combined and users of the helper do not have to worry about what selectors they should use when calling 'timeout'. Does anyone know how to achieve this? Is there a better way of handling this?