目前分類:ASP.NET(VB) (27)

瀏覽方式: 標題列表 簡短摘要

ASP.NET上傳圖檔自動修改成固定大小

 

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim filename As String = Session("name").ToString & ".jpg"
If FileUpload1.HasFile Then '檢查是否有檔案
Dim fileallow As Boolean = False '是否允許上載

毛魚 發表在 痞客邦 留言(0) 人氣()

<table border="0" cellpadding="0" cellspacing="0"
    width="185">
                                                  <tr>
                                                      <td height="25">
                                                          <table border="0" cellpadding="0" cellspacing="0"

毛魚 發表在 痞客邦 留言(0) 人氣()

Asp.net用smtp寄出信件

 

Try
Dim newPassword As String = ""
newPassword = newPassword & ((Rnd() * 99) \ 1) & Chr(Rnd() * 25 + 65) & ((Rnd() * 99) \ 1) & Chr(Rnd() * 25 + 65) & ((Rnd() * 99) \ 1) & Chr(Rnd() * 25 + 65)
SqlDataSource1.UpdateParameters("id").DefaultValue = id

毛魚 發表在 痞客邦 留言(0) 人氣()

ASP.NET將GridView表頭排序加上方向--vb.net

 

Protected Sub GridView1_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowCreated

'GridView1.SortExpression.ToString()

毛魚 發表在 痞客邦 留言(0) 人氣()

將FormView,GridView裡的DropDownList控制裡面的TextBOX

 

Protected Sub DropDownList4_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
CType(FormView1.Row.Cells(0).FindControl("post_titalTextBox"), TextBox).Text = CType(FormView1.Row.Cells(0).FindControl("DropDownList4"), DropDownList).SelectedValue
End Sub


毛魚 發表在 痞客邦 留言(0) 人氣()

將FormView,GridView匯出到excel

 

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim name As String = "attachment;filename="
name += Request.QueryString("name") + ".xls"
Response.Clear()

毛魚 發表在 痞客邦 留言(0) 人氣()

將FormView,GridView匯出到word

 

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
   Dim name As String = "attachment;filename="
   name += Request.QueryString("name") + ".doc"
   Response.Clear()

毛魚 發表在 痞客邦 留言(0) 人氣()

«12