Web.config and Sharepoint Designer 2007 aspx datasource
I have taken over a project that was developed in Sharepoint Designer 2007 with about 10 .aspx pages. The problem is that these pages have data sources embedded in them(inline). The datasources have explicit server/username/password information in them. So, when we want to move this from dev to test to prod I have to create the backup .cmp file from dev and restore it to test. However test is using a different database along with different login credentials so I have to manually change the datasource info. So my question is, how can I create a variable in the web.config file to specify this datasource connection so it is not hard coded in the inline aspx page. Remember these pages do NOT have code behind. They were developed in Sharepoint designer 2007 using the GUI. I have tried adding a <key> or a <connectionStrings> item in the web.config file in hopes that the .aspx page would recognize it and problem solved. When I reference the item in the .aspx page as <%$ ConnectionStrings:dbname %> it just does not recognize it. Please help, under some pressure here.
October 11th, 2010 5:22pm

What about creating a custom list to store that information? That way, you can have the same data connection on each page, that grabs the same information from that same list. Then all you would have to do is update the list and you're done.http://donahoo-development.com
Free Windows Admin Tool Kit Click here and download it now
October 11th, 2010 6:03pm

That doesn't seem like a logical fix to this problem. The datasource would still be hard coded in the aspx pages. The idea is that I can make a backup in dev and restore to test without changing any of the code.
October 11th, 2010 6:42pm

Hi, Yes, you can’t do this. SharePoint Designer is target to a web designer not a developer. The web designer have less secure permission than a developer and the web designer have no permission to modify the web.config file. So In SharePoint designer you have no option to use the variable from web.config file. By the way, In SharePoint design you just can create and publish a content page not an application page and the content page just belong one Site not whole web application. Hope this helps Thanks! StanffordEverything will be fine.
Free Windows Admin Tool Kit Click here and download it now
October 14th, 2010 8:30am

What about creating a custom list to store that information? That way, you can have the same data connection on each page, that grabs the same information from that same list. Then all you would have to do is update the list and you're done. http://donahoo-development.com how can you access that custom list in all your lists without using lookuptables and that kind of things? Can you in Sharepoint designer 2010 add another data connection? All my lists are xsltviews. There has to be a way I hope to address variables that you can use in multiple lists without showing them to your users
January 4th, 2011 8:05am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics