启用选项严格时进行后期绑定

时间:2018-09-17 08:10:15

标签: vb.net

 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")的后期绑定问题

1 个答案:

答案 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')