Showing posts with label website. Show all posts
Showing posts with label website. Show all posts

Wednesday, March 28, 2012

Installation problem

Hi

I'm using VS 2005 on Vista Business. I installed AJAX Extentions ans Toolkit. When I create a new AJAX enabled website everything is fine. But when I use some of the demos I get hundreds of errors - as if the AJAX extentions were disabled. In case of the ToDoList-CS demo website for instance I get the following errors.

Error 1 Element 'ScriptManager' is not a known element. This can occur if there is a compilation error in the Web site. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 3 6 C:\...\ToDoList-CS\
Error 2 Element 'UpdateProgress' is not a known element. This can occur if there is a compilation error in the Web site. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 11 10 C:\...\ToDoList-CS\
Error 3 Validation (XHTML 1.0 Transitional): Element 'progresstemplate' is not supported. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 12 10 C:\...\ToDoList-CS\
Error 4 Validation (XHTML 1.0 Transitional): Element 'img' is missing required attribute 'alt'. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 14 14 C:\...\ToDoList-CS\
Error 5 Element 'UpdatePanel' is not a known element. This can occur if there is a compilation error in the Web site. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 23 10 C:\...\ToDoList-CS\
Error 6 Validation (XHTML 1.0 Transitional): Element 'contenttemplate' is not supported. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 24 10 C:\...\ToDoList-CS\
Error 7 Element 'GridView' is not a known element. This can occur if there is a compilation error in the Web site. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 25 14 C:\...\ToDoList-CS\
Error 8 Validation (XHTML 1.0 Transitional): Element 'columns' is not supported. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 33 11 C:\...\ToDoList-CS\
Error 9 Element 'CommandField' is not a known element. This can occur if there is a compilation error in the Web site. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 34 18 C:\...\ToDoList-CS\
Error 10 Element 'BoundField' is not a known element. This can occur if there is a compilation error in the Web site. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 35 18 C:\...\ToDoList-CS\
Error 11 Element 'BoundField' is not a known element. This can occur if there is a compilation error in the Web site. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 37 18 C:\...\ToDoList-CS\
Error 12 Element 'CheckBoxField' is not a known element. This can occur if there is a compilation error in the Web site. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 38 18 C:\...\ToDoList-CS\
Error 13 Validation (XHTML 1.0 Transitional): Element 'triggers' is not supported. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 42 10 C:\...\ToDoList-CS\
Error 14 Element 'AsyncPostBackTrigger' is not a known element. This can occur if there is a compilation error in the Web site. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 43 14 C:\...\ToDoList-CS\
Error 15 Element 'UpdatePanel' is not a known element. This can occur if there is a compilation error in the Web site. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 52 9 C:\...\ToDoList-CS\
Error 16 Validation (XHTML 1.0 Transitional): Element 'contenttemplate' is not supported. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 53 6 C:\...\ToDoList-CS\
Error 17 Element 'DetailsView' is not a known element. This can occur if there is a compilation error in the Web site. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 54 14 C:\...\ToDoList-CS\
Error 18 Validation (XHTML 1.0 Transitional): Element 'fields' is not supported. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 61 10 C:\...\ToDoList-CS\
Error 19 Element 'BoundField' is not a known element. This can occur if there is a compilation error in the Web site. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 62 18 C:\...\ToDoList-CS\
Error 20 Element 'BoundField' is not a known element. This can occur if there is a compilation error in the Web site. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 64 18 C:\...\ToDoList-CS\
Error 21 Element 'CheckBoxField' is not a known element. This can occur if there is a compilation error in the Web site. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 65 18 C:\...\ToDoList-CS\
Error 22 Element 'CommandField' is not a known element. This can occur if there is a compilation error in the Web site. C:\Users\Igor\Desktop\ToDoList-CS\ToDoList-CS\Default.aspx 66 18 C:\...\ToDoList-CS\

Why is that? I followed the tips from ASP.NET AJAX Control Toolkit: Installation and getting started onhttp://ajax.asp.net/ during installation.

so when you downloaded the toolkit zip folder. you loaded the poject then compiled and ran it, getting the demo page and all that? and then you added the dll to the toolbox area?


I don't fully understand. I did everything as shown on the webcast.

I installed (at least I think so) everything required to be able to create AJAX enabled web sites. At present, when I open VS and create a new website I can easily add (both AJAX extentions and AJAX Toolkit tas in the tolbox menu are visible) AJAX extentions, updatepanels etc. I can also build those pages easily - with no errors.

But when I open VS and choose to open an exisitng website and point to one of the folders downloaded from asp.net site VS display errors, like these above.

Maybe I'm doing something incorrectly.

Both the ajax extentions and toolkit installed are the latest available.


that is odd, maybe there is a linking issue with finding the controll toolkit. Are there any other erros that you get that arnt like the ones you showed before?

also if you have somethign like this in your code

<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

make sure the tagPrefix is the same as what is used in your code to create controls, so make sure you page uses

<asp:Textbox ID="text1" runat="server"/>

for example. They must match that add line, but because this is a demo from online it should be right

Installing AJAX Control Toolkit for Visual Web Developer Express Edition

I cannot find any documentation on the asp.net website on how to install the AJAX Control Toolkit using Visual Web Developer Express Edition. Can anyone point me in the right direction?

Thanks,


Tom

have you tried

http://www.asp.net/ajax/documentation/live/InstallingASPNETAJAX.aspx


Found a great tutorial that steps through the process of adding the controls to the toolbox at

http://www.mcpblog.net/Lists/Categories/Category.aspx?Name=.NET

Monday, March 26, 2012

Installing/Adding ATLAS Conrol Extenders

Hi,

I have downloaded the extenders from the website.

Although when I attempt to add Microsoft.AtlasControlExtender.dll to the toolbar - I receive the following error:

--------
Microsoft Visual Studio
--------
There are no components in 'C:\Program Files\Microsoft ASP.NET\Atlas\v2.0.50727\Atlas\Microsoft.AtlasControlExtender.dll' that can be placed on the toolbox.
--------
OK
--------

why is that so? what am i doing wrong? I just want to use the textbox watermark for a start :).

any help is much appreciated.

Thank you.Install "AtlasControlToolkit.dll", not "Microsoft.AtlasControlExtender.dll"

See http://atlas.asp.net/atlastoolkit/Walkthrough/Setup.aspx for full setup
Colin,

I have already installed that one.

But when I've added all the controls - none of the TextBox watermark or sliding Containers - they're not there.

So I figured I had to install the Extenders...

If in fact they're part of the AtlasControlToolkit.dll - why dont all the extenders come up when I add them to the toolbar?
Interesting... they should be in AtlasControlToolkit.dll

Check to make sure you have the latest version of the control toolkit. If you do, you might try deleting the tab (or resetting the toolbox) and recreating the toolkit tab.

Microsoft.AtlasControlExtender.dll only contains the base class that all the extenders inherit from, so you won't find any useful toolbox items there.
Colin - i had a look - and in fact after re-adding it - worked perfectly.

Thank you very much.

R

instant update from database in aspx page using AJAX

Hi

Can someone point me in the right direction? I have a simple admin screen on my website which shows a tables values from my mssql database. How ever, rather than refreshing every 30 seconds to check for new entries, is there a way using AJAX which instantly updates the admin screen as soon as a new entry is inserted into the database?

thanks

There's not a way for the server to communicate directly with the client, unless the client requests it. The way functionality like what you want is implemented is to continually ping a light weight service that returns information about the last update to the underlying data.

For example, a JSON Web Method that returns the timestamp of the most recent item, which you can compare with the timestamp of the most recent refresh you did. If it's newer than your last update, then you can call a heavier method to update the table.

You can use window.setInterval() in JavaScript to set up the periodic check.


You really have no choice but to set a timer and check the database at a set interval, unless you want to get outside the realm of AJAX and DHTML.

