how to add code-behind for aspx page

knonnefappy

New Member
i have a script code in my default.aspx page which is used to print the data from chart controls........ but i want to convert same script code into code behind code..Here is my script code...\[code\]<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title> <script type="text/javascript" language="javascript"> function printSpecial() { var html = '<HTML>\n<HEAD>\n'; if (document.getElementsByTagName != null) { var headTags = document.getElementsByTagName("head"); if (headTags.length > 0) html += headTags[0].innerHTML; } html += '\n</HEAD>\n<BODY>\n'; var printReadyElem = document.getElementById("printPart"); if (printReadyElem != null) { html += printReadyElem.innerHTML; } else { alert("Could not find the printPart div"); return; } html += '\n</BODY>\n</HTML>'; var printWin = window.open("", "printSpecial"); printWin.document.open(); printWin.document.write(html); printWin.document.close(); printWin.print(); }</script></head><body> <form id="form1" runat="server" > <div id="printPart"> <input type="button" value="http://stackoverflow.com/questions/12705555/Print Graph" onclick="printSpecial();" style="z-index: 1; left: 671px; top: 179px; position: absolute; width: 88px" /></div> </form></body>\[/code\]please help me As Soon As Possible
 
Back
Top