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

Wednesday, March 28, 2012

different version of AJAX

Dear All,

I and my friend are working on similar project.we installed the same VS 2005 version and SP1 and AJAX.my program has error.

it couldnt loadSystem.Web.Extensions does it cause by different version of AJAX?

or any other reason?

how can I fix this error?

<tagMapping>

<add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="System.Web.UI.Compatibility.CompareValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">

<addtagType="System.Web.UI.WebControls.CustomValidator"mappedTagType="System.Web.UI.Compatibility.CustomValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<addtagType="System.Web.UI.WebControls.RangeValidator"mappedTagType="System.Web.UI.Compatibility.RangeValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<addtagType="System.Web.UI.WebControls.RegularExpressionValidator"mappedTagType="System.Web.UI.Compatibility.RegularExpressionValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<addtagType="System.Web.UI.WebControls.RequiredFieldValidator"mappedTagType="System.Web.UI.Compatibility.RequiredFieldValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<addtagType="System.Web.UI.WebControls.ValidationSummary"mappedTagType="System.Web.UI.Compatibility.ValidationSummary, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

</tagMapping>

Have you tried to re-install the AJAX library again?


of course I tried to re-install AJAX but nothing happenedConfused


Sorry that I asked, but sometimes those are the common errors. Also are you sure that you installed 1.0 instead of 3.5?


As I saw in the version tab it is 1.0.does it cause trouble to install version 3.5 instead of 1.0?(if my problem is solved in this case)


hello.

well, the validators are not on the system.web.extensions assembly. I think that they're on the validators dll:

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

btw, if you update your app to use the new version, i think that you no longer need to use those validators.

Monday, March 26, 2012

DetailView and UpdatePanel

Hi,

I'm having an error trying to put a GridView visible from a Ok button placed in a DetailView control template and an updatepanel. It says that I can not add an invalid control Id to the trigger.

Can somebody help me on that?

Idea

hello-

how are you getting the id of the button? i think that you might not be getting a reference to the button...


Of course it is, the problem is that the control is inside a grid view template, so I want to see how I can reference that control in a way that the updatepanel can see it.

Here is my code

<atlas:UpdatePanelID="UpdateGridUsers"runat="server">

<triggers><atlas:controleventtriggercontrolid="ButtonCancel"eventname="ItemCommand"/></triggers>

I have the code placed for the trigger. The button name is Button cancel, but it is inside of a template in the DetailView like this

<InsertItemTemplate><asp:ButtonID="ButtonInsert"runat="server"CausesValidation="True"CommandName="Insert"Text="Insert"/> <asp:ButtonID="ButtonCancel"runat="server"CausesValidation="False"CommandName="Cancel"Text="Cancel"/></InsertItemTemplate>

Detailed error messages with AJAX?

I'm building the front and back ends of a website and my issue is that when an error occurs in a section that is "ajaxed", the error is displayed in a javascript pop-up.

Is there any way that I can have it at least display a line number of the file causing the error? It's driving me crazy to debug, especially when I have dozens of classes working together. Please help. Thanks!

Ryan

Hi Ryan,

There are some good articles out there on the error handling in AJAX, but probably the first thing you need to do is to use the OnAsyncPostBackError attribute of the ScriptManager tag to add an event handler - allowing you to log the exception, or do something else with it.

Then you can start looking at supressing the alert, etc.

ScottGU's blog has a post which might be a good starting point when you want to go into a bit more depth, and produce a response which is more aimed at the users than developers!


You canadd custom handling of async errors pretty easily.

In that example, check out args._error for more details. _error.lineNumber and _error.stack might be helpful to you.

Designer rendering error for UpdateProgress control, cant find ScriptManager

My page includes a scriptmanager right at the top, as always. I have a detailsview that includes a couple of TemplateFields that contain in the ItemTemplate, updatePanels. Each updatePanel contains a label, button, and UpdateProgress control. In the design mode the designer gives the error for the detailsView, "There was an error rendering a control. The Control with the ID 'UpdateProgress1' requires a ScriptManager on the page. The Script must appear before any controls that need it."

Here is an example of the Template field:

<asp:TemplateField HeaderText="BadLogistics"> <ItemTemplate> <asp:UpdatePanel ID="UpdatePanelBL" runat="server"> <ContentTemplate> <asp:Button ID="BLButton" runat="server" OnClick="BLButton_Click" Text="Get number of Files" /> <asp:UpdateProgress ID="UpdateProgressBL" runat="server" AssociatedUpdatePanelID="UpdatePanelBL" DisplayAfter="1"> <ProgressTemplate> <asp:Image ID="ImageBL" runat="server" ImageUrl="~/images/ajax-loader.gif" /> </ProgressTemplate> </asp:UpdateProgress> <asp:Label ID="BLLabel" runat="server"></asp:Label> </ContentTemplate> </asp:UpdatePanel> </ItemTemplate> <HeaderTemplate>Bad Logistics Status PDSF Files in the last <asp:Label ID="BadLogisticsMins" runat="server" ForeColor="Red"></asp:Label> Minutes </HeaderTemplate> </asp:TemplateField>

Am I doing anything wrong here? I'm pretty new to Ajax. The website runs fine, but the designer just shows this error instead of the fields. How can I fix this? Is this an unsupported use?

Just to be clear, the script manager is the first control inside the form, and no master pages are being used. I don't understand why it can't find the ScriptManager that is clearly on the page right above the detailsview. Any Ideas?

Thanks for the help in advance!

Hi BenderM,

