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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh Data on Page After Submit of Button - How?

Status
Not open for further replies.

eb24

Programmer
Dec 17, 2003
240
US
I have a web form that upon visiting it (on Sub Page_Load) it dispalys some data-bound datagrids. I also have a textbox to add some notes towards the bottom and a Submit button attached to it.

This application works fine except when the user submits their Notes via the textbox, I would like it to automatically refresh the page so it can be displayed on the Datagrid with the pertinent information.

My .aspx page has the following format:
Code:
Sub Page_Load(Sender As Object, E As EventArgs)
     If Not IsPostBack Then
          ...code...
     End If
End Sub

Sub btnSubmit_Click(sender As Object, e As ImageClickEventArgs)
     ...code...
End Sub

Can someone please assist me?
 
Your submit button saves the data to the database right?

Well just reload the data from the database or if it's already in a dataset there's no need to reload from the database.

Then rebind the grid with the refreshed datasource be that a dataset dataview whatever.

That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Try just moving the refresh info into a function.
Code:
Sub Page_Load(Sender As Object, E As EventArgs)
     If Not IsPostBack Then
          LoadPage()
     End If
End Sub

Sub btnSubmit_Click(sender As Object, e As ImageClickEventArgs)
     LoadPage()
End Sub

Private Sub LoadPage()
     '...some code...
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top