Showing posts with label following. Show all posts
Showing posts with label following. Show all posts

Wednesday, March 28, 2012

Page_Validator undefined Error??

Hi,

I have a jscript function calledEnableAll(). The following is the Function:-

function EnableAll()

{

alert("Hai");

EnableAllValidators(false);

EnableValidator('valreq_Salutation',true);

ShowError();

}

This i called on a button click. but only the alert message is pop_up. after that im getting this errorPage_Validators is undefined Jscript runtime error .

What was the solution for this??

How can i over come this...

Hi,

I'm not quite sure why you use this function. It seems you want to enable all validators on the page according to the name of the function.

The error is caused by an javascript exception, looks like it uses an object that doesn't exist internally. And I can't tell since I don't know your implementation in EnableAllValidators and EnableValidator function. You'd better use Visual Studio to debug your javascript to find out the reason and resolve it.

Monday, March 26, 2012

PageMethods is undefined when calling webservice from usercontrol

I have the following code to call a webservice in an aspx file. But the same code does not work in a usercontrol that I have created. I always get the message that 'PageMethods is undefined'. On the aspx page it generates the following:

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

but in the usercontrol this variable is not generated. The following is the code in the aspx page which is very similar to the code in the user control. Please help!

<atlas:ScriptID="Script1"runat="server"Path="~/ScriptLibrary/AtlasCompat.js"Browser="Mozilla"/>

<atlas:ScriptID="Script2"runat="server"Path="~/ScriptLibrary/AtlasCompat.js"Browser="Firefox"/>

<atlas:ScriptID="Script3"runat="server"Path="~/ScriptLibrary/Atlas.js"/>

<scripttype="text/C#"runat="server">

[WebMethod]

publicstring HelloWorld(string s)

{

return"Hello '" + s +"'";

}

</script>

</head>

<body>

<formid="Form1"runat="server">

Enter your name:

<asp:TextBoxid="nameTextBox"runat="server"></asp:TextBox>

<buttonid="buttonGo"onclick="return OnbuttonGo_click()">GO</button>

</form>

<scripttype="text/javascript"language="JavaScript">

function OnbuttonGo_click()

{

//textbox string value passed as a param to the server method

PageMethods.HelloWorld(document.getElementById("nameTextBox").value, OnWebRequestComplete1);

returnfalse;

}

PageMethods are currently not supported inside user controls. I've open a bug to track that issue. Thanks.


If I put the WebMethod in the calling page I can call it from the usercontrol, which allows for the functionality that I desire. This is not as clean as I hoped for but it will work.

Thanks


Has this been fixed in the December release? It appears not, unless I am doing something incorrect. I am getting the js error 'Web' is undefined. Even my work around for this problem apears to be broken.

PageMethods not found (Javascript Error)

Hey Guys,

the following is my aspx page

<%@dotnet.itags.org.PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_Default" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title>Untitled Page</title>

</head>

<body>

<formid="form1"runat="server">

<asp:ScriptManagerID="ScriptManager1"runat="server"EnablePageMethods="true"/>

<div>

<scripttype="text/javascript">

function getme()

{

PageMethods.getResults();

}

</script>

<asp:LabelID="lblText"runat="server"></asp:Label>

<inputtype="button"value="btnVal"onclick="getme();"/>

</div>

</form>

</body>

</html>

The following is my code behind

using System;

using System.Data;

using System.Configuration;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using System.Web.Services;

publicpartialclass_Default : System.Web.UI.Page

{

protectedvoid Page_Load(object sender,EventArgs e)

{

}

[WebMethod()]publicvoid getResults()

{

lblText.Text ="Sridhar";

}

}

The Current Version only support static method for Page Methods. So you cannot access the other element of the page.


Modify your page method return a string, then set lblText's value on the client side. This is an example of doing exactly that: http://encosia.com/index.php/2007/07/11/why-aspnet-ajax-updatepanels-are-dangerous/

PageRequestManagerServerErrorException 12019 12130 12031 and 12152

