Hi, is it possible to use dash (-) in a member name of an anonymous class? I'm mainly interested in this to use with asp.net mvc to pass custom attributes to html-helpers, since I want my html to pass html5-validation, this starting with data-.
Exemple that doesn't work:
<%=Html.TextBoxFor(x => x.Something, new {data-animal = "pony"})%...
We have a large amount of data stored on an IBM mainframe using VSAM files. A lot of this data is dropped on the network every night in the form of text files to be processed and dumped into FoxPro and SQL Server databases. There are also many text files produced nightly by custom applications that get uploaded to the mainframe to keep e...
I have three user controls. Here are the description of them:
1) First user control(ucCountry) contains combobox which displays country names from an xml file.
2) Second user control(ucChannelType) contains two radio buttons one to select TV and other to select Radio Channel Type.
3) Third usercontrol(ucChannels) will populate all the ...
Hi
I need to fetch a flex application from a process in C#.
How can i get access to the externalInterfaceAPI when the flex application is running as a Application?
EDIT: After further reading it looks like it is possible, as from what i understood, a flex stand alone application is a ActiveX "container", so what i need is to get acces...
I would like to create a function that will return list of type that is specified by me at run time.
I tried something along this line:
public static List<T> GetMyList<T>(string[] itemList)
{
List<T> resultList = new List<T>(itemList.Length);
return resultList.AddRange(itemList);
}
But this doesn't work. Obviously I d...
In my service layer for my MVC application I am attempting to convert the linq to sql entity results into my business model entities. I am currently attempting the following code:
public IList<Project> GetAllProjects()
{
var results = from p in _context.Repository<DBMappings.project>()
select p;
...
I have a VS 2008, .NET 3.5 targeted MVC.NET app. I am developing on Windows 7 with its IIS, but deploying to a Windows Server 2003 environment with .NET 3.5 SP1 installed.
We have a image scaling action that returns an image from the database in the requested resolution, and converts to PNG on the fly with System.Drawing and System.Draw...
I have to validate using regex decimal number between 00.00 to 35.35 with following simple assumptions(I am using C#).
1) leading zeros are not required(optional).
2) 2 decimals are always required.
In other words, it should be a decimal number within a range with 2 decimal points.
Examples of valid numbers are: 0.00, 00.00, .67, 2.8...
There are questions pertaining to reading settings from a separate config file and others similar to it, but my question is specific to application property settings (i.e. <MyApplication.Properties.Settings> - see XML file below) and how to load them dynamically. I tried the method in this post, which involved refreshing the entire appSe...
I ran into this dilemma when working on an ASP.net web application using Web Client Software Factory(WCSF) in C#, and the same could apply to other platform and languages. My situation is like this:
I am defining an I*View interface for each web page/user control based on WCSF paradigm, then have the page class implement the I*View inte...
Given a BehaviorSubject, what is the practical difference between calling all of these different functions on it?
First()
Last()
LatestValue()
MostRecentValue()
NextValue()
Single()
Take(1)
Assuming I understand it right, they should all do about the same thing, given the BehaviorSubject.
If so, then which call is the most appropria...
I need to avoid serializing an Event class member because when the event is handled by an object that is not marked as Serializable the serialization will fail.
I tried using the NonSerialized attribute on the Event class member but it fails to compile with the following error:
<NonSerialized()> Public Event PropertyValueChanged()
re...
The following two controls on my page:
<asp:LinkButton ID="OpenLB" runat="server" >Open</asp:LinkButton>
<asp:HyperLink ID="OpenHL" runat="server">Open</asp:HyperLink>
I set them during page load like this:
OpenLB.PostBackUrl = @"file:\\web\documents-emails\doc1.docx";
OpenHL.NavigateUrl = @"file:\\web\documents-emails\doc1.docx";
...
I am trying to replace an asmx WebService with a WCF service. My primary goal is to keep the SOAP message the same. The caller is not .NET, and would require significant re-work to take minor changes to the contract.
My pain point is that the web methods I am trying to replace webmethod uses the the following Attribute deceleration:
[S...
NOTE: Right before posting this question it occurred to me there's a better way of doing what I was trying to accomplish (and I feel pretty stupid about it):
IEnumerable<string> checkedItems = ProductTypesList.CheckedItems.Cast<string>();
filter = p => checkedItems.Contains(p.ProductType);
So OK, yes, I already realize this. However, ...
I'm not looking for how, I'm looking for why? I couldn't find a straight forward answer to this.
...
Hello,
I am developing a very basic windows service in C#. Apart from the service I also need to develop a program which will be used to set various parameters for the service.
As the service and program will be running in different processed by different users how do I tell the service that parameters have changed?
One way that I am ...
I support a .NET 2.0 Winforms application that is fairly widely deployed. On rare occasion we get a support call from a customer in which the application returns a .NET runtime exception AS SOON as you attempt to launch the application.
In the past we have helped the customer re-install the .net framework and very often that works...but...
I am trying to get comp1's value in the most simple way in C#. I want to be able to do it with a way that requires least checkes whether an element like Primary is there, etc.
i.e.
// pseudo code
xmlItem = root.SelectSingleNode "/Primary/Complex?Name='comp1'"
So I can just check if xmlItem is null, or has no elements, instead of doi...
I have code that sends emails to users from a signup webpage. Occasionally, users will mistype an email address and the address ends up having a bad domain.
I would love to be able to check to see if the domain is bad BEFORE calling the System.Net.Mail.SmtpClient.Send() method since this would lead to a better user experience. I thi...