473,473 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Images on server.

Hi all,
I'm facing this problem I have images on my website but when I Deploye
the website on server the Images are not there I only get the X sign.
How can I go about this.
Thanks

Mar 30 '07 #1
76 2890
"rcoco" <nc******@yahoo.cawrote in message
news:11**********************@d57g2000hsg.googlegr oups.com...
I'm facing this problem I have images on my website but when I Deploye
the website on server the Images are not there I only get the X sign.
How can I go about this.
By making sure that the images are where the rest of the app is expecting to
find them...

Why are they not there...? Have you forgotten to deploy them to the
website...? Are you using absolute addressing when you should be using
relative addressing...?
Mar 30 '07 #2
"rcoco" <nc******@yahoo.cawrote in message
news:11**********************@d57g2000hsg.googlegr oups.com...
>I'm facing this problem I have images on my website but when I
Deploye the website on server the Images are not there I only get the
X sign. How can I go about this.
By making sure that the images are where the rest of the app is
expecting to find them...

Why are they not there...? Have you forgotten to deploy them to the
website...? Are you using absolute addressing when you should be using
relative addressing...?
And to test this, see the properties of such a failed image (or find it in
the
html-source of the page in the browser). Is the URL what you expect it to
be? Are the images really where that URL is pointing to?

Hans Kesting
Mar 30 '07 #3
On Mar 30, 12:53 pm, Hans Kesting <news.2.han...@spamgourmet.com>
wrote:
"rcoco" <nclau...@yahoo.cawrote in message
news:11**********************@d57g2000hsg.googlegr oups.com...
I'm facing this problem I have images on my website but when I
Deploye the website on server the Images are not there I only get the
X sign. How can I go about this.
By making sure that the images are where the rest of the app is
expecting to find them...
Why are they not there...? Have you forgotten to deploy them to the
website...? Are you using absolute addressing when you should be using
relative addressing...?

And to test this, see the properties of such a failed image (or find it in
the
html-source of the page in the browser). Is the URL what you expect it to
be? Are the images really where that URL is pointing to?

Hans Kesting
Thanks Hans,
I have managed to see it on The server But when I try getting the
website on The Client I can't see Images. what could i do?
Thanks.

Mar 30 '07 #4
"rcoco" <nc******@yahoo.cawrote in message
news:11**********************@y80g2000hsf.googlegr oups.com...
I have managed to see it on The server But when I try getting the
website on The Client I can't see Images. what could i do?
Ah... you surely haven't hardcoded the full filespec of the image files,
have you...?

E.g. <img src="C:\Inetpub\wwwroot\MyProject\images\logo.jpg" />
Mar 30 '07 #5
On Mar 30, 5:02 pm, "Mark Rae" <m...@markNOSPAMrae.comwrote:
"rcoco" <nclau...@yahoo.cawrote in message

news:11**********************@y80g2000hsf.googlegr oups.com...
I have managed to see it on The server But when I try getting the
website on The Client I can't see Images. what could i do?

Ah... you surely haven't hardcoded the full filespec of the image files,
have you...?

E.g. <img src="C:\Inetpub\wwwroot\MyProject\images\logo.jpg" />
Thanks,
Is it any different? I'm using ImageUrl.
ImageUrl="file:///C:\Inetpub\wwwroot\MyProject\Images\logo.JPG "
Thanks

Mar 30 '07 #6
"rcoco" <nc******@yahoo.cawrote in message
news:11*********************@e65g2000hsc.googlegro ups.com...
On Mar 30, 5:02 pm, "Mark Rae" <m...@markNOSPAMrae.comwrote:
>"rcoco" <nclau...@yahoo.cawrote in message

news:11**********************@y80g2000hsf.googleg roups.com...
I have managed to see it on The server But when I try getting the
website on The Client I can't see Images. what could i do?

Ah... you surely haven't hardcoded the full filespec of the image files,
have you...?

E.g. <img src="C:\Inetpub\wwwroot\MyProject\images\logo.jpg" />

Thanks,
Is it any different? I'm using ImageUrl.
ImageUrl="file:///C:\Inetpub\wwwroot\MyProject\Images\logo.JPG "
It's the same thing - this is never going to work...

Use relative addressing for all your images.
Mar 30 '07 #7
Hi Mark,
Could you please help me and show a simple example how to use relative
addressing?
Thank you.

Apr 2 '07 #8
Hi Mark,
Could you please help me and show a simple example how to use relative
addressing?
Thank you.

Apr 2 '07 #9
On Apr 2, 10:09 am, "rcoco" <nclau...@yahoo.cawrote:
Hi Mark,
Could you please help me and show a simple example how to use relative
addressing?
Thank you.
If MyProject is a name of the virtual root, you can represent it (the
root path) with a tilda (~) character.

~/Images/logo.JPG

If the web form is located in C:\Inetpub\wwwroot\MyProject\

you can use

Images/logo.JPG

Apr 2 '07 #10
"rcoco" <nc******@yahoo.cawrote in message
news:11**********************@y66g2000hsf.googlegr oups.com...
Could you please help me and show a simple example how to use relative
addressing?
http://www.google.co.uk/search?sourc...ive+address%22
Apr 2 '07 #11
thanks,
I have just tried it but it ain't working this is how I've just tried
it: ImageUrl="file:///C:\Inetpub\wwwroot\Images\logo.JPG".
Thanks.

Apr 2 '07 #12
"rcoco" <nc******@yahoo.cawrote in message
news:11*********************@y66g2000hsf.googlegro ups.com...

Rocco,
I have just tried it but it ain't working this is how I've just tried
it: ImageUrl="file:///C:\Inetpub\wwwroot\Images\logo.JPG".
You cannot hard-code the absolute path like this!!!

Not sure why you seem to be finding this so difficult to understand...

Imagine your site has the following structure (FORGET TOTALLY ABOUT
C:\Inetpub\wwwroot !!!)

<root>
\bin
\Properties
\References
\Folder1
File1.aspx
File2.aspx
\Folder2
File3.aspx
File4.aspx
\images
logo.jpg
\master
default.master
default.aspx
Global.asax
web.config

You are editing \Folder1\File1.aspx and want to include a link to your
logo - do this:

ImageUrl="../images/logo.jpg"

or

ImageUrl="~/images/logo.jpg"
Apr 2 '07 #13
Thanks Ray,
When I did this:ImageUrl="../Images/logo.JPG", Even on serverside
cannot see the image.
Thanks.

Apr 2 '07 #14
On Apr 2, 2:04 pm, "rcoco" <nclau...@yahoo.cawrote:
Thanks Ray,
When I did this:ImageUrl="../Images/logo.JPG", Even on serverside
cannot see the image.
Thanks.
and what about TILDA?

Apr 2 '07 #15
Even tilda does not show any Image.
Thanks

Apr 2 '07 #16
"Alexey Smirnov" <al************@gmail.comwrote in message
news:11**********************@n76g2000hsh.googlegr oups.com...
On Apr 2, 2:04 pm, "rcoco" <nclau...@yahoo.cawrote:
>Thanks Ray,
When I did this:ImageUrl="../Images/logo.JPG", Even on serverside
cannot see the image.
Thanks.

and what about TILDA?
http://en.wikipedia.org/wiki/Tilde
Apr 2 '07 #17
"rcoco" <nc******@yahoo.cawrote in message
news:11**********************@o5g2000hsb.googlegro ups.com...
Even tilda does not show any Image.
Do a View Source and look at the URL that ASP.NET has created - what does it
say...?
Apr 2 '07 #18
On Apr 2, 4:04 pm, "Mark Rae" <m...@markNOSPAMrae.comwrote:
"rcoco" <nclau...@yahoo.cawrote in message

news:11**********************@o5g2000hsb.googlegro ups.com...
Even tilda does not show any Image.

Do a View Source and look at the URL that ASP.NET has created - what does it
say...?

It says: <img id="Logo2" src="../Images/logo.JPG".
Thanks.

Apr 2 '07 #19
"rcoco" <nc******@yahoo.cawrote in message
news:11*********************@o5g2000hsb.googlegrou ps.com...
On Apr 2, 4:04 pm, "Mark Rae" <m...@markNOSPAMrae.comwrote:
>"rcoco" <nclau...@yahoo.cawrote in message

news:11**********************@o5g2000hsb.googlegr oups.com...
Even tilda does not show any Image.

Do a View Source and look at the URL that ASP.NET has created - what does
it
say...?


It says: <img id="Logo2" src="../Images/logo.JPG".
Cool! Now we're getting somewhere - you're finally using relative
addressing - hurrah!

