|
Thank you but it doesn't work too.
Eric H.
|
|
|
|
|
|
Thank you but this is the source that make me problem (see my first post)
Eric H.
|
|
|
|
|
what problem you got with the example script? any js error? you try to run in FF to see more detail with js error..
<< >>
|
|
|
|
|
1) What is FF
2) I do not get any error but when I am selecting a picture from my hard disk using the dialog box, no picture is previewed
Thank you
Eric H.
|
|
|
|
|
FF is Firefox browser...
<< >>
|
|
|
|
|
As i used this before..and it's working well..so can you send me your html page to see what problem?
<< >>
|
|
|
|
|
Thank you for your help,
You can copy the code from my first post
Eric H.
|
|
|
|
|
As you didn't use the "Ignore HTML" option when you posted the code, he can't use it. There are several parts of the code that doesn't show up in the message.
---
single minded; short sighted; long gone;
|
|
|
|
|
Thank you Guffa,
Here is my code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<script type="text/javascript">
// width to resize large images to
var maxWidth=100;
// height to resize large images to
var maxHeight=100;
// valid file types
var fileTypes=["bmp","gif","png","jpg","jpeg"];
// the id of the preview image tag
var outImage="previewField";
// what to display when the image is not valid
var defaultPic="box_icons.jpg";
/***** DO NOT EDIT BELOW *****/
function preview(what)
{
var source=what.value;
var ext=source.substring(source.lastIndexOf(".")+1,source.length).toLowerCase();
for (var i=0; i<fileTypes.length; i++) if (fileTypes[i]==ext) break;
globalPic=new Image();
if (i<fileTypes.length)
globalPic.src=source;
else
{
globalPic.src=defaultPic;
alert("THAT IS NOT A VALID IMAGE\nPlease load an image with an extention of one of the following:\n\n"+fileTypes.join(", "));
}
setTimeout("applyChanges()",200);
}
var globalPic;
function applyChanges()
{
var field=document.getElementById(outImage);
var x=parseInt(globalPic.width);
var y=parseInt(globalPic.height);
if (x>maxWidth)
{
y*=maxWidth/x;
x=maxWidth;
}
if (y>maxHeight)
{
x*=maxHeight/y;
y=maxHeight;
}
field.style.display=(x<1 || y<1)?"none":"";
field.src=globalPic.src;
field.width=x;
field.height=y;
}
// End -->
</script>
</head>
<body>
<div style="line-height: 1.9em; text-align:center">
Test it by locating a valid file on your hard drive:
<br/>
<input type="file" id="picField" onchange="preview(this)"/>
<br/>
<img alt="Graphic will preview here" id="previewField" style="width: 288px; height: 272px;"/> <br/>
</div>
</body>
</html>
Eric H.
|
|
|
|
|
As I wrote upstair, I simplify the problem to a short code. Can you try to help me on this code. I think it will help me to the big one too.
The problem is that I do not see the picture.
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<script language="javascript" type="text/javascript">
// <!CDATA[
function Button1_onclick() {
document.getElementById("img1").src="C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Water lilies.jpg"
}
// ]]>
</script>
</head>
<body>
<form id="form1" runat="server">
<img src="" style="width: 96px; height: 96px" id="img1" />
<input id="Button1" type="button" value="button" önclick="return Button1_onclick()" />
</form>
</body>
</html>
Thank you,
Eric H.
|
|
|
|
|
Hi friends.
I have One table in which i have one field of projectTitle.
I want to bind this projecttitle to autocomplete text of textbox.
When I start to wrting in textbox, all project title will be appear in autocomplete text.
How can I performe this task?
Plz give me right solution
Thanks In adavance
Pathan
---------------------------------------------------
|
|
|
|
|
Hi Pathan,
You can use AJAX to archive this...
<< >>
|
|
|
|
|
Hi I have a question:
how to assign QueryString value to a variable, that should return unique ID of a user from ASPDBNET table.
I used wrote this way:
string id=Request.QueryString["UserID"];
but it doesn't assigns any value...
Thank u
|
|
|
|
|
string id=Request.QueryString["UserID"].ToString();
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
I'm sorry, but now it gives me this kind of exception:
System.NullReferenceException was unhandled by user code
Message="Object reference not set to an instance of an object."
Source="App_Web_p-lbdwwh"
Thank you
|
|
|
|
|
It gives error becoz ur quiry string is null.
check condition first
if(Request.QueryString["id"]!=null)
{
code here
}
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
what is the url? is this something like yourwebpage.aspx?Userid=???
<< >>
|
|
|
|
|
|
Can you put the break point there and debug the code..to see if there is any element in querystring collection or not?
<< >>
|
|
|
|
|
Yes, it shows the value of UserID, but doesn't assign it
|
|
|
|
|
use this one man
Dim strcom As String
strcom = Request.QueryString.GetValues("CID")(0)
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
|
|
|
|
|
Oh, Could you write it in C#, please, couse I'm not familiar with VB at all.
Thanx
|
|
|
|
|
string strcom = Request.QueryString.GetValues("CID")();
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
|
|
|
|
|
It shows me the error: Method name expected
|
|
|
|