Thursday, August 23, 2012

ASP.NET/C#/AJAX - trigger ModalPopUp from server side code

Add BehaviorID="ModalPopupBehaviorID" to your modal popup extender and add this to any server function.
ScriptManager.RegisterStartupScript(Page, this.GetType(), "id", "function pageLoad(){$find('ModalPopupBehaviorID').show();}", true);


Wednesday, August 22, 2012

JQuery - looping through select options to string

If you have a HTML listbox from the <select><options> kind that's the easiest way I found to "export" the values to a string:

var str = $('#my_listbox_id option').map(function () { return $(this).val();}).get().join(', ');


Tuesday, August 7, 2012

HTML/JQuery - onunload function

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