CodePaste Logo
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 ASP.net
<script type="text/javascript">
 
    function CustomValidatorOmbudsmanNotifiedDate(s, args) {
        var dt = args.Value
 
        if (!dt && $("*[id$='OmbudsmanNotifiedFlag'] input:checked").val() == '1') {
            args.IsValid = false;
        }
        else {
            args.IsValid = true;
by Cat   December 12, 2011 @ 3:27pm
44 Views
no comments
 
C#
public float Value
        {
            get
            {
                object o = ViewState["Value"];
                if (o == null)
                    return 0;
                return (float)o;
            }
            set
by Robert Friberg   September 20, 2011 @ 2:36am
47 Views
no comments
 
C#
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Web.Mvc;
using Microsoft.Practices.EnterpriseLibrary.Validation;
 
namespace Thoughtology.Web.Mvc
{
    /// <summary>
    /// Maps a browser request to a data object and provides validation
by Enrico Campidoglio   May 23, 2011 @ 3:49am
238 Views
no comments
 
C#
public ActionResult Index()
{
    string modelDefinition = 
    @"public class ChangePasswordModel
        {
            [Required]
            [DataType(DataType.Password)]
            [Display(Name = ""Current password"")]
            public string OldPassword { get; set; }
by Jon Galloway   May 15, 2011 @ 3:35pm
288 Views
no comments
 
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="ViewLog.aspx.cs" Inherits="Module_Admin_ViewLog"
    ValidateRequest="false" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentHeader" Runat="Server">
<style type="text/css">
    .lastUpdate
    {
        height: .8em;
        font-size: .8em;
    }
by Ken Wiebke   March 19, 2011 @ 6:34am
181 Views
no comments
 
C#
string path = System.Environment.SystemDirectory; 
            path = path.Substring(0, path.LastIndexOf('\\')); 
            path = Path.Combine(path, "Microsoft.NET"); 
            // C:\WINDOWS\Microsoft.NET\  
            string[] versions = new string[]{     
                "Framework\\v1.0.3705",     
                "Framework64\\v1.0.3705",     
                "Framework\\v1.1.4322",     
                "Framework64\\v1.1.4322",     
                "Framework\\v2.0.50727",     
by ibsk8in31   March 18, 2011 @ 12:08pm
91 Views
no comments
 
string displayMe = (string)Request.ServerVariables["HTTP_USER_AGENT"];
            if (displayMe.IndexOf(".NET4.0") == -1)
            {
                versionCheck.Text = displayMe;
            }
by ibsk8in31   March 18, 2011 @ 11:39am
127 Views
no comments
 
C#
I have an issue with accessing certain public objects of my RESx files. I am working with a MEF solution around an MVC3 application. My 
RESx files are implemented as public so they are accessible across assemblies. However, this seems to be limited. 
 
The solution I have is just changing the Custom Tool to PublicResXFileCodeGenerator. This allows switching the accessor that is applied 
to the class from internal to public. However, there is a catch when we throw MEF into the mix.
 
Because MEF works on the principle of importing assemblies into an AppDomain and managing the export and import connections that it 
contains, the soft referencing that is implied does not connect one RESx file to another.
 
Project Brand
by Bryan Wood   March 10, 2011 @ 10:49am
Tags: MVC, asp.net, MEF, resx
186 Views
no comments
 
This Issue resolved by using an Ajax:Accordion and some control transition.
 
Thank you for your interest
by hajloo   February 13, 2011 @ 2:47am
168 Views
no comments
 
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="WebFormsTest._Default" ClientIDMode="Static" %>
 
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Welcome to ASP.NET!
    </h2>
    <asp:TextBox ID="LazyCoderHidden" runat="server"></asp:TextBox>
by Jon Galloway   October 14, 2010 @ 5:14pm
292 Views
no comments
 
C#
/// <summary>
/// Returns the content of the POST buffer as string
/// </summary>
/// <returns></returns>
public static string FormBufferToString()
{
    HttpRequest Request = HttpContext.Current.Request;            
 
    if (Request.TotalBytes > 0)            
        return Encoding.Default.GetString(Request.BinaryRead(Request.TotalBytes));
by Rick Strahl   August 19, 2010 @ 2:39pm
264 Views
no comments
 
Try
 
    Habanero.Base.GlobalRegistry.ApplicationName = "IGD"
    Habanero.Base.GlobalRegistry.ApplicationVersion = "v1.0"
    HabaneroApplication = New Habanero.UI.Win.HabaneroAppWin(Habanero.Base.GlobalRegistry.ApplicationName, Habanero.Base.GlobalRegistry.ApplicationVersion)
    HabaneroApplication.ClassDefsXml = IGD.BO.BOBroker.GetClassDefsXml()
 
    If Not HabaneroApplication.Startup() Then
        Throw New Exception("Unable to start Habanero Application")
    End If
by Mitchell William Cooper   May 30, 2010 @ 2:57pm
Tags: Habanero, ASP.NET,
209 Views
no comments
 
C#
using System;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web.Mvc.Html;
using System.Web.Routing;
 
namespace MvcSamples.Html
{
    public static class UrlExtensions
by Bobby Diaz   April 08, 2010 @ 10:10pm
Tags: ASP.NET, MVC 2
1390 Views
1 comments
 
{
   "Fields":[
      {
         "FieldName":"Name",
         "ReplaceValidationMessageContents":true,
         "ValidationMessageId":"Name_validationMessage",
         "ValidationRules":[
            {
               "ErrorMessage":"Meno musí mať 5 až 40 znakov.",
               "ValidationParameters":{
by Jozef Izso   March 09, 2010 @ 7:37am
Tags: asp.net, mvc
622 Views
no comments
 
C#
public class URLRewriterModule : IHttpModule
    {
        /// <summary>
        /// You will need to configure this module in the web.config file of your
        /// web and register it with IIS before being able to use it. For more information
        /// see the following link: http://go.microsoft.com/?linkid=8101007
        /// </summary>
        #region IHttpModule Members
 
        public void Dispose()
by ZeroDotNet   February 22, 2010 @ 11:04pm
333 Views
no comments
 
XML
  <Target Name="AfterMerge">
  <ItemGroup>
    <JsFiles Include="$(TempBuildDir)\Scripts\infinitecarousel.js;$(TempBuildDir)\Scripts\jquery.autocomplete.js;$(TempBuildDir)\Scripts\core.js"/>
    <CssFiles Include="$(TempBuildDir)\Content\reset.css;$(TempBuildDir)\Content\infinitecarousel.css;$(TempBuildDir)\Content\Site.css" />
  </ItemGroup>
    
  <ReadLinesFromFile File="%(JsFiles.Identity)">
    <Output TaskParameter="Lines" 
            ItemName="jsLines"/>
  </ReadLinesFromFile>
by ArranM   February 16, 2010 @ 2:25pm
1760 Views
no comments
 
C#
using System;
using System.Collections.Specialized;
using System.Web;
using System.IO;
 
namespace ConfigFileExample.Services
{
    public interface IConfigurationManager
    {
        NameValueCollection AppSettings { get; }
by Bob Cravens   February 03, 2010 @ 2:46pm
496 Views
2 comments
 
C#
public enum StyleConditions {
   IE6OrLess, IE7OrLess
}
 
public static class HtmlHelpers {
   #region Image
   public static string Image(this HtmlHelper helper, string route, string action, int id, int height, int width, int imageType,
      string altText, string cssClass) {
      var urlHelper = new UrlHelper(helper.ViewContext.RequestContext);
      var imageUrl = urlHelper.RouteUrl(route, new RouteValueDictionary(new {
by Richard Kimber   January 20, 2010 @ 1:16pm
976 Views
no comments
 
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
 
<!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></title>
    <link runat="server" href="~/style/my.css" rel="stylesheet" type="text/css" />
</head>
<body>
by andreabalducci   January 11, 2010 @ 3:55pm
Tags: asp.net
265 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
386 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