Ask a Question related to ASP.NET General, Design and Development.
-
Mark MacRae #1
Re: Problem: Can't pad spaces in dropdownlist
have you tried the HTML space character?
"  "
"VB Programmer" <growNO-SPAM@go-intech.com> wrote in message
news:uH8OGMRXDHA.536@TK2MSFTNGP10.phx.gbl...ideas?> I have a ddl that is based on data from a datareader. Between column 0 and
> column 1 I wanted to pad it with 15 spaces.
>
> Problem is it keeps only putting 1 space in between the columns! Any_>
> Here's a snippet...
> drReader = cmdSqlCmd.ExecuteReader
>
> ' loop through reader and populate offices
> Do While drReader.Read()
> ddlOffice.Items.Add(drReader.GetString(0) & " " &> drReader.GetInt32(1))
> Loop
>
>
Mark MacRae Guest
-
EditItemTemplate's DropDownList problem
I have follow the instruction from the web. http://aspnet.4guysfromrolla.com/demos/dgExample16.aspx When I was trying to implement new codes in... -
DropDownList problem
Hi, I have a WebForm on which I have 2 buttons: "Retreive" and "Insert" When I push "Retreive" I would like to retreive info from my DataBase and... -
Problem with a DropDownList in a WebControl
I created a webcontrol with inside a dropdownlist, and exposed its proprieties DataSource,DataMember,DataTextField,DataValueField But I can't set... -
problem with dropdownlist selected item
I'm having the problem with this drop down list on postback. For some reason both the ListItems get selected when I change the selected item. Using... -
Inherited DropDownList Designer problem
I have an inherited DropDownList custom control that in the DataBind() method I add a bunch pre determined list items that contain the various... -
John Timney \(Microsoft MVP\) #2
Re: Problem: Can't pad spaces in dropdownlist
This has worked for me before, but its IE only I think. You could hold the
number of spaces required in your web.config file instead of the actual
spaces
Dim EncodedString As String = "This is a Test
String    EndTestString"
Dim writer As New System.IO.StringWriter()
Server.HtmlDecode(EncodedString, writer)
Dim DecodedString As String = writer.ToString()
lstTest.Items.Add(DecodedString)
--
Regards
John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
----------------------------------------------
"VB Programmer" <growNO-SPAM@go-intech.com> wrote in message
news:ec0S1ZRXDHA.2204@TK2MSFTNGP12.phx.gbl...System.Web.Configuration.HttpConfigurationRecord.E valuateRecursive(IConfigur> That padding is actually in a <appSettings> variable in my Web.config.
> Right now it was...
> <appSettings>
> <add key="DummyFillerSpace" value=" " />
> </appSettings>
> When I try
> <appSettings>
> <add key="DummyFillerSpace" value=" " />
> </appSettings>
> It fails. Here are the error messsage details:
> System.Configuration.ConfigurationException: Reference to undeclared
> parameter entity, 'nbsp'. (c:\inetpub\wwwroot\POWERWeb\web.config) --->
> System.Xml.XmlException: Reference to undeclared parameter entity, 'nbsp'.
> at System.Xml.XmlLoader.ExpandEntityReference(XmlEnti tyReference eref) at
> System.Xml.XmlEntityReference.SetParent(XmlNode node) at
> System.Xml.XmlNode.AppendChild(XmlNode newChild) at
> System.Xml.XmlLoader.LoadAttributeChildren(XmlNode parent) at
> System.Xml.XmlLoader.LoadAttributeNode() at
> System.Xml.XmlLoader.LoadCurrentNode() at
> System.Xml.XmlLoader.LoadElementNode() at
> System.Xml.XmlLoader.LoadCurrentNode() at
> System.Xml.XmlLoader.LoadCurrentNode() at
> System.Xml.XmlLoader.LoadChildren(XmlNode parent) at
> System.Xml.XmlLoader.LoadElementNode() at
> System.Xml.XmlLoader.LoadCurrentNode() at
> System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) at
> System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean
> preserveWhitespace) at System.Xml.XmlDocument.Load(XmlReader reader) at
> System.Configuration.ConfigXmlDocument.LoadSingleE lement(String filename,
> XmlTextReader sourceReader) at
>configKey,> ationSectionHandler factory, Object config, String[] keys, Int32 iKey,
> XmlUtil xml) at
> System.Web.Configuration.HttpConfigurationRecord.E valuate(StringconfigKey,> SectionRecord section) --- End of inner exception stack trace --- at
> System.Web.Configuration.HttpConfigurationRecord.E valuate(StringconfigKey,> SectionRecord section) at
> System.Web.Configuration.HttpConfigurationRecord.G etConfig(StringconfigKey,> Boolean cacheResult) at
> System.Web.Configuration.HttpConfigurationRecord.G etConfig(StringSystem.Web.Configuration.HttpConfigurationSystemBa se.System.Configuration.IC> Boolean cacheResult) at System.Web.HttpContext.GetConfig(String name) at
>at> onfigurationSystem.GetConfig(String configKey) at
> System.Configuration.ConfigurationSettings.GetConf ig(String sectionName)"> System.Configuration.ConfigurationSettings.get_App Settings() at
> POWERWeb._Default.cmdLogin_Click(Object sender, EventArgs e) in
> C:\Inetpub\wwwroot\POWERWeb\Login.aspx.vb:line 66
>
> "Mark MacRae" <nospam@nospam.com> wrote in message
> news:urGMfTRXDHA.2576@TK2MSFTNGP09.phx.gbl...> and> > have you tried the HTML space character?
> > "  "
> >
> > "VB Programmer" <growNO-SPAM@go-intech.com> wrote in message
> > news:uH8OGMRXDHA.536@TK2MSFTNGP10.phx.gbl...> > > I have a ddl that is based on data from a datareader. Between column 0> > ideas?> > > column 1 I wanted to pad it with 15 spaces.
> > >
> > > Problem is it keeps only putting 1 space in between the columns! Any> > >
> > > Here's a snippet...
> > > drReader = cmdSqlCmd.ExecuteReader
> > >
> > > ' loop through reader and populate offices
> > > Do While drReader.Read()
> > > ddlOffice.Items.Add(drReader.GetString(0) & "> &>> > _> >> > > drReader.GetInt32(1))
> > > Loop
> > >
> > >
> >
>
John Timney \(Microsoft MVP\) Guest



Reply With Quote

