G
Guest
Hi,
What is wrong with this code? I can't figure this out. Its suppose to display
..a bunch
..of errors
on my page. I am stuck for over 4 hrs now an this crap. Please assist.
This is on form load
Dim str As String = "a bunch|of errors"
Dim errors() As String = str.Split("|")
Dim sb As StringBuilder = New StringBuilder
' HTML code for a bulleted list
sb.Append("<ul>\n")
' Append each error to the bulleted list
Dim serror As String
For Each serror In errors
sb.Append("<li>" + serror + "</li>\n")
Next
sb.Append("</ul>")
' Create a <div> tag using an HtmlGenericControl
Dim gc As HtmlGenericControl = New HtmlGenericControl("div")
gc.Attributes.Add("id", "errorList")
' Set its InnerHtml to the error list.
gc.InnerHtml = sb.ToString()
' Add it to the PlaceHolder on the page.
placehandler.Controls.Add(gc)
Thanks
What is wrong with this code? I can't figure this out. Its suppose to display
..a bunch
..of errors
on my page. I am stuck for over 4 hrs now an this crap. Please assist.
This is on form load
Dim str As String = "a bunch|of errors"
Dim errors() As String = str.Split("|")
Dim sb As StringBuilder = New StringBuilder
' HTML code for a bulleted list
sb.Append("<ul>\n")
' Append each error to the bulleted list
Dim serror As String
For Each serror In errors
sb.Append("<li>" + serror + "</li>\n")
Next
sb.Append("</ul>")
' Create a <div> tag using an HtmlGenericControl
Dim gc As HtmlGenericControl = New HtmlGenericControl("div")
gc.Attributes.Add("id", "errorList")
' Set its InnerHtml to the error list.
gc.InnerHtml = sb.ToString()
' Add it to the PlaceHolder on the page.
placehandler.Controls.Add(gc)
Thanks