All web based communication is initiated by the client. The only way to have server initiated communication is through an application, such as an AcitveX Object. There are a few (a very few) websites which address this topic but because it is so much more difficult, invasive to the end-users computer, and platform/browser specific, it is rare to find this type of setup.


thanks for your replies, very interesting. I guess the timer option is the way i will have to go. I wish to make the 'service' as light as possible, and the timestamp seems ideal - do you know of any examples, or have any tips on making this as optimal and least processor intensive as possible?

thanks again


You could basically combine these two posts from my blog, with setInterval, to do it:

http://encosia.com/index.php/2007/07/11/why-aspnet-ajax-updatepanels-are-dangerous/

http://encosia.com/index.php/2007/07/13/easily-refresh-an-updatepanel-using-javascript/


thanks gt, great posts - just had a quick browse of the rest of your site, you've got some excellent content on there!!

cheers Yes


I decided to put a simple example together, if anyone else is interested: http://encosia.com/index.php/2007/07/25/display-data-updates-in-real-time-with-ajax/

Interesting if it would be possible

Dear Members,

I have developed a mobile application using the Emulator 5.0, but when i am going to browse the website using Emulator or any mobile then my Java Script is not working, please share if you have any idea. Also if javascript is not working on mobile then how can i use AJAX control toolkit like update panel and all.

Please share if you have any good idea about that.

Regards,

Asif

Ajax isn't supported with current mobile browsers. There is a project in microsoft labs called deepfish that may or may not fix that issue.
Have u got the solution??

Saturday, March 24, 2012

Internet Explorer freezes after using AJAX

Hi

I have a weird problem. I have created an ASP.NET site which is displayed as a popup in another website.
The popup shows a treeview with which the user can update some data via an webservice. After selecting a treenode, a webservice is called in the code behind.
When I open this popup two times it will freeze all Internet Explorer windows which belongs to the current website. Only restarting the Internet Explorer helps. There is no javascript error or any other exception.

I have made tests with similar websites without ajax without any problem., so I think this may have to do with ASP.NET AJAX. The problem occurrs with Internet Explorer 6 and 7.

This is the code of the popup website:

<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div id="header">
<h1>
<asp:Label runat="server" Text="folder choice" ID="LaHeader"></asp:Label>
</h1>
</div>
<div id="haupt">
<div id="navi">
<asp:UpdatePanel runat="server" ID="UpPaTreeView" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:TreeView runat="server" ID="TrViStructure" DataSourceID="XmDaSoStructure" OnSelectedNodeChanged="TrViStructure_SelectedNodeChanged">
<DataBindings>
<asp:TreeNodeBinding DataMember="Root" PopulateOnDemand="True" TextField="Name" ValueField="GUID" />
<asp:TreeNodeBinding DataMember="Folder" TextField="Name" ValueField="GUID" />
<asp:TreeNodeBinding DataMember="Underfolder" TextField="Name" ValueField="GUID" />
</DataBindings>
<NodeStyle CssClass="TreeItem" />
<HoverNodeStyle CssClass="TreeItemHovered" />
<SelectedNodeStyle CssClass="TreeItemSelected" />
</asp:TreeView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div id="content">
<asp:UpdatePanel ID="UpPaStatus" runat="server" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:Panel ID="PaButton" runat="server" Visible="false">
<div id="controls">
<asp:Button OnClientClick="closewindow()" runat="server" CssClass="button" Text="Close"
ID="BuClose" />
</div>
</asp:Panel>
<asp:Panel ID="PaMessage" runat="server" Visible="false">
<div id="label">
<asp:Label ID="laErrorHeader" runat="server" Text="Header"></asp:Label><br />
<asp:Label ID="laErrorMessage" runat="server" Text="Label"></asp:Label>
</div>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpPaTreeView">
<ProgressTemplate>
<div id="update">
<img src="img/ajax-loader-blueBg.gif" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</div>
</div>
<asp:XmlDataSource runat="server" ID="XmDaSoStructure" DataFile="~/XML/Folders.xml">
</asp:XmlDataSource>
</form>

