16,016,759 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 8587874 (Top 8 by date)
Member 8587874
17-Jul-13 4:15am
View
yes,im getting the json response inthe flex end.
Member 8587874
22-Mar-12 2:44am
View
I am extremely sorry,Now i can understand it very well,and thank you
Member 8587874
21-Mar-12 12:47pm
View
sir those who are asking questions to expert are not intelligent as you,ie they are asking a solutions to the expert,if you cant able to answer those silly questions pleasse leave it,why are you trying to discourage them like this.Iam beginner in this field and iam trying to study asp.net myself,i dont have 6-7year experience like you.
Member 8587874
21-Mar-12 12:41pm
View
first of all,i like to say iam beginner inthis field and iam studying myself, sir instead of creating a print application of my own,i wish to call print tool in my IE to print my form in my webpage while running my web applications,I wish to know whether it possible or any code for it.
Member 8587874
20-Mar-12 4:44am
View
sorry sir its not helpful to me,by putting doublequotes for javascript it shows error such as semicolon,closing bracket expected like this.sir is it possibel to use current browser print control in c# web application,if so please provide me the code,i need the print properties seen in internet explorer or any other browser,ie perfect print with page settings,printpreview like.If not how can we set the header for a printpage.
Member 8587874
19-Mar-12 2:56am
View
Class i used
public class PrintHelper
{
public PrintHelper()
{
//
// TODO: Add constructor logic here
//
}
public static void PrintWebControl(Control ctrl)
{
PrintWebControl(ctrl, string.Empty);
}
public static void PrintWebControl(Control ctrl, string Script)
{
StringWriter stringWrite = new StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite);
if (ctrl is WebControl)
{
Unit w = new Unit(100, UnitType.Percentage);
((WebControl)ctrl).Width = w;
}
Page pg = new Page();
pg.EnableEventValidation = false;
if (Script != string.Empty)
{
pg.ClientScript.RegisterStartupScript(pg.GetType(), "PrintJavaScript", Script);
}
HtmlForm frm = new HtmlForm();
pg.Controls.Add(frm);
frm.Attributes.Add("runat", "server");
frm.Controls.Add(ctrl);
pg.DesignerInitialize();
pg.RenderControl(htmlWrite);
string strHTML = stringWrite.ToString();
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Write(strHTML);
HttpContext.Current.Response.Write("<script>window.print();</script>");
HttpContext.Current.Response.End();
}
}
//on button click
Session["ctrl"] = FormView1;
ClientScript.RegisterStartupScript(this.GetType(), "onclick",
"<script language=javascript>window.open('Print.aspx','PrintMe','height=auto,width=300px,scrollbars=1');</script>");
PrintHelper.PrintWebControl(FormView1);
//default page load
Control ctrl = (Control)Session["ctrl"];
PrintHelper.PrintWebControl(ctrl);
Member 8587874
19-Mar-12 2:37am
View
Class i used
public class PrintHelper
{
public PrintHelper()
{
//
// TODO: Add constructor logic here
//
}
public static void PrintWebControl(Control ctrl)
{
PrintWebControl(ctrl, string.Empty);
}
public static void PrintWebControl(Control ctrl, string Script)
{
StringWriter stringWrite = new StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite);
if (ctrl is WebControl)
{
Unit w = new Unit(100, UnitType.Percentage);
((WebControl)ctrl).Width = w;
}
Page pg = new Page();
pg.EnableEventValidation = false;
if (Script != string.Empty)
{
pg.ClientScript.RegisterStartupScript(pg.GetType(), "PrintJavaScript", Script);
}
HtmlForm frm = new HtmlForm();
pg.Controls.Add(frm);
frm.Attributes.Add("runat", "server");
frm.Controls.Add(ctrl);
pg.DesignerInitialize();
pg.RenderControl(htmlWrite);
string strHTML = stringWrite.ToString();
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Write(strHTML);
HttpContext.Current.Response.Write("<script>window.print();</script>");
HttpContext.Current.Response.End();
}
}
//on button click
Session["ctrl"] = FormView1;
ClientScript.RegisterStartupScript(this.GetType(), "onclick",
"<script language=javascript>window.open('Print.aspx','PrintMe','height=auto,width=300px,scrollbars=1');</script>");
PrintHelper.PrintWebControl(FormView1);
//default page load
Control ctrl = (Control)Session["ctrl"];
PrintHelper.PrintWebControl(ctrl);
Member 8587874
19-Mar-12 2:20am
View
k,sir thank you
Show More