|
I assign image path to some string variable like this:
string path = "C:\at.jpg";
and apply this:
protected void Page_Load(object sender, EventArgs e)
{
Response.Write(@"<table border='1'>");
Response.Write(@"<tr>");
Response.Write(@"<td><img src=path></td>");
Response.Write(@"<td><img src='D:\try.jpg'></td>");
Response.Write(@"</tr>");
Response.Write(@"</table>");
}
Then it does not display image neither it shows any error message. Why so?Please help..
|
|
|
|
|
As i mentioned in the post before do the following:
1. create a folder called images in your Application folder (where your website is)
2. copy the try.jpg to this folder
3. rewrite your code to this:
Reponse.Write(@"<td><img src='images\try.jpg'></td>");
The browser (client side) does not provide an error when it couldn't find the image file.
|
|
|
|
|
I understood your point, did the same and got the accurate results too..
but now i want to assign that image path to some variable and then want to assign that variable to src..as i said in my last message...
Guide me for this please!!!
|
|
|
|
|
Well than just do that:
<br />
string sImage = "images/try.jpg";<br />
...<br />
...<br />
Response.Write(@"<td><img src='" + sImage + "'></td>");<br />
|
|
|
|
|
|
Semartens!!
I want to vote your answer..How can i do that?
|
|
|
|
|
When you view my response, click at one of the numbers at the bottom right side of the message (labeled with "Rate this message") (1 is bad, 5 is good)
Thanks for voting This will mark your message as answered.
Regards
Sebastian
|
|
|
|
|
hello,
i'm dealing with a primitive http server that doesn't support client-side javascript.
my question is why does it have to support it? i am using internet explorer browser,
the browser does support js. why does the server have to support client-side javascript?
thank you,
|
|
|
|
|
Makes no sense. You mean your web server dont process client scripts. Javascripts are totally processed by the client.
The thing that you have to do, is just to download the js file to the client. Check the extensions associated with the web server.
Also if possible, let us know which server you are using?
|
|
|
|
|
hello,
thanks for answering.
you realy helped me. it was my problem and i thought it is the server's.
what about css? is it the same?! the server has to support it?
thanks again,
|
|
|
|
|
Yes .. Same buddy..
Just see if the extension css is blocked to the server or not. If it is not, css will load just like the JS.
|
|
|
|
|
as long as your pages have been coded correctly and the sever is meant to send js to files to the client it should work. Servers don't really "support" javascript. they send the files. and if they are not doing that then it's probably a security setting or server-side rule for javascript docs.
Javascript runs entirely client side. it can make requests for pages (http request), but that's just about it in terms of client-server interaction.
Like the other poster said; What server are you using???
|
|
|
|
|
maybe the web server only allow to download certain document.
in particular, maybe it DOESN'T allow to download .js file?
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Are you sure its not Java? I always thought jscript runs soley on the users computer.
|
|
|
|
|
I have integrated auto-suggest(using actb.js) within our application Uhuroo (Uhuroo is a web application that provides a smart and secure way of collaborating on documents with distributed teams).
The problem that we face is, suppose the auto-suggest may match 10 items and if we show just 5 at a time, it will show "\/ (5 more)"... Can I replace "\/"(combination of back slash and fore slash) with a nice image?
Thanks
|
|
|
|
|
Probably. But if you need help you need to provide code samples.
|
|
|
|
|
there is a replaceHTML(c,'/\\'); function call in the js file(ie. actb.js) that i have downloaded from here.
where c given like,
a = document.createElement('table');
r = a.insertRow(-1);
c = r.insertCell(-1);
c.style.color = actb_self.actb_textColor;
c.style.fontFamily = 'arial narrow';
c.style.fontSize = actb_self.actb_fSize;
c.align='center';
replaceHTML(c,'/\\');
in some other place replaceHTML is called with '\\/'.
Instead of this up and down arrows we needed an image.
Thanks.
|
|
|
|
|
dunno about replace html - but you can use "innerHTML" or "split" and "join".
|
|
|
|
|
sorry if this was discussed before. but i have to ask this question again.
I have a windows media player on my site. It's working fine with IE but not in firefox. I used javascript to play a video when the image is clicked.
here is my code. im getting an error document.getElementById("player").controls is undefined
Javascript Code:
<script language="javascript">
var forcepage = false;
var forcepagediv = '';
function changepage(page){
//alert(page);
var divwatch, divsynopsis, divreview, divrating, divemail,divrating2, divppv;
var imgwatch, imgsynopsis, imgreview, imgrating, imgemail, imgppv;
divwatch = document.all['divwatch'];
divsynopsis = document.all['divsynopsis'];
divreview = document.all['divreview'];
divrating = document.all['divrating'];
divemail = document.all['divemail'];
divrating2 = document.all['divrating2'];
divppv = document.all['divppv'];
imgwatch = document.all['imgwatch'];
imgsynopsis = document.all['imgsynopsis'];
imgreview = document.all['imgreview'];
imgrating = document.all['imgrating'];
imgemail = document.all['imgemail'];
imgppv = document.all['imgppv'];
if (divwatch && divsynopsis && divreview && divrating && divemail && divrating2 && divppv
&& imgwatch && imgsynopsis && imgreview && imgrating && imgemail && imgppv){
divwatch.style.display = 'none';
divsynopsis.style.display = 'none';
divreview.style.display = 'none';
divrating.style.display = 'none';
divemail.style.display = 'none';
divrating2.style.display = 'none';
divppv.style.display = 'none';
imgwatch.src = 'imgs-movies/watchnow2.jpg';
imgsynopsis.src = 'imgs-movies/but-synopsis.jpg';
imgreview.src = 'imgs-movies/but-review.jpg';
imgrating.src = 'imgs-movies/but-userrating.jpg';
imgemail.src = 'imgs-movies/but-tellfriend.jpg';
imgppv.src = 'imgs-movies/but-ppvbasis.jpg';
switch(page){
case 'watch':
divwatch.style.display = 'inline';
imgwatch.src = 'imgs-movies/watchnow1.jpg';
break;
case 'synopsis':
divsynopsis.style.display = 'inline';
imgsynopsis.src = 'imgs-movies/but-synopsis-on.jpg';
break;
case 'review' :
divreview.style.display = 'inline';
imgreview.src = 'imgs-movies/but-review-on.jpg';
break;
case 'rating' :
divrating.style.display = 'inline';
divrating2.style.display = 'inline';
imgrating.src = 'imgs-movies/but-userrating-on.jpg';
break;
case 'email' :
divemail.style.display = 'inline';
imgemail.src = 'imgs-movies/but-tellfriend-on.jpg';
break;
case 'ppv' :
divppv.style.display = 'inline';
imgppv.src = 'imgs-movies/but-ppvbasis-on.jpg';
break;
default :
divwatch.style.display = 'inline';
imgwatch.src = 'imgs-movies/watchnow1.jpg';
break;
}
}
}
function change(){
changepage('watch');
if(-1 != navigator.userAgent.indexOf('MSIE'))
{
document.getElementById('ForTheFirstTime').controls.play();
}
else if(-1 != navigator.userAgent.indexOf('Firefox'))
{
document.getElementById('ForTheFirstTime2').controls.play();
}
}
</script>
Windows Media Player Code:
<OBJECT id="ForTheFirstTime" style="WIDTH: 500px; HEIGHT: 363px" type="application/x-oleobject"
height="363" width="500" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" VIEWASTEXT>
<PARAM NAME="URL" VALUE="http://url.asx">
<PARAM NAME="rate" VALUE="1">
<PARAM NAME="balance" VALUE="0">
<PARAM NAME="currentPosition" VALUE="0">
<PARAM NAME="defaultFrame" VALUE="">
<PARAM NAME="playCount" VALUE="1">
<PARAM NAME="autoStart" VALUE="0">
<PARAM NAME="currentMarker" VALUE="0">
<PARAM NAME="invokeURLs" VALUE="-1">
<PARAM NAME="volume" VALUE="100">
<PARAM NAME="mute" VALUE="0">
<PARAM NAME="uiMode" VALUE="full">
<PARAM NAME="stretchToFit" VALUE="0">
<PARAM NAME="windowlessVideo" VALUE="0">
<PARAM NAME="enabled" VALUE="-1">
<PARAM NAME="enableContextMenu" VALUE="-1">
<PARAM NAME="fullScreen" VALUE="0">
<PARAM NAME="enableErrorDialogs" VALUE="0">
<embed type="application/x-mplayer2" name="ForTheFirstTime2" id="ForTheFirstTime2" width='500' height='363' src='http://url.asx'
controller="true" displaysize="4" autostart="false" showstatusbar='1' playeveryframe="false"
pluginspage='https://www.microsoft.com/Windows/'>
</OBJECT>
modified on Tuesday, July 28, 2009 4:22 AM
|
|
|
|
|
if i remember rightly FF users need to download a plugin.
|
|
|
|
|
hi, i've downloaded the windows media player 11 plugin but the error is still the same.
|
|
|
|
|
not sure then I'm afraid. You could try removing sections of you r code till you find the offending line. I presume it was working before?
|
|
|
|
|
its not working before.
|
|
|
|
|
Well the only thing I can suggest is using a different player. Personally I found that having to download another plugin puts off many users. So I started using flash (it's already on 95% of computers or something). Plus flash allows you to edit the player to fit in better with the site.
There are other options however. But you will need to research them. Silverlight for example is now on many machines.
If you do choose to go the flash route there are good tutorials on http://gotoAndLearn.com[^]
When developing a media player always publish for slightly older versions - if you don't want users installing plugins. I.e:
Current Flash version is 10. So publish to 8.
Current silverlight is 2 ( I think). SO publish to 1.
|
|
|
|
|
we are going to upgrade our system and we will use silverlight. but for the meantime we are using wmp. the video that we are playing is drm protected. i can't use flash.
|
|
|
|