Created
January 29, 2010 22:56
-
-
Save dandean/290238 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Here you go Bess. Let me know if you have any questions. | |
| /** | |
| * ChangeMonth([e]) -> "undefined" | |
| * - e (HTMLSelectChangeEvent): Optional, provided when this function is an event handler on a select element. | |
| **/ | |
| function ChangeMonth(e){ | |
| // Get the select element and its current value. | |
| var select = $('<%= this.monthListControl.ClientId_Dropdown %>'), | |
| selectedMonth = select.value; | |
| // Stop the event, if provided. There will be no event if called manually. | |
| // I don't see why this would be needed though... | |
| if (e) e.stop(); | |
| if(selectedMonth != '' && selectedMonth != currentMonth){ | |
| currentMonth = selectedMonth; | |
| // Post asynchronously, pass `name` as the target. `name` is the same as .Net's UniqueID. | |
| Page.post({target: select.name}); | |
| } | |
| } | |
| if (selectedMonthCookie) { | |
| if(selectedMonthCookie != currentMonth){ | |
| currentMonth = selectedMonthCookie; | |
| // Change month if necessary. ChangeMonth will work itself out internally. | |
| ChangeMonth(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment