如何在formview中找到asp图像控件 [英] How to find asp image control in formview

查看:100
本文介绍了如何在formview中找到asp图像控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

In VB code of an ASP 3.5 page, I want to put an uploaded image into an image object on a FormView. My code looks like this:

FormView1.ChangeMode(FormViewMode.Edit)
Dim pictureIMG As Image = CType(FormView1.FindControl("Image2"), Image)
pictureIMG.DescriptionUrl = filePath & fileName

Where filepath and fileName are strings set equal to the correct path & filename on my local machine..

When I run the page on the local machine, I get this error message:

"Object reference not set to an instance of an object."

推荐答案

这篇关于如何在formview中找到asp图像控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