Any ideas what causes the following error message:

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code is:

I receive one of 4 error numbers: 12019 12130 12031 or 12152

I believe it might have to do with a content switch but not sure. Any help would be greatly appreciated.

I am getting the same Error Message with error number :12031...

Any suggestion ?


Hi,

Please refer to this:http://support.microsoft.com/kb/193625

The issue seems to be with the WinInet api, may be you can try to access it with another browser to see if it works.


Hi,

it is true that it is about Wininet api.i can access my page and can work with Another browsers but with IE 7.0 OR 6.0 i come accross with this error.(in I.E The error code is 404)..What is ur advice to solve this problem?When i launch the project without connecting to source safe,it works but after i connect to sourcesafe,this problem occurs..This error is very annoying.What should i do?Thank u very much for ur Help.(My problem doesnt depend on Data Intesivity or row count)


Raymond Wen - MSFT:

Hi, Please refer to this:http://support.microsoft.com/kb/193625

The issue seems to be with the WinInet api, may be you can try to access it with another browser to see if it works.

So, seeing this error on a partial-page update (UpdatePanel Async postback) means that the application I'm developing is not going to work with Internet Explorer? Or is this just a fluke that will go away on a restart / deployment scenario / etc.

I'm getting this one:

 12019 ERROR_INTERNET_INCORRECT_HANDLE_STATE
The requested operation cannot be carried out because the handle supplied is not in the correct state.



Hi

we had the same problem on our live-system. It was caused by SSL-Connection. If you have SSL, try turning off Keep Alive for IE.


hth


Just so you know, we did find one possible cause of this problem.

It seems to crop up sometimes if you are using IE6 supplied with MultipleIEs package.

http://forums.asp.net/t/1123365.aspx

PageRequestManagerServerErrorException, status code 504

I got the following error message on my ASP.NET AJAX web app:

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 504

What does it mean?Huh?

Hi monkeyno,

10.5.5 504 Gateway Timeout

The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI (e.g. HTTP, FTP, LDAP) or some other auxiliary server (e.g. DNS) it needed to access in attempting to complete the request.

 Note: Note to implementors: some deployed proxies are known to return 400 or 500 when DNS lookups time out.

To troubleshoot this issue, we really need the source code to reproduce the problem, so that we can investigate the issue in house. It is not necessary that you send out the complete source of your project. We just need a simplest sample to reproduce the problem. You can remove any confidential information or business logic from it.

You get the Sys.WebForms.PageRequestManagerServerErrorException whenever the aspx handler throws an exception responding to an ajax.net update panel submit. If you took away the update panels you would see the classic asp.net exception page with lots of potentially useful information like the stack trace, but since the form submit has been ajaxified you just get a generic error message through a javascript alert. For example create an aspx page with an update panel containing a button and a multiline text control with the text set to "".

monkeyno:

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server.

Clicking on the button you'll get the generic error: The status code returned from the server was: 500 Now try it again after placing the controls outside of the update panel. When you click the button you will get an exception page with details about a potentially dangerous/script-attack form value. The exception evens details a possible (though non-recommended) workaround of adding the attribute, ValidateRequest="false", to the aspx page directive. Of course for a real page it's a pain to strip out the update panels, so here is a quicker way to see the exception details. Just add the attribute, EnablePartialRendering="false", to your ScriptManager like below. Just set it back when you're done troubleshooting the issue.

Saturday, March 24, 2012

PageRequestManagerServerException

I have a callback funtion but I get the following error when I use this when the login credential has expired:

Sys.WebForms.PageRequestManagerServerException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500

I.e It tries to get information from a function that is not reachable as the user has been loged out.

If the page is reloaded i will get rerouted to the login page but as i don't reload the page and only using a callback i don't get rerouted - i only get the above error message.

Any Ideas?

You can capture the error on the client side and redirect the user there using the Javascript window.location

