I have an image that i would like to change for each company that logs in to the site.开发者_如何学Go" />
开发者

Dynamically change a picture in asp.net

img src="Images/MainMaster/TruckImg.gif" id="imgCompanyLogo" alt="Company Logo" />

I have an image that i would like to change for each company that logs in to the site.开发者_如何学Go How can i dynamically change that picture to an image stored in my database? Thank you!


You need to have a dictionary that connects a log-in ID to a picture path on your databse. At log-in (or just on PageLoad, I have no idea how your site is set up), just say:

string filePath = ImageTable[loginID]
imgCompanyLogo.ImageURL = filePath;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