New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of Control
C#
public static Control FindControlUsingStack(Control root, string id)
{
   // Seed it.
   Stack<Control> stack = new Stack<Control>();
   stack.Push(root);
 
   while(stack.Count > 0)
   {
      Control current = stack.Pop();
      if (current.ID == id)
by Arjan   June 24, 2010 @ 4:06am
23 Views
no comments
 
C#
/// <summary>
/// Holds up the test execution for the given duration without blocking the UI thread.
/// </summary>
void UIPause(int sec)
{
    Storyboard PauseSB = new Storyboard() { Duration = new Duration(new TimeSpan(0, 0, sec)) };
    PauseSB.Completed += (sender, e) => { TestComplete(); };
    PauseSB.Begin();
}
69 Views
no comments
 
<Extension()> _
Public Function GetBindingInfo(ByVal DataLayoutControl As DataLayoutControl, _
                               Optional ByVal ExcludePropetries As String = "") As List(Of DataLayoutBindingInfo)
    Dim bh As New LayoutElementsBindingInfoHelper(DataLayoutControl)
    Dim info As LayoutElementsBindingInfo = bh.CreateDataLayoutElementsBindingInfo
    GetBindingInfo = (From x As LayoutElementBindingInfo In info.GetAllBindings _
                      Where (Not x.DataInfo.Name.ToUpper.EqualsAny(ExcludeNames)) _
                      And (Not x.DataInfo.Name.ToUpper.EqualsAny(ExcludePropetries)) _
                      Select New DataLayoutBindingInfo(x.DataInfo.Name, x.DataInfo.Caption, x.Visible, x.EditorType)).ToList
End Function
by Thom Lamb   May 19, 2010 @ 7:42am
44 Views
no comments
 
C#
private void button_Click(object sender, EventArgs e) 
{ 
    // pass in the containing panel 
    LoadControl<MyControls.MyControl>(panelContainer); 
} 
 
void LoadControl<T>(Panel panel) where T : Control, new() 
{ 
    T _Control = GetControl<T>(panel); 
    if (_Control == null) 
by Jerry Nixon   March 05, 2010 @ 8:17am
121 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Text.RegularExpressions;
using System.Reflection;
using Activity_Search.Code;
 
namespace Activity_Search.Controllers
February 09, 2010 @ 5:31am
80 Views
no comments
 
Public Class ctlDragableSizable
 
    ' Locked when parent control handles the resizing
    Private blnIsResizeLocationLocked As Boolean = False
 
    Private intXMouseDownPosition As Integer
    Private intYMouseDownPosition As Integer
 
    Private blnSizableVertical As Boolean = False
    Private blnSizableHorizontal As Boolean = False
by Mitchell William Cooper   January 05, 2010 @ 7:57am
171 Views
no comments
 
C#
<system.web>
  <pages>
    <controls>
      <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
      <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </controls>
  </pages>
</system.web>
by afsharm   December 24, 2009 @ 5:00am
108 Views
no comments
 
C#
using Microsoft.TeamFoundation.VersionControl.Client;
using Microsoft.TeamFoundation.WorkItemTracking.Client;
 
// create a new work item linked to an existing item in version control
static void CreateLinkedWorkItem(String teamProject, String workItemType)
{
    using (var tfs = TeamFoundationServerFactory.GetServer(_ServerUri))
    {
        var workItemStore = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
 
by Jim Lamb   October 29, 2009 @ 8:01pm
133 Views
no comments
 
C#
using Microsoft.TeamFoundation.VersionControl.Client;
 
// query the version control repository for items matching a file specification
// set the folder for the root of your search
String rootFolder = "$/MyProject";
 
// construct the set of item specifications you want to search for
ItemSpec[] itemSpecs = new ItemSpec[] { 
    new ItemSpec(String.Format("{0}/*.sln", rootFolder), RecursionType.Full),
};
by Jim Lamb   October 29, 2009 @ 7:54pm
68 Views
no comments
 
C#
 
// Renders ANY control into HTML
public static string RenderControl(Control ctrl)
{
    StringBuilder sb = new StringBuilder();
    StringWriter tw = new StringWriter(sb);
    HtmlTextWriter hw = new HtmlTextWriter(tw);
 
    ctrl.RenderControl(hw);
    return sb.ToString();
by Groove Commerce   August 27, 2009 @ 11:32am
85 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Mvc;
using Westwind.Utilities;
using System.ServiceModel.Syndication;
using CodePasteBusiness;
using System.Text;
using System.Collections;
using System.IO;
by Rick Strahl   August 10, 2009 @ 4:44pm
502 Views
no comments
 
C#
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MensajeGeneralError.ascx.cs"
    Inherits="Syllabus_PL.UserControls.WebUserControl1" %>
<table cellspacing="0" cellpadding="0" class="cf ve">
    <tbody>
        <tr>
            <td class="vj">
            </td>
            <td class="vi" />
            <td class="vk" />
        </tr>
by Claudia Hidalgo   August 10, 2009 @ 12:56pm
75 Views
no comments
 
C#
public static string Control<ControlType>(this HtmlHelper htmlHelper, string name, 
                                          ControlType control, object htmlAttributes) 
                                        where ControlType : BaseControl
{
    control.HtmlHelper = htmlHelper;
    control.UrlHelper = new UrlHelper(htmlHelper.ViewContext.RequestContext);
    control.Id = name;
    control.MergeAttributes(htmlAttributes);
    return control.Render();
}
by Rick Strahl   July 29, 2009 @ 7:46am
181 Views
no comments
 
<td>
<%= Html.DateField("ToDate",
   new DateControl
   {
       CssClass = "datefield",
       SelectedDate = Model.Parameters.ToDate,
       DateFormat = "mm/dd/yyyy"
   },
   new { style = "min-width: 150px;" } )
%></td>
by Rick Strahl   July 29, 2009 @ 6:43am
121 Views
1 comments
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Routing;
 
namespace CodePasteMvc.Controllers
{
by Rick Strahl   July 20, 2009 @ 3:34pm
284 Views
no comments
 
C#
public class ShowSnippetViewModel
{
   
 
    public ShowSnippetViewModel(SnippetController controller)
    {
        this.Controller = controller;
    }
   SnippetController Controller = null;
by Rick Strahl   July 18, 2009 @ 4:38pm
80 Views
no comments
 
C#
public string GetTagLinkList(string tags)
{
    if (string.IsNullOrEmpty(tags))
        return string.Empty;
 
    string[] tagStrings = tags.Split( new char[1] {','}, StringSplitOptions.RemoveEmptyEntries);
 
    StringBuilder html = new StringBuilder();
    foreach (string tagString in tagStrings)
    {
by Rick Strahl   July 18, 2009 @ 3:41pm
92 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Routing;
 
namespace CodePasteMvc.Controllers
{
by Rick Strahl   July 12, 2009 @ 12:16pm
109 Views
no comments
 
brought to you by:
West Wind Techologies


If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate