imageUrl and email

collie

New member
imageUrl and email

Good morning, Can someone please help me with my question? 1. ImageUrl: I have an image on my aspx page. The images are located in a certain folder on my computer. I also have a database where each user has a different picture. How can i write the imageurl to receive the picture from the database. In the database only the name and file extension is written such as pic1.jpg and not the entire path such as d:/pictures/pic1.jpg.​
 

collie

New member
email

Hi, I forgot to ask my email question: I want to include an email link such as the following: <a href mailto=email@email> Joe Cohen </a> Both the name and email i receive from the database. How can i do it? This is what i tried: ad_poster=rs("email").value Label1.Text = ad_poster & mail.To = email​
 

gooshi

New member
email

first make this runat=server and give it an ID in the aspx page like this: <a runat="server" id="lnk"></a> in the code page do this: add this row, in the class before page_load: protected withevents lnk as System.Web.UI.HtmlControls.HtmlAnchor dim userName as string 'get the user name from the RS, something like this but with the right 'Key inside the Quotation Marks userName=rs("name").value ad_poster=rs("email").value lnk.innerHTML = userName lnk.href = "mailto:" & ad_poster Hope it works...
The Goosh
 

collie

New member
Object reference not set to an inst

Thanks for the reply. The navigateUrl thingy works but not the email. I wrote exactly what you told me to and i receive the following error: Object reference not set to an instance of an object. lnk.href = "mailto:" & email I get email from the db: email=rs("email").value​
 

collie

New member
../images/Emo13.gif|nevermind it works

I had a label that caused the problem. It works great now. Thanks sooooooooo much.​
 

gooshi

New member
ImageUrl

you must write something like this: //Code to Get Data Table from Database and put the image name into //a string variable - > named imageName string const IMAGE_DIR = "c:\MyImagesFolder\"; string imageFullPath = IMAGE_DIR + imageName; obj.ImageUrl = imageFullPath; Hope this helps...
The Goosh
 
למעלה