TAILIEUCHUNG - ASP.NET 2.0 Instant Results phần 2

Tham số DeleteMethod Các kiểm soát ObjectDataSource cũng được nối với DeleteContact lớp Contact. Việc kiểm soát GridView đã được thiết lập để hiển thị một liên kết để xóa từng số liên lạc, và đó là phương pháp này không thực tế | The Online Diary and Organizer It gets its data from the ObjectDataSource control ObjectDataSourcel which in turn connects to the Contact class s GetContactByFirstLetter shared method asp ObjectDataSource ID ObjectDataSource1 runat server SelectMethod GetContactsByFirstLetter TypeName Contact DeleteMethod DeleteContact SelectParameters asp SessionParameter DefaultValue 6 Name DiaryId SessionField DiaryId Type Int32 asp Parameter Name FirstLetterOfSurname Type Char SelectParameters DeleteParameters asp ControlParameter ControlID GridView1 Name ContactId PropertyName SelectedValue Type Int64 DeleteParameters asp ObjectDataSource The ObjectDataSource control s DeleteMethod parameter is also hooked to the Contact class s DeleteContact. The GridView control has been set to show a link to delete each contact and it s this method that does the actual deleting Public Shared Sub DeleteContact ByVal ContactId As Long Dim diaryDBConn As New SqlConnection conString Dim sqlString As String DeleteContact Dim sqlCmd As New SqlCommand sqlString diaryDBConn @ContactId ContactId sqlCmd Nothing diaryDBConn Nothing End Sub The Gridview also includes an Edit link which when clicked navigates the user to the page asp HyperLinkField DataNavigateUrlFields ContactId DataNavigateUrlFormatString SecureDiary ContactId O Text Edit The corresponding Contactld is passed in the URL as URL data. Adding a new user involves clicking the Add Contact link on the page. This takes you to a basic form for adding contact information such as name e-mail phone number and so on. This page and the page are identical in operation except for one important detail The page retrieves the details of the contact to be edited using the Contact class. This happens in the Page_Load event 33 Chapter 1

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.