Showing posts with label toolkit. Show all posts
Showing posts with label toolkit. Show all posts

Wednesday, March 28, 2012

Asp.net Ajax Toolkit

Hi, i'musing Ajax 'DynamicPopulateExtender' to show the search results on my page. This is working fine when the search has results. errors 'Web service call failed : 500' when no results found. Can someone help me out?

Hi,

According to your description, this is quite probably caused by your code in the web service. It would be easier to solve it if you debug through the web method since we don't have any idea how your code goes.


Thanks. This is occuring bcz of unhandled exception in the webservice code.

ASP.NET AJAX ScriptManager

Hi,

I am a total newbee to whole AJAX as well as Javascripting in general. I just installed the ASP.NET AJAX Extensions and Toolkit and I was watching couple of videos on this site. The first video mentioned something about only having 1 instance of the ScriptManager..?

This is how we develop at the moment. We have a general page on which we just drop ASCX (User controls). Each control has thus it's own Load event and all along with it's own design with few controls in it.

So where do I need to drop this ScriptManager control? On every ASCX file?

Cheers,

Nirav Patel

Nirav,

If you have a MasterPage in your website, and you'll be using AJAX on every page then the MasterPage is theonly place where you would drop the ScriptManager control.

Otherwise, you would drop the ScriptManager control to your "general".aspx page.

Let me know if you need more info.


Thanks for a quick reply.

We don't have a master page type of setup nor we have a general page.

What we have is a template where we define section of the page like "header", "content" (this might have "left" for menu, "middle" for contect, "right" for ads), "footer". Then ASCX are inserted into those sections as required.

So can I just modify the template and add the ScriptManager at the top?

Cheers :)


niravpatel:

This is how we develop at the moment. We have ageneral page on which we just drop ASCX (User controls).

The term 'general page' I used because you used it in your original post.

The fact is that there can only be one instance of ScriptManager control per page. This is why you must place the ScriptManager control in a parent .aspx page. If the user controls need to reference a script or a service, then you can use ScriptManagerProxy control in your .ascx controls.


Hiniravpatel,

You should add it after the <form> tag.

<html>
<headrunat="server">
<title></title>
</head>
<body>
<formid="form1"runat="server">
<asp:ScriptManagerID="ScriptManager1"runat="server"></asp:ScriptManager>
</form>
</body>
</html>

Otherwise you will get the following error:

Server Error in '/' Application.
------------------------

Control 'ScriptManager1' of type 'ScriptManager' must be placed inside a form tag with runat=server.

Cheers,
Al

Monday, March 26, 2012

ASP.NET Ajax Control Toolkit in different browsers

This toolkit seems to be incredible, better than a lot of packaeg offered (charged) by 3rd providers. I am only concerned all these controls will behave accordingly in any browser chosen, from IE 6, 7 to Firefox. Has anyone done tests, or used them in production?

I have tested most of the controls, and use them in my production environment, with many browsers (FF 1.5(OSX, Windows), FF2(OSX, Windows), IE 6, IE 7, Opera 9(OSX, Windows), Safari (OSX)). They all worked fine. Microsoft has gone through alot of trouble to see that they do. :)


This is nice to hear, if you dont mind, a nice list table with the results of your findings with respect to the various browsers.

I am working on creating webparts ( custom composite controls , DLLS , what ever you call them) to use AJAX.NET extensions and the "unsupported" Ajax.NET ControlToolkit and I must say the behaviour is NOT as rosy as it may be when using the controls in the WYSIWYG drop-n-drop way of the VS designer.

behaviour varies from IE6 to IE7, even on mozilla


You talked about "drag & drop′", considering u r working with webparts. Actually I know there is one of the toolkit components that is able to be dragged, the others AFAIK are not able to such a task. So as for this problem you mentioned, you were referring particularly to this case with webparts ?


Hi,

When developing webparts as custom composite or server controls, drag-n-drop is not an option as the WYSIWYG editors such as VS2k3 or WS2K5.

And yes, I am referring specifically to WebParts using ASP.NET 2.0 WebParts class and also using AJAX.NET extensions and AJAXControlToolkit extenders etc.

To be clear i am talking about the behaviour of coded webparts ( not user controls such as ASCX stuck into a webpart zone) such as overriding CreateChildControls and RenderContents or Render where the layout and lifecycle of the objects are different when laying out objects on an ASP.NET webpage or webpartpage.

Anyways, its an uphill battle. Right now I want the AlwaysVisibleControl Extender ( if thats the "correct" name) to work properly in a custom ajaxified webpart (DLL). This is where the browse side problem appears.

