code_junkie

How can I make my image control's imageurl dynamic depending on host?

Nov 12th, 2011
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
  2. If Request.Url.Host.Contains("localhost") Then
  3. Image1.ImageUrl = "C:Usersfirstname.lastnameDocumentsVisual Studio 2008WebSitesecardsystemimagesECard Platform.jpg."
  4.  
  5.  
  6. End If
  7.  
  8. End Sub
  9.  
  10. Image1.ImageUrl = "~/images/Card Platform.jpg."
Add Comment
Please, Sign In to add comment