So, is the above source actually correct relative to the folder that the
ASPX is in...?
Apr 2 '07 #20
On Apr 2, 5:19 pm, "Mark Rae" <m...@markNOSPAMrae.comwrote:
"rcoco" <nclau...@yahoo.cawrote in message

news:11*********************@o5g2000hsb.googlegrou ps.com...
On Apr 2, 4:04 pm, "Mark Rae" <m...@markNOSPAMrae.comwrote:
"rcoco" <nclau...@yahoo.cawrote in message
>news:11**********************@o5g2000hsb.googlegr oups.com...
Even tilda does not show any Image.
Do a View Source and look at the URL that ASP.NET has created - what does
it
say...?
It says: <img id="Logo2" src="../Images/logo.JPG".

Cool! Now we're getting somewhere - you're finally using relative
addressing - hurrah!

So, is the above source actually correct relative to the folder that the
ASPX is in...?
Yes it is.

Apr 2 '07 #21
On Apr 2, 5:42 pm, "rcoco" <nclau...@yahoo.cawrote:
On Apr 2, 5:19 pm, "Mark Rae" <m...@markNOSPAMrae.comwrote:


"rcoco" <nclau...@yahoo.cawrote in message
news:11*********************@o5g2000hsb.googlegrou ps.com...
On Apr 2, 4:04 pm, "Mark Rae" <m...@markNOSPAMrae.comwrote:
>"rcoco" <nclau...@yahoo.cawrote in message
>>news:11**********************@o5g2000hsb.googleg roups.com...
Even tilda does not show any Image.
>Do a View Source and look at the URL that ASP.NET has created - what does
>it
>say...?
It says: <img id="Logo2" src="../Images/logo.JPG".
Cool! Now we're getting somewhere - you're finally using relative
addressing - hurrah!
So, is the above source actually correct relative to the folder that the
ASPX is in...?

Yes it is.- Hide quoted text -

- Show quoted text -
Hi,
I was wondering does it matter where I place the folder with the
Images could it be the problem?
Thanks.

Apr 3 '07 #22
"rcoco" <nc******@yahoo.cawrote in message
news:11**********************@b75g2000hsg.googlegr oups.com...
I was wondering does it matter where I place the folder with the
Images
Of course it does!!!
Apr 3 '07 #23
On Apr 3, 3:35 pm, "Mark Rae" <m...@markNOSPAMrae.comwrote:
"rcoco" <nclau...@yahoo.cawrote in message

news:11**********************@b75g2000hsg.googlegr oups.com...
I was wondering does it matter where I place the folder with the
Images

Of course it does!!!
They are next to the Bin folder hope I'm not doing a mistake!
Thanks

Apr 3 '07 #24
"rcoco" <nc******@yahoo.cawrote in message
news:11**********************@d57g2000hsg.googlegr oups.com...
On Apr 3, 3:35 pm, "Mark Rae" <m...@markNOSPAMrae.comwrote:
>"rcoco" <nclau...@yahoo.cawrote in message

news:11**********************@b75g2000hsg.googleg roups.com...
I was wondering does it matter where I place the folder with the
Images

Of course it does!!!

They are next to the Bin folder hope I'm not doing a mistake!
Oh dear... The important thing here is the depth of the folder in relation
to the root.

Once again...

Imagine your site has the following structure (FORGET TOTALLY ABOUT
C:\Inetpub\wwwroot !!!)

<root>
\bin
\Properties
\References
\Folder1
File1.aspx
File2.aspx
\Folder2
File3.aspx
File4.aspx
\Folder3
File5.aspx
\images
logo.jpg
\master
default.master
default.aspx
Global.asax
web.config

You are editing \Folder1\File1.aspx and want to include a link to your
logo - do this: ImageUrl="../images/logo.jpg"

However, that wouldn't work for File5.aspx because it is at a different
depth relative to the root. For File5.aspx, you'd need to do:
ImageUrl="../../images/logo.jpg"

Apr 3 '07 #25
On Apr 3, 3:23 pm, "Mark Rae" <m...@markNOSPAMrae.comwrote:
You are editing \Folder1\File1.aspx and want to include a link to your
logo - do this: ImageUrl="../images/logo.jpg"

However, that wouldn't work for File5.aspx because it is at a different
depth relative to the root. For File5.aspx, you'd need to do:
ImageUrl="../../images/logo.jpg"
Parent paths are disabled by default in IIS 6.0 and can be disabled on
IIS 5 as well.

