Format:
Recent snippets matching tags of Asp.net
function IsPageValid() { var validated = Page_ClientValidate('UserComments'); if (validated) { //Its valid return true; } else
9 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.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
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
/// <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
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
{
"Fields":[
{
"FieldName":"Name",
"ReplaceValidationMessageContents":true,
"ValidationMessageId":"Name_validationMessage",
"ValidationRules":[
{
"ErrorMessage":"Meno musí mať 5 až 40 znakov.",
"ValidationParameters":{
623 Views
no comments
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()
334 Views
no comments
<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>
1775 Views
no comments
using System; using System.Collections.Specialized; using System.Web; using System.IO; namespace ConfigFileExample.Services { public interface IConfigurationManager { NameValueCollection AppSettings { get; }
501 Views
2 comments
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 {
984 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>
266 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
