Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

<ExecuteUrl> in ONET.XML not working

  Asked By: Devika    Date: Jul 07    Category: Sharepoint    Views: 1882

I've created a very simple page to set the theme.
If I code the executeurl in ONET.XML, (reset IIS), and create a page
from the WSS web front-end (/_layouts/1033/newsbweb.aspx), my page is
not executed.
If I REPLACE "default.aspx" on the home page
with "_layouts/1033/esconfig.aspx", it works fine.
i.e.: http://.../dava/blank/default.aspx
then http://.../dava/blank/_layouts/1033/esconfig.aspx works.
The code inthe ONET.XML is:
<Configuration ID="1" Name="Blank">
<Lists>
<List Title="Site Template Gallery"
Type="111"
Url="_catalogs/wt"
RootWebOnly="TRUE" />
<List Title="Web Part Gallery"
Type="113"
Url="_catalogs/wp"
RootWebOnly="TRUE" />
<List Title="List Template Gallery"
Type="114"
Url="_catalogs/lt"
RootWebOnly="TRUE" />
</Lists>
<Modules>
<Module Name="DefaultBlank"/>
<Module Name="WebPartPopulation"/>
</Modules>
<ExecuteURL Url="_layouts/1033/esconfig.aspx"/>
</Configuration>

( I even took out the [%
=System.Threading.Thread.CurrentThread.CurrentUICulture.LCID%] to
make it even simpler.)

My page to execute is cribbed from all the samples on-line:

<%@ Page language="VB"%>
<%@ Register Tagprefix="SharePoint"
Namespace="Microsoft.SharePoint.WebControls"
Assembly="Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint"%>

<script runat="server" language="VB">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

dim myNewWeb As SPWeb = SPControl.GetContextWeb(Context)

myNewWeb.AllowUnsafeUpdates = True
myNewWeb.ApplyTheme("Arctic")
myNewWeb.Update()
Response.Redirect(myNewWeb.Url)

End Sub
</script>

What am I missing? Why doesn't this work?

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Laura Walker     Answered On: Jul 07

You have to include this page  in Onet.xml itself.
> <Modules>
> <Module Name="DefaultBlank"/>
> <Module Name="WebPartPopulation"/>
> <Module Name="customFile"/>
> </Modules>

And include this module in Modules tag in Onet.xml and give
reference of this file.
I hope i will work.

 
Answer #2    Answered By: Lacey Daniels     Answered On: Jul 07

I tried what you suggested, and got a "File Not Found." error.

Any other thoughts?

I used my blank template, in order to have has little else going on
as possible, and added the Module element as you suggested:

<Configuration ID="1" Name="Blank">
<Lists>
<List Title="Site Template Gallery"
Type="111"
Url="_catalogs/wt"
RootWebOnly="TRUE" />

<List Title="Web Part Gallery"
Type="113"
Url="_catalogs/wp"
RootWebOnly="TRUE" />

<List Title="List Template Gallery"
Type="114"
Url="_catalogs/lt"
RootWebOnly="TRUE" />
</Lists>
<Modules>
<Module Name="DefaultBlank"/>
<Module Name="WebPartPopulation"/>
<Module Name="CustomFile"/>
</Modules>
<ExecuteURL Url="_layouts/1033/esconfig.aspx"/>
</Configuration>

Then I added the CustomFile Module in the Module section

<Module Name="CustomFile" Url="" Path="">
<File Url="_layouts/1033/esconfig.aspx"/>
</Module>

When the above didn't work  (File Not Found), I tried every variation
I could think of with URL, Path, and the File element URL and
the "_layouts/1033" path and esconfig.aspx file name. 7-8 tries. No
go.

Has anyone actually made this work? Everything I can find in MSDN and
various blogs indicates this the way to go.

 
Didn't find what you were looking for? Find more on &lt;ExecuteUrl&gt; in ONET.XML not working Or get search suggestion and latest updates.




Tagged: