Private Sub dgrKostendrager_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgrKostendrager.ItemDataBound
If e.Item.ItemType = ListItemType.AlternatingItem OrElse e.Item.ItemType = ListItemType.Item Then
Dim btnTemp As Button = CType(e.Item.FindControl("btnSelecteer"), Button)
btnTemp.Attributes.Add("onclick", "doSelect('" & e.Item.DataItem("KOSTL") & "','" & Replace(e.Item.DataItem("KLTXT"), "'", "\'") & "'); return false;")
End If
End Sub
e.Item.DataItem("KOSTL")
和e.Item.DataItem("KLTXT")
的后期绑定问题
答案 0 :(得分:0)
错误是由于数据类型不匹配
将e.Item.DataItem(“ KOSTL”)更改为e.Item.DataItem(“ KOSTL”)。ToString()
from PIL import Image
import requests
img = Image.open(requests.get(url, stream = True).raw)
img.save('img1.jpg')