Friday, April 19, 2013

How to Enable and Disable ASP.NET TextBox Control on CheckBox Click in Java Script


  • Create New Project in Visual Studio 2010 (or in any version).
  • Add New Page ( named default.aspx ).
  • Add Following aspx Code in default.aspx page.

        <table style="width: 100%;">

            <tr>
                <td align="right" style="width: 50%">
                    <asp:Label ID="LabelClick" runat="server" Text="Click Me !!!"></asp:Label>
                </td>
                <td align="left" style="width: 50%;">
                    <asp:CheckBox ID="CheckBox" onclick="EnableDisableTextBox();" Checked="false" runat="server" />
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 50%">
                    <asp:Label ID="LabelName" runat="server" Text="Name:"></asp:Label>
                </td>
                <td align="left" style="width: 50%">
                    <asp:TextBox ID="TextBoxName" runat="server" Width="70%"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 50%">
                    <asp:Label ID="LabelAge" runat="server" Text="Age:"></asp:Label>
                </td>
                <td align="left" style="width: 50%">
                    <asp:TextBox ID="TextBoxAge" runat="server" Width="70%"></asp:TextBox>
                </td>
            </tr>
        </table>



  • Add Following Java Script Code inside head tag in default.aspx page.

    <script type="text/javascript" language="javascript">
        function EnableDisableTextBox() {

            var CallerCheckBoxID = "<%= CheckBox.ClientID %>";
            var LblName = "<%= LabelName.ClientID %>";
            var TxtName = "<%= TextBoxName.ClientID %>";
            var LblAge = "<%= LabelAge.ClientID %>";
            var TxtAge = "<%= TextBoxAge.ClientID %>";
            if (document.getElementById(CallerCheckBoxID).checked == true) {

                document.getElementById(LblName).disabled = true;
                document.getElementById(TxtName).disabled = true;
                document.getElementById(LblAge).disabled = true;
                document.getElementById(TxtAge).disabled = true;

            }
            else {

                document.getElementById(LblName).disabled = false;
                document.getElementById(TxtName).disabled = false;
                document.getElementById(LblAge).disabled = false;
                document.getElementById(TxtAge).disabled = false;

            }
        }
    </script>

You have all done. View it in browser.
Follow me on Facebook to get more cool tutorials. -:)

Saturday, March 30, 2013

ORA-00215 Must be at Least one Control File

Error Code
ORA-00215

Description
Must be at least one control file.

Cause
Possible cause of this error is, no control file is specified or the control file specified does not exist.

Action
To fix this issue, specify at least one valid control file and retry the operation.

reference

ORA-00214 Control file String Version String Inconsistent

Error Code
ORA-00214

Description
Control file 'string' version string inconsistent with file 'string' version string.

Cause
Possible cause of this error is, an inconsistent set of control files, datafiles/logfiles, and redo files was used.

Action
To fix this issue, use a consistant set of control files, datafiles/logfiles, and redo log files. That is, all the files must be for the same database and from the same time period.

reference

ORA-00213 Cannot Reuse Control File

Error Code
ORA-00213

Description
Cannot reuse control file; old file size string, string required.

Cause
Possible cause of this error is,to reuse a control file, it must be the same size as the one previously used.

Action
To fix this issue, either do not specify REUSE, or specify a matching combination of MAXDATAFILES, MAXLOGFILES, MAXLOGMEMBERS, MAXLOGHISTORY, and MAXINSTANCES clauses in the CREATE DATABASE or CREATE CONTROLFILE statement.

reference

ORA-00212 Block Size String below Minimum Required Size of String Bytes

Error Code
ORA-00212

Description
Block size string below minimum required size of string bytes.

Cause
Possible cause of this error is, the block size specified was too small. Space for the system overhead is required.

Action
To fix this issue, specify a larger block size and retry the operation.

reference