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

Monday, March 26, 2012

Programming model question for Atlas apps

Hi,

I am designing a new web application and hope to leverage Atlas to make a better user experience than a regular ASP.NET web app. One of my things I hoping to archive to is to eliminate the need to have multiple ASPX pages.

Here is a scenario:

The web page may contain a left navigation panel that contains three links:

  1. Step 1
  2. Step 2
  3. Step 3

If I am to design a regular ASP.NET web app, I would make each of the links point to a separate ASPX page. Each of ASPX will share a common chrome such as header, top navigation panel and left navigation panel, but the main content area will be different. I would use a shared master page for them. The drawbacks of the traditional approach are:

  1. Opening each link will cause screen flickers
  2. There will be network delay from one step to another step that I can not reduce by preloading asynchronously.
  3. Each step will add to the browser history that my designer does not like.

I am hoping that Atlas will allow me to collapse all these ASPX pages into a single ASPX page, but I could not find a good approach. Specifically, I didn't find UpdatePanel useful for my design.

I am very interested to hear suggestions on how to archive my design objective. Thanks in advance.

Wei Zhu

hello.

well, you can use atlas to do this, though i really think that eliminating the history may not be a good thing. for instance, when i go to a web site, i really enjoy using the next and back buttons...and regarding to the delay, i really don't think that a normal asp.net page that has been modified to use atlas will be quicker that a traditional page.


Hi Luis,

Can you tell me how to use Atlas to achive my objective?

Regarding whether it is wise to eliminating IE history, I guess some people like it and some people don'tSmile [:)]. I personally don't have a strong opinion on either. As for the network delay, my thought is that using Atlas, maybe I can preload the UI for the step 2 asyncroulsy while user is still on step 1. However, reducing delay is more of an extra bonus credit, not a requirement.


Wei Zhu,

A simple approach to accomplish what I have interpreted your requirements is this:

Your left navigation could be setup as LinkButton controls.

You could put all 3 "pages" of content into a MultiView control.

On the postback of each LinkButton control, you could dynamically show and initialize all controls on the corresponding "View" of the MultiView control.

Surround all of these controls with an UpdatePanel and the result should be a page that appears to work completely clientside using the Atlas framework.

Hope this helps.

Ryan


Thanks Ryan.

I have considered using MultiView inside an UpdatePanel, but I think it will run into the following problems.

1. If I use Validators in each view, then switch view will cause a postback and the validators on those views that haven't been viewed will raise errors and prevent the postbacks from even happening.

2. This approach does not appear to be scale well as the number of views increase.


OK, I may have found a solution. The solution basically is to create a ASCX user control for each view, then load each user control dynamically using Page.LoadControl() inside a UpdatePanel. I did a quick test and it seems to work, although I still need to try it more.

This solution still does not address how to preload next view. It feel like possible to me, but I don't know exactly how to do it yet.


Have you considered using a Wizard control inside an update panel?

Proxy server problem

In my AJAX application ,My application is running fine, but when it is used through proxy server it hangs out.

Any suggestion is also welcome.

Thnx in advance.

Hi,rajkumarsharma

I am afraid we cannot find out the exact root cause without further information captured when the problem occurs.

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.

Thank you.

Saturday, March 24, 2012

push data to client/ keep checking the server side for any update to load

hi..

Im developing a web application to be used over the internet (not entranet) that means I have unknown of users accessing my web site.

I need to keep checking the server side every 30sec by creating hidden iframe to keep submiting to the server and check for specific updates( such database table). I think this way will reduce the performance of the server and not accepted!

is it true as I think? there is any other technique to this? is there some AJAX control to use instead?

note: Im fetching a small amount of text from the server

It really depends on your system and the expected number of users. Of course, every time you poll the server it takes some performance but in many cases the rewards outweight the performance hit.There are a lot of sites that do this and its not a huge performance hit if you are just retrieving a small amount of text. I would say go for it if you have the capacity.


Take a look at this: http://encosia.com/index.php/2007/07/25/display-data-updates-in-real-time-with-ajax/

The page method call for polling keeps the traffic level very low, compared to other techniques.

Q From MS ajax sample

Why microsoft uses the code:

if ( typeof(Sys)!=="undefined" ) Sys.Application.notifyScriptLoaded() ;

and not

if ( typeof(Sys)!= "undefined" ) Sys.Application.notifyScriptLoaded() ;

Is it the same?

Leeor

