Click here to Skip to main content
15,889,595 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys



JavaScript
function driverprint()
{
  var textboxText = document.getElementById('<%= TextBox1.ClientID %>');
  var ListBox1 = document.getElementById('<%= ListBox1.ClientID %>');
  var windowUrl = 'about:blank';
  var windowName = 'Print' + new
  Date().getTime();
  var printWindow = window.open(windowUrl, windowName, 'left=50000,top=50000,width=0,height=0');
  printWindow.document.write(textboxText.value);
  printWindow.document.write(ListBox1.value);

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


Am printing textbox and listbox contents, Now problem is ListBox1.value is not printed,How can i solve this?
Posted
Updated 23-Jan-12 1:02am
v2

According to the documentation[^] the ListBox does not contain a Value property.
 
Share this answer
 
Comments
Anele Ngqandu 23-Jan-12 7:14am    
so any ideas on what i shud do?
Richard MacCutchan 23-Jan-12 7:19am    
Yes, read the documentation and figure out how to print the details of the items you are interested in. Perhaps iterating through the ListBox items would be a good start.
There's a tutorial here, it solved my problem last year.
Please take a look:
http://codeabout.wordpress.com/2010/12/27/print-from-a-listbox-using-c/[^]
 
Share this answer
 

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