Monday, October 29, 2012

Toggle Display (On / Off)

JavaScript
<script language="javascript" type="text/javascript">

  function TDisplay(elementID) {

  var CurrentElement = document.getElementById(elementID);

  CurrentElement.style.display = (CurrentElement.style.display != 'none') ? 'none' : '';

  return false;

}

</script>

.ASPX Page
<asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="return TDisplay('panel1');">

Toggle Display(On / Off)</asp:LinkButton>

<asp:Panel ID="panel1" runat="server">

    Panel content here!

</asp:Panel>

Pass data from one page to another new popup window

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title></title>

<script language="javascript" type="text/javascript">

    function PassData() {

        var Qstr = document.getElementById("<%=txtData.ClientID %>").value;

        window.open('Your-Target-Page.aspx?ID=' + Qstr, 'NewWindow', 'width=400,height=300,location=no,menubar=no,resizable=no,scrollbars=no,status=yes,toolbars=no');

        return  false;

}



</script>

</head>

<body>

    <form id="form1" runat="server">

    <div>

<asp:TextBox ID="txtData" runat="server" Text="23"

CssClass="TextBox"></asp:TextBox>

<asp:Button ID="btnRedirect" runat="server" Text="Window Open"

CssClass="Button" OnClientClick="return PassData(); " />

    </div>

    </form>

</body>

Monday, October 15, 2012

Hide Files or Folders Using Command Prompt

For that you need to follow the following instructions

  1. Press windowkey+R: Run command dialog box appears.
  2. Now type "cmd" and hit enter. A command prompt window displays.
  3. Now type "attrib +s +h E:\collegephotos" and hit enter.
  4. The folder "collegephotos" will be hidden (Note: It cannot be viewed by any search options)

    (To view this folder again, use the same command but replace '+' with '-' on both flags 's' and 'h')