Showing posts with label application. Show all posts
Showing posts with label application. Show all posts

Wednesday, March 28, 2012

Multiple UpdatePanel query

In my web application, on one page I'm having 4 UpdatePanel. All data corresponding to this UpdatePanel comes from database, so there is a substantial waiting time. When the page gets loaded, data for each UpdatePanel gets loaded 1 at a time.Can I load data for all sections asynchronously? Since this can help my application to reduce the loading time. Or it's not possible to start another request before the 1st one is complete?Any help will be appreciated.

Hi

I am not sure abt ur first issue but i think that in case you can do synchronization.

Tell me if you get any help regarding your blog..

Thanx


Please refer to this: http://forums.asp.net/t/1108522.aspx


Thanks for your reply. I have referred that post, before posting this query.

Can you provide me with some document if you have any.


To have a good understanding of the life cycle of async-request is helpful. Please refer to this for more information, http://ajax.asp.net/docs/overview/AJAXClientEvents.aspx

With the UpdatePanels, only one asynchronous request is handled at a time. This is intentional because these request include the ViewState on the page and make it almost impossible to keep it all in sync if multiple requests are occuring simultaneously. Raymond is correct in mentioning that you should get a good grasp of the life cycle that happens during these request - there is the asp.net page lifecycle, but there is also a client-side lifecycle. In short, become familiar with the PageRequestManager, this client-side object will grant you more control of what goes on during these ajax postbacks. Lastly, check out this sample to see how to work with the client-side events:http://weblogs.asp.net/davidbarkol/archive/2007/03/25/asp-net-ajax-client-side-event-viewer.aspx


Thanks Raymond and David for your suggestion.

Monday, March 26, 2012

Multiple XmlHttpRequest

Hi All,

I am new in Ajax Web Technologies. But want to learn deeply. Currently I am trying to develop a web application which reports ISA Server logs according to our needs.For example, I am fetching a dataset from SQL server and displaying them on a table. As soon as page loaded, I am executing Ajax functions which resolve host name from IP address. As you can imagine the result of query is more than 300 rows. So, resolving IP addresses one by one for 300 rows takes too long time and it is not desirable. In order to handle this problem I used Ajax library that I found onhttp://www.szajkowski.com/ajaxsample.html . It is pretty good. It creates multiple xmlhttprequests at same time. And its object handles are being stored separately. So no overwritten requests.

But the problem is, because of the limitations of IE and even Firefox, only two XmlHttpRequests are permitted for requests which points to same domain. As I learnt, it was possible to increase this value by modifying registry settings. But I don't want to do it.

I wondering that is it possible to make many simultaneous Ajax requests by using Web service methods? In XmlHttpRequest If I use POST in stead of GET.

Or is there any other way to be able to accomplish it?

Thanks in advance for your helps.

As far as I know, unless you're using some kind of IFrame-based hack, all the methods you describe are still using XmlHttpRequest objects 'under the hood'.

However, I'd argue that 2 is enough at any given time. Consider paging and chaining calls. For example, let's say that you want 50 items per page. You fire off two ajax calls, and those calls return with the 50 records plus information about which page they are and what the total number of pages is. Your 'OnRequestSuccess' handler on the clientside inspects that information in additon to parsing the data into your page, it decides if there's more data to be gotten, and fires off a request for the next page. You'd probably want to add in some logic to make sure you're not grabbing the same page twice and the like as well, but that's the basic idea. Figure that it'll take the user at least a few seconds to look at each page of data, and even if that's not quite enough time for the next batch to come down, you should be at least one page ahead of him at all times.

paul


Hi Paul,

You are right. I did some modification on server-side code.Now, I am using just one XmlHttpRequest and sending all IPs at once. And in server-side code, I used multi threaded DNS queries. And after all threads exits, it sends the all results together at once.

Thank you very much for your interest and valuable comments.

Ilhan

MultiView control, View control and nested UpdatePanels

I have an application that is using a MultiView control to simulate "tabs". Within that MultiView control, I have a number of View controls with nested UpdatePanels and they work just fine. However, whenever I try to encase the MultiView control inside an UpdatePanel, paging between the View controls works fine with no postbacks, but none of the UpdatePanels in any of the View controls works after that.

Has anyone ever run into this or provide any suggestions? Code samples available if necessary...

Thanks!

hello.

yes, seeing a small sample would help. btw, i must say that i still don't like the idea of nesting updatepanels.

Saturday, March 24, 2012

Navigation best practices

I'm writing a ASP.NET web application that uses Ajax. The application has an "outlook-like" layout with navigation elements (bars, tree) on the left and a menu on the top. The layout is implemented in a masterpage. There is a mix of both <a href> (get) and linkbutton controls (postback with response.redirect) that causes navigation to other page.

