Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help and or suggestions

Status
Not open for further replies.

kss444

Programmer
Sep 19, 2006
306
US
I have a calendar control on my page it's a 3rd party control from infergistics. Postback on the control is turned off.

further down the page I have a text box that is suppose to store a number in based on what date was choosen from the calendar control.

So when the date is changed I want to call a stored proc which returns a number that I need to display in the text box.

I think page postback would not be acceptable with the client. I thought about using updaepanel but I don't know if that would work, since the calendar control is out side of the updatepanel.

I am at a loss on how to go about doing this, any help or advice would be great.


Thanks,

Ordinary Programmer
 
I use this to display the user's selected Date in a text box. The calendar is a standard control from the toolbox.
Code:
Sub Calendar1_SelectionChanged(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
        Me.TextBox1.Text = Calendar1.SelectedDate
    End Sub
Not sure if you can get this to work since the calendar is a 3rd party control. But it might point you in the right direction.
Code:
Sub Calendar1_SelectionChanged(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
        If Calendar1.SelectedDate = "01/01/2009" Then
            Me.TextBox1.Text = "1"
        End If
 End Sub

Thanks,
Chilly442
---------------------------------------
If I lived anywhere else I'd be Sunny442
 
if you don't want the postback then you will need to either
1. do all the processing on the client. this is a good option if the logic is strictly presentational (no business logic).
2. make an ajax request to do the work. An UpdatePanel is worst way to make an ajax request. any benefit (other than a viewable page refresh) are lost to what the true power of ajax provides.

if this is presentational (selecting a date and putting in another control, formatted. then do the work on the client using js.

if business logic is envolved, research what ajax really is (not the update panel). this will open the possiblities of what can be done.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Thanks all, but I think I have decided to try and use client callbacks or the scripting manager.

I have found examples that update the datetime, but not for what I want to do. And I can't seem to understand what is going on, and how to get it to work for my purposes.

But I think this is the correct road to take, and I will still be trying to figure it out.

Ordinary Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top