|
Hi there EveryOne
Need assistance (in the form of code) on how to do a search for images in a folder.
Thanks a million
Saaiman
(PS!! Thanks Paul for your advice)
|
|
|
|
|
You still haven't provided enough context for someone to answer your question.
What development language are you using?
Where (client/server) do you want to search for files? If you are using ASP.NET, you can search for files on the server using the static method System.IO.Directory.GetFiles . You can't search for files on the client machine using JavaScript/VBScript. Script executed by the web browser can't access sensitive resources like the file system for reasons of security.
Paul Marfleet
|
|
|
|
|
Why would your web app search for images inside a folder ? You realise you can't do this on a client PC, only on a folder on the server ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I don't know what it's called. I don't know where to start but i've seen this in some sites.
I'd like a control or a panel that's always visible to the user whether I scroll up or down the page. Like I have a really long content and when I scroll down I still want my menu (on the left) to always be visible.
Thank you.
Gerri
|
|
|
|
|
Hi Gerri
I've used the following in the past:
Wrap what you want to remain static in a div:
<div id="myPanel">
...Content...
</div>
Within your body tag, add onscroll="javascript:repositionPanel()";
Add a style something like the following:
#myPanel {background-color:white;text-align:center;
z-Index:5;position:absolute;
top:320px;left:200px;width:200px;height:410px;
}
Then in your repositionPanel() javascript function:
function repositionPanel(){
var x = (posRight()-230) + 'px';
var y = (posTop()+panelTop) + 'px';
moveObjTo('myPanel',x,y);
}
function moveObjTo(objectID,x,y) {
var objs = xDOM(objectID,1);
objs.left = x;
objs.top = y;
}
Any questions, let me know.
Cheers
Ben
-- modified at 4:40 Thursday 18th October, 2007
|
|
|
|
|
I'm sorry I can't get it to work.
Is this correct?
I found a similar control on mapleglobal.com
There are ads on the right side of the page whenever I (browser) scroll down, it scrolls down as well. Thank you.
...
<ajax:Accordion>...</ajax:Accordion>
</div>
<div class="ForumSig">Gerri</div>
|
|
|
|
|
Hi Gerri
Apologies, it looks like I may have missed a couple of functions.
The following html page will do what you want, although it doesn't run as smoothly as the example you gave:
<html>
<head>
<script type="text/javascript">
function movePanel(){
var panel = document.getElementById("panel");
var current = panel.style.top.split('px')[0];
var top = posTop();
if(current < top){
while (current < top){
panel.style.top = current + 'px';
current++;
}
} else if (current > top){
while (current > top){
panel.style.top = current + 'px';
current--;
}
}
}
function posTop(){
if(!document.body.scrollTop){
return 0;
}
else if (document.body && document.body.scrollTop){
return document.body.scrollTop;
}
else if (document.documentElement && document.documentElement.scrollTop){
return document.documentElement.scrollTop;
}
}
</script>
</head>
<body onscroll="movePanel();">
<div style="width:500px;height:3000px;float:left;border:1px black dashed;">
</div>
<div id="panel" style="position:absolute;top:20px;right:10px;width:200px;height:200px;border:1px red dashed;">
some text
</div>
</body>
</html>
Cheers
Ben
|
|
|
|
|
WOW! YOU'RE THE BEST! THANK YOU SO MUCH.
I do have another question please.
Well my div is on the left side, if I resize my browser window and then scroll to the right
it moves itself to the right side thereby making it always visible. Can it just stay in its location and just scroll up/down accordingly?
Thank you very much.
Gerri
|
|
|
|
|
Hi Gerri
Not sure why you're getting that behaviour...
If you replace the body from the above example with the following:
<div style="width:1500px;">
<div style="width:1000px;height:3000px;float:right;border:1px black dashed;">
</div>
<div id="panel" style="position:absolute;top:20px;left:10px;width:200px;height:200px;border:1px red dashed;">
some text
</div>
</div>
</body>
And then scroll to the right, the panel remains on the left hand side....
Cheers
Ben
|
|
|
|
|
|
I used nant to build ASP .NET application my VS 2005 .sln file
is being compiled using nant builder ..I heard that nant is used to compile and deploy the ASP .NET application ......
Can anyone plese tell me how to deploy ASP .NET application using nant. I have compiled file ready i want to know how to deploy it...
I m using VS 2005 and Nant-0.85
aaa
|
|
|
|
|
Why are you using NAnt and not the built in compiler/deployment options (just curious)?
|
|
|
|
|
-- modified at 2:14 Monday 15th October, 2007
hi friends,
I know one of u can answer this question.
my question is how to set the border of the layer at client side programming.......
i am at beginner level in javascript even after that i made a function called setBorder in which i am setting the border of the layer but at runtime it giving the error ::"document.form1.layer1.style.border is null or not an object."
now here is i am giving my code which i am using please tell me what i have to do if i am wrong where i am wrong.....
this code i am using in asp.net
Thanks in advance...........
<HTML>
<HEAD>
<title>Test</title>
</HEAD>
<body>
<script language="javascript">
function setBorder(layer)
{
resetBorder();
if (layer==1)
document.form1.layer1.style.border = 2;
if (layer==2)
document.form1.layer2.style.border = 2;
if (layer==3)
document.form1.layer3.style.border = 2;
if (layer==4)
document.form1.layer4.style.border = 2;
if (layer==5)
document.form1.layer5.style.border = 2;
}
function resetBorder()
{
document.form1.layer1.style.border = 0;
document.form1.layer2.style.border = 0;
document.form1.layer3.style.border = 0;
document.form1.layer4.style.border = 0;
document.form1.layer5.style.border =0;
}
//==============================>
function DispUpload(ControlNo)
{
document.form1.oFile.disabled=false;
document.form1.txtControlNo.value=ControlNo;
alert(ControlNo);
return true;
}
</script>
<form id="form1" runat="server">
<table id="table1" style="WIDTH: 625px; HEIGHT: 714px" borderColor="#800000" height="714"
width="625" border="1" runat="server">
<tr>
<td style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; BORDER-BOTTOM: 1px solid">
<div id="layer1" onclick="setBorder(1);" style="BORDER-RIGHT: 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: 1px solid; PADDING-LEFT: 4px; Z-INDEX: 2; LEFT: 41px; PADDING-BOTTOM: 1px; BORDER-LEFT: 1px solid; WIDTH: 188px; PADDING-TOP: 1px; BORDER-BOTTOM: 1px solid; POSITION: absolute; TOP: 303px; HEIGHT: 121px; BACKGROUND-COLOR: #ffffff">
<IMG id="imgF1" style="WIDTH: 176px; HEIGHT: 118px" height="118" width="176" runat="server"></div>
<div id="layer2" onclick="setBorder(2);" style="BORDER-RIGHT: 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: 1px solid; PADDING-LEFT: 4px; Z-INDEX: 2; LEFT: 43px; PADDING-BOTTOM: 1px; BORDER-LEFT: 1px solid; WIDTH: 188px; PADDING-TOP: 1px; BORDER-BOTTOM: 1px solid; POSITION: absolute; TOP: 455px; HEIGHT: 229px; BACKGROUND-COLOR: #ffffff">
<IMG id="imgF2" style="WIDTH: 176px; HEIGHT: 224px" height="224" width="176" runat="server"></div>
<div id="layer3" onclick="setBorder(3);" style="BORDER-RIGHT: 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: 1px solid; PADDING-LEFT: 4px; Z-INDEX: 3; LEFT: 218px; PADDING-BOTTOM: 1px; BORDER-LEFT: 1px solid; WIDTH: 254px; PADDING-TOP: 1px; BORDER-BOTTOM: 1px solid; POSITION: absolute; TOP: 347px; HEIGHT: 305px; BACKGROUND-COLOR: #ffffff">
<IMG id="imgF3" style="WIDTH: 248px; HEIGHT: 298px" height="298" width="248" runat="server"></div>
<div id="layer4" onclick="setBorder(4);" style="BORDER-RIGHT: 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: 1px solid; PADDING-LEFT: 4px; Z-INDEX: 6; LEFT: 437px; PADDING-BOTTOM: 1px; BORDER-LEFT: 1px solid; WIDTH: 133px; PADDING-TOP: 1px; BORDER-BOTTOM: 1px solid; POSITION: absolute; TOP: 273px; HEIGHT: 123px; BACKGROUND-COLOR: #ffffff">
<IMG id="imgF4" style="WIDTH: 128px; HEIGHT: 118px" height="118" width="128" runat="server"></div>
<div id="layer5" onclick="setBorder(5);" style="BORDER-RIGHT: 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: 1px solid; PADDING-LEFT: 4px; Z-INDEX: 5; LEFT: 433px; PADDING-BOTTOM: 1px; BORDER-LEFT: 1px solid; WIDTH: 133px; PADDING-TOP: 1px; BORDER-BOTTOM: 1px solid; POSITION: absolute; TOP: 453px; HEIGHT: 194px; BACKGROUND-COLOR: #ffffff">
<IMG id="imgF5" style="WIDTH: 152px; HEIGHT: 216px" height="216" width="152" runat="server"></div>
</td>
</tr>
</table>
</form>
</body>
</HTML>
|
|
|
|
|
Your layers are displayed on top of your message, making it unreadable.
Use the "Ignore HTML" option when you are posting html code.
---
single minded; short sighted; long gone;
|
|
|
|
|
You need to set borderWidth:
Also no need for the too many if statements to get the layer name:
<code>var layer=document.getElementById('layer'+layer);
layer.style.borderWidth='10px';</code>
And your HTML should be like:
<div id="layer" style="border-width:10px;border-color:Red;border-style:solid">
dsd
</div>
Hesham A. Amin
My blog: http://forloveofsoftware.blogspot.com
|
|
|
|
|
I am opening a socket stream and sending and receiving messages to a DVR Server.
The DVR server uses Digest Authentication and i have made sure that i have every name value exactly the way i think it goes and for a week i can not seem to produce any fruit.
I have even gone as far as creating separate objects to aid in the separation of the challenge and the client response.
I keep getting and error of: null 400 bad request
I am opening a stream socket, make a request, make a second request with the Authorization header: Digest, and then i get the error.
I need to open a stream to the DVR so that i can get the video data stream for a camera.
Here are the objects that i have...
Can someone give me some advice on this please?
http://afccinc.com/Examples/Software/Web-Applications/Authentication/Digest/Digest[0]/Challange.cs.txt
http://afccinc.com/Examples/Software/Web-Applications/Authentication/Digest/Digest[0]/ClientChallangeResponse.cs.txt
http://afccinc.com/Examples/Software/Web-Applications/Authentication/Digest/Digest[0]/NetWorkLink.cs.txt
=========================================================================================================
Any suggestions at all will help out a lot.
|
|
|
|
|
Hello,
I know this question has been asked everywhere but I cannot find a solution that will help me. I hope someone here has some ideas.
I have 9 TextBoxes in a Repeater Control. A user can edit dates in these textboxes. If the user changes the date, I want to dynamically change the color of the background of the textbox. When the data is saved I will set the textboxes back to it's original background(I can do this in the code-behind)
Right now I can get it to change but I have to do a postback in order to do it on the TextChanged Event of the TextBox. This page has 14 rows with 9 textboxes in each so postbacks are tedious to the user after 3 of them.
Can anyone help me accomplish this in Javascript?
This is in my code-behind:
foreach (RepeaterItem item in rptrShots.Items)
{
TextBox txt1 = (TextBox)item.FindControl("txt1");
txt1.Attributes["onTextChanged"] = "ChgColor('" + txt1.UniqueID + "');";
}
This is in the mark-up:
<script language="javascript" type="text/javascript">
function ChgColor(sender)
{
sender.style.backgroundColor = '#CC3300';
}
</script>
I am just so frustrated that I am following similar code to do similar things but it isn't working for me. I don't know if it is because my textboxes are in a repeater or not.
Please help!!!
Thanks in advance!
~Candi
|
|
|
|
|
One reason that it doesn't work is that you are sending a string to the javascript function, and it uses it as if it was an element.
Another reason that it doesn't work is that you are using uppercase letters in the event name.
A third reason is that you are trying to use the name of a server side event in the client code. There is no ontextchanged event in html, there in an onchange event.
As you are calling the method from the element itself, you can use the this keyword to send a reference to the element to the function:
txt1.Attributes["onchange"] = "ChgColor(this);";
---
single minded; short sighted; long gone;
|
|
|
|
|
Those are a few reasons! Thanks, Guffa! I was finally able to make this work out like I need it too!
~Candi
|
|
|
|
|
I'm using this code:
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(pageAddress);
HttpWebResponse rsp = (HttpWebResponse)req.GetResponse();
in WindowsForms application, to get a page source. Everything works fine, when I run my app in debug mode (Visual Studio uses app.vshost.exe), but when I run it without VS, I get exception:
System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
I will really appreciate any help.
borryz
|
|
|
|
|
I would suspect that there is an issue with your pageAddress you are passing in. I would make sure that when you are not in vs that the correct address is getting passed in.
Ben
|
|
|
|
|
My pageAddress is set properly for sure.
Thanks
borryz
|
|
|
|
|
1) Does the request need to go through any Proxy Server?
2) Verify the pageAddress value as a quick MessageBox or a log file.
|
|
|
|
|
1) I was pretty sure it does not, but I chekced it out and it looks like there is a Proxy on the request way.
2) pageAddress is fine.
OK. Thanks for drawing my attention to a Proxy Server. I'll see what can be done with it.
borryz
|
|
|
|
|
We r using YAHOO.widget.AutoComplete to show information in div or container... this all happens on keypress event of textbox. this is fine .. working ok..
Now i want to show some default list or info. in container or div on onclick event of textbox when textbox is empty. now here i am stuck ...
please help me in this ... Thanks in adv
|
|
|
|