|
Same answer as last time. You need to know what the content is, and write the correct content type, so the browser knows how to try and display it.
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 Christian, I already know that from when you told me last time. What I would like to know is after I write the content type can I do something like setting the text area to the byte array to display it? Thanks for your help.
-- modified at 6:03 Monday 30th July, 2007
|
|
|
|
|
If the data you get out is just text, you can just set the Text property of a text control, in order to put it there, yes.
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 )
|
|
|
|
|
I confused with the tiers in 3 tier architecture ? I heard that calling DAL from presentation layer is bad programming habit. Could you tell me, how this will affect program performance ? I always used to call DAL directly from presentation layer, and still it's working fine for me.
|
|
|
|
|
Quite plainly, it's an architecture issue and not a performance issue. Your app would probalby perform slightly better if it was all written in one place, given that it wouldn't have to interact with dlls. The issue is a clean design.
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 )
|
|
|
|
|
Christian Graus wrote: Quite plainly, it's an architecture issue and not a performance issue.
Thanks, I also doubt this. Now cleared. I found an article on creating datalayer in MSDN. But they explained it with creating datasets design time. But I still feel comfortable with writing code for dataset with SQLAdapter. What do you prefer ? Design time or the other ?
|
|
|
|
|
I'm not sure I understand the question, but my preference is for writing 100% code, no designers. I'd prefer to have a framework within which my code specifies the stored procs to call, the parameters, and return the result.
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 )
|
|
|
|
|
i don;t have anough knowlege bcz i'm internee but i think if u don't use business logic layer and putting it's code in Presentation layer then and if u want to change interface or presentation layer then it's hard to do so
B asharatA li
Internee
METESYS Lahore
Pakistan
|
|
|
|
|
Hello,
I am trying to preview a picture from my hard disk before upload it to the server but I didn't success, no error occured but no picture is shown.
Please help here is the code
Thank you.
// 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";
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 -->
Test it by locating a valid file on your hard drive:
Eric H.
|
|
|
|
|
Unable to find problem in your code since it is too big. I did this by simply specifying local image path to image tag src using javascript. Try that method.
|
|
|
|
|
Hello,
I simplify the problem, please see the following code:
// <!CDATA[
function Button1_onclick() {
document.getElementById("img1").src="C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Water lilies.jpg"
}
// ]]>
Thank you much
Eric H.
|
|
|
|
|
ayeleteric wrote: C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Water lilies.jpg
In javascript \ will be escaped. So use \\ instead of \ . I think this will solve your problem.
|
|
|
|
|
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...
<< >>
|
|
|
|