H
Harry
Dear all,
It is found that when a webform control trigger an event,
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
This function will be load first, followed by
Private Sub Submit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Submit.Click
End Sub
the click event of button.
I have to generate a table from the database table.
I found that the generation of table function should put in submit_click
function
Private Sub Submit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Submit.Click
displaytablefromdatabase()
End Sub
Also, i have to put the displaytablefromdatabase() function page_load as i
have to deal with the postback when the page is refreshed.
Thus, i added something in Page_load
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If me.ispostback() then
displaytablefromdatabase()
end if
End Sub
The problem is that, i have another button called "reset", if a user click
"reset" button, the textbox in the form is set to empty string.
however, each time the "reset" button has been click, it will autopost back
and go to the "Page_Load" function and execute the
displaytablefromdatabase() and display the form. before the form goes to
"Reset_Click" function.
Clearly, i don't want to execute displaytablefromdatabase() when i click
Reset button. But, the webform has to go to Page_Load function before go to
the "Reset_Click" function.
What can i do?
Thanks all
Regards,
Harry
It is found that when a webform control trigger an event,
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
This function will be load first, followed by
Private Sub Submit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Submit.Click
End Sub
the click event of button.
I have to generate a table from the database table.
I found that the generation of table function should put in submit_click
function
Private Sub Submit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Submit.Click
displaytablefromdatabase()
End Sub
Also, i have to put the displaytablefromdatabase() function page_load as i
have to deal with the postback when the page is refreshed.
Thus, i added something in Page_load
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If me.ispostback() then
displaytablefromdatabase()
end if
End Sub
The problem is that, i have another button called "reset", if a user click
"reset" button, the textbox in the form is set to empty string.
however, each time the "reset" button has been click, it will autopost back
and go to the "Page_Load" function and execute the
displaytablefromdatabase() and display the form. before the form goes to
"Reset_Click" function.
Clearly, i don't want to execute displaytablefromdatabase() when i click
Reset button. But, the webform has to go to Page_Load function before go to
the "Reset_Click" function.
What can i do?
Thanks all
Regards,
Harry