Why don't you use

ImageUrl="/images/logo.jpg"

That path will always work, with no depends where the aspx is located.

Apr 3 '07 #26
On Apr 2, 3:04 pm, "Mark Rae" <m...@markNOSPAMrae.comwrote:
"Alexey Smirnov" <alexey.smir...@gmail.comwrote in message

news:11**********************@n76g2000hsh.googlegr oups.com...
On Apr 2, 2:04 pm, "rcoco" <nclau...@yahoo.cawrote:
Thanks Ray,
When I did this:ImageUrl="../Images/logo.JPG", Even on serverside
cannot see the image.
Thanks.
and what about TILDA?

http://en.wikipedia.org/wiki/Tilde
All right. Good to know

Apr 3 '07 #27
On localhost, the code: ImageUrl="/images/logo.jpg" works but when
deployed on server it doesnot work? Why is it so?
Thanks.

Apr 4 '07 #28
On Apr 4, 1:45 pm, "rcoco" <nclau...@yahoo.cawrote:
On localhost, the code: ImageUrl="/images/logo.jpg" works but when
deployed on server it doesnot work? Why is it so?
Thanks.
On the server you should have the same configuration as on the
localhost. Namely,

1) the aspx page is in the root directory
2) the root directory has /images
3) logo.JPG is in the /images

Apr 4 '07 #29
Thanks alot,
I have just realised my stupid mistake, I wasn't deploying the Image
after deploying the image i had to only add this code in html:
ImageUrl="logo.JPG" and now it's working well.
Thanks again.

Apr 4 '07 #30
"rcoco" <nc******@yahoo.cawrote in message
news:11**********************@l77g2000hsb.googlegr oups.com...
I have just realised my stupid mistake, I wasn't deploying the Image
That was the very first thing I asked you in my first reply to your original
post back on 30th March...
Apr 4 '07 #31
Yes I have realised that's true that's why it becomes more stupid of
me not to have realised that yet I had the answer from you at the
begining. Sorry for that and I really Appriciate all the help.
Thanks alot

Apr 5 '07 #32
Here again I'm in trouble. I have this datagrid column that is
Supposed to hold both Character and Image. I set RadioButtonlist that
has two radiobutton. One good mood the other one bad mood. In the same
column are two images one imggm the other imgbm. When radiobutton good
mood is selected I want image imggm to be selected automatically. I'm
using this code.

System.Web.UI.WebControls.RadioButtonList st5=new
System.Web.UI.WebControls.RadioButtonList();
st5=(System.Web.UI.WebControls.RadioButtonList)e.I tem.Cells[1].FindControl("rblmood");
System.Web.UI.WebControls.Image imgDaily=new
System.Web.UI.WebControls.Image();
imgDaily=(System.Web.UI.WebControls.Image)e.Item.C ells[1].FindControl("imgbm");
myCommand.Parameters.Add(new SqlParameter("@MoodToday",SqlDbType.Char,
45));
if(e.Item.Cells[1].Equals("Bad Mood"))
{
imgDaily.ImageUrl = "imgbm";
}
else
{
imgDaily.ImageUrl = "imggm";
}
myCommand.Parameters["@MoodToday"].Value=st5.SelectedValue;
My problem is that only goog mood appears but the image imggm does not
does not appear how should I do it.
Thanks

Apr 5 '07 #33
On Apr 5, 9:36 am, "rcoco" <nclau...@yahoo.cawrote:
Here again I'm in trouble. I have this datagrid column that is
Supposed to hold both Character and Image. I set RadioButtonlist that
has two radiobutton. One good mood the other one bad mood. In the same
column are two images one imggm the other imgbm. When radiobutton good
mood is selected I want image imggm to be selected automatically. I'm
using this code.

System.Web.UI.WebControls.RadioButtonList st5=new
System.Web.UI.WebControls.RadioButtonList();
st5=(System.Web.UI.WebControls.RadioButtonList)e.I tem.Cells[1].FindControl(*"rblmood");
System.Web.UI.WebControls.Image imgDaily=new
System.Web.UI.WebControls.Image();
imgDaily=(System.Web.UI.WebControls.Image)e.Item.C ells[1].FindControl("imgb*m");
myCommand.Parameters.Add(new SqlParameter("@MoodToday",SqlDbType.Char,
45));
if(e.Item.Cells[1].Equals("Bad Mood"))
{
imgDaily.ImageUrl = "imgbm";}

