IE Web Controls and SharePoint

R

Rob Kellow

Hello

Has anyone successfully used any of the ie web controls (ToolBar, TabStrip, TreeView, etc...) with SharePoint Services running on Server 2003? I have the web controls built and working fine on my development system but as soon as I move it to Server 2003 running SharePoint the app stops working. If I remove the ie web control from the ASP.NET page, the page works again. When I put the web control back on the page, it displays "File Not Found" on a blank page

Any help would be greatly apprciated

Thanks and Regards
Rob
 
K

Ken Cox [Microsoft MVP]

Isn't all the code for SharePoint sites stored in the database? I suspect
you'd have to create a Web part to get that to work.
 
R

Rob Kellow

Hi Ken

Thanks for the repsonse. I'm not quite sure what you mean by all the code is stored in the database... I've written and successfully called a lot of .aspx pages from inside SharePoint sites and I've also written some Web Parts. The only thing that seems to be a bit of a hinderance with SharePoint is your base virtual directory. Instead of it being something like \inetpub\wwwroot\mysite it is \Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\LAYOUTS\mysite. But aside from that minor change everything else works fine. My problem is that to even create a regular ASP.NET page (not even for SharePoint) I can't do it using the IE Web Controls. I write a page that has just a text box on it and it runs fine. Then I add one of the IE Web Controls to that page (let's say the ToolBar control) and run the page again and it comes up with a "File Not Found" message on the page. I remove the ToolBar control and run it and it works fine. That's the problem

Any thoughts

Thanks again
Rob
 
R

Rob Kellow

Thanks for the response. I tried to what you outlined and it failed but perhaps I'm not getting what you suggested. My virtual directory is \_layouts and my project is called WebControlsTest so I added the following to web.config

<configuration><MicrosoftWebControls><add key="CommonFiles" value="/_layouts/webcontrolstest
</MicrosoftWebControls></configuration

But it didn't work, in fact it gave me an error and wouldn't even bring the page up.

Thanks for your help and if you have any other thoughts or if I misunderstood what you suggested let me know as I'm still trying to get this working

Thanks and Regards
Ro
 
S

Scott

Now; create that directory _layouts/webcontrols and copy the files from webctrl_client\1_0; so you should see something like:

_layouts\webcontrolstest\treeview.htc
_layouts\webcontrolstest\toolbar.htc

Of course you can tweak the path to keep more of the same structure as the IE webcontrols. Download the controls from aspnet.com and look at BaseRichControl.cs for more details of how this works.

You should be able to view the browser source and correlate the paths in the stuff that the IE webcontrols are generating with what you have setup.

Scott
Thanks for the response. I tried to what you outlined and it failed but perhaps I'm not getting what you suggested. My virtual directory is \_layouts and my project is called WebControlsTest so I added the following to web.config:

<configuration><MicrosoftWebControls><add key="CommonFiles" value="/_layouts/webcontrolstest"
</MicrosoftWebControls></configuration>

But it didn't work, in fact it gave me an error and wouldn't even bring the page up.

Thanks for your help and if you have any other thoughts or if I misunderstood what you suggested let me know as I'm still trying to get this working.

Thanks and Regards,
Rob
 
S

Scott G.

What does the HTML for the toolbar look like when you view the source? Why don't you post a snipit.

Also, what browser are you using? Try a non-IE browser (the web controls will automatically downlevel, and skip using the behaviors).

Scott
Hi Scott,

Thanks again for the help. It seems as though it's getting closer but still not working. The text from the buttons that should be on the Toolbar is now being displayed but still no Toolbar. This is an improvement since I'm not seeing a blank page with an error message but it still doesn't have the working toolbar. I'll keep trying and if you have any other thoughts I would appreciate them.

Regards,
Rob
 
S

Scott G.

I was looking to see the source in that the browser sees; one should be able to see the full paths. Run this page in your browser and grab the view source.

Scott
Hi Scott,

Here is the test page I'm using to try to get the toolbar web control to work.

====================================================================

<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="webcontrols.WebForm1" codePage="65001"%><%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" ><HTML><HEAD><title>WebForm1</title><meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"><meta name="CODE_LANGUAGE" Content="C#"><meta name="vs_defaultClientScript" content="JavaScript"><meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"></HEAD><body MS_POSITIONING="GridLayout"><form id="Form1" method="post" runat="server"><asp:Label id="Label1" style="Z-INDEX: 101; LEFT: 48px; POSITION: absolute; TOP: 112px" runat="server"
Font-Names="Arial" Font-Size="X-Large" ForeColor="#C0C000">Test Page</asp:Label><iewc:Toolbar id="Toolbar1" style="Z-INDEX: 102; LEFT: 32px; POSITION: absolute; TOP: 16px" runat="server"><iewc:ToolbarButton Text="First"></iewc:ToolbarButton><iewc:ToolbarSeparator></iewc:ToolbarSeparator><iewc:ToolbarButton Text="Second"></iewc:ToolbarButton></iewc:Toolbar></form></body></HTML>

========================================================================

As I mentioned, the text from the buttons displays but no toolbar.

Thanks,
Rob
 
R

Rob Kellow

Hi Scott

Here is the source from inside the browser

=========================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" ><HTML><HEAD><title>WebForm1</title><meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"><meta name="CODE_LANGUAGE" Content="C#"><meta name="vs_defaultClientScript" content="JavaScript"><meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"></HEAD><body MS_POSITIONING="GridLayout"><form name="Form1" method="post" action="WebForm1.aspx" id="Form1"><input type="hidden" name="__Toolbar1_State__" value="" /><input type="hidden" name="__VIEWSTATE" value="dDwxODEzODg2MDQwOztsPFRvb2xiYXIxOz4+NunCc4Ldc36yaSFtEh4K3r1vfl8=" /><span id="Label1" style="color:#C0C000;font-family:Arial;font-size:X-Large;Z-INDEX: 101; LEFT: 48px; POSITION: absolute; TOP: 112px">Test Page</span><?XML:NAMESPACE PREFIX="TBNS" /><?IMPORT NAMESPACE="TBNS" IMPLEMENTATION="/webctrl_client/1_0/toolbar.htc" /><TBNS:Toolbar id="Toolbar1" oncheckchange="JScript:if (event.srcNode != null) __Toolbar1_State__.value+=((event.srcNode.getAttribute('selected')=='true')?'+':'-')+event.flatIndex+';';" onbuttonclick="JScript:if (event.srcNode != null) if ((event.srcNode.getType() != 'checkbutton') || (event.srcNode.getAttribute('_autopostback') != null)) if (getAttribute('_submitting') != 'true'){setAttribute('_submitting', 'true');try{__doPostBack('Toolbar1',event.flatIndex);}catch(e){setAttribute('_submitting', 'false');}}" onwcready="JScript:try{__Toolbar1_State__.value = ''}catch(e){}" style="Z-INDEX: 102; LEFT: 32px; POSITION: absolute; TOP: 16px"><TBNS:ToolbarButton onkeydown="if (event.keyCode==13){event.returnValue=false}">First</TBNS:ToolbarButton><TBNS:ToolbarSeparator /><TBNS:ToolbarButton onkeydown="if (event.keyCode==13){event.returnValue=false}">Second</TBNS:ToolbarButton></TBNS:Toolbar><input type="hidden" name="__EVENTTARGET" value="" /><input type="hidden" name="__EVENTARGUMENT" value="" /><script language="javascript"><!-
function __doPostBack(eventTarget, eventArgument)
var theform
if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1)
theform = document.forms["Form1"]

