|
Hai webProgrammer,
Security point:
I think that it's very dangerous when some javascript can control the browser. If the browser allowed a script to change some options on print dialog, why shouldn't that be also used to change (for example) your browser settings, like your security settings. Therefor I'm quite sure that what you want to do won't be allowed by the browser.
So that basically rules out the javascript approach.
With HTML you define the structure and the text within that of a webpage. The formatting should be done with Cascading Style Sheets. If you don't know how to write a CSS file and link it to your webpage, then take a look at W3Schools or something like that. The official specifications can (of course) be found at www.w3.org/Style/CSS.
As you've noticed a webpage on your screen doesn't always look good when it's printed. Therefor you can create different stylesheets for different media. You indicate through the media attribute of the link-element to what media the stylesheet should be applied. If you don't specify the media attribute, the default value of 'all' is used.
By using media="print" for a stylesheet you tell the browser to only use that stylesheet for printing.
There's a section of the CSS Level 2 specification which handles that aspect and it's called paged media.
You might want to take a look at
section 13.2.2 Page size: the 'size' property, because there you'll find your answer.
Example of landscape setting:
@page {
size: landscape;
}
Hope this is more clear
|
|
|
|
|
believe it or not I happen to have seen all of this before and I still posted the message because, if you would look a little further into the css documentation and specification in "section 13.2.2" you will notice that these are only what they would like to do for the future, however the pagesize property of css will not work in current browsers, and I know this for a fact, since I have tested them all in Netscape and IE, I can also tell you that the "margin" atribute of the "page" property will work (at least in IE).
the reason I asked you to explain was because I thought you had found an alternative way of doing things (a way that might work).
even though I have already established that what I would like to do is not possible through either javascript or CSS, I really appreciate your consideration and help.
|
|
|
|
|
Damn, you're right
I've created my own test page an tried it in IE6, Mozilla 1.4 and Opera 7.11 and it was still portrait
As it turns out I did know how it should be done, not how it works
The real problem is that browsers still don't implement an important W3C Recommendation dated 12-May-1998 decently!
As far as Mozilla is concerned I'll probably gonna file this as a bug (after some more testing).
|
|
|
|
|
Hi,
I'm trying to get data from my network servers, and add the literal data onto a chart using (Office web Components). I have the chart working with information from the local machine that the ASP code is running on, however, I need to get information from all servers within my LAN. Does anyone have any ideas on how to do this? I've tried using FSO to get access to an admin share ($) but script returns error -- path not found.
Thanks
Tony
|
|
|
|
|
Hello all
I'm posting some form data to server which processes the data and will give a webpage in reply depending on success or failure. How to know what kind of page server is giving in reply cause I had to process some data depending ont he webpage I'm getting in reply. I'm using javascript.
if anyone knows how to do it, pls help me.
thanks
Hari.
|
|
|
|
|
Are you looking for error code values?
here is a list[^] of them
let the whole world look in who cares who sees anything
BW
|
|
|
|
|
Hello brain
Thanks for the reply. I'm not looking for error values. when I post data to the server, I will get one of the two pages in reply depending the data I post to server. How to know what page I'm getting in reply. I want to further processing depending on the page I'm getting in reply.
If you know how to handle this, pls help.
Thanks
Hari.
|
|
|
|
|
I'm not sure I understand what you are trying to do.
"Manifest plainness, embrace simplicity, reduce selfishness, have few desires." -- Lao Tzu BW
|
|
|
|
|
Hi !
I'm using ASP (not ASP.NET) to create some HTML pages and I'd like to create pdf documents to print them directly on the printer.
Is it possible to do that in ASP ? Is there a free tool ro library to do that ?
Thanks for your help !
Jerome
|
|
|
|
|
|
Sorry for a stupid question everyone, but I just bought a book that go's over asp.net, and the first example throws an error. Here is the code, it tells me that a ";" is expected on line 5. Im totally confused.
"
<%@ Page Language='C#' %>
double ToCelsius(double f)
{
return (5.0/9.0) * (f-32.0);
}
Fahrenheit to Celsius Conversion Chart
<%
for (double f = 50.0; f<=100.0; f++)
{
//sends formatted output to HTTP Response
Response.Output.Write("", f, ToCelsisus(f));
}
%>
° Fahrenheit | ° Celsius |
---|
{0} | {1:f} | |
"
Thanks!
Ryan
|
|
|
|
|
In my Perl script , Im using Win32::OLE to access and read an Excel file. The annoying thing is that every time an Excel file is accessed, a shortcut for it is automatically created at the root of my C: drive. If I access 3 different Excel files, there will be 3 different shortcuts created. These are not temporary files -- they remain there permanently (until I manually delete them). What is doing this??? Is there some Excel macro that's doing this? Or does it have to do with some configuration setting in IIS? I've been trying to search the internet for this topic but cant find anything. Please help if you can. Thanks.
|
|
|
|
|
Hello. My problem is that I wrote a session handling-script from a book I bought, but the code they have connects to a MS Access database. I can't use Access databases at my webhotel so I tried to rewrite it to connect to MySQL instead. It doesn't work for me.
The MS Access version connects via a file called Global.asa and via ODBC. The Global.asa file looks like this:
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
SUB Application_OnStart
Application.Lock
Application("Conn") = "driver={SQL Server};SERVER=localhost;UID=login;PWD=password;Database=database"
Application.UnLock
END SUB
</SCRIPT>
(The SQL Server code I've added myself, it's supposed to be the same type of connectioncode there but for Access)
And this is how my connection strings in the documents looks like:
Login:
<%
un = Request.Querystring("un")
pw = Request.Querystring("pw")
If (Len(un) > 0) And (Len(pw) > 0) Then
Set Cmd = Server.CreateObject("ADODB.Command")
Cmd.ActiveConnection = Application("Conn")
ssql = "SELECT id FROM cmy_se WHERE un = '" & un & "'"
ssql = ssql & " AND pw = '" & pw & "'"
Cmd.CommandText = ssql
Cmd.CommandType = adCmdText
SET Rs = Cmd.Execute
if NOT Rs.EOF Then
Session("userid") = Rs("id")
%>
Newmember:
<%
email = Request.Form("email")
un = Request.Form("un")
pw = Request.Form("pw")
If (Len(email) > 0) AND (Len(un) > 0) AND (Len(pw) > 0) Then
Set Cmd = Server.CreateObject("ADODB.Command")
Cmd.ActiveConnection = Application("Conn")
ssql = "SELECT * FROM cmy_se WHERE un = '" & un & "'"
ssql = ssql & " AND pw = '" & pw & "'"
Cmd.CommandText = ssql
Cmd.CommandType = adCmdText
Set Rs = Cmd.Execute
If Rs.EOF Then
SQLStmt = "INSERT INTO cmy_se"
SQLStmt = SQLStmt & "(email,un,pw)"
SQLStmt = SQLStmt & "VALUES(?,?,?)"
Cmd.CommandText = SQLStmt
Cmd.CommandType = adCmdText
Set prm = Cmd.CreateParameter (,adVarChar,,Len(email),email)
Cmd.Parameters.Append prm
Set prm = Cmd.CreateParameter (,adVarChar,,Len(un),un)
Cmd.Parameters.Append prm
Set prm = Cmd.CreateParameter (,adVarChar,,Len(pw),pw)
Cmd.Parameters.Append prm
Cmd.Execute
ssql = "SELECT id FROM cmy_se WHERE un = '" & un & "'"
ssql = ssql & " AND pw = '" & pw & "'"
Cmd.CommandText = ssql
Cmd.CommandType = adCmdText
Set Rs = Cmd.Execute
If Not Rs.EOF Then
Session("userid") = Rs("id")
%>
What changes must I make to get it to work with my MySQL database?
Might I add I can't use ODBC or DSN, I have to use a direct connection.
Thank you.
Yeah..
|
|
|
|
|
Some people on the ASP.NET forums have been talking this one up but I don't think it's free http://crlab.com/mysqlnet/[^] there are a couple of open source things on sourceforge but I don't think they are complete but you could give them a try. The only other way is using ODBC.
|
|
|
|
|
As far as I can see, you're not using a Connection object, but the ConnectionString property of that object!
Beside that you'll probably want the MyOLEDB provider.
To get it to work:
objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "driver={SQL Server};SERVER=localhost;UID=loginWD=password;Database=database"
A word of caution: don't open the database connection in your global.asa. This will 'kill' the webserver if you have more than 1 user. IOW: open the connection just before querying and close it as soon as possible thereafter.
|
|
|
|
|
Hi,
is it possible to create web page layout like this:
______________________
| | |
| 100px | Width-100px |
|<----->|<------------>|
| | |
| | |
|_______|______________|
using DIVs and styles ?
I know how to divide page to two parts using width in percents but how to do this with pixels ?
Thanks!
i'm only pointer to myself
|
|
|
|
|
Do you mean 100% in the second block, not 100px?
Paul Watson Bluegrass Cape Town, South Africa
Crikey! ain't life grand?
|
|
|
|
|
I mean something like this (but without table):
<table width="100%">
<tr>
<td width="100px"> Left... </td>
<td> Right... </td>
</tr>
</table>
i'm only pointer to myself
|
|
|
|
|
Ok, so a fixed width left column and the a variable width content column.
Sure, use this:
<div id="navigation">
<ul>
<li><a title="Page link" href="">Page 1</a></li>
<li><a title="Page link" href="">Page 2</a></li>
<li><a title="Page link" href="">Page 3</a></li>
<li><a title="Page link" href="">Page 4</a></li>
<li><a title="Page link" href="">Page 5</a></li>
<li><a title="Page link" href="">Page 6</a></li>
</ul>
</div>
<div id="content">
<h1>Page Title</h1>
<p>Content content content content content content content content content content content content content content content content content.</p>
<p>Content content content content content content content content content content content content content content content content content.</p>
<p>Content content content content content content content content content content content content content content content content content.</p>
<p>Content content content content content content content content content content content content content content content content content.</p>
</div>
and then CSS:
div#navigation
{
width: 100px;
float: left;
border: solid 1px #000000;
height: 100%;
}
div#content
{
padding-left: 120px;
border: solid 1px #000000;
}
So the idea is to have a DIV on the left with float:left set and a fixed width. Then the DIV on the right expands to fill the space. The padding-left: 120px; keeps it off the left DIV.
Paul Watson Bluegrass Cape Town, South Africa
Crikey! ain't life grand?
|
|
|
|
|
Thank you !
i'm only pointer to myself
|
|
|
|
|
<style type="text/css"><!--
body {
margin: 0 0 0 0;
}
div.nav {
position: absolute;
width: 100px;
background-color: #dfdfdf;
height: 100%;
}
div.content {
position: relative;
left: 100px;
right: 0;
background-color: #7f7f7f;
height: 100%;
}
--></style>
<div class="nav">
Asparagus
</div>
<div class="content">
Content
</div>
- Mike
|
|
|
|
|
That is a pretty cool way of doing it as well Mike. I really need to remember absolute positioning more.
Paul Watson Bluegrass Cape Town, South Africa
Crikey! ain't life grand?
|
|
|
|
|
I have to convert Rich Text (rtf) code to HTML code so they can display on the internet explore...
In RTF code, there is \tab which is same as pressing Tab key to move/ jump to next 10 space from original in notepad\wordpad\or MSWord...
I mean... ( considering dot (.) as a space )
abcd.........efgh.........ijklm.......... nopqrst .......... uvwxyz
ok...........this.........is a........... three row......... and
five.........columns......but............ not using......... table
I dont' no I can't use < table >
Is there anyway that display tab or spaces in the browser without using table tag??
hello........ how .......... are you?
hello........ I'm .......... fine
hello........ you .......... are nice
thank you
|
|
|
|
|
Are you using VS.NET
Are you using VB or C#
Need more info.
Will
|
|
|
|
|
i'm sorry to reply you that late..
i'm using VB.Net and vbTab is not recognized by web browser
|
|
|
|