Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Wednesday, March 28, 2012

Very weird error. Ajax controls call default.aspx

I have a few pages in my site... and for some reason, if there's any ajax controls on the page, it calls default.aspx and runs the code every time any aspx page with an ajax control exists on it. Problem is, default.aspx resets my session variables.

Why does Ajax call the default.aspx page code? It only runs the CS file... it doesn't actually show the default.aspx page.

I doubt it calls it. Do you have a component in your site somewhere that's got a url of "/" attached to it somewhere, and that's invoking the default page?


it only seemed to only happen when I have Certain Ajax controls on the page. Note, it only does it with Internet Explorer 6 and 7. Firefox seems to be fine.

For example, I have a collapsible PAnel in each row of a Gridview. That is in an UpdatePanel. When the Gridview is populated (and I have a breakpoint on the default.aspx.cs file), it goes through that code. Well, I set my session variables on that page, so in essence it resets them.

It seems like it does this AFTER the page is loaded, because the labels that show content based on those session variables aren't updated until I go to a new page.

It only does this when I have a collapsible panel in IE. The panel is set to collapsed.


Actually, it appears that AJAX is clearing the Session Variables. I don't know where it's doing this, though.

Viewing Source - Javascript error on missing elements

Hello,

I know this is very likely to be my misunderstanding of how ajax works, but any help would be greatly appreciated.

When my page first loads there is a panel that is not visible, inside the UpdatePanel. After a partial postback this panel becomes visible, but when I 'View Source', the outputted code for the panel does not exists, nor the code for its child controls (even though they show on screen). This means when I try to use client-side code for a control in that panel, eg.

var t = window.document.getElementByID(childID);

it cannot be found as the childID doesn't appear in the source.

Any ideas?

Thanks very much.

Simon

This is actually expected... View/Source in the browser only displays the source that was sent down with the original request.

As for your specific issue, make sure you're using the client ID... a common idiom is: $get('<%= MyControl.ClientID %>'). $get() is a shortcut in ASP.NET AJAX for document.getElementByID().

Viewstate verification failed - HELP my website is falling apart. Again :-(

I have a timer component that refreshes my page every minute but after a while it fails with the error "Viewstate verification failed". I left the page refreshing last night and it showed it stopped after 3 hours. The contents of the page haven't changed so I'm wondering if it is a timing issue with another component on my master page that has a javascript timer to which refreshes itself using callbacks.

The full error from my Event Viewer is:

Event Type: Information
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1316
Date: 15/02/2007
Time: 03:31:22
User: N/A
Computer: MAT
Description:
Event code: 4009
Event message: Viewstate verification failed. Reason: Viewstate was invalid.
Event time: 2/15/2007 3:31:22 a.m.
Event time (UTC): 2/14/2007 2:31:22 p.m.
Event ID: b68b7d7fa4d446b3adba40708b352b32
Event sequence: 341
Event occurrence: 1
Event detail code: 50204

Application information:
Application domain: /LM/W3SVC/1/Root/flo-1-128159266743963684
Trust level: Full
Application Virtual Path: /flo
Application Path: c:\inetpub\wwwroot\flo\
Machine name: MAT

Process information:
Process ID: 2308
Process name: aspnet_wp.exe
Account name: MAT\ASPNET

Request information:
Request URL:http://localhost/job_status.aspx
Request path: /job_status.aspx
User host address: 127.0.0.1
User: matthew
Is authenticated: True
Authentication Type: Forms
Thread account name: MAT\ASPNET

ViewStateException information:
Exception message: Invalid viewstate.
Client IP: 127.0.0.1
Port: 1349
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)
PersistedState: /wEWBQK9m9+mCQL20L6+CQLh8tHdBgLd/pFuArD90/EPqAe+PBf42BwApxmU14Oldo6DzQU=
Referer:http://localhost/job_status.aspx
Path: /job_status.aspx

Custom event details:

For more information, see Help and Support Center athttp://go.microsoft.com/fwlink/events.asp.

