2010-10-01 3 views
0

Regardez ce que j'aibackground-image de style chargement css URL dynamique en ut dièse

string imagePath = "http://" & ConfigurationManager.AppSettings("DomainName") & "/images/" 
htmlstring = <tr style='border-width: 0px; height: 36px; background-image: url(' " & imagePath & " cart_top_centbg.jpg');'> 

ici imagePath est configuré dans le fichier web.config, mais ce n'est pas geting chargé dans ce style css background-image, mi fait quelque chose de mal ici?

+1

Je ne pense pas que ce soit un problème css, en tant que tel. Dans quelle langue composez-vous le 'htmlstring'? –

+0

@David Thomar: ouais ce n'est pas un problème css, mais comment composer cette image backround est le problème et son en C sharp – FosterZ

+0

Merci, @FosterZ, vous pourriez bénéficier d'ajouter cela à vos balises pour la question. –

Répondre

1

Le code ci-dessus semble être la syntaxe VB? Si vous êtes en C#, vous auriez besoin:

string imagePath = @"http://" + ConfigurationManager.AppSettings["DomainName"] + "/images/"; 

string htmlstring = "<tr style='border-width: 0px; height: 36px; background-image: url('" + imagePath + "cart_top_centbg.jpg');'>";