Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best option for visually displaying errors on ASP page via VB code

Status
Not open for further replies.

Maven4Champ

Technical User
Jun 16, 2004
154
0
0
Hi all,

I was hoping to get some input on a logical (and most efficient) way to dynamically build a grid (or html table) that displays validation errors that a user might encounter during a validation sub process.

There is no "data source" of where these errors come from but simply a string that I would pass to the grid or table that is descriptive and includes the column there error occured on.

For instance:
Code:
For each record
AddRow: resp1 & " cannot be assigned to this user because they are already assigned: " resp2
Next

So as each error is encountered, I display a GridView or HtmlTable for the user on the ASP webpage that adds a row as a row through each loop. Once the page is displayed, they are presented w/ the errors in a Grid or Table so they actually know what the errors are and can resolve them, re-validate and then finally submit once complete.

What is the best way to handle this in VB.NET? As I understand it, a GridView must have a DataSource and this technically doens't have a datasource - thoughts?
 
Don't think of DataSources in terms of just databases. You could create your own datasource in memory and bind it. I've built pages without any html code or controls--just using response.write to dynamically create html tables. I'm not sure that's the best way however as I'm not a web programmer really, so you might get some better tips in the ASP.Net forum.

forum855
 
Well, I think I now have it working. I used an ArrayList to hold my values and in my FOR EACH loop, added values to the array list. I then call the array list as my datasource for the gridview and guess what - it does work!

I just wasn't sure of the ability of the gridview on this one but it appears to be working fine - thanks for all your help and assistance, as usual!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top