oli.acev-yahoo
-
5/19/2010 5:40:26 AM
Print Function create custom web parts
I want to create Print function WebParts but I can to complete and I need some help. I was created PrintFunctions.ascx page with this code
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="PrintFunctions.ascx.cs" Inherits="CMSWebParts_Viewers_PrintFunctions" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%> <script type='text/javascript'> <!-- function printPage() { var da = (document.all) ? 1 : 0; var pr = (window.print) ? 1 : 0; if(!pr) return; var printArea = document.getElementById("mainareadiv"); if(printArea == null && da) printArea = document.all.mainareadiv; if(printArea) { var sStart = "<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"<%=Configuration.RootDir%>styles/structure.css\"><link rel=\"stylesheet\" type=\"text/css\" href=\"<%=Configuration.RootDir%>styles/editor.css\"><link rel=\"stylesheet\" type=\"text/css\" href=\"<%=Configuration.RootDir%>styles/units.css\"></head><body onload=\"javascript:window.print();\">"; sStop = "</body></html>";
var w = window.open('','printWin','width=650,height=440,scrollbars=yes'); wdoc = w.document; wdoc.open(); wdoc.write( sStart + printArea.innerHTML ) ; wdoc.writeln( sStop ); wdoc.close(); } } //--> </script>
and code behind PrintFunctions.ascx.cs with this code:
using System; using System.Data; using System.Drawing; using System.Web; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls;
namespace CMSWebParts_Viewers_PrintFunctions { /// <summary> /// Summary description for PrintFunctions. /// </summary> public abstract class PrintFunctions : UserControlBase {
private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here }
#region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load); } #endregion } }
I have this error Could not load type CMSWebParts_Viewers_PrintFunctions
Please help me hoe to complete this web parts
Thanks
|