mainrotor
asked on
ASP.Net Postback question
Hi all-
I have an ASP.Net application where a user enters some information into some text fields pressess button and a quote is returned to them.
The first trip around the application works fine. If the user changes some information in the fields and clicks on the button a second time, the quote is not recalculated. Is there some setting in postback that I am not setting properly? Any input would be greatly appreciated.
Thanks in advance,
mainrotor
I have an ASP.Net application where a user enters some information into some text fields pressess button and a quote is returned to them.
The first trip around the application works fine. If the user changes some information in the fields and clicks on the button a second time, the quote is not recalculated. Is there some setting in postback that I am not setting properly? Any input would be greatly appreciated.
Thanks in advance,
mainrotor
ASKER
tgerbert
I don't use:
Sub Page_Load(...)
If Not IsPostBack Then
... Do initial processing, e.g. set some text box values
Else
... if it is a postback, do the calculations
End If
End Sub
because I populate my dropdownlist controls at design time using SQLDataSource objects. For my button I just use my button_click event. I have attached my button's on click event as a code snippet.
Thanks,
mainrotor
I don't use:
Sub Page_Load(...)
If Not IsPostBack Then
... Do initial processing, e.g. set some text box values
Else
... if it is a postback, do the calculations
End If
End Sub
because I populate my dropdownlist controls at design time using SQLDataSource objects. For my button I just use my button_click event. I have attached my button's on click event as a code snippet.
Thanks,
mainrotor
Protected Sub btnGetQuote_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnGetQuote.Click
If ddlShimpentType.SelectedValue = "A" Then
GetAirQuote()
ElseIf ddlShimpentType.SelectedValue = "G" Then
GetGroundQuote()
End If
cmdSave.Enabled = True
cmdSave.Visible = True
cmdNew.Enabled = True
cmdNew.Visible = True
Button2.Enabled = True
Button2.Visible = True
'cmdRerate.Enabled = True
cmdRerate.Visible = True
btnGetQuote.Visible = False
btnGetQuote.Enabled = False
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
tgerbert
Thanks for the quick response. Let me cleanup my code a little and then I will post it.
mainrotor
Thanks for the quick response. Let me cleanup my code a little and then I will post it.
mainrotor
Normally you would use...
Sub Page_Load(...)
If Not IsPostBack Then
... Do initial processing, e.g. set some text box values
Else
... if it is a postback, do the calculations
End If
End Sub
Post your code if you can.