當我們在某個Inpup控制項按下enter鍵時,讓他去做特定的事時,
我們必需在Input 的 tag中加入
onkeydown="form_action();"
然後在我們的script 中加入form_action() 這段method的內容就可以了…
例如說…如果按下enter會做出某些事時…
form_action() {
Dim adCourseBlock As New SqlDataAdapter Dim scmCourseBlockInsert As New SqlCommand With scmCourseBlockInsert .Connection = conn .Transaction = trans .CommandType = CommandType.StoredProcedure .CommandText = "RG_AddCourseBlockData" .Parameters.Add(New SqlParameter("@syear", SqlDbType.NChar, 3)).Value = cbObj.syear |
如何讓DataGrid有那種選到該列就變顏色的效果呢?
Step 1.
實作ItemCreated事件
Private Sub dgdBlockCourse_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgdBlockCourse.ItemCreated e.Item.Attributes.Add("onmouseover", "javascript:this.className='blueon'") e.Item.Attributes.Add("onmouseout", "javascript:this.className='blueoff'") e.Item.Attributes.Add("class", "White") End Sub |
最近有寫有關系統登入的部份,剛好看到董大偉先生的ASP.NET程式設計徹底研究(這本書很不錯)
有一個範例是有關登入的機制,之前寫J2EE時並沒有用過這個用法…
第一:
先建立有關使用者登入的物件
Public Class LoginObj
Private _emp_no As String = "" ' 使用者帳號
......
' 使用者帳號