CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

MS SQL 2008 on ASP.NET Hosting



Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 8/2/2004 2:33:35 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 61 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
magister
Asp.Net User
Custom CheckBoxList control "Length cannot be less than zero" error8/2/2004 2:33:35 PM

0/0

Hello I have a custom CheckBoxList control so I can add attributes to listitems....
All works fine and I have a RadioButtonList that does the same, but for this when postingback multiple times and then changing the selected option I get the error

Length cannot be less than zero. Parameter name: length

further down in the trace output:

aspx.page Begin ProcessPostData 0.006315 0.000024
Unhandled Execution Error
Length cannot be less than zero.
Parameter name: length
at System.String.Substring(Int32 startIndex, Int32 length)
at System.String.Substring(Int32 startIndex)
at System.Web.UI.WebControls.CheckBoxList.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection)
at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
at System.Web.UI.Page.ProcessRequestMain()

here's the control, any ideas thanks!
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace myUI
{
/// <summary>
/// Summary description for AttributesCheckBoxList.
/// </summary>
public class AttributesCheckBoxList : System.Web.UI.WebControls.CheckBoxList
{
protected override void Render(HtmlTextWriter writer)
{
if (HasControls())
{
int i = 0;
foreach (ListItem listItem in Items)
{
writer.WriteBeginTag("input");
writer.WriteAttribute("ID",this.UniqueID+"_"+i );
writer.WriteAttribute("type", "checkbox");
writer.WriteAttribute("name", this.UniqueID);
writer.WriteAttribute("value", listItem.Value, true);
if (listItem.Selected)
writer.WriteAttribute("checked","true");
listItem.Attributes.Render(writer);
writer.Write('>');
writer.WriteEndTag("input");
writer.WriteBeginTag("label");
writer.WriteAttribute("for",this.UniqueID+"_"+i );
listItem.Attributes.Render(writer);
writer.Write('>');
HttpUtility.HtmlEncode(listItem.Text, writer);
writer.WriteEndTag("label");
if (i < Items.Count-1)
writer.RenderBeginTag(HtmlTextWriterTag.Br);
writer.WriteLine();
i++;
}
}
}
}
}
magister
Asp.Net User
Re: Custom CheckBoxList control "Length cannot be less than zero" error8/2/2004 4:45:18 PM

0/0

thanks got it
writer.WriteAttribute("name", this.UniqueID+":"+i);
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
Custom CheckBoxList control "Length cannot be less than zero ... Custom CheckBoxList control "Length cannot be less than zero" error. Last post 08-02-2004 2:09 PM by magister. 1 replies. Sort Posts: ...
CodeGuru Forums - Custom Checkbox List So I'm focusing on that. EDITx2: This is the full error message I get:. Code:. ArgumentOutOfRangeException: Length cannot be less than zero. ...
microsoft.public.dotnet.framework.aspnet.buildingcontrols: By Thread Events in a custom template control Matthew Judd (08/06/04) ... Re: Custom CheckBoxList "Length cannot be less than zero" error Juno (08/02/04) ...
CodeProject: Magic AJAX: Applying AJAX to your existing Web Pages ... Argiris, I got this error message: Length cannot be less than zero. ... 2) A CheckBoxList always has just one child control, therefore, the recursiveness of ...
ZNet Free Controls for Asp.Net Aug 4, 2008 ... CheckBoxList Validation - Validator for CheckBoxList control in Asp.Net. Download .... should always be less than count of datakey(s) ...
Inside Microsoft: Advanced Validation Techniques in ASP.NET following listing shows the declaration of the CheckBoxList control and the ... in the checkbox list" Display="static"> Less than three options selected ...
microsoft.public.dotnet.framework.aspnet.webcontrols: By Thread Re: How Can I use multiple instances of the same custom control on an ASP. ...... Re: Custom CheckBoxList "Length cannot be less than zero" error Juno ...
.NET ASP Page 69 - Bytes Site Map Use validationSummary to display error message in user control .... Length cannot be less than zero. Parameter name : length ยท Password validation in ASP. ...
CodeProject: DropDownCheckList ASP.NET Server Control. Free source ... Oct 18, 2005 ... Subclass of CheckBoxList that renders as a custom drop-down with ... of an < iframe> with a z-index one less than the z-index of the
. ...
TheMSsForum.com >> Asp >> FreeTextBox problem with validate ... Custom CheckBoxList and Postback/ViewState exception (HtmlInputControl et al) Hi all, ... ArgumentOutOfRangeException: Length cannot be less than zero. ...




Search This Site:










load dynamtic event handler

collectioneditor prevents rendering runat=server

protocols used by ads related services (bmdp, bmcp, bmss, etc)

using assemblies instead of codebehind.

problem adding controls in datalist header

exporting datagrid to excel

trial hosting for asp.net 2.0

xmlnode control

dynamicall created controls in a datagrid

setting style tags for designers

onsetcomponentdefaults() method not getting called...

get list of controls on form

custom control and visual studio design support

how to register custom control globally

declarative controls with code behind files

any "good" .net hosts out there?

webcontrol properties

login

shared host supporting rewriting?

help trying to creata a multi column treeview with drag and drop and context menu (right click)

discountasp: to tack on the extra $10.00/mo 300mb ms sql or not?

custom button from button / imagebutton?

this is a two part question?

conversion please help !!

finding a hosting package

custom datagrid control in user control

getting a list of controls in the property inspector

fontinfo, cssstylecollection

never choose wizwebhost.com!

useer control within user control

  Privacy | Contact Us
All Times Are GMT