The only problem that I need to overcome is that whilst my div tag shows 5 list items, what I need to achieve is to expand the div tag just enough to show the other list items. For instance if I need to show 7 list items, I need to expand the div tag height just to show 7 items, and equally to expand the height if there are 12 items.
Therefore, how I can I dynamically increase the height to fit the number of items I want to show without showing too little or too height?
Hi, you can put the items in another div(for example: id="divMoreItems") which is hidden first and which follows the first five items and is contained in your div. When you click the linkbutton, you can set divMoreItems's display="block" or "". When you click the linkbutton again, set divMoreItems's display="none".
i found this code to upload a file into a sql database using the asp.net fileupload object (or vb)
i found it here
i think it works, but i am a learning noob and have a question...where does my dbase info go in the code?
1. If FleUpload.HasFile Then
2. Dim fileName As String = Server.HtmlEncode(FleUpload.FileName)
3. Dim extension As String = System.IO.Path.GetExtension(fileName)
4. If (extension.ToUpper = ".JPG") Or (extension.ToUpper = ".GIF") Then
6. '**** Resize image section ****
7. Dim image_file As System.Drawing.Image = System.Drawing.Image.FromStream(FleUpload.PostedFile.InputStream)
8. Dim image_height As Integer = image_file.Height
9. Dim image_width As Integer = image_file.Width
10. Dim max_height As Integer = 120
11. Dim max_width As Integer = 160
14. image_height = (image_height * max_width) / image_width
15. image_width = max_width
17. If image_height > max_height Then
18. image_width = (image_width * max_height) / image_height
19. image_height = max_height
21. End If
24. Dim bitmap_file As New Bitmap(image_file, image_width, image_height)
25. Dim stream As New System.IO.MemoryStream
27. bitmap_file.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg)
28. stream.Position = 0
30. Dim data(stream.Length) As Byte
31. stream.Read(data, 0, stream.Length)
32. '**** End resize image section ****
35. Dim myConn As New SqlConnection(ConfigurationManager.ConnectionStrings("cs").ConnectionString)
36. Dim mycmd As New SqlCommand("se_equipmentimages_insert", myConn)
37. mycmd.CommandType = CommandType.StoredProcedure
39. mycmd.Parameters.AddWithValue("@equipment_id", id)
40. mycmd.Parameters.AddWithValue("@image_file", data)
45. Catch ex As Exception
48. End Try
51. lblError.Text = "Please only upload .jpg or .gif files"
52. lblError.Visible = True
53. End If
55. lblError.Text = "No file selected"
56. lblError.Visible = True
57. End If
I am using a multiview in one of my webpage but when I am switching from one view to another in multiview I can't access any control value of previous view to current view. Why am I geeting this problem?
You cannot do it directly.
Use any trick.
Like use div tags (runat=server) containg images and place it on the textbox by setting its position:absolute.
and on the click on div tag write the server side code.
The miracle is this--the more we share, the more we have.
Last Visit: 31-Dec-99 18:00 Last Update: 22-Jun-21 5:25