Skip to main content

Posts

Display Confirmation Message on GridView Deleting

Display Confirmation Message on GridView Deleting This demo describes the different approach to display a confirmation message when deleting a row in GridView and pass the id of the item to the confirmation message. Confirmation means a user is asked first if he/she wanted to delete a record by choosing an option (OK and CANCEL). In this demo, we use the JavaScript confirm function for displaying the confirmation message. Now let’s create our JavaScript confirm function. To do this switch to ASPX source and add the following code block within the <head> tag like: < head runat ="server">     < title > GridView Data Manipulation </ title >     < script type ="text/javascript" language ="javascript">         function ConfirmOnDelete(item)         {           if (confirm( ...

Create, Build, Run,Test and Debug codes online with CodeRun Studio

Create, Build, Run,Test and Debug codes online with CodeRun Studio They called it CodeRun Studio - CodeRun is A free, cross-platform browser-based IDE designed for the cloud. It enables you to easily develop, debug and deploy web applications using your browser. CodeRun Studio can be used instead or alongside your existing desktop IDE. You can upload existing code in order to test it in the cloud or for sharing with your peers. For more information, visit the official site here: http://coderun.com/

Filtering Dates by Periods like (Today, Yesterday,This Week, Last Week, This Month)

Filtering Dates by Periods like (Today, Yesterday,This Week, Last Week, This Month) public class DatePeriod {     private DateTime _StartDate=DateTime.Now ;     private DateTime _EndDate=DateTime.Now ;     public DatePeriod()     {         //         // TODO: Add constructor logic here         //     }     public enum DatePeriods     {         Today,         Yesterday,         ThisWeek,         LastWeek,         ThisMonth     }     public DateTime StartDate     {         get { return _StartDate; }   ...

Show Large Image on MouseOver using JavaScript

Show Large Image on MouseOver using JavaScript <%@ Page Language="VB" AutoEventWireup="false" CodeFile="LargeImage.aspx.vb" Inherits="sample_LargeImage" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">     <title>Untitled Page</title> <script type="text/javascript" language="ecmascript">         function ShowBiggerImage(obj)         {             document.getElementById("LargeImageContainerDiv").innerHTML = "<img src='" + obj.src + "'+'width=150 height=200' >";         }         function ShowDefaultImage(obj)         {      ...

Display animated gif before Iframe content is loaded

Display animated gif before Iframe content is loaded   If you are working with iframe in which the content takes time to load, you may want to display a simple loading indicator to the end users instead of letting the users see a blank screen in the page. To do this, here's one way on how to implemet it using javascript.  <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server">     <title></title>     <script type="text/javascript">        function hideLoading() {             document.getElementById('divLoading').style.display = "none";             document.getElementById('divFrameHolder').style.display = "block";         }     </script> </head> <body>     <form id="form1" run...

Gridview row Selection

Gridview Row Selection  by any column VB: Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound         e.Row.Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(DirectCast(sender, System.Web.UI.Control), "Select$" + e.Row.RowIndex.ToString()))     End Sub       aspx: <%@ Page Language="VB" AutoEventWireup="false"  EnableEventValidation="false" CodeFile="GVEditonHighlight.aspx.vb" Inherits="sample_GVEditonHighlight" %>

Grid View Row Highlighting

Tip Of The Day - Remove Grid View Row Highlighting on Edit Mode Typically we will attach the mouseover and mouseout client-side events on the gridview rows to highlight rows on mouseover, but there are cases that we don't want to make the row highlighted when we are on edit mode. To do this we can check the GridView EditIndex to determine if the row is on edit mode and then do the validation there. Here's a sample code block below of what I am talking about:  VB : Protected Sub GridView1_RowDataBound(sender As Object, e As GridViewRowEventArgs)         If e.Row.RowType = DataControlRowType.DataRow Then                Dim onmouseoverStyle As String =  "this.style.backgroundColor='blue';this.style.color ='white';"       ...