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
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
14 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,
43 Views
no comments
 
C#
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
    Response.Write(DropDownList1.SelectedValue);
}
 
protected void ButtonSave_Click(object sender, EventArgs e)
{
    int n = SqlDataSource1.Insert();
    if (n == 1)
    Response.Redirect("ViewGuestBook.aspx");
May 14, 2010 @ 12:16am
Tags: ASP.net
36 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
278 Views
1 comments
 
C#
 
/*

Author: Mohammad Azam 
http://www.highoncoding.com 

This is a much better version than I demonstrated in the screencast! 

*/
by Mohammad Azam   March 29, 2010 @ 11:51am
219 Views
no 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
145 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
82 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
564 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
99 Views
no comments
 
    /// <summary>
    /// Extension methods on HtmlHelper and UrlHelper that provide strongly-typed access to URLs and ActionLinks for AccountController actions
    /// </summary>
    public static class HelperExtensionsForAccountController
    {
        /// <summary>
        /// Html Helpers for Controller = Account
        /// </summary>
        public static AccountControllerActionLinks Account(this HtmlHelper htmlHelper)
        {
by Ian   February 07, 2010 @ 7:29pm
405 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
184 Views
2 comments
 
C#
       [Test]
       public void Should_create_a_new_meeting()
       {
           _webBrowser.ScreenCaptureOnFailure(() =>
              {
                  Form<LoginInputProxy>("/login/login/index")
                      .Input(m => m.Username, "admin")
                      .Input(m => m.Password, "password")
                      .Submit();
                   
by eric hexter   January 28, 2010 @ 9:39pm
372 Views
no 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
453 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
123 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
119 Views
no comments
 
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="jQueryBlockUi._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">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> 
    <script type="text/javascript" src="http://malsup.com/jquery/block/jquery.blockUI.js?v2.28"></script>
</head>
<body>
by Elijah Manor   December 09, 2009 @ 10:48am
449 Views
no comments
 
Sub ToggleMvcBuildViews()
    DTE.ExecuteCommand("Project.UnloadProject")
    DTE.ExecuteCommand("OtherContextMenus.StubProject.EditProjectFile")
 
    Dim wasSetToTrue As Boolean = SetMvcBuildView(True)
    Dim wasSetToFalse As Boolean
    If Not wasSetToTrue Then
        wasSetToFalse = SetMvcBuildView(False)
    End If
by Al Gonzalez   December 08, 2009 @ 9:31pm
202 Views
no comments
 
C#
/// <summary>
/// A semi-generic Response Filter that allows transformations
/// to be easily hooked up easily via a TransformStream event    
/// </summary>
public class TransformResponseFilter : Stream
{
    /// <summary>
    /// The original stream
    /// </summary>
    Stream _stream;
by Rick Strahl   November 12, 2009 @ 12:14pm
291 Views
no comments
 
C#
/// <summary>
/// Summary description for ResponseFilter.
/// </summary>
public partial class ResponseFilter : System.Web.UI.Page
{
   protected System.Web.UI.HtmlControls.HtmlForm Form1;
   protected System.Web.UI.WebControls.TextBox TextBox1;
 
   protected void Page_Load(object sender, System.EventArgs e)
   {
by Rick Strahl   November 11, 2009 @ 5:19pm
351 Views
no comments
 
C#
IServiceProvider provider = (IServiceProvider)HttpContext.Current.Context;
HttpWorkerRequest worker = (HttpWorkerRequest)provider.GetService(typeof(HttpWorkerRequest)); 
 
by Rick Strahl   November 08, 2009 @ 4:26pm
117 Views
no comments
 
<!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>
    <title>Redirect Link Using jQuery</title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> 
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
    <script type="text/javascript">
        
        // Custom Library Function
        var Library = {
by jwwishart   November 04, 2009 @ 5:34pm
137 Views
no comments
 
C#
/// <summary>
/// Returns an application Url that's Theme relative.
/// images/users.gif
/// returns: /myapp/app_themes/{activetheme}/images/users.gif
/// </summary>
public static string ResolveThemeUrl(string themeRelativePath)
{
    string theme = null;
    
    // try to pick up active theme
by Rick Strahl   October 29, 2009 @ 2:04am
112 Views
no comments
 
C#
string strApplID="", strFileType="";
            if (context.Request.QueryString["FileID"] != null)
            {
                strApplID = context.Request.QueryString["FileID"].ToString();
            }
            else
            {
                context.Response.Write("File Not found.. Please try again");
                return;
            }
by Chakravarthy   October 23, 2009 @ 12:00pm
85 Views
no comments
 
Imports System
Imports System.Linq
Imports System.Net.Mail
Imports System.Web.Mvc
Imports System.Web.Security
Imports MvcMembership
 
 
 
<Authorize(Roles:="Administrador")> _
by Eduardo Molteni   October 22, 2009 @ 8:51am
463 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Web;
using AspNetInfo.Core;
 
namespace AspNetInfo.Detectors
{
    public class AspNetDetector : IDetector
    {
        private EnvironmentPermissions _permissions;
by Aaron Jackson   September 29, 2009 @ 7:11am
Tags: asp.net
84 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