How to hide generated javascript file in visual studio code

In this post I am going to show you a cool trick in visual studio code. Let's suppose you are writing typescript code in visual studio code and you want to hide generated javascript code.

Create .vscode folder in your folder and then create settings.json file and paste following code

{ "files.exclude": { "node_modules":true, "**/.git": true, "**/.DS_Store": true, "**/*": true, "**/*.js": {"when": "$(basename).ts"}     } }

How To Handle an async postback timeout in ASP.NET

<%@ Page Language="C#" AutoEventWireup="true" %>

<script runat="server">
   protected void slow_postback(object sender, EventArgs e)
       // ten seconds is overkill... we timeout after one second (see ScriptManager below) 

<html xmlns="">
<head id="Head1" runat="server">
   <title>Handling an async postback timeout</title>
   <form id="form1" runat="server">
       <!-- This sets the timeout on async postbacks (i.e. UpdatePanel refreshes) to one second -->
       <asp:ScriptManager ID="ScriptManager1" runat="server" AsyncPostBackTimeout="1" />
       <asp:UpdatePanel ID="UpdatePanel1" runat="server">
               <asp:Button ID="Button1" runat="server" Text="Fast postback - no timeout" /> <br />
               <asp:Button ID="Button2" runat="server"
                Text="Slow postback - times out after one second"
 OnClick="slow_postback" /> <br />
               Last updated: <%= DateTime.Now %>

<script type="text/javascript">
   Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function (sender, args) {
       if (args.get_error() && args.get_error().name ===
'Sys.WebForms.PageRequestManagerTimeoutException') {
           alert('Caught a timeout!');
           // remember to set errorHandled = true to keep from getting a
popup from the AJAX library itself 


Post a Comment

Popular posts from this blog

How to get cell value of gridview using JQUERY

how to convert web page to pdf

Export Html to Pdf using iTextSharp(GridView)