else
{
imgDaily.ImageUrl = "imggm";}

myCommand.Parameters["@MoodToday"].Value=st5.SelectedValue;
My problem is that only goog mood appears but the image imggm does not
does not appear how should I do it.
Thanks
>From the code above you cannot see if e.Item.Cells[1] equals the "Bad
Mood" or not. I'm also confused about

e.Item.Cells[1].FindControl("imgb*m");

It used the same cell of the grid. If cell[1] contains a control named
"imgb*m", it cannot be equal to the "Bad Mood"

Apr 5 '07 #34
Imgbm is a sad img is supposed to equal Bad Mood. And these are two
different images. it's supposed to be small image followed by the word
bad or good mood now e.Item.Cells[1].FindControl("imgb*m"); I'm not
sure about it at all. But hope you've managed to get what I want to
do? If you could help me Please.
Thanks

Apr 5 '07 #35
On Apr 5, 12:02 pm, "rcoco" <nclau...@yahoo.cawrote:
Imgbm is a sad img is supposed to equal Bad Mood. And these are two
different images. it's supposed to be small image followed by the word
bad or good mood now e.Item.Cells[1].FindControl("imgb*m"); I'm not
sure about it at all. But hope you've managed to get what I want to
do? If you could help me Please.
Thanks
"Imgbm" cannot be a name of an image and you cannot use it as a value
for the ImageUrl property.

e.Item.Cells[1] cannot be equals to "Bad Mood". If "Bad Mood" is a
value of a radiobutton, then you should compare the value of the
radiobutton

if(st5.SelectedValue == "Bad Mood") {
....
} else {
....
}

Start the application in Debug Mode and check the values.

Apr 5 '07 #36
Hi,
have just tryed this but it seems not to work? where is it wrong?
if(st5.SelectedValue=="Bad Mood")
{
st5.SelectedValue="Images/sad.gif";
}
else if(st5.SelectedValue=="Good Mood")
{
st5.SelectedValue="Images/laughing.gif";
}
And this is the error I'm getting:
Specified argument was out of the range of valid values. Parameter
name: Images/laughing.gif.
Thanks

Apr 5 '07 #37
On Apr 5, 4:37 pm, "rcoco" <nclau...@yahoo.cawrote:
Hi,
have just tryed this but it seems not to work? where is it wrong?
if(st5.SelectedValue=="Bad Mood")
{
st5.SelectedValue="Images/sad.gif";}

else if(st5.SelectedValue=="Good Mood")
{
st5.SelectedValue="Images/laughing.gif";}

And this is the error I'm getting:
Specified argument was out of the range of valid values. Parameter
name: Images/laughing.gif.
Thanks
st5 is your RadioButtonList

st5=(System.Web.UI.WebControls.RadioButtonList)e.I tem.Cells[1].FindControl(*"rblmood");

so, what do you want to get using

st5.SelectedValue="Images/laughing.gif";

?

Apr 5 '07 #38
On Apr 5, 11:10 pm, "Alexey Smirnov" <alexey.smir...@gmail.comwrote:
On Apr 5, 4:37 pm, "rcoco" <nclau...@yahoo.cawrote:
Hi,
have just tryed this but it seems not to work? where is it wrong?
if(st5.SelectedValue=="Bad Mood")
{
st5.SelectedValue="Images/sad.gif";}
else if(st5.SelectedValue=="Good Mood")
{
st5.SelectedValue="Images/laughing.gif";}
And this is the error I'm getting:
Specified argument was out of the range of valid values. Parameter
name: Images/laughing.gif.
Thanks

st5 is your RadioButtonList

st5=(System.Web.UI.WebControls.RadioButtonList)e.I tem.Cells[1].FindControl(**"rblmood");

so, what do you want to get using

st5.SelectedValue="Images/laughing.gif";

?
Sorry I've been away for some time. Yes st5 is my RadioButtonList. I
want the image laughing to come along when good mood is selected.
that's: st5.SelectedValue="Images/laughing.gif";
Thanks.

Apr 10 '07 #39
On Apr 10, 6:57 am, "rcoco" <nclau...@yahoo.cawrote:
On Apr 5, 11:10 pm, "Alexey Smirnov" <alexey.smir...@gmail.comwrote:


