Hvor er fejlen
Jeg kan ikke opdatere mine nye oplysninger ???Partial Class Profile
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If IsNothing(Session("UserID")) Then
Response.Redirect("default.aspx")
Else
Dim objUser As New ProfileFac
Dim dt As Data.DataTable = objUser.GetUser(Session("UserID"))
lblUser.Text &= dt.Rows(0).Item("brugernavn")
lblFornavn.Text &= dt.Rows(0).Item("navn")
lblEfternavn.Text &= dt.Rows(0).Item("efternavn")
lblEmail.Text &= dt.Rows(0).Item("email")
lblAdr.Text &= dt.Rows(0).Item("adresse")
lblBy.Text &= dt.Rows(0).Item("fldBy")
lblPost.Text &= dt.Rows(0).Item("postnummer")
lblTlf.Text &= dt.Rows(0).Item("telefonnr")
lblInfo.Text &= dt.Rows(0).Item("beskrivelse")
If Request.QueryString("edit") = "bosted" Then
Dim objProfile As New ProfileFac
Dim dt2 As Data.DataTable = objUser.GetUser(Session("UserID"))
txtAdr.Text = dt2.Rows(0).Item("adresse")
txtPost.Text = dt2.Rows(0).Item("postnummer")
txtTlf.Text = dt2.Rows(0).Item("telefonnr")
txtBy.Text = dt2.Rows(0).Item("fldBy")
Else
If Not IsPostBack Then
Dim objProfilePro As New ProfilePro
objProfilePro.Adresse = txtAdr.Text
objProfilePro.Postnummer = txtPost.Text
objProfilePro.By = txtBy.Text
objProfilePro.Telefonnr = txtTlf.Text
Dim objProfileFac As New ProfileFac
objProfileFac.UpdateUser(objProfilePro)
End If
End If
End If
End Sub
Protected Sub btnBosted_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnBosted.Click
Dim objProfilePro As New ProfilePro
objProfilePro.Adresse = txtAdr.Text
objProfilePro.Postnummer = txtPost.Text
objProfilePro.By = txtBy.Text
objProfilePro.Telefonnr = txtTlf.Text
Dim objProfileFac As New ProfileFac
objProfileFac.UpdateUser(objProfilePro)
Response.Redirect("profile.aspx")
End Sub
End Class