Can anyone correct the expression below to also not allow blank field?
<asp:RegularExpressionValidator ID="expEmail" runat="server" ControlToValidate="txtEmail" ErrorMessage="valid email address required" ValidationExpression="^([a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]){1,70}$"></asp:Regula...
How do you like to arrange your "using xxx" imports in C#? I got bored the other day and put them in order from shortest to longest.
using System;
using System.Web;
using System.Data;
using System.Linq;
using System.Web.UI;
using Telerik.Web.UI;
using System.Drawing;
using System.Collections;
using System.Configuration;
using System.Web...
Does anyone have any recommendations for plotting scientific data in .net (c# winforms). Some of my requirements are: real time plotting, 3D (waterfall), multiple axis, ability to accept BindingList as a data source and recognize any changes to the data. I also need a high level of user interactivity such as the ability to graphically se...
I have 2 applications A1 and A2 with HttpChannel between them. Also there are 2 classes inherited from MarshalByRefObject - CObj1 and CObj2.
A1:
Cobj1 obj1 = new CObj1();
RemotingConfiguration.RegisterWellKnownServiceType(
typeof(CObj1), "CObj1", WellKnownObjectMode.Singleton);
A2:
Cobj2 obj2 = new CObj2();
stri...
Hi, I've looked through other questions but i don't think this has been asked before:
I have an email client i'm building in the .NET framework, and would like to automatically create google calendar events (just like in gmail). Is there a way to feed an email message (i.e. a string) and automatically identify if there is a possible eve...
Hmmm -
I'm using BindingSource.Find to return to the user's position after refreshing a DataGridView. I use BindingSource.Find and a RowID as the DataColumn I'm searching on. Unfortunately, Oracle can return two RowIDs that differ only in their case.
BindingSource.Find returns the first match regardless of case.
Looking at the MSDN ...
I'm looking for a .Net 3.5 ORM framework with a rather unusual set of requirements:
I need to create and alter tables at runtime with schemas defined by my end-users.
(Obviously, that wouldn't be strongly-typed; I'm looking for something like a DataTable there)
I also want regular strongly-typed partial classes for rows in non-dynamic ...
In Visual Studio 2008 C#, if I create a new class the following namespaces appear by default and I remove them manually every time. Is there a setting/folder template where I can go and remove these unwanted namespaces from appearing on each and every new class that's created on the project?
using System.Collections.Generic;
using Syste...
I'm working with data consumed from a RESTful service that looks like the following:
<?xml version="1.0" encoding="UTF-8"?>
<couponfeed>
<link type="TEXT">
...
</link>
<link type="TEXT">
...
</link>
...
</couponfeed>
I have the xsd, and I generated C# classes from it using the xsd.exe utility. Here is the relevant pa...
For example I have a big sentence:
"I like to eat pie and have fun around the house all day long!"
And I want it to appear like this:
"I like to eat pie and have
fun around the house all
day long!"
In this post: http://stackoverflow.com/questions/1673963/multi-line-list-items-on-winforms-listview-control Grammarian said that you only ...
csc /target:library /reference:System.dll,System.Web.dll,System.Web.Mvc.dll Foo.cs
Microsoft (R) Visual C# 2010 Compiler
version 4.0.30319.1 Copyright (C)
Microsoft Corporation. All rights
reserved.
error CS0006: Metadata file
'System.Web.Mvc.dll' could not be
found
(Note - it does exist in the GAC under GAC_MSIL fol...
I would like to write a helper function which build the exception message to write to a log.
The code look like:
if(IsWebApp)
{
use HttpContext to get the Request Path and RawUrl
}
else
{
//else it a winform/console
Use Assembly to get executing path.
}
...
I'd like to execute the static constructor of a class (i.e. I want to "load" the class) without creating an instance. How do I do that?
Bonus question: Are there any differences between .NET 4 and older versions?
Edit:
The class is not static.
I want to run it before creating instances because it takes a while to run, and I'd like to...
I have an extension of the winforms TabControl, it's draws an X on each tab to allow the user to close the tab.
Compare that to the standard:
How can I simulate button look&feel on that image? What I mean is, when the user clicks down, it should visually indicate that. A button does this with an inset image. For bonus points, I'...
I'm working on an existing class that is two steps derived from System.Windows.Forms.Combo box.
The class overrides the Text property thus:
public override string Text
{
get
{
return this.AccessibilityObject.Value;
}
set
{
if (base.Text != value)
{
...
I have a handful of public read/write members that are not being serialized and I can't figure out why. Reviewing some code, and my root class is marked serializable:
[Serializable]
public class MyClass
I have a default constructor that initializes 10-15 string members. There are about 50 public read/write string members in MyClass wi...
I'm encrypting the web.config in our web sites using aspnet_regiis. However, I want the ability to export the encryption key so if we need to move from Machine A to Machine B, asp.net will be able to decrypt it.
When I run aspnetregiis -px "NetFrameworkConfigurationKey" c:\keys.xml -pri, I get the following : 'Key not valid for use in s...
I have a ViewModel class to encapsulate "Personal" and "Business" models. My problem is that both models have a property called "Email" and the model binding is not able to make a distinction between the two.
I read that [Bind(Prefix = ... is used to resolved this issue, but I have not been able to see a concise example on how to achie...
If so are the changes I would need to make to an existing program written in c# vast?
...
I am trying to automate a web page via the weBrowser and the button that i'm trying to click has no ID only a value. here's the html code for it:
<td width='10%' align='center'><button class="buttonf" onclick="window.location='staticpage.php?accept=123456' ">Accept</button></td>
I can't useGetElementById as the button has no ID.
If I ...