I have a asp.net page that is used for searching rows of data. I want to be able to search a specific date-interval, therefore I have added two calendars (from & to) and a textbox for each one. 

When a date is selected in the calendar it is displayed in the matching textbox, although this causes a postback, and that is my problem. 

I have never used javascript before, so I thought I would give that a go, but I almost exclusivly see examples using HTML, which I am not using at all. I only use ASP.NET web controls such as `<asp:Calendar.../>`.

So this code that follows is just off the top of my head, I know the javascript is totally wrong, but I hope you understand what it is that I want to achieve when you look at it. 

```
<script type="text/javascript">
    function Calendar1_SelectionChanged() {
        FromDate.Text = Calendar1.SelectedDate.ToString();
    }
</script>    

<asp:Calendar ID="Calendar1" runat="server" 
    onselectionchanged="Calendar1_SelectionChanged"></asp:Calendar>

<asp:TextBox ID="FromDate" runat="server"></asp:TextBox>

```

All answers are greatly appreciated! I have been trying to find an answer to this by googling, but no luck..

EDIT: For this to work on the page, I need to keep the textboxes. Or any other way where the date can be edited manually (in DateTime format)