This is why I createdhttp://forums.asp.net/t/1128326.aspx a while back with no feedback from anyone. Oh well, i will figure it out eventually.

ASP.NET AJAX Control Toolkit & UpdatePanel

All seems to me that ASP.NET AJAX Control Toolkit has a builtin feature that is able to deal by itself with all Ajax issues. That said, then wouldnt we need to use UpdatePanel anymore, since all these controls know how to deal with Ajax?

it is true that the control toolkit controls can update properly on their own. Like how you can use a calendar extender without needing it to be in a update panel with a textbox, they can both just be on the form. I still tend to user panels though simply because it helps me group sets of controls and visually makes it easy to see what kind of results i should expect when i know what controls are bound to what area on the screen. Using update panels has never cause me any extra problems so i stick with it


My fear is to make things redundant, and worse, degrade performance, since there would be 2 types of ajax treatment. One, dealt by UpdatePanel, and the other dealt by the control itself...

if you have you page up and running no problem without the use of update panels, then there is no need for them. It really comes down to how you have stuff set up I guess. I have pages with a lot of dynamically created controls like tables that are all updated individually (for when users edit them). And some of the editing features might include a calendar extender, so I would include that extender inside of the update panel that my table is in to group the controls because the interact with each other. But like i said, if your pages are set up in way that they work without update panels, then no worries :)

ASP.NET Ajax Control Toolkit - Firewall blocking TabContainer

Hey there,

First thing's first - if this is posted in the wrong forum, I apologize. Next...

I've got an ASP.NET AJAX application developed with VS 2008 Beta 2, using the 3.5 version of the Ajax Control Toolkit - when deploying it to our web server, something interesting happens. If I access the site through a machine on the same network as the web server, it renders fine. However, if I access it from another network, or through the internet, the TabContainer is not rendering.

I checked out the reason why, and it appears that our firewall is blocking the client's ability to download the WebResource.axd file associates with the Ajax Control Toolkit - what else is interesting is that I'm also using FreeTexBox on this page (which downloads a seperate WebResource.axd file, and can access it without any problem).

If anyone has any suggestions, or has run into this problem in the past, please let me know. Thank you!

Anthony

32 views and no responses?

Wow...either I didn't explain it well enough, or nobody's run in to this.

Can anyone let me know which is the case?

Thanks.


Well, if you want comments, here is mine.. I always read anything related to the tabs since I use them a lot...

But sorry, never run into this, works fine on my laptop and the corporate machines (that have high security)... And firefox, ie 6-7...

- Have you tried with another machine, that is not on same network as webserver + where you can test different firewalls/settings?

- Also, are you sure the tabs are to blame? Is everything on your web app from the same domain?

It could be so many different things...Tongue Tied


Yeah I had a similar issue. We use an Aventail product (now SonicWall I believe) to allow users to login securely to our network over the net. It was configured in a way that was stopping that WebResource.axd file from being downloaded.

It seems that the issue is with your firewall. If it is blocking the file then there is little you can do. We configure our firewall\Aventail product to be a little less stringent so that the file is now downloaded and the asp.net ajax apps work fairly well. There are still other issues.

So I think you need to talk to your Network Admin people...?


Hi Anthony,

Why not use a debugging tool such as Web Development Helper,Fiddler and Firebug(used on Firefox) etc? They will help you on detecting all the downloaded items.

Best regards,

Jonathan


Jonathan Shen – MSFT:

Hi Anthony,

Why not use a debugging tool such as Web Development Helper,Fiddler and Firebug(used on Firefox) etc? They will help you on detecting all the downloaded items.

Best regards,

Jonathan

Thanks for the suggestion - that's the point of my query, however. I do in fact know that the file is not being downloaded, I'm just trying to determine what changed between the AJAX Toolkit for VS2005 and the toolkit that's compatible with 3.5 (VS 2008) that's causing it to be filtered by our firewall. It seems odd to me that it would work with a prior release, yet not with the new version.


After some more debugging, I think I may have determined the reason why the ScriptResource.axd files are not being downloaded - it appears that they are using a Content-Type of application/javascript, where WebResource.axd (downloaded without any problems) uses Content-Type application/x-javascript.

Additionally, I checked older projects built on VS 2005 .NET 3.0, and the ScriptResource.axd files there use Content-Type text/javascript.

So the question then becomes: Why in the world was the Content-Type changed to something which isn't successfully downloading?

Thoughts?


Alright, for anyone who searches this post in the future, here's the solution that we just implemented and tested:

First of all, we checked the content type of the files that weren't coming through to the client when it was posted to the web using Fiddler2 (http://www.fiddlertool.com/fiddler/).

