Banner Ad

Saturday, September 27, 2014

How to disable the “tooltip” for a Asp.net control programmatically?

By Francis   Posted at   12:31 AM   ASP.Net with Javascript No comments
One of the forum member ask this question in the asp.net forum. The answer is yes, we can use a simple javascript to achieve this functionality. Take a look at the below code:
Using Javascript:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function DisableToolTip() {
            // Get the object
            var obj = document.getElementById('LnkBtn');
            // set the tool tip as empty
            obj.title = "";
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:LinkButton runat="server" Text="Simple Link Button" ToolTip="Simple Button with Tool Tip" ID="LnkBtn" ClientIDMode="Static" ></asp:LinkButton>
    <a href="#" id="lnkDisable" onclick="DisableToolTip();">Disable Tool Tip</a>
    </form>
</body>
</html>

Using JQuery:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#lnkDisable").click(function () { $('#LnkBtn').attr({'title':''}); });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:LinkButton runat="server" Text="Simple Link Button" ToolTip="Simple Button with Tool Tip" ID="LnkBtn" ClientIDMode="Static" ></asp:LinkButton>
    <a href="#" id="lnkDisable">Disable Tool Tip</a>
    </form>
</body>
</html>

Monday, September 15, 2014

ASP.Net Forums - FAQ #5: How to change the Title Case of a string to Uppercase in Server Side?

By Francis   Posted at   12:04 PM   ASP.Net Forums No comments
One of the user in the forum asked similar to this question. In server side, I thought take the string, and covert it to character array and loop thru the character and change the first Letter alone to capital letter.
                     Instead,we can use “TextInfo” class to achieve the solution in a easier manner. The below function used to convert the given string’s first character alone as a Capital letter.

       
        using System.Globalization;
        using System.Threading;
        public string changeName(string inputname)
        {
            string modifiedname = string.Empty;
            string[] names = inputname.Split(' ');
            foreach (string name in names)
            {
                    CultureInfo cultureInfo   = Thread.CurrentThread.CurrentCulture;
                    TextInfo txtinfo = cultureInfo.TextInfo;
                    string temp=txtinfo.ToTitleCase(name);
                    modifiedname = string.Concat(temp, " ");
            }
            return modifiedname;
        }

Wednesday, August 27, 2014

Settled with Cognizant!!!

By Francis   Posted at   7:08 AM   General No comments

NewJob

           After a last couple of month (serious Smile) job hunt ended with an offer with Cognizant, an multinational IT giant in India. As a asp.net blogger, I missed out a lot for the last few months. Hope this change will make a difference in all aspects. At the same time, I want to thank my previous company colleagues and friends for their wonderful support during my tenure there.  Be cognizant!!!

Thursday, July 17, 2014

Daily Interview Question #14 : What is Cross-Page Posting?

By Francis   Posted at   1:22 PM   ASP.Net Interview Questions No comments

Cross page posting is used to submit a page (page1.aspx) to another page (page2.aspx). However, the user can still able to access the first page’s (page1.aspx) controls, properties etc in the second page (page2.aspx). In order to access the first page’s control, we have to use “Previouspage” property.

Sunday, July 13, 2014

Daily Interview Question #13 : What is “Postback”?

By Francis   Posted at   4:42 PM   ASP.Net Interview Questions No comments

                     In ASP.Net postback means, page posted back itself to the server(IIS) whenever an event triggered. That is, page is submitted to the same url. The event may be a button click or dropdown list changed etc. Postback can be identified by IsPostBack() property, to detect the page object is created due to postback.

Connect with Us