|
Partial Class Create
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim m As BlogMessage
If Request("ID") IsNot Nothing Then
m = BlogMessage.Load(New Guid(Request("ID")))
Else
m = New BlogMessage
End If
m.Title = TextBox1.Text
m.Message = TextBox2.Text
m.Save()
Response.Redirect("View.aspx?ID=" & m.ID.ToString)
End Sub
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
If Request("ID") IsNot Nothing And Not Page.IsPostBack Then
Dim b As BlogMessage = BlogMessage.Load(New Guid(Request("ID")))
TextBox1.Text = b.Title
TextBox2.Text = b.Message
Button1.Text = "Update Post"
Page.Title = "Update Post"
End If
End Sub
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.