I'm using ajax on single pages to handle refresh-less updates, but I really want to change this application so that clicking on a link or linkbutton does not re-load the whole page (treeview, menu etc), but only updates the content part of the masterpage. The only option I know is reverting to good old <frames> but I hate frames. Is there anyway I cat use Ajax to handle cross page navigation correctly?

Hi Paala,

Do i understand you correctly that you want the navigation links to use Ajax so that your page is update with other content. If this is what you want to achieve it isn't possible with AJAX.. The links you are clicking on right now point to content pages (which inherit from the masterpage). These pages are totally new pages Ajax is a way to partial refresh parts of pages not to totally load new pages. (a masterpage will never be requested by an end-user, the content pages are requested by end-users)

The only solution you can use is to put al your content on one page and use the multi-view control and switch between the view when a user clicks on a link. This solution is very ugly because you have all your content on one page. Hope this helps

Regards,


Yes, that is the effect I was after. If I still reject using frames one method I've found is to convert all my content aspx files into web user controls (ascx) and use a placeholder inside a updatepanel on the "main page". All links will cause one or more controls to be loaded dynamically and the updatepanel causes the new content to be displayed. Since my pages does not only include text content, but are "applications" with post-back controls I will need to "reload" the controls on each postback so that viewstate and events still work.

Re-loading the controls does seam feasable, but I'm unsure about the performance. Anyone tried such an approach?

Need expert comment on copying Ajax Dlls to bin

I have a huge web application that is Altas-based. I have only 2 weeks to add some new functionality to it so there is no time to upgrade it to Ajax.
That will be in the next project. In the mean time I still need to use some Ajax functionality just to show the sort images as described inhttp://mattberseth.com/blog/2007/09/how_to_improve_column_sort_pre.html

So I copied the Ajax DLLs into bin where the Atlas DLLs currently are. Then I changed the web.config as seen below.

Question:

Will that have any types of negative bearing on my other asp controls such as asp:gridview, asp:label etc...? Any caveats I should be aware of? Thanks

If in web.config <pages>

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

</controls>

</pages>

You won't have any issues at all with existing controls.

Just make sure you're website is running in fulltrust, and that your host allows full trust.

Need help

I'm using asp.net ajax controls in my application. ( i do't now about the version but downloaded last year OCT)

and builded a application using this. And installed the latest version(Currently available in download).

In previous version assemblies are named as "microsoft.web.extensions"

and current version assemblies are named as "system.web.extensions"

So i can use my previous application after updation of my ASP AJAX extension.

any bodies please help me to solve this problem.

Thanx in advance.

well, you cant use latest AJAX dll for your old project.

only thing you can do is modified your old project with latest ajax dll and web.config


Thanking you for your response.

I did a mistake. Actually it's not working...

but, i think that installing the assembly "Micrososft.web.extensions" to GAC is enough to run the application.......

any idea????

Need Help - UserControl Completely disappears

I'm developing an ASP.NET Ajax application in VS2005. The problem is describe bellow

Scenario
=============
I have a ASPX page with a UpdatePanel( say it is UpdatePanel_ 1) and a Button(say it is UpdatePanel_ 1_Button). Under the UpdatePanel_ 1 I have a Panel(say it is BodyPanel_1) to load different control as require.

On UpdatePanel_ 1_Button click event, it will load different UserControl in the BodyPanel_1 and then call UpdatePanel_ 1.Update() method.

Now say I have a UserControl( say it is UserControl_ 1) have a TextBox and a Button(say it is UserControl_ 1_Button). On click on the Button(UserControl_ 1_Button), add a simple text(say - "You Click Me") in the UserControl_ 1's TextBox.

Issue
==========
If I load the UserControl(UserControl_ 1) in PageLoad event it works fine.

But when I load the UserControl_ 1 on the page UpdatePanel_ 1_Button click event, it load the UserControl_ 1 but in that UserControl when I click on the UserControl' s ( The UserControl_ 1_Button ) Button the UserControl Completely disappears ( The UserControl_ 1 get vanish from the page ).

In the design mode I can drag the user control (UserControl_ 1) and at run time can do visible and invisible but it's not the solution as I like to load different controls in the same page base on some logic.

Following is my Button Click event function.
protected void UpdatePanel_ 1_Button_Click(object sender, EventArgs e)
{
//get the panel
Panel bodyPanel = (Panel)this. Page.FindControl ("BodyPanel_1");
//load the usercontrol
Control myControl = this.LoadControl( "UserControl_ 1");
myControl.ID = "45646546";
//add the usercontrol
bodyPanel.Controls. Add(myControl) ;
//update the UpdatePanel
UpdatePanel_ 1.Update();
}

