|
-
Feb 5th, 2004, 04:42 PM
#1
Thread Starter
New Member
Print ASPX
Need Help !
I want to run the printer dialog in IE but in the aspx pages mwe dont have access to the print dialog box.
So i want to press a Print button in form and see the beautiful print dialog box .
I search a lot for Windows XP API and i way to uses this function but the only thing i found its pages that want my money in exchange of help
Plz help me !
-
Feb 5th, 2004, 04:45 PM
#2
api isnt going to do you any good. all you can do is javascript print function
window.print();
-
Feb 5th, 2004, 04:49 PM
#3
Frenzied Member
try JavaScript.... window.print()
Magiaus
If I helped give me some points.
-
Feb 5th, 2004, 04:49 PM
#4
Frenzied Member
hey i was going to say that
Magiaus
If I helped give me some points.
-
Feb 5th, 2004, 06:49 PM
#5
Frenzied Member
this is important if you had tried to use api it would have opened a print dialog on the server not the client......
Magiaus
If I helped give me some points.
-
Feb 6th, 2004, 10:01 AM
#6
Thread Starter
New Member
Private Sub btnAccept_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAccept.Click
If (btnAccept.Text = "Print") Then
btnAccept.Text = "Request another"
Response.Write("window.print()")
Else
btnAccept.Text = "print"
Response.Write("<SCRIPT>")
Response.Write("window.print();")
Response.Write("</SCRIPT>") End If
End Sub
Now my question is :
How do i execute this -> Response.Write("window.print();")
if i press this button btnAccept_Click, it write window.print(); it only write this in the aspx page but it didn't execute it
-
Feb 6th, 2004, 11:43 AM
#7
Frenzied Member
Code:
<html>
<head><title>Print</title></head>
<script language="javascript">
function showPrint(){window.print();}
</script>
<body>
<div id="anyhtml_element" height="25px" width="100px" onclick="showPrint();">Print</div><!-- the ; in onclick may cause script to fail in early versions of netscape !@#$%^ netscape -->
</body>
</html>
web programming is not about Response.Write it is about html, css and javascript (maybe vbscript too but @#$%^&* netscape) yes asp.net does wonders for dynamicly creating html, css, and javascrpt and fetching data but the actual web page still has to be those other things that conect up and work together on the client not the server
Magiaus
If I helped give me some points.
-
Feb 6th, 2004, 11:51 AM
#8
Frenzied Member
about your code
I think I see what you tried to do but what you need is what my example shows forgrtt asp the script is client not server and why postback to the server to response. write that bit of clientside script? I think you need to read up on web programming because the way your going your going to kill that server. What if 100 people clicked the print button at once that would be 100 postback and re runs of the aspx code just to try to execute a script that should be on the client. Never use aspx to do what the browser alone can do.
Magiaus
If I helped give me some points.
-
Feb 9th, 2004, 09:46 AM
#9
Thread Starter
New Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|