When we checked the remote site, Fiddler showed that the files were forbidden. I checked it through localhost to see that the Content-Type was application/javascript.

Then, we checked our firewall. We had both application/x-javascript, and text/javascript, but no application/javascript!

We updated the configuration file for the firewall to include application/javascript content-types, uploaded it, and tested the site again - Voila, the Ajax Control Toolkit now works with Visual Studio 2008 and the 3.5 framework.

Thanks everyone for their help with this, much appreciated.

ASP.NET AJAX 1.0 Beta - Unable to use asp:ScriptManager in Control Toolkit and samples

Hi All,

I have uninstalled all the ATLAS related things using “Add or Remove Programs” and installed ASP.NET AJAX 1.0 Beta in the following way

Step 1 – Download and installed ASP.NET AJAX 1.0 Beta

Step 2 – Download and installed ASP.NET AJAX CTP

Step 3 – Download the ASP.NET AJAX Samples

Step 4 – Download the ASP.NET AJAX Control Toolkit

Now I can create new websites but I am unable to run the Samples and Control tool kit samples. I am getting JavaScript errors 'Sys' is undefined, Expected '}' etc.

I have even tried changing asp:ScriptManager to aspatlas:ScriptManager as mentioned in some blogs

Anyone facing such problems ?

Did you build the toolkit solution? I think by default when you download the source that you have to before you run the samples as the bin folder of the sample website does not have the toolkit dll...


Thanks Jodywbcb for your quick reply.

I have build the solution before running the toolkit. Also for the sample applications (Contacts, SimpleList and TaskList) I have copied Microsoft.Web.Preview.dll from the ASP.NET AJAX CTP installation directory (%Program Files%\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025\) to the Bin directory of each sample application.

None of the samples are working in my system. But I can run the tool kit fromhttp://ajax.asp.net/ajaxtoolkit/ in my system.

I also tried reinstalling, restarting etc... No hope...


No problem... Can you post a a screenshot or capture of the error message you are recieving?

Sounds to me like for whatever reasons you are not able to GAC the Microsoft.Web.Extensions.dll for whatever reasons .. if you have the preview then you should have that dll ( its in the same folder you copied the preview stuff from btw if not revisit the Ajax announcement page and do step 1...). So try copying the dll I listed to the AjaxControlToolkit\SampleWebSite\Bin - it will search for it there if not in the GAC and let me know if you have any issues from that point. If you are installing the kit on a laptop / desktop that actually does set restriction that may be the cause - but copying the dll to you bin should allow it to run as there is nothing explicitly documented with this release that it needs to be GACed...


Error is 'Sys' is Undefined, 'Type' is Undefined, Expected '}'. Also I am unable to use intellisense in VS 2005 forasp:ScriptManager and other ajax elements. The error is "Element ScriptManager is not a known element"

Microsoft.Web.Extensions.dll is already there in GAC. Even after coping it to the BIN folder error exists.


Ref:My blog and see if anything helps you - the toolkit example does work as intended if everything is properly installed but there are workarounds...

I have tried running toolkit samples in 3 different systems and got the following observations

1. I have copied the AjaxControlToolkit folder to all the 3 systems and installed Microsoft.Web.Extensions.dll in GAC

2. I can successfully build and run the application using VS 2005.

3. When I open any one page (Any Ajax sample page)first time it will work

4. When I open some other page I will get the JavaScript error I mentioned

5.After that none of the page will work (Including the first page which successfully executed) in that system


I have the exact same problem with the samples.

I've noticed that the web.config has a namespace entry under system.web -> pages -> controls with tagPrefix="asp" for both the preview and extensions dlls, so maybe the problem is related to those dlls.


Could it be that you're missing some javascript files?

Re: Intellisense not working, did you try removing all the Atlas components from Visual Studio and re-adding the new 1.0.6x NET Framework Components? Also, make sure you have the new files in Bin folder.


Do I need to explicitly add any JavaScript files for the toolkit? New dll's I copied to the BIN folder.

Is there anyone who is successfully using the toolkit? I have tried installing it in more than four systems (In all the systems ATLAS was there)

The very first sample I can run, After that no hope to run any sample in that system.


Gary A. Stafford:

Re: Intellisense not working, did you try removing all the Atlas components from Visual Studio and re-adding the new 1.0.6x NET Framework Components? Also, make sure you have the new files in Bin folder.

I've installed it on a machine with a fresh VS2005 installation, meaning no Atlas component.

I've copied the 'Preview' and 'Extensions' dlls to the bin folder, if thats what you meant.