Any help would be appreciated.

Hi Matthew,

I remember some time ago to find a similar problem. It had to do with the fact that viewstate is saved in a hidden field at the end of the page, and continuous AJAX refreshes queued successive requests before they were finished, at the point where the request still had to reach the "end" of the page, where the ViewState resides. As you can see, the ViewState validator couldn't do it's work and, therefore, it threw an exception like the one you are having.

If you search the forum you may find that thread, as I haven't started it I have no easy way to point you to the link. I think I remember there was a workaround as well.

Sorry not to be more helpful, but maybe at least I gave a direction to start looking at.

Regards,

Juan


Thanks for the info. I have set up two almost duplicate copies of the site, one with buffering and one without to see if that is causing invalid data. If that doesn't work I'll look for the thread you mentioned.


Have you figured this out yet? I'm seeing this intermittently and am not sure where it's coming from.

Thanks!


I have managed to resolve this problem by not having multiple types of callback components, ie AJAX and custom made callback scripts.

What I did in the end was to setup a timer on the masterpage. On the content pages if I want update panels to update I add a trigger to the update panel that is pointing to the timer on the masterpage. Therefore evry minute the timer on the masterpage refreshes all updatepanels that are connected to it.

If you need more info let me know and i'll sort some code out for you.

Monday, March 26, 2012

Visual Studio doesnt recognize(see) ATLAS from LAN!

When I try to open a website from server(LAN) I get following error within VS 2005:

Error 1 Element 'ScriptManager' is not a known element. This can occur if there is a compilation error in the Web site. ...

but the site works properly anyway... This error just annoys me, I can't see any Intellisence code for atlas components...

I have installed VS on server and installed Atlas components there too. VS shows Atlas tags properly when I launch VS from server, but doesn't do that when I try to open the same project from another computer.

The other computer has installed VS 2005 too...

Can anyone answer how to solve this?

hello.

i think this has been reported here...if i'm not mistaken, it only works without any problems when you open a local project.

Saturday, March 24, 2012

Was this error a bugs on AJAX Control Toolkit or what?

Kindly explain if the error below was a bugs on AJAX Control Toolkit or cause by what.

Error:

System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. --> System.NotSupportedException: This page is missing a HtmlHead control which is required for the CSS stylesheet link that is being added. Please add . at AjaxControlToolkit.ScriptObjectBuilder.RegisterCssReferences(Control control) in d:\E\AjaxControlToolkit\Release\AjaxControlToolkit\ExtenderBase\ScriptObjectBuilder.cs:line 229 at AjaxControlToolkit.ScriptControlBase.OnPreRender(EventArgs e) in d:\E\AjaxControlToolkit\Release\AjaxControlToolkit\ExtenderBase\ScriptControlBase.cs:line 270 at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) -- End of inner exception stack trace -- at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.file_utilities_usermaster_edituser_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Thank you in advance,

Zed

Simple answer looks like no.

From the error it seems you have added a CSS without a head tag..i.e. ina control. And to register that CSS directly as you intend to do...use

AjaxControlToolkit.ScriptObjectBuilder.RegisterCssReferences(Control control)

Hope that helps..


Thank you for your immediate response. My assumptions is that you're correct however the only thing that keeps me on thinking is that I did not changed or modify anything on the page and even the CSS file. The page is working fine from the beginning and suddenly I just received this error. Its kind a weird you know.Smile

Thanks again,

Zed


Hi Zed,

If you want me to investigate, Ia m more then happy to do so, but for that you will have to put the code here , else if its just one occasion, try replicating it. Are you using CSS control adapter by any chance.

If the answer above helped do not forget to mark so.

Thanks

Watermark Extender Validation error

