Skip to main content

Posts

Showing posts from April, 2010

Get data from Clipboard

 if (Clipboard.GetDataObject().GetDataPresent(DataFormats.rtf))                    Label1.Text = Clipboard.GetDataObject().GetData(DataFormats.rtf).ToString();         else             Label1.Text = "There is no data in clipboard"; end if

Disable back button of browser

To disable the back button of browser (internet explorer, Microsoft) and to clear the cache write this two line of code in your pageload event Response.Cache.SetCacheability(HttpCacheability.NoCache) Response.Cache.SetNoStore() The above two lines will clear cache of the last visited page. now on every page i think you must be checking that a particular user is logged in or not (with session variable). if user=session("usersession") then response.redirect("~/Next page.aspx", False) else response.redirect("~/Loginpage.aspx", False) endif

Generate PDF in dotnet

The best way to generate a pdf in .net is by using iTextsharp(very good library). With less stress in mind and without using any costly third party tool. Add reference top itextsharp dll in your project Add These two line using iTextSharp.text; using iTextSharp.text.pdf; Then in any event you can write these lines, I have written it in page load. protected void Page_Load(object sender, EventArgs e) { Document doc = new Document(); PdfWriter.GetInstance(doc, Response.OutputStream); doc.Open(); doc.Add(new Paragraph("This an ITextsharp generated PDF")); doc.Close(); Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment; filename=Sample.pdf"); Response.End(); } } Further tutorials can be found in http://itextsharp.sourceforge.net/

machine to machine

Error 1 It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

LMS

There are many opensource LMS packages built in java and other languages. Check the list below Docebo eFront Dokeos Claroline ATutor ILIAS OLAT Sakai .LRN openelms Ganesha Choose the best