asp.net中用户配置文件中的图像(C#) [英] image in user profile in asp.net(C#)

查看:65
本文介绍了asp.net中用户配置文件中的图像(C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
我的项目中有用户个人资料,

个人资料中有精选照片,



我的问题:

用户选择照片时(用户照片)应显示在他的所有页面上

但是我不知道怎么做

请帮帮我

hi I have user profiles on my project,
There is a selection of photos in profile,

My question:
When the user selects a photo(User Photo)should be displayed on all pages of his
But I do not know how to do it
Please help me

推荐答案





我想,你正在存储图片网址数据库。



在你想要照片的每一页的页面加载中调用这个方法。还要为getphotos()方法编写代码。

Hi,

I guess, you are storing image url's in database.

Call this method in page load of every page where you want photo.and also write code for getphotos() method.
public void BindMemberPhotos()
   {

       DataSet dsPhotos = user.GetPhotos();
       if (Convert.ToString(dsPhotos.Tables[0].Rows[0]["Photo"]) != null && Convert.ToString(dsPhotos.Tables[0].Rows[0]["Photo"]) != "")

       {
           imgPhoto.Visible = true;
           imgPhoto.ImageUrl =  dsPhotos.Tables[0].Rows[0]["Photo"].ToString();
       }
       else
       {
          imgPhoto.Visible = true;
          imgPhoto.ImageUrl="~/images/NoImage.jpg";
       }
   }


这篇关于asp.net中用户配置文件中的图像(C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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