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
function IsPageValid() 
{
    var validated = Page_ClientValidate('UserComments');
 
    if (validated) 
    {
        //Its valid
        return true;
    }
    else 
by Egli   Thursday @ 4:04pm
9 Views
no comments
 
Encrypting appSettings and connectionStrings sections in web.config :
 
   aspnet_regiis.exe –pef "appSettings" "<Path.to.website.directory>"
 
   aspnet_regiis.exe –pef "connectionStrings" "<Path.to.website.directory>"
 
-----
 
Encrypting appSettings and connectionStrings sections in web.config and specifying the Data Protection Provider:
by NEParis   January 04, 2012 @ 9:33am
24 Views
no comments
 
<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
46 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
48 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
public partial class Features_ImportExport : System.Web.UI.Page
{
    const string DocumentUrl = @"~/Content/Demo/SampleImportDocument.rtf";
    const string ContentFolder = @"~/UploadImages/Imported";
by Mehul Harry   May 30, 2011 @ 10:04pm
220 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
241 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
292 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
183 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
92 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
130 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
187 Views
no comments
 
Download Kaspersky Internet Security 2012 Beta With 91 Days Genuine Activation Key
 
    * Best Anti Virus Software
    * Download Kaspersky 2012 Beta
    * Kaspersky
    * Kaspersky 2012 Activation
    * Kaspersky Antivirus 2012
    * Kaspersky Internet Security 2012
    * KIS 2012
    * KIS 2012 Beta
by even   March 08, 2011 @ 10:17pm
942 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
171 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
293 Views
no comments
 
<% Html.RenderAction("Menu"); %>
<%= Html.Action("Menu") %>
 
<% Html.RenderPartial("Menu"); %>
<%= Html.Partial("Menu") %>
by Unknown (google)   September 23, 2010 @ 5:17am
283 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
265 Views
no comments
 
To Encrypt, run the following from the Visual Studio command prompt:
 
  aspnet_regiis -pe "connectionStrings" -app "/AppName" -prov "RsaProtectedConfigurationProvider"
 
To Decrypt, run the following from the Visual Studio command prompt:
 
  aspnet_regiis -pd "connectionStrings" -app "/AppName"
 
by Al Gonzalez   July 12, 2010 @ 4:39pm
256 Views
no comments
 
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
152 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,
211 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
1404 Views
1 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