Click here to Skip to main content
15,900,681 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my Project, I want to print my Bill in online. So I am using this javascript function for print

C#
function Print(elementId)

{

var printContent = document.getElementById(elementId);

var windowUrl = 'about:blank';

var uniqueName = new Date();

var windowName = 'Print' + uniqueName.getTime();

var printWindow = window.open(windowUrl, windowName, 'left=50000,top=50000,width=0,height=0');

printWindow.document.write(printContent.innerHTML);

printWindow.document.close();

printWindow.focus();

printWindow.print();

printWindow.close();

}


This is working It is Print the div. I want write the div content on C# code.

So, How to Write content in specify Div using c# using Response.Write Method But I want to write that specify div

Please help me
Posted
Updated 25-May-12 19:10pm
v3

1 solution

create a div like this


HTML
<div id="MyDiv" style="display:none;"><%= Data1 ></div>


and then you can create a property like
C#
public string Data1
{
get
{
}
set
{
}

}

then you can store the value thorough the coding....
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900