Format:
Recent snippets matching tags of ASP
function IsPageValid() { var validated = Page_ClientValidate('UserComments'); if (validated) { //Its valid return true; } else
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:
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;
46 Views
no comments
public float Value { get { object o = ViewState["Value"]; if (o == null) return 0; return (float)o; } set
48 Views
no comments
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";
220 Views
no comments
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
241 Views
no comments
public ActionResult Index() { string modelDefinition = @"public class ChangePasswordModel { [Required] [DataType(DataType.Password)] [Display(Name = ""Current password"")] public string OldPassword { get; set; }
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; }
184 Views
no comments
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",
92 Views
no comments
string displayMe = (string)Request.ServerVariables["HTTP_USER_AGENT"];
if (displayMe.IndexOf(".NET4.0") == -1)
{
versionCheck.Text = displayMe;
}
130 Views
no comments
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
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
943 Views
no comments
This Issue resolved by using an Ajax:Accordion and some control transition. Thank you for your interest
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>
293 Views
no comments
<% Html.RenderAction("Menu"); %> <%= Html.Action("Menu") %> <% Html.RenderPartial("Menu"); %> <%= Html.Partial("Menu") %>
283 Views
no comments
/// <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));
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"
256 Views
no comments
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)
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
211 Views
no comments
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
1404 Views
1 comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