<script type="text/javascript">
function closewindow()
{
window.opener = this;
window.close();
}

</script>

</body>


Hi c.kr

It is not recommended to add the line number in your source code. Would you please modify it and provide more C# code and XML file related to your page ?


Hi, sorry for the line numbers, I removed it.

This is the used xml file for the treeview:

<Folder Name="foobar" GUID="some guid">
<Folder Name="foobar2" GUID="some guid2"></Folder>
<Folder Name="foo" GUID="5871D39C-7DD0-DB11-A445-0003FF6D5330">
<Folder Name="bar" GUID="E8C495C8-7DD0-DB11-A445-0003FF6D5330">
</Folder>
</Folder>
</Folder>
 This is the code behind file for the webpage:
public partialclass FolderChoice : System.Web.UI.Page
{
string _objectId =string.Empty;
CrmService _service;

private SessionData sessionData
{
get {return Session["SessionData"] ==null ?null : (SessionData)Session["SessionData"];
}
set { Session["SessionData"] =value;
}
}

protected void Page_Load(object sender, EventArgs e)
{
sessionData = CRMplusServiceConnector.GetSessionData(Request.ServerVariables["HTTP_ACCEPT_LANGUAGE"]);
_objectId = Server.UrlDecode(Request.QueryString["oId"].ToString());

LaHeader.Text = sessionData.Translation["folderchoice.LaHeader"];
BuClose.Text = sessionData.Translation["folderchoice.BuClose"];
}

private void ConnectToCrm()
{
_service =new CrmService();

_service.Url = CRMplusServiceConnector.Configuration["crmServiceUrl"];
_service.Credentials = System.Net.CredentialCache.DefaultCredentials;

//----------------------
// Gets the Current User's Information
//---------------------- WhoAmIRequest userRequest =new WhoAmIRequest();
WhoAmIResponse userResp = (WhoAmIResponse)_service.Execute(userRequest);

//----------------------
// Set UserId of current User as CallerId
//---------------------- _service.CallerIdValue =new CallerId();
_service.CallerIdValue.CallerGuid = userResp.UserId;

//----------------------
// Cache credentials so we don't have to re-authenticate on each request.
//---------------------- _service.PreAuthenticate =true;
}

protected void TrViStructure_SelectedNodeChanged(object sender, EventArgs e)
{
this.PaMessage.Visible =false;

PaButton.Visible =false;
TrViStructure.Enabled =false;
TrViStructure.EnableClientScript =false;

SelectFolder();

TrViStructure.Enabled =true;
TrViStructure.EnableClientScript =true;
PaButton.Visible =true;
}

private void SelectFolder()
{
try { ConnectToCrm();// Create the target object for the request TargetRetrieve<someEntitiy> targetDoc =new TargetRetrieve<someEntity>();

// Set the target object's IDstring guiddoc = _objectId.Replace('{',' ');
guiddoc = guiddoc.Replace('}',' ');
guiddoc = guiddoc.Trim();
targetDoc.EntityId =new Guid(guiddoc);

// Create the request object RetrieveRequest reqDoc =new RetrieveRequest();

// Set the request object's properties reqDoc.Target = targetDoc; reqDoc.ColumnSet =new AllColumns();

// Execute the request RetrieveResponse retDoc = (RetrieveResponse)_service.Execute(reqDoc); <someEntity> curDoc =new <someEntity>();
if ( retDoc.BusinessEntity !=null )
{
curDoc = (<someEntity>)retDoc.BusinessEntity;
}
else { Environment.Exit(1); } curDoc.new_documentfolderid =new Lookup();
curDoc.new_documentfolderid.type = EntityName.new_folder.ToString();
curDoc.new_documentfolderid.Value =new Guid(TrViStructure.SelectedNode.Value.ToString());
_service.Update(curDoc);
}
catch ( System.Web.Services.Protocols.SoapException exc )
{
ShowException(exc);
}
}

private void ShowException(System.Web.Services.Protocols.SoapException exc)
{
this.PaMessage.Visible =true;
this.laErrorHeader.Text = sessionData.Translation["folderchoice.LaError"];
this.laErrorMessage.Text = exc.Detail.InnerText;
}
}

I replaced one of our classes with <someEntity>. The service which is called belongs to Microsoft Dynamics CRM.

Hi c.kr,

Sorry for the delay.I'm failed to reproduce your problem after wholly copied your code into a new project. The best way to indicate the exact root cause is dubugging it step by step in VS2005. By the way, Treeview control is not support very well inside UpdatePanel.http://ajax.asp.net/docs/overview/UpdatePanelOverview.aspx please focus on "Controls that Are Not Compatible with UpdatePanel Controls ".

If you has found it , please share it with us.

Invalid Argument

Hi there

I get an odd error when I publish my website to a 2003 server box with the latest asp.net ajax dll installed.

Currently my only page that uses the toolkit has a usercontrol containing a DragPanelExtender. When it loads I get an 'Invalid Argument' client javascript exception. If I try to debug, it breaks into the client side script at

a.left=c+"px"

where c is an invalid number (NaN)

This works fine locally on my dev box.

thanks in advance

Found it!! After tearing what little hair I have left out. I found that certain web servers (I am still looking into the exact detail that causes this to happen!) seem to a cause IIS/IE/ASP NET AJAX to have a problem with frame attributes like frameborder when their values are set to "yes" or "no" rather than "1" or "0".

Once I updated all of them the problem went away.

Hope this helps someone

Invoking postback for an update panel in a parent document

The default page for my website contains a div with links to user data that is only visible when a user is logged into my site. The login control lives in an IFrame within the default page (see sample code below).

Now, how can I get the udpate panel on the default page to recognize an event or a button click inside of the login control? I'm not looking for a tutorial on getting the login control to work, but rather any link button inside of the IFrame's update panel forcing the default page's update panel to post back. Both pages have a script manager.

chopped down version of existing code:

dafault page:

1<asp:update panel id="upUserPrefs" runat="server" updatemode="conditional">2 <contenttemplate>3 <div id="userPrefs" runat="server"><a href="prefs.aspx">preferences</a></div>4 </contenttemplate>5</asp:update panel>

IFrame source page:

1 <asp:UpdatePanel ID="updateSignon" runat="server" UpdateMode="conditional">2 <ContentTemplate>3 <asp:Table ID="tblLoginCtrl" runat="server" visible="false" Width="100%" HorizontalAlign="Left" CellPadding="0" CellSpacing="0">4 <asp:TableRow>5 <asp:TableCell ID="tcLoginCtrl">6 <uc1:LoginControl ID="LoginControl" Enable runat=server LoginStyle=Login_Home />7 </asp:TableCell>8 </asp:TableRow>9 </asp:Table>10 </ContentTemplate>11 </asp:UpdatePanel>
Any help would be greatly appreciated.

</p><p> (this.Parent.Parent as UpdatePanel).Update();</p><p>

is what I use.....however i have other problems...LOL. but that should fix yours.


Hi,

I think you can add a invisible button in the default page, set it as a trigger for the update panel.

Then add a javascript function in the contained page, in which invoke the click event of the button in the container.

Please feel free to let me know if there is any problem.


I tried that before, but when I have 2 instances of the same control on my page, it fires events for both of them. Or did I do something wrong?? Should this be happening? Have you ever heard of this??


In my opinion, it's normal that two control of the same type would behavior the same.

Wednesday, March 21, 2012

Is Atlas a Regular ASP.NET Page?

I created a website and selected the Atlas Website template. I don't know if I will use Atlas, but thought I might. Is it still a regular ASP.NET website? Or should I have selected ASP.NET website and added Atlas later. It might be out of beta before I use it. How hard it is to add Atlas later?

Thank you for any help.

