![]() ![]() Not sure I have all the steps correct, would appreciate it if someone could be of assistance with this problem. I have tried to print straight from the button click event. I get the following error, do not know what I am doing wrong. Win.focus() // This will give focus to your newlyįollowing function can be written on the new window "Print.aspx" Page Load Event, so as if you wnat the Print Dialog Box also to be Pop Up:. Win = window.open(sUrl,"Print", sFeatures) Var sFeatures = "height=680,width=700,left=" xLeft ",top=" yTop ",status=no,toolbar=no,menubar=no, location=no" //This will give all these features to your Var sUrl = "PrintPage.aspx" //New Window Name. Var yTop = 0 //This will put your new window on Var xLeft = 150 //Will keep x position from Left. Hope this also can be useful for the readers. I would like to add 1 more script in this article, which i have used, as per the req. ("window.print() window.This overall article is very interesting and worth reading. 'html string from table, or another control Public Shared Sub PrintWebControlTable(ByVal ctrl As Control, ByVal Script As String)ĭim sb As StringBuilder = New StringBuilder()ĭim tw As StringWriter = New StringWriter(sb)ĭim hw As HtmlTextWriter = New HtmlTextWriter(tw)ĭim w As Unit = New Unit(100, UnitType.Percentage) Public Shared Sub PrintWebControlTable(ByVal ctrl As Control) ).Īdded to metods to printhelper, i use it for my table, but with some corrections it works for any control. The Controls collection cannot be modified because the control contains code blocks (i.e. NET Framework Version:7.42 ASP.NET Version:7.42 Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 5102 Page.RaisePostBackEvent(NameValueCollection postData) 33 Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) 11 UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) 7 _Default.PrintOrder_Click(Object sender, EventArgs e) in D:\CompuSwift\Content_Pages\Email_Hosting\Email_:115 PrintHelper.PrintWebControl(Control ctrl) in D:\CompuSwift\App_Code\PrintHelper.vb:19 PrintHelper.PrintWebControl(Control ctrl, String Script) in D:\CompuSwift\App_Code\PrintHelper.vb:39 Control.RenderControl(HtmlTextWriter writer) 22 Control.RenderChildren(HtmlTextWriter writer) 24 Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) 130 ![]() Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) 121 Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) 25 Source File: D:\CompuSwift\App_Code\PrintHelper.vb Line: 39 ![]() Line 40: Dim strHTML As String = stringWrite.ToString() Please review the stack trace for more information about the error and where it originated in the code.Įxception Details: : A page can have only one server-side Form tag. I need a solution rather urgentlyĪ page can have only one server-side Form tag.ĭescription: An unhandled exception occurred during the execution of the current web request. ![]() This overall article is very interesting and worth reading. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |