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

开发者 https://www.devze.com 2023-03-24 09:31 出处:网络
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

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

精彩评论

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