When you use the atlas template, all your doing is setting up a solution with the atlas dll already included in your bin folder, all the proper declarations already setup in your web.config, and a script manager registered on your default.aspx page for you. Nothing says you have to use atlas, in fact, untill you add some atlas components, your not. It's for all intents and purposes a standard asp.net page.
Does anyone know when Atlas goes into production?

hello.

yes, this is true. however, if you're not using atlas, then you'd probably be better to use a normal web site (the altas dll + web.config entries introduce some handlers that will intercept some requests unnecessarily).

one more thing: there's already a go live licence for atlas so you can use it in production.

Is it possible to "redirect"/URLrewrite ScriptResource.axd?

Hi,

I'm currently working on a project where the client is using a Third-party tool for handling authentication to the website. This means problem because we cannot exclude more files than Default.aspx in the root of the website. The rest of the "unsecure" files needs to be in a special folder. If I look at the source for Default.aspx I see the following (which I understand is AJAX resources?):

<script src="/MySite/WebResource.axd?d=..." type="text/javascript"></script>
<script src="/MySite/WebResource.axd?d=..." type="text/javascript"></script>
<script src="/MySite/ScriptResource.axd?d=..." type="text/javascript"></script>
<script src="/MySite/ScriptResource.axd?d=..." type="text/javascript"></script>

I need to include this resources from another URL. Like this:

<script src="http://pics.10026.com/?src=/MySite/unsec/WebResource.axd?d=..." type="text/javascript"></script>
<script src="http://pics.10026.com/?src=/MySite/unsec/WebResource.axd?d=..." type="text/javascript"></script>
<script src="http://pics.10026.com/?src=/MySite/unsec/ScriptResource.axd?d=..." type="text/javascript"></script>
<script src="http://pics.10026.com/?src=/MySite/unsec/ScriptResource.axd?d=..." type="text/javascript"></script>

Is this possible to do?

regards // Magnus

Hi,

I have tested it with the following code:

Overriding Page.Render and replace the string.

<%@. Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = TextBox1.Text;
}
protected override void Render(HtmlTextWriter writer)
{
System.IO.StringWriter sw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw);
base.Render(htw);
string s = sw.ToString();
s = s.Replace("/AJAXEnabledWebSite3/WebResource.axd", "/AJAXEnabledWebSite3/Secure/WebResource.axd");
writer.Write(s.Replace("/AJAXEnabledWebSite3/ScriptResource.axd", "/AJAXEnabledWebSite3/Secure/ScriptResource.axd"));

}
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /><div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>

ThenI received "sys is undefined" error,I think it is because there is no WebResource.axd created in that sub folder, So how to tell ASP.NET to create WebResource.axd in that folder rather than at the root? See following for answer:

AJAX's script handler is performing path check. Hence it is blocking our trick:

Declaring Type: System.Web.Handlers.ScriptResourceHandler
Assembly: System.Web.Extensions, Version=1.0.61025.0

private static void CheckPath(string path)
{
if (!string.Equals(path, VirtualPathUtility.ToAbsolute("~/ScriptResource.axd"), StringComparison.OrdinalIgnoreCase))
{
Throw404();
}
}

To workaround this further, we can:

1. With IIS, create the "Secure" folder under the root directory of our web application (e.g. "C:\Inetpub\wwwroot\AJAXEnabledWebApplication\Secure").

2. Use IIS Configuration Tool to create an child Application for the "Secure" node:

IIS 7.0 Beta: Add a Web Application
http://technet2.microsoft.com/windowsserver2008/en/library/7450f8c5-8d46-4bb2-bd59-4e6ff23df3201033.mspx

The purpose of this is to workaround the virtual path check mentioned above.

3. Open the Web.Config of the application and configure the machine key:

<system.web>
<machineKey
validationKey="0000000000000000000000000000000000000000"
decryptionKey="0123456789012345"
validation="SHA1"/>

This makes the encryption/decryption mechanism consistent between our root application and child application.

4. Apply the code change mentioned previously.

This should work.

This should work.

Best Regards,