else
theform = document.Form1

theform.__EVENTTARGET.value = eventTarget.split("$").join(":")
theform.__EVENTARGUMENT.value = eventArgument
theform.submit()

// --></script></form></body></HTML

==============================================================

Thanks again
Rob
 
S

Scott G.

On your server do you have a the following path:

IMPLEMENTATION="/webctrl_client/1_0/toolbar.htc"

You should be able to see this path on the server and since it's rooted at the top of the server, make sure if you are using a virtual directory that this directory is located in the root of the server.

You ought to have been able to override this directory with the configuration stuff I posted earlier; but, I guess that didn't work out.

Scott
Hi Scott,

Here is the source from inside the browser:

==========================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" ><HTML><HEAD><title>WebForm1</title><meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"><meta name="CODE_LANGUAGE" Content="C#"><meta name="vs_defaultClientScript" content="JavaScript"><meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"></HEAD><body MS_POSITIONING="GridLayout"><form name="Form1" method="post" action="WebForm1.aspx" id="Form1"><input type="hidden" name="__Toolbar1_State__" value="" /><input type="hidden" name="__VIEWSTATE" value="dDwxODEzODg2MDQwOztsPFRvb2xiYXIxOz4+NunCc4Ldc36yaSFtEh4K3r1vfl8=" /><span id="Label1" style="color:#C0C000;font-family:Arial;font-size:X-Large;Z-INDEX: 101; LEFT: 48px; POSITION: absolute; TOP: 112px">Test Page</span><?XML:NAMESPACE PREFIX="TBNS" /><?IMPORT NAMESPACE="TBNS" IMPLEMENTATION="/webctrl_client/1_0/toolbar.htc" /><TBNS:Toolbar id="Toolbar1" oncheckchange="JScript:if (event.srcNode != null) __Toolbar1_State__.value+=((event.srcNode.getAttribute('selected')=='true')?'+':'-')+event.flatIndex+';';" onbuttonclick="JScript:if (event.srcNode != null) if ((event.srcNode.getType() != 'checkbutton') || (event.srcNode.getAttribute('_autopostback') != null)) if (getAttribute('_submitting') != 'true'){setAttribute('_submitting', 'true');try{__doPostBack('Toolbar1',event.flatIndex);}catch(e){setAttribute('_submitting', 'false');}}" onwcready="JScript:try{__Toolbar1_State__.value = ''}catch(e){}" style="Z-INDEX: 102; LEFT: 32px; POSITION: absolute; TOP: 16px"><TBNS:ToolbarButton onkeydown="if (event.keyCode==13){event.returnValue=false}">First</TBNS:ToolbarButton><TBNS:ToolbarSeparator /><TBNS:ToolbarButton onkeydown="if (event.keyCode==13){event.returnValue=false}">Second</TBNS:ToolbarButton></TBNS:Toolbar><input type="hidden" name="__EVENTTARGET" value="" /><input type="hidden" name="__EVENTARGUMENT" value="" /><script language="javascript"><!--
function __doPostBack(eventTarget, eventArgument) {
var theform;
if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
theform = document.forms["Form1"];
}
else {
theform = document.Form1;
}
theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
// --></script></form></body></HTML>

