Click here to Skip to main content
15,900,378 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questioni want Blowfish code in ASP.net Pin
Kareema 217-Mar-12 21:20
Kareema 217-Mar-12 21:20 
AnswerRe: i want Blowfish code in ASP.net Pin
Richard MacCutchan17-Mar-12 22:24
mveRichard MacCutchan17-Mar-12 22:24 
AnswerRe: i want Blowfish code in ASP.net Pin
Vasudevan Deepak Kumar21-Mar-12 6:57
Vasudevan Deepak Kumar21-Mar-12 6:57 
Questionhow to asess data on single page from diifrent tables stored in database Pin
pankaj308617-Mar-12 20:39
pankaj308617-Mar-12 20:39 
AnswerRe: how to asess data on single page from diifrent tables stored in database Pin
taha bahraminezhad Jooneghani19-Mar-12 20:48
taha bahraminezhad Jooneghani19-Mar-12 20:48 
Questionuse several xml in one page Pin
Member 873714417-Mar-12 6:03
Member 873714417-Mar-12 6:03 
AnswerRe: use several xml in one page Pin
Lakxman18-Mar-12 19:58
Lakxman18-Mar-12 19:58 
QuestionHow to apply .css style to div tag..when writing printing using javascript... Pin
mdimran0317-Mar-12 5:04
mdimran0317-Mar-12 5:04 
XML
why google chrome not showing text boxes and its data when i click the print button...

and one more thing css style is not applied when i click the print button ..

please check the following code...

Here iam just try to printing the div content only....

Default.aspx

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title> </title>
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript" src="PrintDivContent.js">
    </script>

</head>
<body>

    <form id="form1" runat="server">
    <div id="PrintableArea"  >

        <table class="style1">
            <tr>
                <td>
                    <asp:Label ID="Label1" runat="server" Text="UserName"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label2" runat="server" Text="Password"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                </td>
            </tr>
        </table>

    </div>

   <input id="Button2" type="button" onclick="PrintContent('PrintableArea')" value="Print" />
    </form>
</body>
</html>

JavaScript file (PrintDivContent.js)

function PrintContent(divName) {
    var DocumentContainer = document.getElementById(divName);
    var WindowObject = window.open('', 'PrintWindow', 'width=750,height=650,top=50,left=50,toolbars=no,scrollbars=yes,status=no,resizable=yes');

   WindowObject.document.writeln(DocumentContainer.innerHTML);


    WindowObject.document.close();
    WindowObject.focus();
    WindowObject.print();
    WindowObject.close();
}


Css Style sheet file (StyleSheet.css)

body {
}
.txtboxborder
{
    border-width: 1px;
    border-style: solid;
    background-color: #FFCCCC;
}


Waiting for your reply..

QuestionASP page refresh in a client server environment Pin
rajmithun16-Mar-12 17:24
rajmithun16-Mar-12 17:24 
AnswerRe: ASP page refresh in a client server environment Pin
Karthickeyan.k21-Mar-12 17:21
Karthickeyan.k21-Mar-12 17:21 
Question2010 web deployment Pin
dcof16-Mar-12 9:33
dcof16-Mar-12 9:33 
AnswerRe: 2010 web deployment Pin
R. Giskard Reventlov16-Mar-12 9:51
R. Giskard Reventlov16-Mar-12 9:51 
GeneralRe: 2010 web deployment Pin
dcof19-Mar-12 11:52
dcof19-Mar-12 11:52 
Question--Help-- aps.net web Pin
Member 873583816-Mar-12 8:56
Member 873583816-Mar-12 8:56 
AnswerRe: --Help-- aps.net web Pin
R. Giskard Reventlov16-Mar-12 9:49
R. Giskard Reventlov16-Mar-12 9:49 
GeneralRe: --Help-- aps.net web Pin
dcof18-Mar-12 10:13
dcof18-Mar-12 10:13 
GeneralRe: --Help-- aps.net web Pin
R. Giskard Reventlov19-Mar-12 11:06
R. Giskard Reventlov19-Mar-12 11:06 
AnswerUnable to browse Website from Winxp .-using windows authentication. Pin
GuhananthS15-Mar-12 7:48
GuhananthS15-Mar-12 7:48 
GeneralRe: Unable to browse Website from Winxp .-using windows authentication. Pin
Not Active15-Mar-12 7:52
mentorNot Active15-Mar-12 7:52 
QuestionRe: Unable to browse Website from Winxp .-using windows authentication. Pin
GuhananthS15-Mar-12 19:03
GuhananthS15-Mar-12 19:03 
AnswerRe: Unable to browse Website from Winxp .-using windows authentication. Pin
ZurdoDev16-Mar-12 8:55
professionalZurdoDev16-Mar-12 8:55 
GeneralRe: Unable to browse Website from Winxp .-using windows authentication. Pin
Bernhard Hiller15-Mar-12 22:09
Bernhard Hiller15-Mar-12 22:09 
GeneralRe: Unable to browse Website from Winxp .-using windows authentication. Pin
GenJerDan16-Mar-12 3:30
GenJerDan16-Mar-12 3:30 
QuestionCalenderExtender's Date Pin
Seema Bawa15-Mar-12 6:43
Seema Bawa15-Mar-12 6:43 
Questiondatagridview Pin
altafmohd15-Mar-12 6:39
altafmohd15-Mar-12 6:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.