You mention the error states that the updateprogress ID is UpdateProgress1, but your sample code shows it to be calledUpdateProgressBL

Please include the CODE containing the UpdateProgress control with the ID UpdateProgress1.

Thanks,

wil


Sorry about that, the error stats UpdateProgressPP instead of UpdateProgress1. Here is the code containing that UpdateProgressPP, it is alost exactly the same as UpdateProgressBL:

<asp:TemplateField> <ItemTemplate> <asp:UpdatePanel ID="UpdatePanelPP" runat="server"> <ContentTemplate> <asp:Button ID="PollpathButton" runat="server" OnClick="PollpathButton_Click" Text="Get number of Files" /> <asp:UpdateProgress ID="UpdateProgressPP" runat="server" AssociatedUpdatePanelID="UpdatePanelPP" DisplayAfter="1"> <ProgressTemplate> <asp:Image ID="ImagePP" runat="server" ImageUrl="~/images/ajax-loader.gif" /> </ProgressTemplate> </asp:UpdateProgress> <asp:Label ID="PollpathLabel" runat="server"></asp:Label>  </ContentTemplate> </asp:UpdatePanel> </ItemTemplate> <HeaderTemplate> <div style="width:200px"> # of files in Pollpath, created in the last <asp:Label ID="PollpathMins" runat="server" ForeColor="Red"></asp:Label> Minutes </div> </HeaderTemplate> </asp:TemplateField>
I hope that helps.

hey benderm,

I cant see where the problem is. I dont want you to do this until you are certain all other options have been tried, but I helped someone a couple days ago that had a problem where something using Ajax just didn't make any sense and he fixed it by downloading the latest build of Ajax 1.0 (I think he said the latest was only a couple months old).

That or reinstall VS servicepack 1!Embarrassed

Sorry I nothing else for you.


I see this problem when I use master pages....Huh?

I am using the newest build of ajax.

i reinstalled Vs2005 SP1 and still am getting the designer message


Did you ever solve this problem? I am having the same issue.


Anyone? Anyone? this problem still persists with VS2008 RTM (.NET2.0)

Saturday, March 24, 2012

deploying my ajax app

hey all,

i have a brand new windows 2003 server that i'm trying to deploy my ajax app to and i'm getting an error with the web.config. is there anything special i need to do to the server for my app to work?

thanks,

rodchar

hello.

well, you just need to install the asp.net ajax toolkit and configure your web app so that it uses asp.net 2.0.


Thank you.


hello again.

~sorry...in the previous post i meant the asp.net ajax extensions and not the asp.net ajax toolkit :) btw, both are available on the download section of the ajax.asp.net site.

Deploying AJAX project to Development Server

In deploying my AJAX application to a development server, I'm getting the following error:

Parser Error Message:Could not load file or assembly 'System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
<add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

Do I need to add extensions on the server itself? I have the AjaxControlToolkit.dll & .pdb files in my Bin folder. Is there more to it?

You can remove that line.

It was a by-product of adding a particular build of the Toolkit to your project. It's related to design-time improvements and not necessary for deployment.

Dependent Dropdown + AJAX Error

Hello Friends

I have gone mad with this problem.

For this i am unable to continue with my project........

So plz help me.........

I have input form where........

I have two drop down in a .aspx page .

When I change the first dropdown the secound dropdown takes its vales form the database and poputate it using ajax.

All this is happening cool.......

But when i try to save the values to the data base it shows the following error......

Server Error in '/Equill_Web_v2' Application.

Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@dotnet.itags.org. Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.ArgumentException: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@dotnet.itags.org. Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[ArgumentException: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@dotnet.itags.org. Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.]
System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) +2127900
System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument) +106
System.Web.UI.WebControls.DropDownList.LoadPostData(String postDataKey, NameValueCollection postCollection) +55
System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +11
System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +408
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3776



Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

I have tried this also

ddlParentLocation.Attributes.Add("onchnage", Page.ClientScript.GetPostBackEventReference(ddlParentLocation, "Select$" + ddlParentLocation.SelectedIndex.ToString, True))

But this of no use to me till now.........

Please help........

Well, for some reason, what you did is considered an invalid postback.

You can solve this problem in three ways:

1. In your web.config file, under system.web insert the following:
<pages enableEventValidation="false"/>

2. Get the data only to the client and add the items in javascript to your dropdown lists

3. Do the same using CascadingDropdownList from AjaxToolkit, this would save a whole bench of javascript to implement solution 2.



Thanks Vinija

The option 1 and 2 is not working but i am considering the third option.

But I am not really getting how to implement it.

Still i m reading few articles to get it done.Yes

Thanks

Amit Yes


I first try to add

<%@. Page ... EnableEventValidation="false" %>

the specific page which show the error, not to the web.config. This always works for me when I change a server side dropdownlist collection in the client side by javascript.


Vinija:

Do the same using CascadingDropdownList from AjaxToolkit, this would save a whole bench of javascript to implement solution 2.

Won't work, CascadingDropdownList also needs enableeventvalidation=false


Hi dev,

If you are facing this problem so please write EnableEventValidation="true" in the line

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" EnableEventValidation="false"%>

It will help you.

Thanks

Swapnil

"If it is working so please "mark as answer""


swapnil.malviya:

If you are facing this problem so please write EnableEventValidation="true" in the line

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" EnableEventValidation="true"%>

It will help you.

You mean EnableEventValidation="false" right?


Yes.

deloyment = true

as soon as i place this in my code i get an error. then i take it out to see the error but it works fine. what can cause this? this occours on every page too.

hello.

could you be a little more specific? what are you trying to do? where do you put that?