It seems that the caching issue solved in the ASP.NET AJAX 1.0 release. Now there is no script error!! Smile

Thanks

Saturday, March 24, 2012

ASP.NET 2 - AJAX control toolkit autocomplete

hi

how can i do to have a session variable ( like for example session("name") ) to web site ( asp.net 2) in a class of control toolkit autocomplete.

with the use of this instructions in the class vb autocomplete :

Dim session As System.Web.SessionState.HttpSessionState

session = System.Web.HttpContext.Current.Session

the 'session' variable is nothing

thanks to attention

Hi Robby,

My understanding of your issue is that use session your WebService which is associated with a AutuCompleteExtender. If I have misunderstood, please feel free to let me know.

Based on this knowledge, here is a sample which is written by Jeffrey Zhao. I found it on MS WebCast. This sample is not use AutuCompleteExtender but they are similar. You can do some changes on your source code.

<%@. WebService Language="C#" Class="EnableSessionService" %>using System;using System.Web;using System.Web.Services;using System.Web.Services.Protocols;using System.Web.Script.Services;using System.Web.SessionState;[WebService(Namespace = "http://tempuri.org/")][WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)][ScriptService]public class EnableSessionService : System.Web.Services.WebService{ [WebMethod(true)] public int AddOne(){HttpSessionState session = HttpContext.Current.Session;object objValue = session["value"];int value = objValue == null ? 0 : (int)objValue;value++;session["value"] = value;return value; } }
Aspx page:
 
<%@. 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"></script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Enable Session</title></head><body> <form id="form1" runat="server"><asp:ScriptManager runat="server" ID="ScriptManager1" ScriptMode="Debug"><Services><asp:ServiceReference Path="Services/EnableSessionService.asmx" InlineScript="true" /></Services></asp:ScriptManager> <input type="button" value="Add One" onclick="addOne()" /><script language="javascript" type="text/javascript">function addOne(){EnableSessionService.AddOne(onSucceeded);}function onSucceeded(result){alert(result);}</script> </form></body></html>

Please pay attention to the "Bold" part. Hope this help.

Best regards,

Joanthan


Hi Joanthan

thanks to your advice, it's that i had necessity.

in my code i haven't put TRUE in[WebMethod(true)]

now is working

thanks

Asp.Net 1.1 Compatibility

Can the toolkit be used with ASP.NET 1.1?

As far as i know the toolkit is for .NET 2.0+


You need Framework v2.0 or above. Take a look at the link below and the Required Software.

http://www.asp.net/AJAX/Documentation/Live/InstallingASPNETAJAX.aspx

Asp.net & Microsoft Ajax Performance issues

I am having performance problems with ajax control toolkit. I have a web form with some ajax control toolkit controls(Textbox, Dropdownlist) and some simple standard asp.net controls. Now whats hepening with me whenever I post a ajax call to server each time request size increases secondly all the data of controls of the page is being sent back to server on each request why?

If I do all this work with raw javascript using XMLHttpRequest object(the very first form of ajax) it works fine.

Hi,

According to your description, I think it's normal to see this.

When you use ASP.NET AJAX, it doesn't eliminate unnecessary data transfer. All information on current page will be posted to server just as a normal request.

While working with a raw XmlHttpRequest, you can send necessary data explicitly.


you are right its normal way of httprequest.

But my point is, don't you think for a specific control say a button or text box only required data(viewstate) should be travel to server as you can do using simple ajax.

I think if this functionality could be added in Ajax Framework it will be a value added in this framework for enterprise applications wehere performance is critical.


Yes, this is a good point.

But we have to sacrifice some performances when we manage to achieve an easy-to-use framework. This sacrifice usually comes with UpdatePanel, but if you are accessing WebService or PageMethod, there will be less unnecessary traffic.

Wednesday, March 21, 2012

ASP AJAX Control toolkit tags showing up differently

I just installed ASP AJAX Control toolkit into my Visual Studio 2005. When I access the control tool and drag and drop it into my web page, it shows up with a <cc1...> tag instead of a <ajaxToolkit>... tag. The control does not show up in my web page.

Any ideas how to fix it.

Thanks,

Praveen

Its just a option that can be done. It allows for a declaration of the Ajax control. You can change it if you want by going to the top of the page where the assebly is first called which gives you the ability to make cc1 anything you wish. I am just wondering why would you want to change? What is the need to have <ajaxtoolkit> instead of cc1.

It won't make much of a difference and you shall still know that these are ajax extensions.


I thought that the tag being something other than <ajaxtoolkit> was the reason why my web page ignored all the stuff I put in there for making that particular control work. Perhaps I am wrong and the reason why my ajax controls did not work is something else?

