Author: admin

  • WordPress Spam Link Hack Solved

    One of the wordpess site was hacked with a spam link. spam link was porn and pharma link automatically generated in the website. After browsing internet it was bas64_encode added in reverse in the theme functions.php file. base64_encode code as a reversed string and the…

  • Checking File Upload Size using Custom Validator in ASP.NET and Javascript

    The following snippet uses custom validator control  and javascript to check the file upload size and disabling the form submission if the file size exceeds the limit. The form will not submit if the validator fails. ASPX.PAGE [sc:tcbox ] <asp:FileUpload ID=”fileUpload” runat=”server” /> <br />…

  • Increment Filename Number if exists using c# and asp.net

    When you upload a file in asp.net web application and if the file exists it just simply overwrites the existing file. In this example, what we are trying to do is check the filename if it exists. If exists then add an increment number at…

  • Set menu item active based on URL using Jquery

    This is a small snippet using jquery that reads the current URL and set the corresponding menu item active by add a css class “active”. I have just given the html and jquery. You can design your own css. HTML MENU [sc:tcbox ] <div id=”cssmenu”>…

  • Best jquery scripts that you can use for your projects

    Here is the link of the snippets of different jquery that you can use in your projects modalIt_jQuery hoverControlCss_jQuery onlyOneCheckBox_jQuery rwQueryString_jQuery confirm_jQuery expandCollapse_jQuery capitalizeTextBox_jQuery multiControlRfv_jQuery ajaxPopulate_jQuery restoreScrollPosition_jQuery logIt_jQuery ajaxCascadeDdl_jQuery isDirtyPrompt_jQuery highlightChanges_jQuery enableControlOnCheck_jQuery highlightAndToggleGridRows_jQuery sumIt_jQuery upDownTextBox_jQuery tooltip_jQuery popupPanel_jQuery watermark_jQuery limitTextBox_jQuery https://code.google.com/p/m-jq-projects/w/list

  • Insert Item at top of the DropDownList in ASP.net Codebehind

    Here is the snippet, for demo i am pulling the List of States and its ID from the database   [sc:tcbox ] ddl_State.DataSource = GetAllStates(); ddl_State.DataTextField = “Title”; ddl_State.DataValueField = “StateID”; ddl_State.DataBind();   ddl_State.Items.Insert(0, new ListItem(“Select State”, “”)); // I am inserting Empty Value at the…

  • Force URL to lower case in ASP.NET using web.config

    If your hosting company has IIS rewrite module installed, then you can force all the url in the browser to be in lower case. This is good for SEO as google will see only one url  eg. LOWERCASE.ASPX and lowercase.aspx will both point lowercase.aspx page…

  • Setting active tab or menu link of the current page using jquery

    Using jquery we can set the class of the tabs link or menu link to ‘active’ so we can highlight for the current page. the snippet is give below. It is achieved through jquery by iterating the links in the navigation bar or tabs and…

  • Using local jquery if CDN of google jquery is not available

    Well most of us will be using Google CDN jquery file. At times if the jquery file fail to load from the cdn network you can always load and use the local jquery file in  your server. Just use the following snipped