On Apr 5, 4:37 pm, "rcoco" <nclau...@yahoo.cawrote:
Hi,
have just tryed this but it seems not to work? where is it wrong?
if(st5.SelectedValue=="Bad Mood")
{
st5.SelectedValue="Images/sad.gif";}
else if(st5.SelectedValue=="Good Mood")
{
st5.SelectedValue="Images/laughing.gif";}
And this is the error I'm getting:
Specified argument was out of the range of valid values. Parameter
name: Images/laughing.gif.
Thanks
st5 is your RadioButtonList
st5=(System.Web.UI.WebControls.RadioButtonList)e.I tem.Cells[1].FindControl(***"rblmood");
so, what do you want to get using
st5.SelectedValue="Images/laughing.gif";
?

Sorry I've been away for some time. Yes st5 is my RadioButtonList. I
want the image laughing to come along when good mood is selected.
that's: st5.SelectedValue="Images/laughing.gif";
Thanks.- Hide quoted text -

- Show quoted text -
1) SelectedValue is a read-only property and you cannot assign a value
using st5.SelectedValue=...

2) st5 is a RadioButtonList and it cannot be equal to the "Images/
laughing.gif"

Apr 10 '07 #40
On Apr 10, 10:12 am, "Alexey Smirnov" <alexey.smir...@gmail.com>
wrote:
On Apr 10, 6:57 am, "rcoco" <nclau...@yahoo.cawrote:


On Apr 5, 11:10 pm, "Alexey Smirnov" <alexey.smir...@gmail.comwrote:
On Apr 5, 4:37 pm, "rcoco" <nclau...@yahoo.cawrote:
Hi,
have just tryed this but it seems not to work? where is it wrong?
if(st5.SelectedValue=="Bad Mood")
{
st5.SelectedValue="Images/sad.gif";}
else if(st5.SelectedValue=="Good Mood")
{
st5.SelectedValue="Images/laughing.gif";}
And this is the error I'm getting:
Specified argument was out of the range of valid values. Parameter
name: Images/laughing.gif.
Thanks
st5 is your RadioButtonList
st5=(System.Web.UI.WebControls.RadioButtonList)e.I tem.Cells[1].FindControl(****"rblmood");
so, what do you want to get using
st5.SelectedValue="Images/laughing.gif";
?
Sorry I've been away for some time. Yes st5 is my RadioButtonList. I
want the image laughing to come along when good mood is selected.
that's: st5.SelectedValue="Images/laughing.gif";
Thanks.- Hide quoted text -
- Show quoted text -

1) SelectedValue is a read-only property and you cannot assign a value
using st5.SelectedValue=...

2) st5 is a RadioButtonList and it cannot be equal to the "Images/
laughing.gif"- Hide quoted text -

- Show quoted text -
Is that the reason I'm getting this error:
Specified argument was out of the range of valid values. Parameter
name: Images/laughing.gif ?
Thanks

Apr 10 '07 #41
On Apr 10, 9:28 am, "rcoco" <nclau...@yahoo.cawrote:
On Apr 10, 10:12 am, "Alexey Smirnov" <alexey.smir...@gmail.com>
wrote:


On Apr 10, 6:57 am, "rcoco" <nclau...@yahoo.cawrote:
On Apr 5, 11:10 pm, "Alexey Smirnov" <alexey.smir...@gmail.comwrote:
On Apr 5, 4:37 pm, "rcoco" <nclau...@yahoo.cawrote:
Hi,
have just tryed this but it seems not to work? where is it wrong?
if(st5.SelectedValue=="Bad Mood")
{
st5.SelectedValue="Images/sad.gif";}
else if(st5.SelectedValue=="Good Mood")
{
st5.SelectedValue="Images/laughing.gif";}
And this is the error I'm getting:
Specified argument was out of the range of valid values. Parameter
name: Images/laughing.gif.
Thanks
st5 is your RadioButtonList
st5=(System.Web.UI.WebControls.RadioButtonList)e.I tem.Cells[1].FindControl(*****"rblmood");
so, what do you want to get using
st5.SelectedValue="Images/laughing.gif";
?
Sorry I've been away for some time. Yes st5 is my RadioButtonList. I
want the image laughing to come along when good mood is selected.
that's: st5.SelectedValue="Images/laughing.gif";
Thanks.- Hide quoted text -
- Show quoted text -
1) SelectedValue is a read-only property and you cannot assign a value
using st5.SelectedValue=...
2) st5 is a RadioButtonList and it cannot be equal to the "Images/
laughing.gif"- Hide quoted text -
- Show quoted text -

