Skip to main content

Posts

To change the background color or to change the inner text of a item in dropdown

To change the background color or to change the inner text of a item in dropdown // Loop around the dropdown for (row = 0; row < ddlUserName.Items.Count; row++) { // To color a particular user name if (ddlUserName.Items[row].Value == this.USERID.ToString()) ddlUserName.Items[row].Attributes.Add("style", "background-color:" + "#663333;color:#ffffff;"); }

Gridview headertemplate with checkbox and client side ( javascript) handling of select all / unselect all

Gridview headertemplate with checkbox and client side handling of select all / unselect all using javascript. courtesy from http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2008/07/16/checkbox-in-headertemplate-to-select-all-checkboxes-inside-a-gridview-using-javascript.aspx Idea and code from this site, I enhached and made small corrections this for my application, according to my requirement Thanks to http://dotnetslackers.com/ for all the code.         <div>         <input type="hidden" id="hdnCheckBoxValue" />             <table>                 <tr>                     <td style="width: 100px;">                         <asp:GridView ID="gvVendorBulletin">                             <Columns>                                 <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle"                            

Dynamically add CommandField of type Image to a gridview or any container.

Dynamically add CommandField of type Image to a grid or any container. if (!IsPostBack) { CommandField ImageCommand = new CommandField(); ImageCommand.ButtonType = ButtonType.Image; ImageCommand.DeleteImageUrl = "~/images/delete.gif"; ImageCommand.ShowCancelButton = false; ImageCommand.ShowDeleteButton = true; GridView1.Columns.Add(ImageCommand); } Then do the normal protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { } to delete or change as per your requirements.

To get the email addresses from aliases names : Outlook Programming using C#

Breach of Trust To get the email addresses from aliases names : Outlook Programming using C# IDE : Visual Studio 2008 Please ignore inappropriate content as put entire code since I am adding some more functionality other than finding the address through aliases names. using System; using System.Collections.Generic; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Microsoft.Office.Interop.Outlook; using System.Runtime.InteropServices; using System.IO; using ObjOutlook = Microsoft.Office.Interop.Outlook; namespace Stmp_Client_2008 { public partial class Form1 : Form { public String MailsSub; public String Cc; public String To; public String Bcc; public String SenderMailAddr; private static ArrayList emailCollection = new ArrayList(); public static Boolean SuccMail = false; public static Boolean MailFlag = false; ObjOutlook.Applicati

To create a User Control for add new rows dynamically using JavaScript, Asp.net, C#

User Control Code AddMore.ascx <% @ Control Language ="c#" Inherits ="Ind.UC.AddMore" CodeFile ="AddMore.ascx.cs" %> < table cellpadding ="0" cellspacing ="0" width ="100%" align ="center" id ="tblAddMore"> < tr > < td align ="right"> < input class ="button" id ="btnAdd" type ="button" value ="Add Row" runat ="server"> < input class ="button" id ="btnDelete" type ="button" value ="Delete Row" runat ="server"> td > tr > < tr style ="display:none"> < td align ="right"> < input class ="button" id ="btnGet" type ="button" value ="Get Values"