===============================================================

Thanks again,
Rob
 
R

Rob Kellow

Hi Scott

Sorry for being so stupid but where would I have this IMPLEMENTATION=... statement? In my System Environment or somewhere else. I guess since I don't know where I should have it, it's safe to say that I don't have it

Thanks
Rob
 
S

Scott G.

I cut and pasted from the HTML you posted; the path part is what you are intested (ignore the IMPL...) in having on your web server.

Scott
Hi Scott,

Sorry for being so stupid but where would I have this IMPLEMENTATION=... statement? In my System Environment or somewhere else. I guess since I don't know where I should have it, it's safe to say that I don't have it.

Thanks,
Rob
 
R

Rob Kellow

Hi Scott

Oh, OK. I wasn't sure what you were talking about with the IMPLEMENTATION but yes, I do have /webctrl_client/1_0/toolbar.htc in fact, I've put it all over the place trying to find where it needs to be. For example, my virtual root directory is a folder called /layouts so I have /layouts/webctrl_client/1_0 then I read somewhere that the web controls only worked if there were local to your ASP app so my test app (the one I sent you) is called webcontrols so I have /layouts/webcontrols/webctrl_client/1_0. I even moved the .htc files in the both the /layouts as well as the /layouts/webcontrols folders and NOTHING has worked. The really strange thing is that I've added the web controls to my toolbox in Visual Studio and I can drap a Toolbar control on to my web form and it works and all the functionality of the toolbar is there and works (I can add buttons through the property builder) but when I run the app, I just get the text from the Toolbar buttons, no Toolbar

Thanks again
Rob
 
R

Rob Kellow

Hi Scott

I got it working... FINALLY! I took what you said in your last post and thought about it. With SharePoint Services running on the server things don't work the way they do without SharePoint. For example, I have to build applications in or under the /layouts directory, if I build them in /Inetpub/wwwroot, it doesn't work. So, with the web controls I was making the same assumptions but after reading you post I thought what the heck, so I put /webctrl_client/1_0 under /inetpub/wwwroot and it worked

Thanks for all your help and sticking with it, I can't begin to tell you how much I appreciate it

Regards
Rob
 
R

Rob Kellow

Hi Scott

That is so true. It made the week of messing around with the web control seem so much better. Thanks again fo rall the help

--Rob
 
G

Gus Lopez

Go to the Sharepoint Central Administration. Under Virtual Server
Configuration select Configure virtual server settings, then select the
Default Web Site.

Under Virtual Server Management click on Define managed paths.

Under Add a New Path, add webctrl_client to the path and select the
“Excluded path” radio button.
 
G

Gus Lopez

Go to the Sharepoint Central Administration. Under Virtual Server
Configuration select Configure virtual server settings, then select the
Default Web Site.

Under Virtual Server Management click on Define managed paths.

Under Add a New Path, add webctrl_client to the path and select the
“Excluded path” radio button.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top