Is that the reason I'm getting this error:
Specified argument was out of the range of valid values. Parameter
name: Images/laughing.gif ?
Thanks- Hide quoted text -

- Show quoted text -
Wait, I think I made a mistake telling that it's a read-only:

MSDN: "Gets the value of the selected item in the list control, or
selects the item in the list control that contains the specified
value."
Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

Sorry.

The error message "Specified argument was out of the range of valid
values. Parameter name: Images/laughing.gif" means that there is no
such value "Images/laughing.gif".

Apr 10 '07 #42
"Alexey Smirnov" <al************@gmail.comwrote in message
news:11**********************@l77g2000hsb.googlegr oups.com...
1) SelectedValue is a read-only property
No it isn't...
Apr 10 '07 #43
On Apr 10, 10:01 am, "Mark Rae" <m...@markNOSPAMrae.comwrote:
"Alexey Smirnov" <alexey.smir...@gmail.comwrote in message

news:11**********************@l77g2000hsb.googlegr oups.com...
1) SelectedValue is a read-only property

No it isn't...
I had already replied on this

Apr 10 '07 #44
"Alexey Smirnov" <al************@gmail.comwrote in message
news:11*********************@w1g2000hsg.googlegrou ps.com...
On Apr 10, 10:01 am, "Mark Rae" <m...@markNOSPAMrae.comwrote:
>"Alexey Smirnov" <alexey.smir...@gmail.comwrote in message

news:11**********************@l77g2000hsb.googleg roups.com...
1) SelectedValue is a read-only property

No it isn't...

I had already replied on this
Sorry - your reply hadn't arrived when I posted...
Apr 10 '07 #45
On Apr 10, 11:14 am, "Alexey Smirnov" <alexey.smir...@gmail.com>
wrote:
On Apr 10, 10:01 am, "Mark Rae" <m...@markNOSPAMrae.comwrote:
"Alexey Smirnov" <alexey.smir...@gmail.comwrote in message
news:11**********************@l77g2000hsb.googlegr oups.com...
1) SelectedValue is a read-only property
No it isn't...

I had already replied on this
How can I make it work? Please help me.
thanks

Apr 10 '07 #46
On Apr 10, 10:33 am, "rcoco" <nclau...@yahoo.cawrote:
On Apr 10, 11:14 am, "Alexey Smirnov" <alexey.smir...@gmail.com>
wrote:
On Apr 10, 10:01 am, "Mark Rae" <m...@markNOSPAMrae.comwrote:
"Alexey Smirnov" <alexey.smir...@gmail.comwrote in message
>news:11**********************@l77g2000hsb.googleg roups.com...
1) SelectedValue is a read-only property
No it isn't...
I had already replied on this

How can I make it work? Please help me.
thanks
Mark, no problem, actually I don't know why I thought it's a read-only
property. Maybe I had never used that before.

Rcoco,

You should understand conceptually what you are doing, rather than
following copy-and-paste code blindly. Your program is working as you
designed it, and not as you might think it should work.

You have to understand what the "out of the range of valid values"
means. This means that st5 (a RadioButtonList) has no value named
"Images/laughing.gif". I cannot answer, how you can make it working,
because I don't know how it should work. You used the following code
before:

imgDaily.ImageUrl = "imgbm"

Now, you are using

st5.SelectedValue = "..."

Why did you change this and what is the logic behind?

I thought, you wanted to change an image. Using st5.SelectedValue you
will change selection (a point) of the radio button.

If you definitely need to change the selected item in the
RadioButtonList you should know what values it has. Look in your code
where you bind the values (dataset, whatever) to this control.

Apr 10 '07 #47
On Apr 10, 11:07 am, "Alexey Smirnov" <alexey.smir...@gmail.com>
wrote:
On Apr 10, 10:33 am, "rcoco" <nclau...@yahoo.cawrote:

Rcoco,

You should understand conceptually what you are doing, rather than
following copy-and-paste code blindly. Your program is working as you
designed it, and not as you might think it should work.

You have to understand what the "out of the range of valid values"
means. This means that st5 (a RadioButtonList) has no value named
"Images/laughing.gif". I cannot answer, how you can make it working,
because I don't know how it should work. You used the following code
before:

