I've found a pattern in my Views like this:
<% if (someCondition)
{
Response.Write(string.Format("Foo {0}, Bar {1} Baz {2}.", userName, someCounter, someDate)); }
else
{
Response.Write(string.Format("Foo is {0}.", bar));
}
%>
The basic pattern of if...else with a bunch of repeated Response.Write(string.Forma...
Does Subsonic support .Net 4.0?
...
Is it possible to develop Web Parts using the 4.0 framework and use them in WSS 3.0? I've searched all over the place and can't find anyone else asking this question which makes me think the answer is an obvious "no".
...
I am having a problem with code that worked fine in .NET 2.0 but is giving this error under .Net 4.
Build (web): Inheritance security
rules violated while overriding
member:
'Controls.RelatedPosts.RenderControl(System.Web.UI.HtmlTextWriter)'.
Security accessibility of the
overriding method must match the
security accessib...
Hi,
Senario: Masterpage with a UserControl and a child ASPX page
In the past when using this senario I've used an Interface as a way to pass a value from the UserControl (embedded in a
master page) to the masterpage code behind then consume that value in the child aspx page.
My question is now that asp.net 4 have arrived is this still...
After watching in horror as the .NET framework 3.5 SP1 bloated to whopping 231 MB I was amazed to see that .NET Framework 4 Full (x86) is only 35 MB and client profile just 29 MB.
My question is if .NET Framework 4 is in any way dependent on previous versions of the framework being installed on the client machine or if my users will hav...
I'm assuming this isn't possible but before digging further is there a way to do something like this:
public void ProcessInterface(ISomeInterface obj) {}
//...
dynamic myDyn = GetDynamic<ISomeInterface>()
ProcessInterface(myDyn);
I've seen a post arguing for it but it sounds like it wasn't included.
A little context: .Net assembl...
I'm maintaining a WPF based application which contains a WinForms based WebBrowser control that based on the IE web browser control. When we deploy, we have had to also supply Microsoft.mshtml.dll and do some custom configuration stuff for our ClickOnce publishing process as well in order to get things to work.
I'm curious that with the...
I'm just looking in to the new .NET 4.0 features. With that, I'm attempting a simple calculation using Parallel.For and a normal for(x;x;x) loop.
However, I'm getting different results about 50% of the time.
long sum = 0;
Parallel.For(1, 10000, y =>
{
sum += y;
}
);
Console.WriteLine(sum.ToString());
sum = 0;
for...
I have been using Snippet Compiler for a few years, and it's great. Unfortunately, it isn't getting maintained, and is falling behind. Doesn't support .NET 4, which we recently switched to, and even some C# 3 features like extension methods get flagged as errors (though they do compile).
Alternatives?
...
In .NET 4 and multicore environment, does the linq to sql datacontext object take advantage of the new parallels if we use DataLoadOptions.LoadWith?
EDIT
I know linq to sql does not parallelize ordinary queries. What I want to know is when we specify DataLoadOption.LoadWith, does it use parallelization to perform the match between each...
Trying to decide on the best element to use for a grid view, pretty much exactly like the one you'd see in uTorrent or any other upload/download client. Specifically, I want to have a 'progress' column too (with progress bars). Using VS2010/.NET4. Haven't really started the project yet, so either WPF or WinForms are fine. What would you ...
I have a bit of code with the following logic:
//pseudo-code
foreach (element in elementList) {
if (element is whatever)
return element;
}
}
In theory, there is always one element that is whatever, so this method should pose no problems. In any case, I've put an assertion on the end of the method just to be sure:
//ps...
VS 2010 code analysis reports the following:
Warning 4 CA2000 : Microsoft.Reliability : In method 'Mailer.SendMessage()', object 'client' is not disposed along all exception paths. Call System.IDisposable.Dispose on object 'client' before all references to it are out of scope.
My code is :
public void SendMessage()
{
S...
I have just updated to using EF 4.0 where before i was using Linq 2 SQL.
I have a query:
var UserList = this.repository.GetUsers();
return Json(UserList, JsonRequestBehavior.AllowGet);
This was generating an error: "A circular reference was detected while serializing an object of type"
This prompted this code which worked f...
I've set up my DataContext like this:
<Window.DataContext>
<c:DownloadManager />
</Window.DataContext>
Where DownloadManager is Enumerable<DownloadItem>. Then I set my DataGrid like this:
<DataGrid Name="dataGrid1" ItemsSource="{Binding Path=/}" ...
So that it should list all the DownloadItems, right? So I should be able to set...
I have a column defined like this:
<DataGridTextColumn Binding="{Binding Path=FileSizeBytes, Mode=OneWay}" Header="Size" IsReadOnly="True" />
But instead of displaying the file size as a big number, I'd like to display units, but still have it sort by the actual FileSizeBytes. Is there some way I can run it through a function or somet...
I recently found myself needing a typesafe "fire-and-forget" mechanism for running code asynchronously.
Ideally, what I would want to do is something like:
var myAction = (Action)(() => Console.WriteLine("yada yada"));
myAction.FireAndForget(); // async invocation
Unfortunately, the obvious choice of calling BeginInvoke() without a ...
If I do this...
public PriorityQueue(Dispatcher dispatcher = null)
{
this.dispatcher = dispatcher ?? Dispatcher.CurrentDispatcher;
}
And then use it in a ViewModel (without passing any args) that is created through the XAML, this.dispatcher will point to the UI thread right?
...
I'm trying to render the report viewer programmatically within a custom Page placed in an IHttpHandler context
ReportViewer rv = new ReportViewer();
ReportDataSource rds = new ReportDataSource();
rds.Name = "Report";
rv.LocalReport.ReportPath = "Report.rdlc";
rds.Value = SomeReportObject;
rv.LocalReport.DataSources.Add(rds);
rv.LocalR...