EDIT: I need this for my custom web part.
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.Sign up to join this community
Have a look at the source code for SharePoint LiveListData. I am reading the ListName property from ListViewWebParts on the page using jQuery and the Web Services.