By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,533 Members | 2,102 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,533 IT Pros & Developers. It's quick & easy.

udate doesn't work as expect need help

P: n/a
I have two datalist in two panel (viewdatalistpanel and updateDatalist). One
datalist bring all student details from the database and the other update the
student details in the database. On page load the viewdatalistpanel is
visible, when a button is click it become invisible and the updatedatalist
becomes visible. Every thing works fine. But when i click the
updateStudent_Click button, the details do not update and also instead of
taking me to the viewdatalistpanel to display the updated details, it come up
with an blank page. Below is the all the sub in my <script>...</script>
portion of the page: i need help
<script runat="server">
Sub Page_Load(ByVal Sender As Object, ByVal e As EventArgs)
If Not IsPostBack Then
Dim StudentID As Integer = CInt(Request.Params("studentID"))
Dim SimpleSearch As New StudentDB()

ViewDataList.DataSource =
SimpleSearch.StudentState(Request.Params("studentI D"))
ViewDataList.DataBind()

ViewDetailsPanel.Visible = True
UpdateDetailsPanel.Visible = False
Else
Dim StudentID As Integer = CInt(Request.Params("studentID"))
Dim SimpleSearch As New StudentDB()

UpdateDataList.DataSource =
SimpleSearch.StudentState(Request.Params("studentI D"))
UpdateDataList.DataBind()

ViewDetailsPanel.Visible = False
UpdateDetailsPanel.Visible = True
End If
End Sub

Sub BindViewPanel()
If Page.IsValid = True Then
Dim StudentID As Integer = CInt(Request.Params("studentID"))
Dim SimpleSearch As New StudentDB()

ViewDataList.DataSource =
SimpleSearch.StudentState(Request.Params("studentI D"))
ViewDataList.DataBind()

UpdateDataList.Visible = False
'UpdateDataList.DataSource =
SimpleSearch.StudentState(Request.Params("studentI D"))
'UpdateDataList.DataBind()
End If
End Sub


Sub showUpdateDetails_Click(ByVal Sender As Object, ByVal e As
EventArgs)

ViewDetailsPanel.Visible = False
UpdateDetailsPanel.Visible = True
End Sub


Sub UpdateStudent_Click(ByVal sender As Object, ByVal e As EventArgs)

If Page.IsValid = True Then
Dim StudentID As Integer = CInt(ViewState("StudentID"))
Dim tbTitle As TextBox
Dim tbStatus As TextBox
Dim tbSurname As TextBox
Dim tbFirstname As TextBox
Dim tbHouseNumber As TextBox
Dim tbStreet As TextBox
Dim tbTown As TextBox
Dim tbCounty As TextBox
Dim tbCountry As TextBox
Dim tbPostcode As TextBox
Dim tbDateOfBirth As TextBox
Dim tbNationality As TextBox
Dim tbTelephone As TextBox
Dim tbMobile As TextBox
Dim tbEmail As TextBox
Dim tbFax As TextBox
Dim tbCourseID As TextBox
Dim tbDateEnroled As TextBox
Dim tbComment As TextBox

Dim item As DataListItem
For Each item In UpdateDataList.Items
tbTitle = item.FindControl("Title")
tbStatus = item.FindControl("Status")
tbSurname = item.FindControl("Surname")
tbFirstname = item.FindControl("Firstname")
tbHouseNumber = item.FindControl("HouseNumber")
tbStreet = item.FindControl("Street")
tbTown = item.FindControl("Town")
tbCounty = item.FindControl("County")
tbCountry = item.FindControl("Country")
tbPostcode = item.FindControl("PostCode")
tbDateOfBirth = item.FindControl("DateOfBirth")
tbNationality = item.FindControl("Nationality")
tbTelephone = item.FindControl("Telephone")
tbMobile = item.FindControl("Mobile")
tbEmail = item.FindControl("email")
tbFax = item.FindControl("Fax")
tbCourseID = item.FindControl("CourseID")
tbDateEnroled = item.FindControl("DateEnroled")
tbComment = item.FindControl("Comment")
Next

Dim UpdateDetails As New StudentDB
UpdateDetails.UpdateStudentDetails(StudentID, tbTitle.Text,
tbStatus.Text, tbSurname.Text, tbFirstname.Text, tbHouseNumber.Text,
tbStreet.Text, tbTown.Text, tbCounty.Text, tbCountry.Text, tbPostcode.Text,
tbDateOfBirth.Text, tbNationality.Text, tbTelephone.Text, tbMobile.Text,
tbEmail.Text, tbFax.Text, tbCourseID.Text, tbDateEnroled.Text, tbComment.Text)
BindViewPanel()
End If
End Sub

</script>

Can someone please help me.
Jan 9 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
You using uncompiled .Net right?
Try to rebind on the event, may be the ViewState is not been hold

Jan 9 '06 #2

P: n/a
Thanks Herique, i don't understand what u mean by uncompiled.net. i try
rebind on the event but it seems the same

"Henrique Mello" wrote:
You using uncompiled .Net right?
Try to rebind on the event, may be the ViewState is not been hold

Jan 9 '06 #3

P: n/a
Uncompiled ASP.NET is when you dont use the compiler to generate a .dll
with the aspx.cs(vb) files.

You tryed to put a Response.Write on the event to see if the problem is
not with the event it self?

Jan 9 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.