=== and !== differ from == and != in that they avoid type coersion.

In this particular case, I'm not sure there's a difference, but in general the "strict equals" (=== and !==) operands are usually what you want.


Sorry but I didnt understand theprincipal difference


It's all about type coercion:

"100" == 100 // returns true, because the types are coerced
"100" === 100 // returns false, because the types have to first match before the comparison is even performed

Does that make sense?


That sounds alot betterWink

Thanks man

Question about atlas and web interface update

Is the following scenario possible with atlas:

A web based application is run on a server, so clients use web browser to access it. The application uses inforamation from a database to populate the UI with the information. The information is stored in a database and can be changed either from the application or some other source (lets say another server). Is is possible to update the UI on a user's computer when the database is updated from the other server (the user doesn't need to refresh the screen manualy)?

Thanks in advance,
Marko Vuksanovic.

hello.

well, it's possible, though probably not as you wanted. what you must do is poll the server from the client from x to x seconds and if there's new info, then refresh the client. the most common approach is:

1- wrap the contents that need to be refreshed with an updatepanel

2- call the web service from x to x seconds; if there's new info, then refresh the panel.

Question about AutoCompleteExtender and DelimiterCharacters

Hello, I'm developing and application that uses the autocompleteextender.

This autocomplete should work more or less as the "add adress" bar in an email program. You introduce text, the app suggests something, you choose any suggestion then write a ";" and start de process again until you got al your adresses neatly separated by ";" in a multiline textbox;

Via the DelimiterCharacters i'm getting this effect using ";" as the delimiter character. What I don′'t like is the way it renders after you have chosen one field:

Example

See what I mean? I don't want the "El inquilino comunista" in front of every suggestion, I've already choosen it. The more suggestions you choose the more confusing it becomes:

Example

