Category: Javascript
-
Owin Google Logout in Asp.net Identity
In our asp.net application we can use Owin to login and/or register with Gmail. After creating a successful login to your asp.net application using gmail. You can still see that the gmail is logged in eventhough you are redirected to your application. The following snippet…
-
Prevent Cross Site Scripting – Disable Form Submission if HTML tags detected using Custom Validator Javascript in ASP.NET Webform
Still there are applications developed using asp.net webform. In your application when a user enters html tags for cross site scripting or load malicious script to inject into your site in your forms and submit you will get the following error A potentially dangerous Request.Form…
-
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 />…
-
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…
-
Delete confirmation using javascript
When you try to delete a record, set of records you may want to confirm again to delete. If you delete a bunch of records accidentally by clicking a button all the data will be lost. You can add a javascript confirm box to any…
-
Same Page Navigation Using Java Script
Most of the times it is dull to have that long scrolling HTML pages with anchor tags to display many products, all in one page. Java Script can be used to display all the products or information in one row depending upon the links clicked.…
-
JavaScript Dynamic dependent drop down list box
Dynamic dependent drop down list box can be created using Java Script. In most of the HTML FORMS you need to have to list boxes. The first one is the category and second one is the sub-category. When you select the first list box, depending…
-
Setting TextBox Focus on page load using Java Script
A small snippet for Setting TextBox Focus on page load using Java Script. Add the following java script the in the body tag to set the focus. In the snippet “form1” is the form name, “txtBox” is the input text box name.
-
3 level Dynamic Drop Down List using java script
Here is the snippet for 3 level dynamic drop down list using java script. It has category, sub-category1 and sub-category2.