Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > ASP.NET > ASP.NET General Discussion

ASP.NET General Discussion General discussion on ASP.NET development with VB.NET

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-27-2009, 9:00 AM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: May 2009
Posts: 7
Reputation: 0
IT_Help is on a distinguished programming path ahead
Default

Hi All,

I have a web page that accepts parameter and based on the parameter value it displays the image(Image is saved in project images folder with parametername.jpg)
Now what i am doing is, i am reading that parameter from query string and assigning it to a hidden value.
then on aspx page i am reading image as
<img src = "Images/<%hidden1.value%.jpg>"
this approach works fine but the problem is
1.) the images folder needs to be outside the project images folder and it adds the whole path of local system to the http://localhost:67634/images/C:/pro...eter.jpg--this results in no image found
2.) a default image to be displayed when no image found as i am chcking the file as file.exists(parameter.jpg)

Edit:
i am assingning a dynamic value to image through hidden feild value and it is not working.

the tag is
<img src="<%hidden1.value%>" alt=""/>

this does not show any image and on checking the properties of image it says no URL defined
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-22-2009, 12:49 PM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Jul 2009
Age: 32
Posts: 5
Reputation: 0
majicmonk is on a distinguished programming path ahead
Default

You should assign the image in the code behind file like:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If Request.QueryString("YourParameterName") IsNot Nothing Then
Image1.ImageUrl = Request.QueryString("YourParameterName")
Image1.Visible = True
Else
Image1.Visible = False
End If

End Sub

Last edited by majicmonk; 07-22-2009 at 1:56 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
dynamic, file, image


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 3:05 PM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.