i need to print the form in asp.net using vb coding.
anyone can help by providing me the code for printing the form, using vb code
thanks a lot

Recommended Answers

All 3 Replies

print function of JavaScript is needed to print a web page.

..
<script type="text/javascript">
    function doit(){
       print();
   }
</script>
..

i didn't get you

Protected Sub CmdPrint_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CmdPrint.Click
        Dim S As String = "<SCRIPT>window.print();window.close();</SCRIPT>"
        If Not ClientScript.IsClientScriptBlockRegistered("print") Then
            ClientScript.RegisterClientScriptBlock(Me.GetType, "print", S)
        End If
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.