Html.Partial vs Html.RenderPartial & Html.Action vs Html.RenderAction

Html.Partial returns a String. Html.RenderPartial calls Write internally and returns void. The basic usage is: In the snippet above, both calls will yield the same result. While one can store the output of Html.Partial in a variable or return it from a method, one cannot do this with Html.RenderParti Html.Partial returns a String. Html.RenderPartial calls Write internally and returns void. The basic usage is: In the snippet above, both calls will yield … Read more

Cannot send a content-body with this verb-type

Don’t get the request stream, quite simply. GET requests don’t usually have bodies (even though it’s not technically prohibited by HTTP) and WebRequest doesn’t support it – but that’s what calling GetRequestStream is for, providing body data for the request. Given that you’re trying to read from the stream, it looks to me like you actually want to get the response and read the response stream … Read more

What is the difference between const and readonly in C#?

Apart from the apparent difference of having to declare the value at the time of a definition for a const VS readonly values can be computed dynamically but need to be assigned before the constructor exits.. after that it is frozen. const‘s are implicitly static. You use a ClassName.ConstantName notation to access them. There is a subtle difference. Consider a class defined … Read more

C# cannot convert method to non delegate type

You need to add parentheses after a method call, else the compiler will think you’re talking about the method itself (a delegate type), whereas you’re actually talking about the return value of that method. Extra Non-Essential Information Also, have a look at properties. That way you could use title as if it were a variable, … Read more

Best C# API to create PDF

Update: I’m not sure when or if the license changed for the iText# library, but it is licensed under AGPL which means it must be licensed if included with a closed-source product. The question does not (currently) require free or open-source libraries. One should always investigate the license type of any library used in a project. I have … Read more

ClickOnce runtime DFSVC.EXE

Can someone either detail or point me to some information on what role exactly the DFSVC.EXE plays in the execution cycle of a ClickOnce application? If I launch a ClickOnce application via: I see that a DFSVC.EXE process is started. I then see that the actual EXE process of my ClickOnce application is invoked (by … Read more

Why does .Net Socket.Disconnect take two minutes?

Timeout in case of Shutdown followed by Disconnect or BeginDisconnect will occur in the case if the other side Socket is not Receiving. Here how it works: Shutdown(SocketShutdown.Send) (or Both) produce SENDING of zero byte to other side. And then if you call Disconnect it will block until other side accept this zero byte packet. This is … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)