Seehttp://www.asp.net/AJAX/Documentation/Live/tutorials/CustomizingErrorHandlingforUpdatePanel.aspx for handling errrors from the UpdatePanel; if you are using PageMethods seehttp://www.singingeels.com/Articles/Using_Page_Methods_in_ASPNET_AJAX.aspx for capturing errors.

-Damien


Try to capture asynchronous post back error as the follow.


ScriptManager.AsyncPostBackError += new EventHandler<AsyncPostBackErrorEventArgs>(ScriptManager_AsyncPostBackError);


Determine if it is asynchronous post back : ScriptManager.IsInAsyncPostBack;

Get synchronous post back error message: ScriptManager.AsyncPostBackErrorMessage;


Get asynchronous post back source: ScriptManager.AsyncPostBackSourceElementID;

Let me know if this helpful to you

Wednesday, March 21, 2012

Parameters... :(

Hi,

I have a menu with divs (items)...and I want to make one function to handle all menu items..

I have the following code:

var sCurrentPage = "";

<font size=2></font></p><p><font color=#0000ff size=2>function</font><font size=2> MouseClick(sender)
{
</font><font color=#0000ff size=2> if</font><font size=2> ($(sCurrentPage))
$(sCurrentPage).style.backgroundColor = </font><font color=#800000 size=2>"#FFFFFF"</font><font size=2>;
</font><font size=2>
sCurrentPage = sender.get_id();
$(sCurrentPage).style.backgroundColor = <font color=#800000 size=2>"#BBBBFF"</font><font size=2>;
</font></font><font size=2>}</font></p><p><font size=2></font>...</p><p>//my atlas script</p><font size=2><p><label id=</p></font><font color=#800000 size=2>"MenuItemNutriente"</font><font size=2>>
</font><font size=2><behaviors>
<clickBehavior </font><font size=2>click=</font><font color=#800000 size=2>"MouseClick"</font><font size=2> />
</behaviors>
</label><p></p></font>

The "sender" parameter is allways the clickBehavior object. How can I get the Label object that are firing the event?

thanx :)

I'm having trouble parsing all the HTML formatting above - does this question involve the Atlas Control Toolkit?

Parser Error <atlas:ScriptManager ID="sm" runat="server" EnablePartialRendering="True"&

I am getting the following error, and I have no idea where it is coming from, can anyone point me in the right direction please?

Line 31: </asp:DropDownList><br />Line 32: <br />Line 33: <atlas:ScriptManager ID="sm" runat="server" EnablePartialRendering="True">Line 34: <Scripts>Line 35: <atlas:ScriptReference Path="../../Includes/TextChangedBehavior.js" />

Rich

Can you provide a little more information please. Be a little more detailed.

From the looks of it...why are you using ATLAS? Upgrade to AJAX's newest version. One thought could be to Reigster your Toolkit at the top of your .aspx page.

Thanks,


Double checking your web.config should probably be the first step. Are you actually running the older, Atlas version or is that just the tag prefix you chose?

Make sure you have this line in your web.config:

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

You can check the rest of your web.config against these guidelines: http://www.asp.net/ajax/documentation/live/ConfiguringASPNETAJAX.aspx

Parser Error I got from the server

The website worked on my machine, but after I uploaded it to the server, I get the following error.

Server Error in '/' Application.

Parser Error

Description:Anerror occurred during the parsing of a resource required to servicethis request. Please review the following specific parse error detailsand modify your source file appropriately.
Parser Error Message:Could not load file or assembly 'Microsoft.Web.Atlas' or one of its dependencies. The system cannot find the file specified.
Source Error:

[No relevant source lines]


Source File: none Line: 0
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Web.Atlas' could not be loaded.

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].



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
--
Does anyone have some idea for this?
Thanks
I get this same error. What could it possibly be?

This is with the new December release. I double checked all my files are on the server, and correct. It is an asp.net 2.0 server.

I'm confused.
Here is the reason for these issues, although different AJAX implementations will give different errors.

I emailed godaddy.com, and sitepuppy.com (which i think is just another frontend for godaddy.), and got this reply from them:

