Search Results

Search found 2 results on 1 pages for 'scottie'.

Page 1/1 | 1 

  • Should I group all of my .js files into one large bundle?

    - by Scottie
    One of the difficulties I'm running into with my current project is that the previous developer spaghetti'd the javascript code in lots of different files. We have modal dialogs that are reused in different places and I find that the same .js file is often loaded twice. My thinking is that I'd like to just load all of the .js files in _Layout.cshtml, and that way I know it's loaded once and only once. Also, the client should only have to download this file once as well. It should be cached and therefore shouldn't really be a performance hit, except for the first page load. I should probably note that I am using ASP.Net bundling as well and loading most of the jQuery/bootstrap/etc from CDN's. Is there anything else that I'm not thinking of that would cause problems here? Should I bundle everything into a single file?

    Read the article

  • How do I catch the error from my printer with PrintDocument?

    - by Scottie
    I am using the PrintDocument class to print to my Brother label printer. When I execute the Print() method, the printer starts flashing a red error light, but everything else returns successful. I can run this same code on my laser printer and everything works fine. How can I see what is causing the error on my label printer? Code: public class Test { private Font printFont; private List<string> _documentLinesToPrint = new List<string>(); public void Run() { _documentLinesToPrint.Add("Test1"); _documentLinesToPrint.Add("Test2"); printFont = new Font("Arial", 10); var pd = new PrintDocument(); pd.DefaultPageSettings.Margins = new Margins(25, 25, 25, 25); pd.DefaultPageSettings.PaperSize = new PaperSize("Label", 400, 237); var printerSettings = new System.Drawing.Printing.PrinterSettings(); printerSettings.PrinterName ="Brother QL-570 LE"; pd.PrinterSettings = printerSettings; pd.PrinterSettings.Copies = 1; pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); pd.Print(); } // The PrintPage event is raised for each page to be printed. private void pd_PrintPage(object sender, PrintPageEventArgs ev) { float linesPerPage = 0; float yPos = 0; int count = 0; float leftMargin = ev.MarginBounds.Left; float topMargin = ev.MarginBounds.Top; string line = null; // Calculate the number of lines per page. linesPerPage = ev.MarginBounds.Height / printFont.GetHeight(ev.Graphics); // Print each line of the file. while ((count < linesPerPage) && (count < _documentLinesToPrint.Count)) { line = _documentLinesToPrint[count]; yPos = topMargin + (count * printFont.GetHeight(ev.Graphics)); ev.Graphics.DrawString(line, printFont, Brushes.Black, leftMargin, yPos, new StringFormat()); line = null; count++; } // If more lines exist, print another page. if (line != null) ev.HasMorePages = true; else ev.HasMorePages = false; } }

    Read the article

1