Bad Url after creation of the Polls list

Jul 21, 2008 at 4:00 PM

The web part displays a link after successfully creating the Polls List.  The link is to take one to the Polls List so they can create the Poll.  The url appears to work when the web part is deployed to a collaboration site but when deployed to a page on a publishing site the url is malformed.

For example: http://mysite/subsite/Pages/default.aspx will contain the web part.  The link generated points to http://mysite/subsite/Pages/Lists/Polls  when it should be http://mysite/subsite/Lists/Polls

Has anyone else had aproblem with this?  It is a little bit of a pain for Business Users who will be creating the polls.

Aug 27, 2008 at 8:40 AM
Hi lfarho,

Try to deploy it on a site where the publication is not enabled ;)

The main differences btw Publication sites and "Normal" sites, are the Pages Library.

All the best,
Michael
Sep 15, 2008 at 9:19 PM
Edited Sep 15, 2008 at 9:21 PM
I modified the web part to fix this issue for the install we are using. 

I added the following code to the end of the two methods listed below.

ButtonCreatePollList_Click method and the LinkPollList_Click method, and the web part works on publishing sites as it does on any other site now.

 

//Code added to insure this web part behaves the same in Publishing site/

//and non-publishing sites 
SPWeb web1 = SPContext.Current.Web; 
string webUrl = web1.Url.ToString(); 
Page.Response.Redirect(webUrl +
"/lists/polls"); 
web1.Close();

 

 

Nov 17, 2008 at 1:35 PM
Thanks tbithell ... we need this webpart for published part too. To the dev team : please could you correct this 'bug', it would be really really great for further people.

Thanks to both of you (tbithell and the dev team) !