Praveen


Thanks Cheetahtech for the solution.

Praveen


so do your ajax controls work?

argumentNullException with gridview paging with toolkit control in template field

hi

I have a simple page with a gridview. the item template has an AjaxControlToolkit:confirmButtonExtender. All is good until I tried to enable custom paging in the gridview and object data source. the first page loads but when I click on the 2nd page I get an argumentNullException thrown. The Page argument is null. I can make paging work by removing the AjaxControlToolkit:confirmButtonExtender. Anybody got any ideas about this?

Value cannot be null. Parameter name: page

stack trace:

at Microsoft.Web.UI.ScriptManager.GetCurrent(Page page)
at AjaxControlToolkit.ExtenderControlBase.EnsureScripts() in d:\TFS\AtlasControlToolkit\Release\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs:line 129
at AjaxControlToolkit.ExtenderControlBase.GetScriptReferences() in d:\TFS\AtlasControlToolkit\Release\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs:line 515
at Microsoft.Web.UI.ExtenderControl.Microsoft.Web.UI.IExtenderControl.GetScriptReferences()
at Microsoft.Web.UI.ScriptControlManager.RegisterScriptsForExtenderControls()
at Microsoft.Web.UI.ScriptControlManager.RegisterScripts()
at Microsoft.Web.UI.ScriptManager.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
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)

Page:

<%@dotnet.itags.org.PageLanguage="C#"MasterPageFile="~/SheetDataEntry.master"AutoEventWireup="true"CodeFile="SheetList.aspx.cs"Inherits="SheetList"Title="Untitled Page" %>
<%@dotnet.itags.org.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="ajaxToolkit" %>
<%@dotnet.itags.org.RegisterAssembly="Microsoft.Web.Preview"Namespace="Microsoft.Web.Preview.UI"TagPrefix="asp" %>

<asp:ContentID="Content1"ContentPlaceHolderID="ContentPlaceHolder1"Runat="Server">
<asp:GridViewID="GridView1"runat="server"AutoGenerateColumns="False"DataSourceID="ObjectDataSource1"OnRowCommand="GridView1_RowCommand" AllowPaging="true"pagesize="2">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLinkID="HyperLink1"runat="server"NavigateUrl='<%# Eval("Uid", "SheetEdit.aspx?SheetUid={0}") %>'Target="_parent"Text='<%# Eval("SheetId", "Edit {0}") %>'></asp:HyperLink>
<asp:LinkButtonID="LinkButton1"runat="server"CommandArgument='<%# Eval("Uid", "{0}") %>'CommandName="DeleteSheet"OnClick="LinkButton1_Click">Delete

<ajaxToolkit:ConfirmButtonExtenderID="ConfirmButtonExtender1"runat="server"ConfirmText='Are you sure you want to delete?'TargetControlID="LinkButton1"
BehaviorID="ctl02_ConfirmButtonExtender1"Enabled="True"
>
</ajaxToolkit:ConfirmButtonExtender

</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundFieldDataField="SheetId"HeaderText="SheetId"SortExpression="SheetId"/>
</Columns>
</asp:GridView>

<asp:ObjectDataSourceID="ObjectDataSource1"runat="server"OldValuesParameterFormatString="original_{0}"
OnObjectCreating="ObjectDataSource1_ObjectCreating"SelectMethod="SelectAll"TypeName="Bst.Rincon.BL.SheetInformation.SheetListJunction"
EnablePaging="true"SelectCountMethod="SelectCount">
</asp:ObjectDataSource>

</asp:Content>

here's an explanation of the underlying problem:

Known Issue & Workaround: Extenders no longer work in templated controls:http://forums.asp.net/thread/1441672.aspx

for now i can continue without the ConfirmButtonExtender. And I can tell the boss that I didn't break it... Yipee!

Cheers,

Alan Grant

are we having drag and drop control

Hi,

Iam Mahender.Iam new 2 AjAX.Well recently i doenloaded and installed toolkit ajax and atlas.I want to create a drag and drop facility in my Webpage.it may any control part from panel.For example i took lists.plz help me up in this aspect

Hi,

We dont have any direct control for Drag/Drop functionality.

Beta2 will supports Drag/Drop features to webpart controls.

Please go through below links, you can find more info on that..

http://weblogs.asp.net/scottgu/archive/2006/11/08/ASP.NET-AJAX-1.0-Beta-2-Release.aspx

http://blogs.neudesic.com/blogs/david_barkol/archive/2006/11/07/631.aspx

http://www.neudesic.com/uploads/david_barkol/DNDSafari.jpg

Pradeep Kumar Bura