My Tweets on 2009-12-27
- What a beautiful beautiful sight! http://twitpic.com/upir7 #
- \m/ … ’nuff said. #
- U don’t get the full effect until u walk into liquor store in the Bronx with it on =) http://twitpic.com/uwcr8 #
- …aaaand… It’s over. G’night! #
I hate binding to data list because they add in a ton of extra code that is a bitch to clean up. I like handling and manipulating the raw data and outputting it exactly as I like. So, my dilemma with PagedDataSources is that you need to bind them to a data list to get the data (to the best of my knowledge).
Here’s how I got around it:
1. Fill up your PagedDataSource with data
2. Bind it to a data list (ex: theDataList)
3. In the Data List on the aspx page, pump all the data back to the .vb page into a function.
4. Create a literal on the .aspx page (ex: litOutput)
5. In the function that is used to marshal the data, append all the output to the literal on the aspx page (litOutput.Append(strOutput))
6. After the command to connect the PagedDataSourse to the data list (theDataList.DataSource = objDps / theDataList.DataBind()), make it not visible:
theDataList.Visible = False
BAM! You now have all your data in the literal and the data list with all it’s crappy ass <br/>’s and <span>’s are no where to be found =)
.: Adam