1

在我的项目中,我有一个动态加载图像控件来显示该names & photos网站的成员。

为了检索图像,我使用了图像handler,但问题是在搜索框代码中我使用了类似搜索,以便可以动态显示相似的名称加载图像控件将显示所有名称,但图像对于所有图像都是相同的控件,如果我们明确告诉名称它将显示正确的图像,我该如何克服这个问题?

处理程序的代码如下:

SqlConnection connection = new SqlConnection(conn);
string s2 = HttpContext.Current.Request.QueryString["firstname"];
string sql = "SELECT UploadPhoto FROM profiledata  where firstname='" + s2 + "'";

在cs文件中,代码是这样的(动态加载图片控制页面):

string s2 = TextBox1.Text.ToString();
i2.ImageUrl = "~/ShowImage2.ashx?firstname=" + s2;
4

0 回答 0