I have a textbox with an ajax watermark extender attached to it. As well as a required feild validator. One button on my page is "CauseValidation = true". Before i applyed the watermark extender the validation check worked perfectly, but now the validation check doesnt work as i think it see`s the watermarktext as text in the textbox, is there any way around this? si!

Hi blink18jew,

Would you mind posting your simple source code here?


sure its like this :

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TestBox" ErrorMessage="ERROR"></asp:RequiredFieldValidator>
<asp:TextBox ID="TestBox" runat="server"></asp:TextBox>
<ajaxToolkit:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" TargetControlID="TestBox" WatermarkText="Watermarked..." WatermarkCssClass="water" runat="server">
</ajaxToolkit:TextBoxWatermarkExtender>

the watermark seems to ruin the validation checks...si!


Hi blink18jew,

I'm afraid that I cannot reproduce your problem.Here is my test sampe based on yours. It works fine locally.

Aspx:

<%@. Page Language="VB" %><!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"></script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Water Mark</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TestBox" ErrorMessage="ERROR"></asp:RequiredFieldValidator> <asp:TextBox ID="TestBox" runat="server" CausesValidation="true"></asp:TextBox> <ajaxToolkit:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" TargetControlID="TestBox" WatermarkText="Watermarked..." WatermarkCssClass="water" runat="server"> </ajaxToolkit:TextBoxWatermarkExtender> <asp:Button ID="Button1" runat="server" Text="Button" /> </form></body></html>

So would you give us more details including source code or error information? If you can help us reproducing your problem step by step, it will be greatly appreciated.

By the way, did you use your Validator in a UpdatePanel? If yes, maybe you can benefit from this thread: http://forums.asp.net/t/1066821.aspx

Hope it helps.


no worries it was only to get it looking a bit more professional im just not guna use it, but thanks for your time! si!


Hi blink18jew,

Would you do a test with my sample code to find out the exact root cause for this problem ? If we can find the solution, our community members will benefit from our work then.Thanks, Surprise


Tongue Tied it worked... lol, i duno what was going on cos i tryed my olde code and that still didnt work... haha, oh well, ill mark it as answer! thanks.

WCF 3.5 ajax webservice compilation error

I had AJAX ScriptService, which I converted to WCF 3.5 webservice.

Everything works fine for some time, but after a while (maybe after session timeouts or IIS recycles process) it stops working, and I get this error in Event Log:

WebHost failed to process a request.
Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/19949373
Exception: System.ServiceModel.ServiceActivationException: The service '/ve/MapService.svc' cannot be activated due to an exception during compilation. The exception message is: Could not load file or assembly 'App_Web_nao50rcd, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.. --> System.IO.FileNotFoundException: Could not load file or assembly 'App_Web_nao50rcd, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'App_Web_nao50rcd, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
-- End of inner exception stack trace --
at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)
Process Name: w3wp
Process ID: 2480

Webservice is using sessions and the code is inside /App_Code/ folder.

Any suggestions?

I tried to disable ASP.Net compatibility mode (required for sessions) and then everything works fine for MUCH longer (maybe 8 hours?), but after a while i still get the same error.


Can you please show the WCF configuration as well as how you're registering the service in the webapp.


web.config:

<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/></sectionGroup>
</sectionGroup>
</sectionGroup>

<system.web>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
<add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
...
</system.web>

<compilation debug="true" defaultLanguage="c#">
<assemblies>
<add assembly="System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies>
</compilation>

<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<remove name="ScriptModule"/>
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<handlers>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<remove name="WebServiceHandlerFactory-Integrated"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</handlers>
</system.webServer>

<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="OptionInfer" value="true"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>


<system.serviceModel>
<bindings>
<webHttpBinding>
<binding name="jsonBinding" maxReceivedMessageSize="655360" />
</webHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="MapServiceAspNetAjaxBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="metadataSupport">
<serviceMetadata httpGetEnabled="true" httpGetUrl="" />
<serviceDebug includeExceptionDetailInFaults="true" />
<dataContractSerializer />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<services>
<service behaviorConfiguration="metadataSupport" name="MapService">
<endpoint address="" behaviorConfiguration="MapServiceAspNetAjaxBehavior"
binding="webHttpBinding" bindingConfiguration="jsonBinding" contract="MapService" />
</service>
</services>
</system.serviceModel>

MapService.svc:

<%@.ServiceHostLanguage="C#"Debug="true"Service="MapService"CodeBehind="~/App_Code/MapService.cs" %>

MapService.cs:

[ServiceContract(Namespace = "SCi", Name = "MapService")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
public class MapService { ... }


Also - same error happens when running on IIS or VS built-in ASP.Net Development Server...


do you find the problem?


I think the problem is related to IIS7 - cause seems like problem is happening only on my dev machines which are running Vista Ultimate 64 bit. Though few times it happened on Windows 2003 Server x32, but it does not happen all the time like on Vista.

Wednesday, March 21, 2012

web is not define or other error!

Default.master:

<head runat="server">
<asp:contentplaceholder runat="server" ID="ScriptIncludes">
<atlas:script ID="Script1" runat="server" Path="~/ScriptLibrary/AtlasCompat.js"
Browser="Mozilla" />
<atlas:script ID="Script2" runat="server" Path="~/ScriptLibrary/AtlasCompat.js"
Browser="Firefox" />
<atlas:script ID="Script3" runat="server" Path="~/ScriptLibrary/AtlasCompat.js"
Browser="AppleMAC-Safari" />
<atlas:script ID="Script4" runat="server" Path="~/ScriptLibrary/AtlasCore.js" />
<atlas:script ID="Script5" runat="server" Path="~/ScriptLibrary/AtlasCompat2.js"
Browser="AppleMAC-Safari" />
<atlas:Script ID="Script6" runat="server" Path="~/ScriptLibrary/AtlasRuntime.js"/>
<atlas:Script ID="Script7" runat="server" Path="~/ScriptLibrary/Atlas.js" />
</asp:contentplaceholder>
<link href="http://links.10026.com/?link=style.css" type="text/css" rel="Stylesheet" />
<asp:contentplaceholder runat="server" ID="Head" />
</head>

aspx:

<%@dotnet.itags.org. Page Language="C#" MasterPageFile="~/MyMain.master" Title="我的导航页" %>
<%@dotnet.itags.org. Import Namespace="System.Configuration" %>
<%@dotnet.itags.org. Import Namespace="System.Web.Security" %>
<%@dotnet.itags.org. Import Namespace="System.Data.SqlClient" %>
<%@dotnet.itags.org. Import Namespace="System.Web.Services" %>
<script runat="server">

[WebMethod]
public string ShowContent(string myId)
{
return myId;
}

</script>

....

<script type="text/javascript">
function showContent(id)
{
if(document.getElementById(id).style.display=="none")
{
//document.getElementById(id).innerHTML =
PageMethods.ShowContent(id,onComplete);
document.getElementById(id).style.display="";
}
else
{
document.getElementById(id).style.display="none";
}
}
function onComplete(ret)
{
document.getElementById(id).innerHTML = ret;
}
</script>
</asp:Content>

run is error:web is not define!

<script type="text/javascript"><!--var PageMethods = { ShowContent:function(myId,onMethodComplete, onMethodTimeout, onMethodError) {return Web.Net.PageMethodRequest.callMethod("ShowContent",{myId:myId}, onMethodComplete, onMethodTimeout, onMethodError); }}

if I write code to asmx,and i call it in aspx:

<script type="text/javascript" src="http://pics.10026.com/?src=AboutContent.asmx/js"></script>

<script type="text/javascript">
function showContent(id)
{
if(document.getElementById(id).style.display=="none")
{
//document.getElementById(id).innerHTML =
Samples.AspNet.AboutContent.ShowContent(id,onComplete);
document.getElementById(id).style.display="";
}
else
{
document.getElementById(id).style.display="none";
}
}
function onComplete(ret)
{
document.getElementById(id).innerHTML = ret;
}
</script>
</asp:Content>

run is error:

type is not define:

Type.registerNamespace('Samples.AspNet');
Samples is not define!
why?
please help me how to do!!
thanks !!!
 
In order to this question I did several weeks, helped me, did I have how to solve this problem?

I already solved this problem, extremely thank the time which but I like this did:

alert(Samples.AspNet.AboutContent.HelloWorld());

Returns:[object object]

I must like this write:

alert(Samples.AspNet.AboutContent.HelloWorld(onComplete));

...

function onComplete(ret)

{

alert(ret);

}

If I do not want to write: onComplete, do I have how to do only then can obtain WebService return value? Please advises, extremely thank


please help how to do!!

thanks!!


Now again has the similar problem pulls!

my code is:

var tdId = null;
function showContent(contentid)
{
//myid = "'"+myid+"'";
var aa = document.getElementById(contentid).style.display;
if(aa=="none")
{
tdId = contentid;

alert(tdId);//Here is correct
MyDream.AboutContent.ShowContent(contentid,onAComplete);
}
else
{
document.getElementById(contentid).style.display="none";
}
}

Yesterday all was good, how now again has the problem pulls? Why? May advise me? Extremely thank

web method error in cascadingDropdown

i am trying to use the cascading dropdownlist control, using a web service to get items from a database. the web method works fine, but i get a web method error 404 or 500. any help in solving this would be greatly appreciated.

Hi, mnyats.

I solved right now (telling the true, in this exact minute) a problem I was facing that was generating this same error message. In my case the problem was:

1 - I was trying to make cascadingDropDown to work with no service; (I guess it's possible but all the samples I got on the web says no)

2 - On the call of my service, inside my aspx page, I forgot to include the full namespace of the service;

3 - The service was with the attribute: <System.Web.Script.Services.ScriptService()> commented.

I don't know which problem are you having now, but I hope this can help...

See you!@.!

<mnyats> escreveu na mensagemnews:1966118@.forums.asp.net...

i am trying to use the cascading dropdownlist control, using a web service to get items from a database. the web method works fine, but i get a web method error 404 or 500. any help in solving this would be greatly appreciated.

http://forums.asp.net/p/1172554/1966118.aspx#1966118


Hi,

I think Fiddler is a good choice for you to trouble shooting. Please refer to this thread: http://forums.asp.net/t/1172379.aspx

Web Methodst that returns DataTable gives me exception error " "circular reference was det

Hello,

I am getting this error "circular reference was detected while serializing an object of type". The Method GetRecords() is a function that returns DataTable type.. It happens the same thing when i return DataSet as well.

Any help?

Thanks

function GetStatusRecord() {

// Invoke the Echo method on the server.

PageMethods.GetRecords('1', onComplete);

debugger;

// Callback function.

function onComplete(result) {

// Display the echoed string.

alert(result);

}

returnfalse

}

The latest version of Asp.net Ajax no longer allows to serialize DataTable and DataSet anymore.


you are probably right, i havent updated asp.net ajax for about 6 months.

Web Part PartChromeType.None Causes Zone_ToggleDropCues Function Problem

Using the Atlas March CTP, I receive an error using it's webpart stuff.

It is in "function Zone_ToggleDropCues(show, index, ignoreOutline)"

this.initialize = function() {
Sys.UI.Controls.WebParts.WebPart.callBaseMethod(this, "initialize");

_titleElement.detachEvent("onmousedown", WebPart_OnMouseDown);
this.element.detachEvent("ondragstart", WebPart_OnDragStart);
this.element.detachEvent("ondrag", WebPart_OnDrag);
this.element.detachEvent("ondragend", WebPart_OnDragEnd);

if (_zone.get_webPartManager().get_allowPageDesign() && _zone.get_allowLayoutChange()) {
_titleElement.attachEvent("onmousedown", Function.createDelegate(this, mouseDownHandler));
}
}


"_titleElement.detachEvent("onmousedown", WebPart_OnMouseDown);"
says that _titleElement is null.

This happens when I set the chrometype to none for the webpart.

Nathan

We should be handling the case where _titleElement is null. I've filed a bug and this should be fixed in the next release of Atlas. Thanks for reporting it.

-Mike