ASP.NET

ASP.NET

Response for REST method was truncated because default MaxItemsInObjectGraph was not big enough.

We have a REST service with attributes [WebGet(UriTemplate ="...", BodyStyle =WebMessageBodyStyle.Bare, ResponseFormat =WebMessageFormat.Xml)]Norm... it worked fine. But for particular data it has a huge response that was truncated. The size returned in a few attempts in IE browser was 2196456, in Chrome slightly different 2195397.After a search in google I found http://forums.asp.net/post/... that has a number of suggestions. For WCF service that will transfer large amount of data in ......

HtmlValidator class

I found an article “C# Validate XHTML” with source code and decided to use it as a start point for my Html Fragment validation. Unfortunately there are quite a few things in the original code, that didn’t work as I expected/wanted, so I had to spend much more time to change it that I originally thought. Thanks to Sam Allen for very responsive answers. #region Summary ///////////////////////////... /*/ $History: * Sam Allen http://www.dotnetperls.com/... ......

XmlChoiceCollection class to access XSD generated properties for choice XML elements

When I used XML Schema Definition Tool (Xsd.exe) , it creates proxy class with extra ItemsChoiceType array and enum for xsd:choice elements. MSDN XmlChoiceIdentifierAttribute Class article shows example of XSD, generated proxy class and how to fill pairs of arrays: // Populate an object array with three items, one // of each enumeration type. Set the array to the // ManyChoices field. object[] strChoices = new object[]{"Food", 5, 98.6}; myChoices.ManyChoices=strCh... // For each item in the ManyChoices ......

ASP.NET custom control TextFileViewerControl