I would like the suggestions to be (after i've already chosen "El Inquilino Comunista" and "The White Stripes")

Alan Sparhawk
Alanis Morisette
Alasdair Roberts ...

Any ideas how to acomplish it?

Thank you.

Hi,

I think you may accomplish this in the server side method that fills the DropDownlist.

1. Get the last word separated by the delimiter

2. Fill results according to the word.

For instance:

[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string[] GetCompletionList(string prefixText, int count)
{
string[] result = new string[16];
int index = prefixText.LastIndexOf(";");
if(index >= 0)
prefixText = prefixText.Substring(index);

for (int i = 0; i < 16; i++)
{
result[i] = prefixText + i.ToString();
}
return result;
}

Hope this helps.

Question about DropDownList behavior inside an UpdatePanel

Hi,

I have an application that has two DropDownLists on a page. The first is just a plain ASP DropDownList; the second is an ASP DropDownList inside an UpdatePanel. The page also contains a label inside a second UpdatePanel.

When the item in the first DropDownList is changed, the second DropDownList is populated. When the item in the second DropDownList is changed, the Label's text is changed.

I have noticed that when the first DropDownList changes, the second DropDownList "flickers" as it populates. When I select a value in the second list, the label updates as it should, but the second DropDownList again flickers, as if it is also being refreshed. Both UpdatePanels have UpdateMode="conditional" set.

My question is whether this is normal behavior on the second DropDownList, since it is inside an UpdatePanel, or do I have something set wrong? It's a minor issue, but kind of annoying since I would not expect to see any kind of refresh when changing a value in the second DropDownList.

I have included a simple example which shows what I'm talking about. Thanks as always for your help!

<%@dotnet.itags.org.PageLanguage="vb"AutoEventWireup="false"CodeBehind="Default.aspx.vb"Inherits="DropDownTest._Default" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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"/>

<div>

<ASP:DROPDOWNLISTid="DropDownList1"autopostback="true"runat="server"width="110px"></ASP:DROPDOWNLIST>

<br/><br/><br/><br/><br/><br/>

<ASP:UPDATEPANELid="UpdatePanel1"runat="server"updatemode="conditional">

<CONTENTTEMPLATE>

<ASP:DROPDOWNLISTid="DropDownList2"autopostback="true"runat="server"width="110px"></ASP:DROPDOWNLIST>

</CONTENTTEMPLATE>

<TRIGGERS>

<ASP:ASYNCPOSTBACKTRIGGERcontrolid="DropDownList1"eventname="SelectedIndexChanged"/>

</TRIGGERS>

</ASP:UPDATEPANEL>

<br/><br/><br/><br/><br/><br/>

<ASP:UPDATEPANELid="UpdatePanel2"runat="server"updatemode="conditional">

<CONTENTTEMPLATE>

<ASP:LABELid="Label1"runat="server"text="Label"></ASP:LABEL>

</CONTENTTEMPLATE>

<TRIGGERS>

<ASP:ASYNCPOSTBACKTRIGGERcontrolid="DropDownList2"eventname="SelectedIndexChanged"/>

</TRIGGERS>

</ASP:UPDATEPANEL>

</div>

</form>

</body>

</html>

PartialPublicClass _Default

Inherits System.Web.UI.Page

ProtectedSub Page_Load(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMe.Load

IfNot IsPostBackThen

Me.DropDownList1.Items.Clear()

Dim objListItemAs ListItem

objListItem =New ListItem

objListItem.Text = 1

Me.DropDownList1.Items.Add(objListItem)objListItem =New ListItem

objListItem.Text = 2

Me.DropDownList1.Items.Add(objListItem)

objListItem =New ListItem

objListItem.Text = 3

Me.DropDownList1.Items.Add(objListItem)

EndIf

EndSub

PrivateSub DropDownList1_SelectedIndexChanged(ByVal senderAsObject,ByVal eAs System.EventArgs)Handles DropDownList1.SelectedIndexChanged

Me.DropDownList2.Items.Clear()

Dim objListItemAs ListItemobjListItem =New ListItem

objListItem.Text = 9

Me.DropDownList2.Items.Add(objListItem)

objListItem =New ListItem

objListItem.Text = 8

Me.DropDownList2.Items.Add(objListItem)objListItem =New ListItem

objListItem.Text = 7

Me.DropDownList2.Items.Add(objListItem)

EndSub

PrivateSub DropDownList2_SelectedIndexChanged(ByVal senderAsObject,ByVal eAs System.EventArgs)Handles DropDownList2.SelectedIndexChanged

Me.Label1.Text =Me.DropDownList1.SelectedValue +Me.DropDownList2.SelectedValue

EndSub

EndClass

Does this happen in both FF and IE6/7?


Definitely in IE6, as that's my default right now. I tried Firefox, and it does not seem to have this issue.

I also noticed that in IE6, when I select the item in the first list, the item is highlighted (dark blue background) until I move focus. When I select an item in the second list, the highlighting is removed. This could simply be because the focus shifted to the label. Neither list stays highlighted in Firefox.

So, it appears that it may be an IE quirk. Has anyone else seen this issue or found a work around? I should be getting IE7 on my PC in the next week or two, so maybe that will solve it!


IE6 blows. I know - Shocking news!

Try it out on IE7 and see if that fixes your problem.

I realize that some of the world is still using IE6, some can't even upgrade to 7 (ie. Win2K users) but I hate coding for that browser.


You should set the property of the UpdatePanel named "UpdatePanel2":updatemode="all"

question about the callback feature and scriptmanager

Hi,my application will have a textfield and a button (html control) and when the button is clicked, it will pass the textfield.value by calling a javascript function to the server side function and do something such as find the data in a database, after that it will return the result back to html page.

my question is, as far as I know I can use callback feature to do this, becuase what i need to do is register a page in the behind code. so the js function can call the registed function. However, as I know if use the scriptmanager and create a web serivce page with setting the class or specific methods as [scriptservice] attribute, then the js function can also call the code-behind function. therefore I wonder what is the different between those two feature. Hope someone can explain to me.

Ok, so you are using Callbacks instead of postbacks by using ICallBackHandler? Then you are also using MS AJAX? with ScriptManager?

You should only use one kind of AJAX. If you use only MS AJAX you won't have to use javascript to update your controls.

Wednesday, March 21, 2012

Question in regards to deploying AJAX enabled application to Windows 2003 server

I have developed an AJAX enabled web site on a Vista machine. The page I will be refering to contains ScriptManager, UpdatePanels and CollapsiblePanel. This page works fine on the local machine. However when I deployed this application to a Windows 2003 server (Framework 2.0 and ASP.NET 2.0 AJAX Extensions 1.0 installed) and try to invoke it, I get the following error. Any help will be appreciated.

--------
Windows Internet Explorer
--------
Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

Details: Error parsing near '<!DOCTYPE HTML PUBLI'.
--------
OK
--------

Are you using a Firewall on the server, I've seen issues with some firewalls and a setting "Remove Unknown Headers"

Check outhttp://alpascual.com/blog/al/archive/2007/04/26/How-to-fix-Sys.WebForms.PageRequestManagerParserErrorException-in-AJAX.aspx for a potential fix.

Also see this:http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx for help on debugging the issue.

-Damien

Question with "Sample ASP.NET AJAX Client Application" and "Samples not defined" again!

Yes, I'm getting a "Samples not defined" in the "Sample ASP.NET AJAX Client Application"


If you search on this error message, there are lots of people witht the same question and I've gone through their responses and verified that everything is correct.

I've verified that (what I can think of):

The namespace and the class name match the javascript callThe web service file "HelloWorldService.asmx" exists and is in the same directory location as AjaxScript.aspx
Microsoft.Web.Script.Services; is included in "HelloWorldService.asmx"Microsoft.Web.Extension is registered in AjaxScript.aspx

I looked at the source of the .aspx page and there is one line in particular that caught my attention:

<script src="HelloWorldService.asmx/jsdebug"type="text/javascript"></script>
The question is, where is this jsdebug file live? I suspect that this is the problem that the sample can't find it. I've assumed
it was in the \winnnt\microsoft.net\... folder but I couldn't find it.
 Anyone have any ideas for fun?
Thanks, Tim
OS: Windows 2000 (5.0.2195: SP4)
Browser: Firefox 2.0/IE 6.0.2800.1106 (SP1)
 
Source Code for fun:
AjaxScript.aspx
 
1<%@dotnet.itags.org. Page Language="C#" Title="ASP.NET AJAX Script Walkthrough" %>2<%@dotnet.itags.org. Register Assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="Microsoft.Web.UI" TagPrefix="asp" %>3456<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">78<html xmlns="http://www.w3.org/1999/xhtml">910 <head id="Head1" runat="server">11 <title />12 <style type="text/css">13 body { font: 11pt Trebuchet MS;14 font-color: #000000;15 padding-top: 72px;16 text-align: center }1718 .text { font: 8pt Trebuchet MS }19 </style>2021 </head>22 <body>23 <form id="Form1" runat="server">24 <asp:ScriptManager ID="ScriptManager" runat="server">25 <Services>26 <asp:ServiceReference path="~/HelloWorldService.asmx" />27 </Services>28 </asp:ScriptManager>29  30 <div>31 Search for32 <input id="SearchKey" type="text" />33 <input id="SearchButton" type="button" value="Search" onclick="DoSearch()" />34 </div>35 </form>36 <hr style="width: 300px" />37 <div>38 <span id="Results"></span>39 </div>40 <script type="text/javascript">4142 function DoSearch()43 {44debugger;45 var SrchElem = document.getElementById("SearchKey");46 Samples.AspNet.HelloWorldService.HelloWorld(SrchElem.value, OnRequestComplete);47 }4849 function OnRequestComplete(result)50 {51 var RsltElem = document.getElementById("Results");52 RsltElem.innerHTML = result;53 }5455 </script>56 </body>57</html>58

HelloWorldService.asmx

1<%@dotnet.itags.org. WebService Language="C#" Class="Samples.AspNet.HelloWorldService" %>23using System;4using System.Web;5using System.Web.Services;6using System.Web.Services.Protocols;7using Microsoft.Web.Script.Services;89namespace Samples.AspNet10{1112 [WebService(Namespace="http://tempuri.org/")]13 [WebServiceBinding(ConformsTo=WsiProfiles.BasicProfile1_1)]14 [Microsoft.Web.Script.Services.ScriptService]15 public class HelloWorldService : System.Web.Services.WebService16 {17 public HelloWorldService()18 {1920//Uncomment the following line if using designed components21 //InitializeComponent();22 }2324 [WebMethod]25 public string HelloWorld(String query)26 {27 string inputString = Server.HtmlEncode(query);28 if (!String.IsNullOrEmpty(inputString))29 {30 return(String.Format("Hello, you queriedfor {0}. The" +31 "current timeis {1}", inputString, DateTime.Now));32 }33 else34 {35 return("The querystring wasnull or empty");36 }37 }38 }39}40

Hi Tim,

Just to clarify, the line<script src="HelloWorldService.asmx/jsdebug"type="text/javascript"></script> is added because of the <asp:ServiceReference> tag in your aspx code.
Make sure that you added your HelloWorldService.asmx where your tag is pointing to:"~/HelloWorldService.asmx". It should be right under your web app root.

You can check the proxy object typing /js or /jsdebug after your web service address (e.g. http://your_web_app_address/web_service_name.asmx/js).

Hope this helps,

MaĆ­ra

Question: Report Viewer Control (SSRS) inside an Update Panel Control

Hi All,

My web application displays a report on one of its .aspx webpages coded in C#.

I am currently using a ReportViewer control to diplay the server report. I was trying to avoid the refresh of my report on every postback, by including it inside an AJAX Update Panel, it didn't work.

In my next trial, I tried to create a new report viewer control instance programatically and set its properties accordingly and then add this control to the Update panel'sContentTemplateContainer.Controls collection.

It looks like the control gets added to the Update Panel, however, It won't display on the page when it gets renedered. Below is a code snippet.

Please suggest. Thanks.

this.ReportViewer =newReportViewer();

this.ReportViewer.ID ="rvID";

this.ReportViewer.ServerReport.ReportServerUrl =newUri("http://ReportServer");

ReportParameter[] parm =newReportParameter[6];

parm[0] =newReportParameter("a","5");

parm[1] =newReportParameter("b","160");

parm[2] =newReportParameter("c","NYP-BOS");

parm[3] =newReportParameter("d","Coach");

parm[4] =newReportParameter("e","2007-01-01");

parm[5] =newReportParameter("f","2007-05-25");

PanelReport.ContentTemplateContainer.Controls.Add(this.ReportViewer); (adding the Report Viewer to the Panel)

this.ReportViewer.ShowParameterPrompts =false;

this.ReportViewer.ServerReport.SetParameters(parm);

this.ReportViewer.ServerReport.ReportPath ="/Reports/Report1";

Hi!

You should set theAsyncRendering="true"property of the ReportViewer (or setReportViewer.AsyncRendering =True in code-behind) to get async postbacks.

In that way, the report runs in an IFRAME which only refreshes when you re-render the report.

Let me know if it works for you or if you need the reports running in sync with the page. Some time ago I managed to use an UpdatePanel around them, but I ran into some issues that made me come back to the asyncrendering solution.


Hi, Thanks for the response, I have tried using that. It didn't work.

What I have is a Dropdown control, with Autopostback set to true; and an UpdatePanel somewhere else on the page. (the contenttemplate and triggers are empty on the .aspx page)

Programatically, inside the SelectIndexChange evenhandler for the dropdown, I am creating a ReportViewer control and set its properties as needed (also AsynRendering = true).

Now, I add this ReportViewer control to the control collection of the ContentTemplateContainer of the UpdatePanel.

I might be wrong in the sequence of the steps that I am doing...or something else, but whats happening is on the page I can see the report viewer template showing up which has 0 pages.

How and when does the report viewer control or the report gets rendered in the life cycle?

Thanks.


Hi!,

Yes, that may be the problem. The thing is that the SelectedIndexChanged gets fired even after the Page_Load, I'm not exactly sure "when" you have to generate the report, but could be too late. And a ReportViewer in asyncRender won't work inside an UpdatePanel, remeber that is actually an IFRAME.

But, if you are trying to fire an async postback for the SelectedIndexChanged event, the drop down list is the one that should be inside an UpdatePanel (you may already have that).
If that's you case, what you could do is add the ReportViewer outside the update panel and assign its properties in the markup code, and then call theReportViewer.ServerReport.Refresh() method on the SelectedIndexChanged event. If the ReportViewer is set to AsyncRender=true, you should have the same behavior as if it was inside an UpdatePanel.

Hope that helps,


Hi Juan, Based on your response I had partial success.

I made the following changes (Please note that my dropdown list is the first in a set of 3 cascading dropdown lists and all these are not inside any Update panel. They are working as expected whenever the selection changes on the first dropdown.

Took out the ReportViewer control from inside the Update panel and set the properties declaratively (AsyncRendering="true",ProcessingMode="remote",ShowParameterPrompts="false"and also added a <ServerReport> element with correct url and report path


Hi!, Well, I'm glad you are making some progress! :)

Mmmm...I'll start form your second question, and the answer is yes: You have to send the parameters set every time the report is generated.
Another option would be to use the embedded Report Parameters prompts, but it seems that you don't want to do that....
Remember that you can use ServerReport.GetParameters to get all you parameter info.

About the first one, what do you mean exactly when you say "the Report is not refreshing"?? Is trying to refresh, showing the "Generating Report" animated gif and then comes up blank?? It doesn't do anything at all? It comes up with an error??


Hey, that was quick! :)

Yes, I don't want the embedded parameter prompts.

Correct me if I am wrong, ServerReport.GetParameters gives me a readonly collection of parameter info objects right? what could I do with it?

Coming to the first question, By "not refreshing" what I meant was that the webpage sits with the report that it showed me on initial load, even on subsequent SelectIndexChange events (using debugger I can see the event being fired and the parameters being set and the call to report refresh). Its shows me the same report as If nothing happened, (the screen doesn't even flicker) I see the animated gif only on the initial page load.

I think..I would pick "doesn't do anything at all" from the choices that you have listed :)).

Thanks.


Hi!

Well, with the GetParameters you can get the Parameters Name, DataType, DefaultValue, etc,etc.
It's more useful if you want to dynamically create a toolbar or if you want to check that you are entering (SetParameters) all the required parameters with the right names, etc. You can build an array of Parameters and the use it's properties as reference in the SetParameters function.

About the report not refreshing, I would say that it's too late in the page life cycle to do that (as you can see, the SelectedIndexChanged event fires after Page_Load)
Having had a look at my solution, I saw that I'm refreshing the report on Page_Load avoiding to check for Page.IsPostBack.
Just to check, could you try NOT to refresh the report on SelectedIndexChanged and have a Button or something that refreshes the Report AFTER all the appropiate selections have been made in the DropDownLists? Just remember to move the code that sets the parameters and refreshes the reports to Page_Load.

Give it a try, if it works, you'll have the reason for your problem, altought maybe not the solution! :)

Cheers,


Based on the suggestion, I removed the code from the selectindexchange handler and placed something like the below in my page_load to test if the timinig in the lifecycle for the report refresh is the problem. I passed hard coded values to the parameters just so to make sure that the report output generated is different. The initial load was still good but not the postback, nothing happened on postback even from within the page_load. Sorry for all the trouble...I am desperately trying to get this working so as to complete an important assignment by this friday. Thanks.

page_load(object, EventArgs)

{

if (!IsPostback) /* Initial load*/

GenerateReport("a", "b", "c"); (some dummy values for this post)

else

GenerateReport("e", "f", "g"); // on postback

}

void GenerateReport( x,y,z)

{

reportparmeter [] parm = new reportparamete[3];

parm[0] = ..., parm [1] = ...; parm [2] = ...;

reportvwr.ServerReport.Setparameters(parm);

reprtvwr.ServerReprot.Refresh();

}


Mmmm..weird.......how are you generating the second post-back? Are you using a regular post back control like a Button outside an UpdatePanel?


I set the Autopostback on the first dropdownlist to true declaratively. I have a menu on my page too, so I can click on one of the menu items to generate a postback. In this case, should it matter how the postback is fired, because the page_load has hard coded calls for the report generation.

By the by, should the Asynrendering be set to true? (I have it set to true). I can't think of anything else..for now...ok time to go to work.

-Thanks


Hi Juan,

I noticed something, my report refreshes on only normal postbacks and not the asyncpostbacks. Is it okay to assume that, postbacks coming from any controls that are in some way related to an update panel (in or out of it) are always asyncpostbacks?

Thanks.


Hi!

Well, yes, that was the reason of my previous question: The reports will refresh only on a regular postback. If the control that fires the post back is not inside, but set as a trigger for some other update panel, it will fire an async postback.
If you put any control in a page, not inside and not associated with any UpdatePanel, a fire a postback from there, the reports work?

Cheers,


I have a hovermenu extender on my page not part of a update panel. The panel for the hover menu has a couple of link buttons. When I click those link buttons, a normal postback happens and my report gets refreshed.

This is so confusing, I am hoping that there is a thumb rule(s) of some kind for keeping things clear and simple with AJAX (or do's and don'ts). I am new to AJAX and I was wondering if you could recommend me a good design guide which says, how a particular functionality can be accomplished. Right now, I am just developing the code as I discover things, I am afraid if I end up making the code so inflexible for future changes.

Thanks.


What you are experiencing is exactly the same as I was:
The Reports could not be generated as a part of an async postback and in order to make them work properly they should be refreshed not later than in Page_Load...These could be two rules of thumb.

Keep in mind that the ReportViewer runs in a IFRAME while in asyncRendering=true, so it may be worthwhile investigating the interactions between these and AJAX...