Wcf-The maximum message size quota for incoming messages (65536) has been exceeded?

You should set maxReceivedMessageSize=”2147483647″ to increase message size. Try to change config to this: <binding maxBufferSize=”2147483647″ maxBufferPoolSize=”2147483647″ maxReceivedMessageSize=”2147483647″> <readerQuotas maxDepth=”2147483647″ maxStringContentLength=”2147483647″ maxArrayLength=”2147483647″ maxBytesPerRead=”2147483647″ maxNameTableCharCount=”2147483647″ /> </binding> But it is a bad practice to increase you message values to max value. This can lead you to serious troubles with DOS leaks. UPDATED: <system.serviceModel> <bindings> <wsHttpBinding> <binding … Read more

Finding all controls in an ASP.NET Panel?

It boils down to enumerating all the controls in the control hierarchy: IEnumerable<Control> EnumerateControlsRecursive(Control parent) { foreach (Control child in parent.Controls) { yield return child; foreach (Control descendant in EnumerateControlsRecursive(child)) yield return descendant; } } You can use it like this: foreach (Control c in EnumerateControlsRecursive(Page)) { if(c is TextBox) { // do something useful … Read more

What’s the best method for forcing cache expiration in ASP.NET?

There are many ways to make these caching expire, like page outputcache by Page.Response.Cache.SetCacheability(HttpCacheability.NoCache) Time-based dependency simply expires the item at a defined point in time. Response.Cache.SetExpires(DateTime.Now.AddSeconds(360)); Response.Cache.SetCacheability(HttpCacheability.Private) Response.Cache.SetSlidingExpiration(true); Now when it comes to monitoring cache, unless there is an API on the cache to tell you, then there is no direct way. You could … Read more

Applying Styles To ListItems in CheckBoxList

You can add Attributes to ListItems programmatically as follows. Say you’ve got a CheckBoxList and you are adding ListItems. You can add Attributes along the way. ListItem li = new ListItem(“Richard Byrd”, “11”); li.Selected = false; li.Attributes.Add(“Style”, “color: red;”); CheckBoxList1.Items.Add(li); This will make the color of the listitem text red. Experiment and have fun.

Passing session data between ASP.NET Applications

you could implement a single-signon strategy for your applications. http://aspalliance.com/1545_Understanding_Single_SignOn_in_ASPNET_20.all http://blah.winsmarts.com/2006/05/19/aspnet-20-implementing-single-sign-on-sso-with-membership-api.aspx http://johndyer.name/post/2005/12/Single-SignOn-with-ASPNET-Membership-and-WebServices.aspx http://msdn.microsoft.com/en-us/library/ms972971.aspx

Pagemethods in asp.net

This should work in all browsers by following the steps below: The page method must have the System.Web.Services.WebMethod attribute. [WebMethod] The page method must be public. [WebMethod] public … The page method must be static. [WebMethod] public static … The page method must be defined on the page (either inline or in the code-behind). It … Read more

GridView – Show headers on empty data source

ASP.Net 4.0 added the boolean ShowHeaderWhenEmpty property. http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.showheaderwhenempty.aspx <asp:GridView runat=”server” ID=”GridView1″ ShowHeaderWhenEmpty=”true” AutoGenerateColumns=”false”> <Columns> <asp:BoundField HeaderText=”First Name” DataField=”FirstName” /> <asp:BoundField HeaderText=”Last Name” DataField=”LastName” /> </Columns> </asp:GridView> Note: the headers will not appear unless DataBind() is called with something other than null. GridView1.DataSource = New List(Of String) GridView1.DataBind()