This control opens text file and shows it as plain text in ASP.NET page. It optionaly can delete the file(if it was temporary) after the reading. The source code posted using CopySourceAsHtml using System; using System.Web.UI; using System.Web.UI.WebControls; using System.ComponentModel; using System.IO; using FSHelperLib; namespace FSWeb.CustomControls { /// <summary> /// Summary description for TextFileViewerControl. /// </summary> [DefaultProperty("Text"), ToolboxData("<{0}:TextFi... ......

ASP.NET composite control FromToTextBoxes

This is a simple composite control , that has 2 edit text boxes with corresponding labels. It will be useful to have labels as public properties (not done yet) The possible and popular extension will be to have From/To date controls. The source code posted using CopySourceAsHtml using System; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; //based on http://localhost/quickstart... ......

ASP.NET custom control CheckBoxWithImage

A few years ago I posted ASP.NET custom control HyperLinkWithImage. I also created similar CheckBoxWithImage , but didn't publish it at that time. The class allows to have image next to CheckBox, and by clicking image check-box will be ticked/unticked. using System; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.ComponentModel; using System.Web.UI.Design; //!!!System.Design (in System.Design.dll) using System.Drawing.Design; using System.Collections.Speciali... ......

My QueryStringHelper class.

Previously I've posted a few Helper Classes . This post describes my QueryStringHelper class. using System; using System.Web; using System.Collections.Speciali... using System.Text; using System.Collections; /// <summary> /// Summary description for QueryStringHelper /// </summary> public class QueryStringHelper { //Consider to use HttpUtility.ParseQueryString // openSource alternative in MONO http://dsrg.mff.cuni.cz/pro... ......

my GridViewHelper class.

Previously I've posted a few Helper Classes . This post describes my GridViewHelper class. using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.W... using System.Web.UI.HtmlControls; using System.Diagnostics; public class GridViewHelper { //Copied from on WebFormsHelper class http://geekswithblogs.net/m... public static int ColumnIndexBySortExpression... ......

my ASP.NET ListControlHelper class

Previously I've posted a few Helper Classes . This post describes my ListControlHelper class using System.Net; using System.IO; using System.Diagnostics; using System.Collections.Speciali... using System.Web.UI.WebControls; using System.Data; public static class ListControlHelper { public static string EmptySelectionValue = "-1"; //'http://blogs.msdn.com/pi... public static void ControlBinding(ListControl ctrl, Dictionary<string, ......

Asynchronous long-running tasks in ASP.NET application

I had a requirement to have asynchronous background tasks(i,e. calls to different web services) that should be shown by ASP.NET web page, when completed. The approach is described in How To: Submit and Poll for Long-Running Tasks (see also wiki copy). Instead of using minimal TempDataStore from the article, I used Session Data Management Tool created by Xiangyang Liu (see also my code of Configuration class). Note that in Asyncronous Callback functions I wasn't able to access ASP.Net Session state. ......

My HttpRequestHelper class

Previously I've posted a few Helper Classes . This post describes my HttpRequestHelper class. using System; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; ///<summary> /// Summary description for HttpRequestHelper. ///</summary> public class HttpRequestHelper { // Methods public HttpRequestHelper() { } // from http://groups.google.com.au... public static bool IsBrowserOnServer() ......

My HtmlHelper class

Previously I've posted a few Helper Classes . This post describes my HtmlHelper class: using System; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; ///<summary> /// Summary description for HtmlHelper. ///</summary> public class HtmlHelper { // Methods public HtmlHelper() { } public static void AddBookMark(Control parent, string bookMarkName) { LiteralControl control1 = new LiteralControl(); control1.Text = "<a name=\"" + bookMarkName + "\">"; ......

my UriHelper class.

Previously I've posted a few Helper Classes . This post describes my UriHelper class. using System; using System.Web; using System.Collections.Speciali... using System.Text; using System.Collections; using System.Diagnostics; using Microsoft.VisualBasic; /// <summary> /// Summary description for UriHelper. /// </summary> //There are helper classes available with some functionality that can be useful //http://codeproject.com/as... "A small Class for simplifying ......

My DataBinderHelper class.

Previously I've posted a few Helper Classes . This post describes my DataBinderHelper class. using System; using System.Collections.Generic; using System.Text; using System.ComponentModel; using System.Web.UI; public class DataBinderHelper { public static bool IsPropertyExist(object container, string propName) { if (container == null) { throw new ArgumentNullException("cont... } if (string.IsNullOrEmpty(propN... { throw new ArgumentNullException("prop... } PropertyDescriptor descriptor1 ......

My HttpWebRequestHelper class

Previously I've posted a few Helper Classes . This post describes my HttpWebRequestHelper class: using System; using System.Text.RegularExpressi... using System.IO; using System.Diagnostics ; using System.Net; namespace FSHelperLib { using System; using System.Text; // clarification from http://www.dotnetsmart.com/... // System.Web.HttpRequest is a class used on the server and inside an ASP.NET application. It represents the *incoming* request from a client. // System.Net.HttpWebRequest ......

Explicitely specify Default user credentials for Web Proxy Server.

Some time ago I wrote post "Call Web Services through SQuid proxy server with authentication requested" and hoped, that I will not have more problems with Squid web proxy server. However teh solution wasn't sufficient for other site. I've tried a lot of things, started thread "Unable to access external web sites through Squid proxy server with required authentication." and posted suggestion to Microsoft "Add ability to specify credentials to defaultProxy configuration element". But the best solution, ......

My JScriptHelper class

I've posted a few code snippets and some people noticed that there are references to unresolved methods.I am using a few helper classes. This post describes my JScriptHelper class /// <summary> /// The JScriptHelper class should be a replacer of VB ClientScriptsHelper. /// However VB ClientScriptsHelper has calls to embedded resources, so it is not too easy to move /// TODO move VB methods to JScriptHelper in stages. /// </summary> public class JScriptHelper { public JScriptHelper() { ......

Links for Code Generator/ and O/R mappers for ASP.NET application

I had a requirement to find Code Generator that will help to port existing quite big Access application to ASP.NET and support multiple databases. The codegeneration.net site provides quite a big list of applications that claims to do this. I also was pointed by Paul Wilson's posts: (How do you decide what features to add or cut?, Debate: O/R Mapping or Code Generation and others) that Dynamic SQLs in O/R mappers allow to avoid hundreds of CRUD stored procedures and DAL classes. Unfortunately, most ......

ASP.NET Data Bound UserControl

The .NET 2.0 provides System.Web.UI.WebControls.B... and DataBoundControl classes that can be useful for Custom Data-Bound Web Server Controls . However it often convinient to have User Control with similar data-binding capabilities. Unfortunetely .Net doesn't allow multiple inheritance, so I have to duplicate the functionality in my DataBoundUserControl class derived from UserControl class. At the moment the DataBoundUserControl class is not fully implemented.As it explained in “Data ......

My C# WebFormsHelper class

I've posted a few code snippets and some people noticed that there are references to unresolved methods.I am using a few helper classes. This post describes my WebFormsHelper class: using System; using System.Collections.Generic; using System.Text; using System.Diagnostics ; using System.Web.UI; using System.Web.UI.WebControls; namespace FSCSharpLib.ASP { //TODO merge with FSHelperLib.WebFormsHelper public static class WebFormsHelper { #region "Recursively FindControl" // From http://forums.asp.net/2/880... ......

Full ASP.NET Archive

«August»
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456