Thank you for contactingCustomer Support. Unfortunately, we do not support the use of the AJAXhandler bundle, although we do have some limited capacity to allow theuse of java scripting. If you need to be able to use AJAX, might Irecommend the dedicated or virtual dedicated server options which wouldallow you to install whatever you like onto the operating system of theserver box. We have to keep the shared hosting servers relativelysimplified for the sake of the many different customers they each hold.We apologize for the inconvenience. Please let us know if we can helpyou in any other way.

Make sure you contact whoever it is you want to have host your sites before you try any implementation of AJAX to play around with.

I have tested, and godaddy does not work with AJAX.NET, and any others (including ATLAS).

(this is with shared hosting, btw).

It should run fine on your server, as long as you also upload Microsoft.Web.Atlas.dll. It doesn't need to be in the GAC (Global Assembly Cache) nor do you need to install anything else outside your webapplication. Just make sure you upload the Microsoft.Web.Atlas.dll inside the /bin directory in the root of your site.
I have a working version ofhttp://how2xbox.com/xbox using swirlhost's AJAX driven chatroom. It works well for the most part and it is on a go daddy hosting account.

Parser Error Message: The entry ScriptModule has already been added.

On my development system everything is running fine, when i publish to my beta server (SBS 2003 - *no* VS installed) I get the following error:

Parser Error Message: The entry 'ScriptModule' has already been added.

Removing this line resolves the issue but then presents me with various errors relating to not being able to load System.Web.Extensions... If i can understand why the first issue is occuring this would help! Any clues?

Hi,

I have exactly the same happening on my server, does anyone have a fix for this ?

Thanks
James

This can happen if there are two HttpModules named "ScriptModule". This can mysteriously happen if you are running a virtual directory under an asp application that already has the module defined. You can either remove the HttpModule declaration<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> from the VD web.config, or all a remove node

<remove name="ScriptModule" />

just before adding it back.


Hi,

Excellent, thanks for the heads up.

James


That was an excellent post. Thank you for your help !

Sam


This suggest is not working for me again and again the same error only i am getting is there any other solution

please let me know soon......

Partial rendering issue with AJAX

I have following code working fine with ATLAS with partial rendering in IE and Firefox. But after I move the app to AJAX beta 1.0, it causes the the whole page rendering with Firefox 2.0 but it works fine with IE 6.x.

function setID(myID)
{
opid = document.getElementById ('<%=txtMyID.ClientID%>');
opid.value=myID;
document.getElementById('<%=ibtnMyButton.ClientID%>').click();
}

The page looks like:

<asp:UpdatePanel ID="UpdatePanel1" RenderMode="Inline" UpdateMode="Conditional" runat="Server">
<ContentTemplate>

<asp:UpdatePanel ID="UpdatePanel2" RenderMode="Inline" UpdateMode="Conditional" runat="Server">
<ContentTemplate>

<asp:TextBox ID="txtMyID" runat="server" ></asp:TextBox>

<asp:ImageButton ID="ibtnMyButton" runat="server" ImageUrl="../Images/go.gif"></asp:ImageButton>
........

</ContentTemplate>
</asp:UpdatePanel>

</ContentTemplate>
</asp:UpdatePanel>

How to solve this issue?

Try to change your codes as the following.
<asp:UpdatePanel ID="UpdatePanel1" RenderMode="Inline"ChildrenAsTriggers="false" UpdateMode="Conditional" runat="Server">
<ContentTemplate>
<asp:UpdatePanel ID="UpdatePanel2" RenderMode="Inline"ChildrenAsTriggers="false" UpdateMode="Conditional" runat="Server">
<ContentTemplate>
<asp:TextBox ID="txtMyID" runat="server" ></asp:TextBox>
<asp:ImageButton ID="ibtnMyButton" runat="server" ImageUrl="../Images/go.gif"></asp:ImageButton>
........
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</asp:UpdatePanel>
Wish the above can help you.
Thank you, Jasson, It works.