The above function loads the UserControl( The UserControl_ 1), but when you click on the Button(UserControl_ 1_Button) under the UserControl, it disappears. But when I load the same UserControl in the Page Load every thing works fine.

I understand that when I load the UserControl dynamically at run time it's not register the UserControl' s events.

Please let me know your suggestion.

Thanks

Hi,

It's necessary to add the control in Page_load everytime. Please read this FAQ:

1. Why do I have to recreate dynamic controls every time? /Why dynamic controls are disappeared on PostBack?


Whenever a request comes, a new instance of the page that isbeing requested is created to serve the request even it's a PostBack. Allcontrols on the page are reinitialized, and there state can be restored fromthe ViewState in a later phase.

The dynamic controls have to be recreated again and added tothe control hierarchy. Otherwise, they won't exist in the page.

Please be careful with when to create dynamic controls. Inorder to keep their state, they have to be created before the LoadViewStatephase. Page_Init as well as Page_Load methods are options available.

For more information about this topic, please refer to thisarticle:

Creating Dynamic Data Entry User Interfaces[http://msdn2.microsoft.com/en-us/library/aa479330.aspx ]

Hope this helps.

Wednesday, March 21, 2012

Need Help on AJAX

Hi Friends,

I am new for ASP.NET technology though i am not new in IT Field. I used to work out on Desktop Based Application.My company deals in ERP & SAP and now switching to Web development also.

Tell me how should i get the step by step help to learn the AJAX. I know little bit of ASP.net. I tried one example of Animation through Ajax Control Toolkit.

But I am facing the problem in animation of this control. as the intellisence is not comming in code pane. and there is no help how to use these controls. Only there is an example. but don't have any explanation on properties and attributes of these controls.

Is there any help to come out of it....Geeked

Manish

check this linkhttp://asp.net/ajax/documentation/live/InstallingASPNETAJAX.aspx

Basicaly you need to install ASPAJAXExtSetup.msi. Once installed, you open Visual Studio, click File new website, and then u'll have the option to select between the templates "ajax enabled website". Then you copy paste samples from the control toolkit sample , and it works right away. very simple.


This is ok for me. I know this. and I am trying to use animation control of AJAX. Let us take an example.

<cc1:AnimationExtenderID="OpenAnimation"runat="server"TargetControlID="cmdSubmit">

<Animations>

<OnClick>

<SequenceAnimationTarget="cmdSubmit">

<StyleActionAttribute="overflow"Value="hidden"/>

<ParallelDuration=".3"Fps="15">

<ScaleScaleFactor="0.05"Center="true"ScaleFont="true"FontUnit="px"/>

<FadeOut/>

</Parallel>

<StyleActionAttribute="display"Value="none"/>

<StyleActionAttribute="width"Value="250px"/>

<StyleActionAttribute="height"Value=""/>

<StyleActionAttribute="fontSize"Value="12px"/>

<OpacityActionAnimationTarget="cmdSubmit"Opacity="0"/>

<EnableActionAnimationTarget="cmdSubmit"Enabled="true"/>

</Sequence>

</OnClick>

</Animations>

</cc1:AnimationExtender>

See the Bold Text. I have taken this from example given inhttp://asp.net site. But my question is how should i know the the behavior of these keywords like fade opacityaction, StyleAction, Seqence, e.t.c. Because I don't like to do copy-paste operation. I would like to learn these keywords. As these keywords belongs to Animation Control only. It may varry from control to control. Then how should I guess other keywords which is used in other AJAX Controls.

Hope This will help u to understand me...

Need Help with Error: element buildProviders cannot be defined

When I run my web application locally in VS 2005 it works fine. It is simply the demo from the video by Scott Guthrie. When I publish the site to my server with FTP I get the error and run the webpage I get:

Parser Error Message:The element 'buildProviders' cannot be defined below the application level.

Source Error:

Line 66: -->Line 67: <compilation debug="false">Line 68: <buildProviders>Line 69: <add extension=".asbx" type="Microsoft.Web.Services.BridgeBuildProvider" />Line 70: </buildProviders>

What did I do wrong? Thank you for any help.

just_for_forums:

When I run my web application locally in VS 2005 it works fine. It is simply the demo from the video by Scott Guthrie. When I publish the site to my server with FTP I get the error and run the webpage I get:

Parser Error Message:The element 'buildProviders' cannot be defined below the application level.

Source Error:

Line 66: -->Line 67: <compilation debug="false">Line 68: <buildProviders>Line 69: <add extension=".asbx" type="Microsoft.Web.Services.BridgeBuildProvider" />Line 70: </buildProviders>

What did I do wrong? Thank you for any help.

It did not like the way my virtual directory was set up. I had to create a new virtual directory to the folder.