imgDaily.ImageUrl = "imgbm"

Now, you are using

st5.SelectedValue = "..."

Why did you change this and what is the logic behind?

I thought, you wanted to change an image. Using st5.SelectedValue you
will change selection (a point) of the radio button.

If you definitely need to change the selected item in the
RadioButtonList you should know what values it has. Look in your code
where you bind the values (dataset, whatever) to this control.- Hide quoted text -

- Show quoted text -
P.S.

If you don't get what I mean, once again post the complete source code
of your radio button list which is not working as expected (aspx part
and code-behind) and explain how it should work step by step.

Apr 10 '07 #48
This is how the code looks like:

private void Page_Load(object sender, System.EventArgs e)
{
if (! IsPostBack)
{
Fill();
Bind();
}
}
System.Web.UI.WebControls.RadioButtonList st5=new
System.Web.UI.WebControls.RadioButtonList();
st5=(System.Web.UI.WebControls.RadioButtonList)e.I tem.Cells[1].FindControl("rblmood");
SqlCommand myCommand=new SqlCommand();
myCommand.Connection=con;
myCommand.CommandText="insert into DashBoard (MoodToday) values
(@MoodToday)";
myCommand.Parameters.Add(new
SqlParameter("@MoodToday",SqlDbType.Text));
myCommand.Parameters["@MoodToday"].Value=st5.SelectedValue;
if(st5.SelectedValue=="Bad Mood")
{
st5.SelectedValue="images/sad.gif";
}
else if(st5.SelectedValue=="Good Mood")
{
st5.SelectedValue="images/laughing.gif";
}
Fill();
InsertEmpty();
Bind();
This is the HTML part
<ItemTemplate>
<asp:Label id=Label2 runat="server" Width="104px" text='<%#
DataBinder.Eval(Container,"DataItem.MoodToday")%>' >Label</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:RadioButtonList id="rblmood" runat="server" Width="104px">
<asp:ListItem Value="Good Mood">Good Mood</asp:ListItem>
<asp:ListItem Value="Bad Mood">Bad Mood</asp:ListItem>
</asp:RadioButtonList>
<asp:Image id="imggm" runat="server" ImageUrl="../Images/laughing.gif"
ImageAlign="Right"></asp:Image>
<asp:Image id="imgbm" runat="server" ImageUrl="../Images/sad.gif"
ImageAlign="Right"></asp:Image>
</EditItemTemplate>
Thanks

Apr 10 '07 #49
This how it is supposed to work.
When a user selects RadioButton GoodMood the image imggm(laughing.gif)
should be selected as well.
and if BadMood is selected Image imgbm it should be imgbm(sad.gif).
Thanks.

Apr 10 '07 #50

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mark Allison | last post by:
Hi, Newbie here, please bear with me. I have a C# project which implements a tree view control. I want to add some images to this tree view control. The tree view control represents the tree...
3
by: Tim T | last post by:
Hi, I hope there is someone reading this that has the answer, Please Help! I have the need to send a html email via asp.net. its easy enough to send an html email and add attachments. My...
3
by: Simon | last post by:
This problem has been driving me mad for months.... Seen a few posts on forums about it but no answers... No mention on MSDN etc. XP Pro SP1, VS.NET (c#) .Net framework 1.1, IIS 5.1. In a...
10
by: Neo Geshel | last post by:
I am seeking to hand-roll my own blog in ASP.NET 2.0 and SQLExpress 2005. Why? Because I can. Because I will gain experience. The one thing that has me stumped at square one is inline images....
12
by: Jon B | last post by:
Hi There! For some reasons, some images of my ASP.NET website are cannot be displayed in the browser (even tho they exists on the server). They are just normal JPG and PNG images and the website...
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
12
by: John Kotuby | last post by:
Hi all, Maybe this is a simple problem found in ASP.NET 2.0 course 101, but I must have missed it. When I create a page in Visual Web Developer and use URLs like "/images/picture.gif " or a link...
8
by: Frank Millman | last post by:
Hi all This is not strictly a Python question, but as the system to which relates is written in Python, hopefully it is not too off-topic. I have an accounting/business application, written in...
7
by: Keith Hughitt | last post by:
Hi all, I am having trouble preloading images in a javascript application, and was wondering if anyone had any suggestions. Basically I have a bunch of images stored in a database as BLOBs. At...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.