Showing posts with label asp. Show all posts
Showing posts with label asp. Show all posts

Wednesday, March 28, 2012

Multiple Postbacks for AJAX

OK...I'm trying to think of the best solution for this situation:

I have an asp.net AJAX enabled website where the user can run complex queries off my SQL Server database. Some of these queries can last quite a few minutes to complete. What I want to happen is when the user clicks a button to run the query, the user can still move around the website while the query is running. And when the query is done, it basically alerts the user it is finished (by updating a label on the site, for example). So, I tried to do this in AJAX, but the problem is (as far as I understand it) is that, by default, the last postback takes precedence, so that if the user clicked another button after he clicked the run query button, the query can not post back to the site saying the query is done.

So I have a couple of questions:

1) Is there anyway for the site to respond asynchronsly to multiple postbacks?

2) If I make multiple postbacks, will all the calls still finish processing? Is it only that it can't post anything back to the server? For example, if the user ran a query that inserted rows into a table, and he clicked somewhere on the page, will the first postback still finish to completion?

3) Would any sort of multi-threading work in my example?

Thanks for any responses!!

-Howie

hello.

well, yes, you can, for instance, make several web service calls. you cannot do the same thing with an UpdatePanel since the last postback will, by default, cancel the previous one. what i think you should do is built some sort of queuing for packaging the client queries and sending them to the server. and i also think that you should use web services instead of updatepanels :)


Hi, thanks for the response. When you say that the last postback will cancel the previous ones, do you mean that it will cancel the query midway through? (excuse me if I'm being naive). Or do you mean that my code will still execute OK (that if the user wanted to insert rows into the table, that it will still do so without interruption), but I just can't post back a result to the site? Also, what do you mean I can make several web service calls? Would you be able to point me to a site I can read up more about it? (I know what web services are...I just don't know exaxtly what you'te referring to).

I really appreciate your help.

Multiple Timers - Only on is ticking

Hi,

I have several UpdatePanels and a timer in each of them, as every panel has to be updated at different intervals. However, using the ASP.NET AJAX timer, only one is triggered and it seems to reset the other timers on the postback and thus the others never trigger. I was testing the Telerik Timer control and all of them were ticking properly, however it looks like they caused a memory leak in the WebDevServer as when using them, memory consumption always quickly shot up to over 1 GB.

Does anyone know of a fix or workaround how to get all timers ticking properly?

Thanks

Hi Daikoku,

as discussed inhttp://forums.asp.net/thread/1648410.aspx, the Ajax timers get reset on postback (even if they are in different update panels). I think they have only begun delving into the potential of these controls. I do not know that there is anything you can do about this behavior at this time.


Hi,

as soon as you put the Timers into the UpdatePanels, they will be reset after a partial postback.

Have you tried putting the Timers outside the UpdatePanels and referencing them as AsyncPostBack triggers?


When I place the timers outside the UpdatePanel, the whole page is reloaded on every tick

Hi,

if the timers are placed outside the UpdatePanel, you should add them as AsyncPostBack triggers for the UpdatePanel.


Thanks, that seems to work

Here is a solution I was able to use. Perhaps this will help someone visualize it. I have two timers counting off; 1 counts seconds, the other counts 60 seconds. each triggers an update panel which adds a number to a labels current integer value and re-enabled the calling trigger.

// codebehindprotected void Page_Load(object sender, EventArgs e) {if (!IsPostBack) { Label1.Text ="0"; Label2.Text ="0"; } }protected void Timer1_Tick(object sender, EventArgs e) {int Time1 = Convert.ToInt16(Label1.Text); Time1 += 1; Label1.Text = Time1.ToString();if (Time1 >= 120)// stop the timer after two minutes ((Timer)sender).Enabled =false;else ((Timer)sender).Enabled =true; }protected void Timer2_Tick(object sender, EventArgs e) {int Time2 = Convert.ToInt16(Label2.Text); Time2 += 1; Label2.Text = Time2.ToString(); ((Timer)sender).Enabled =true; }
 <div> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> Seconds: <asp:Label ID="Label1" runat="server" Style=""></asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Timer1" /> </Triggers> </asp:UpdatePanel> <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional"> <ContentTemplate> Minutes: <asp:Label ID="Label2" runat="server" Style=""></asp:Label>  </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Timer2" /> </Triggers> </asp:UpdatePanel> </div> <asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick"> </asp:Timer> <asp:Timer ID="Timer2" runat="server" OnTick="Timer2_Tick"> </asp:Timer>

multiple update panels

hi every one..

i am using multiple update panels (more than 10) on a web page in my Ajax enabled asp.net website.

I would like to know whether it is feasible to use so many Update panels in a single form (one for each control which will go to server), or there is a possibility that i will face some problem due to it.

Any alternatives are also welcome.

thanx,

viraj

hello.

using several updatepanels might be a good approach if the zones wrapped by the panels should be refresed independently. in this case, setting the updatemode to conditional will result in reducing the size of the response returned from the server side. I'm not sure if there's any recommendation in the number of itens UpdatePanels that should be used in a page.


thanx...

Multiple UpdatePanels in my web app

Hi,

In my asp.net 2.0 web app running under IE 6.0, myprimary UpdatePanel is working well in conjuction with the Timercontrol.

The problem I encounter is when I open a newaspx page in a new window (launched via javascript window.open() ). Thenew aspx page that opens in this window also has its own UpdatePanel(with a different ID of course) and a Timer control.

Notonly is my new window NOT updating via the UpdatePanel, but when Iclose this window and return control to the main window, my main windowcompletely hangs up. My browers goes white, the normal URL appears inthe address bar, but the site appears to be trying to refreshindefinitely. It appears to be an infinite refresh loop.

BasicallyI have an Orders.aspx page which displays customer orders (within aRepeater control). I have the timer set at 30 seconds and theUpdatePanel works fine. Now if a customer clicks on the "Submit Orders"link, I launch the SubmitOrders.aspx page in a new window (viajavascript window.open). SubmitOrders also contains an UpdatePanel andTimer control, which does NOT work.

I shall post the code to show you.

Thank you,

Bob

By the way, all my pages are linked to a master page. Here's what my SubmitOrders.aspx page looks like :

<%@. Page Language="C#" MasterPageFile ... >

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<asp:ScriptManager runat="server"></asp:ScriptManager
<asp:Timer ID="TimerSubmit" Interval="3000" runat="server"></asp:Timer>
...

<asp:UpdatePanel ID="UpdatePanelSubmit" UpdateMode="Always" runat="server">
<ContentTemplate>

<asp:GridView ID="GridView1" ... >

<Columns>...

</Columns>...

</asp:GridView
</ContentTemplate>

<Triggers>
<asp:AsyncPostBackTrigger ControlID="TimerSubmit" />
</Triggers
</asp:UpdatePanel>

...


</asp:Content>

<> This is the page that does not appear to be update. Then when I close it, my main Orders.aspx page hangs up.

<>Thank you for your advice and/or suggestions.

<>Bob

<>------


Bob,

It looks like you set your timer to 3 milliseconds instead 30 seconds.

30 seconds = 30,000, please verify


I set it to 3 seconds (3000 ms).

Thanks for checking...

Bob


Bob,

I too have seen a similar behavior in my web app. I have a "inbox" of records that is refreshed via a timer every 2 minutes. Users can create a new record via a new form opened as yours is (window.open) and once they click the save button the record will be asynchronously saved (form fields are within update panel) and a status message (success/failure) is displayed (via ModalPopupExtender) to indicate the result. Once the user clicks the "OK" button on the status modal it calls a javascript function (OnOkScript property) that triggers a remote refresh of the Inbox web form. Once the new record form is closed the Inbox page is usually "broken" (sometimes it happens on 1st new record, sometimes after 2nd/3rd update but it eventually happens) - all actions that trigger an async postback time out (e.g. grid sort, grid select, trying to add a new record (new window just hangs and is blank)). It seems to me that there is something that is killing the session or connection but there are no errors being generated that would give me an indication as to what is causing the problem. My thread that discusses my problem can be found here:

http://forums.asp.net/thread/1688076.aspx

Michael Jensen


Hi Michael,

Yes, I also noticed that the browserfreeze-up doesn't occur the first time. It usually happens the secondor third time I close the second window.

<> In my case, Ithink I figure out one of the potentially several reasons. I have ajavascript function that refreshes the main page when I close thesecond page. However, I think my old refresh technique is obsolete dueto the fact I'm now using Timers and UpdatePanels. Here's what I mean :

On my SubmitOrders aspx page (launched in a new window), the user can click on theReturn button and go back to the main orders page using this button :

<><asp:Button ID="btnClose" OnClientClick="javascript:OnAbort();" Width="" Text="Return" />

The OnAbort function looks like this :

function OnAbort(pActionFrom) {

// initialize client and user vars here ...

opener.location.href = 'orders.aspx?client=' + escape(lcClient) + '&user_id=' + escape(lcUser_Id) + '&action=UnlockAll';
self.close();
return;
}

I think there's a clash between thisopener.location.href command and the ajax UpdatePanel. In other words,if my refresh occurs at the same time as the Ajax-style update then mybrower freezes (my timer is set to 3 seconds on the main orders page).

Anyhow, I think I still have other issue but so far this is what I discovered...

Bob


Hi Michael,

Yes, I also noticed that the browserfreeze-up doesn't occur the first time. It usually happens the secondor third time I close the second window.

<> In my case, Ithink I figure out one of the potentially several reasons. I have ajavascript function that refreshes the main page when I close thesecond page. However, I think my old refresh technique is obsolete dueto the fact I'm now using Timers and UpdatePanels. Here's what I mean :

On my SubmitOrders aspx page (launched in a new window), the user can click on theReturn button and go back to the main orders page using this button :

<><asp:Button ID="btnClose" OnClientClick="javascript:OnAbort();" Width="" Text="Return" />

The OnAbort function looks like this :

function OnAbort(pActionFrom) {

// initialize client and user vars here ...

opener.location.href = 'orders.aspx?client=' + escape(lcClient) + '&user_id=' + escape(lcUser_Id) + '&action=UnlockAll';
self.close();
return;
}

I think there's a clash between thisopener.location.href command and the ajax UpdatePanel. In other words,if my refresh occurs at the same time as the Ajax-style update then mybrower freezes (my timer is set to 3 seconds on the main orders page).

Anyhow, I think I still have other issue but so far this is what I discovered...

Bob


Bob,

This is my implementation of performing a parent form refresh - this script is called when users click the OK button on the child form modal status popup (e.g. "The record was saved successfully.") (ModalPopupExtender property --> OnOkScript="RefreshParent(false)"):

// Function Name: RefreshParent
// Function Purpose: Trigger a async refresh of the parent form.
// Author: Michael Jensen
function RefreshParent(autoClose){

// put function within try-catch-finally block
try
{
// debug statement - set debug = true to view
if (debug) alert(">>Entered JavaScript:RefreshParent");

// define local variables
var control = GetParentDocumentElement('HiddenRefreshButton');

if(control != null)
{
control.click();
}
// if autoClose = true
if(autoClose)
{
self.close();
}
// return false
return false;
}
catch(ex)
{
var msg = "JavaScript:RefreshParent failed. ";
alert(msg + ex.messsage);
}
finally
{
// debug statement = set debug = true to view
if (debug) alert("<<Exiting JavaScript:RefreshParent");
}
}

My parent form has a hidden (style="display: none;") asp:button that is set as an AsyncPostBack trigger for the update panel so when the click event is triggered via the JavaScript it refreshes the "inbox" (gridview). It works great and I love the new functionality it brings to the table but it consistently breaks after the first/second refresh as we both have noticed. I too thought that it was causing a conflict with the timer so I tried setting the refresh behavior to use "window.opener.document.forms[0].submit()" (hard postback) but this did not resolve the issue with the parent form breaking. The autoClose is used by some child forms of the new record form that facilitate adding sub-child records so that the sub-child forms auto close after triggering a refresh of the parent record form.

Regards,

Michael Jensen


Bob,

I forgot to mention also that I have been unable to reproduce this problem when using Firefox/Netscape. I am using IE6 on my dev system but my app testers have seen the problem in IE7 as well.

Regards


I like the scripting technique you're using. Let me ask this: if youdisable the Timer control, does the parent window still break ? If itdoesn't break then I believe our conflict theory is correct.

Ifdisabling the timer doesn't make a difference, can I suggest doing whatI tried. I set my timer to 3 seconds (3000 ms) and just close the childwindow without any refreshes whatsoever. At this point just let thetimer take care of the refresh on its own. Please tell me if that works.

Theproblem I just discovered is more of a application-design issue. I usedto do a "hard" refresh as you mentioned with this script (upon closingthe child window):

opener.location.href = 'orders.aspx?client=' + escape(lcClient) + '&user_id=' + escape(lcUser_Id) + '&action=UnlockAll';

Ifyou'll notice, however, I was also using my custom "action" parameter.This notified the Orders.aspx page that I needed to unlock that user'srecords. I guess I just lost that functionality by letting the timertake control of the refresh. Perhaps I'll use a session varinstead...gotta think about it...

Regards,

Bob


would you mind showing me the code for the hidden refresh button on your aspx page ?

Thanks,

Bob


Bob,

Here is the code for the hidden Asp:Button:

<div style="display: none;"> <asp:Button ID="HiddenRefreshButton" runat="server" OnClick="HiddenRefreshButton_OnClick" /></div>

I also tried the two tests you mentioned previously. I blocked the child form from triggering a refresh both with the timer enabled and disabled and the parent form still broke. A child initiated refresh with the timer disabled also broke the parent form. I am also getting some sporadic parsing errors that I was not getting before. Back to the drawing board I guess. Will keep you posted.


I ended up successfully using your idea toaccess the hidden button from the child window using this js code (opener.document was previously the missing key in my js code).

Keep in mind that I usemaster pages, so the rendered HTML page declares my hidden refresh button asID="ctl00_ContentPlaceHolder1_hidRefreshImg" (as opposed to the simpler ID="hidRefreshImg").

function OnAbortSubmit() { // This fires when I close the child window

var hidRefresh =opener.document.getElementById("ctl00_ContentPlaceHolder1_hidRefreshImg");// hard coding the id work fine...
hidRefresh.click();

self.close();
return;

}


I put this on my main Orders.aspx pagewithin my UpdatePanel:

<> <div style="display:none">
<asp:Button ID="hidRefreshImg" runat="server" />
</div>

I do use a technique for dynamically injectingjavascript vars at runtime in order to store the actual aspx-generatedID for my controls, but the variable does not work for me in thisscenario. I'll share the technique if your interested.

Thanks again,

Bob


Bob,

Eureka!!! I figured out the problem. I have JavaScript methods that are called by my child forms when a user is clicking the "Close/Cancel" button that verify there are no unsaved changes before closing otherwise user is prompted to verify that they want to discard changes or not. If they confirmed that they wanted to close the web form I was simply calling window.close() but was not returning any value from the function which I think was a problem because the Close/Cancel button is located within the update panel (because the image changes depending on the scope of the form (e.g. new or view)) and thus despite closing the window I think somehow the AJAX event lifecycle was being initiated but terminated abnormally because of the form closing. I added a "return false;" in my finally clause for all the functions that are used in the closing of a child web form and lo and behold my parent form no longer breaks (see example function below - added statement is bolded). I hope this solution also works for you. Also, thanks for the compliment on js scripting technique - if you can get it, I highly recommend using CodeSmith Pro to develop coding templates that will help enforce standards and practices on code items (classes, methods, properties, etc.):

// Function Name: CloseVisitLog
// Function Purpose: Close the visit log form.
// Author: Michael Jensen
function CloseVisitLog(scope)
{
// put function within try-catch-finally block
try
{
// debug statement - set debug = true to view
if (debug) alert(">>Entered JavaScript:CloseVisitLog");

// declare local variables
var unsavedChanges = GetUnsavedChangesFlag();

if(scope == "new")
{
// make sure the user really wants to cancel
if (confirm("Are you sure you want to cancel creation of this visit log entry?"))
{
// close the window
window.close();
}
else
{
return false;
}
}
else if(scope == "view")
{
// if there are unsaved changes make sure the user really
// wants to close
if(unsavedChanges == "true")
{
if (confirm("There are unsaved changes, are you sure you want to close?"))
{
// close the window
window.close();
}
else
{
return false;
}
}
else
{
// close the window
window.close();
}
}
}
catch(ex)
{
var msg = "JavaScript:CloseVisitLog failed. ";
alert(msg + ex.messsage);
}
finally
{
// debug statement = set debug = true to view
if (debug) alert("<<Exiting JavaScript:CloseVisitLog");
// return false to prevent postback when window is closing
// otherwise parent form AJAX will break
return false;
}
}


Hi Michael,

I'm glad to hear you found yoursolution. I tried experiementing with the return false idea, but itstill breaks when the parent form's Timer fires off.

Here's my on abort routine again with your return false idea :

function OnAbortSubmit() { // This fires when I close the child window

var hidRefresh =opener.document.getElementById("ctl00_ContentPlaceHolder1_hidRefreshImg");
hidRefresh.click();

try{
self.close();
}
finally{
return false;
}

}

So is the "return false" statement reached even though I'm doing aself.close() before that ? In any case, I think what I'll do is justcomment out the hidRefresh.click() statement due to the fact that Ialready have a 3-second timer on the parent form. So in the worse-casethe user will wait three seconds to see the main window update. Unlessof course there was a way that I could momentarily disable the Timercontrol, then re-enable it when my main page reloads...I'll look intothat...

Thanks for the CodeSmith recommendation.

Regards,

Bob

Multiple UpdateProgress controls not possible?

Hi,

I'm currently learning ASP.NET AJAX. I wanted to play around with the different settings of the DynamicLayout property of the UpdateProgress control. I dragged from the toolbox a scriptmanager, updatepanel and 2 updateprogress controls on the same page.

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="UpdateProgress2.aspx.cs" Inherits="UpdateProgress2" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> </div> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> </asp:UpdatePanel> <asp:UpdateProgress ID="UpdateProgress1" runat="server"> </asp:UpdateProgress> <asp:UpdateProgress ID="UpdateProgress2" runat="server"> </asp:UpdateProgress> </form></body></html>

However this results for the second updateprogress control into this error message:Duplicate component name "UpdateProgress2". Component names must be unique and case-insensitive. Am I trying something stupid/not allowed?

Grz, Kris.

Does the error go away if you change the ID of the second UpdateProgress? I notice that your codebehind class happens to be called "UpdateProgress2" as well, and that's not allowed.

I get a different error message for that, though: "member names cannot be the same as their enclosing type," so it's possible that's not the same error you're seeing.


Hi,

thanks! Renaming solved it. Man, I told you I was probably doing something stupidEmbarrassed. I was so focussed on learning the new stuff that I missed that one.

Grz, Kris.

Monday, March 26, 2012

Multi-threaded/Async methods with Atlas

I've recently started using ASP.NET/Atlas, I've been doing a lot of TCP work in C# with regular Windows Forms applications. All of the work I do with sockets/tcp is Async and I've been trying to get this to work to make a simple TCP Client with a terminal screen in ASP.NET using Atlas. My problem is I understand how to Invoke a delegate in Windows Forms that way you can edit controls created on the UI thread but I'm not sure how to accomplish this in ASP.NET/Atlas. I want to be able to use the Begin* methods of a socket and handle the End* method of them also. I've tried doing this with BeginRead and EndRead however when I try to set the text of a textbox from the other thread nothing happens, I can echo it out to the Debug Output. Is there a way to do this in ASP.NET?

Much thanks,
Chad

Here are a few articles that may help you:

1.http://pluralsight.com/blogs/fritz/archive/2005/02/14/5861.aspx

2.http://msdn.microsoft.com/msdnmag/issues/05/10/WickedCode/


I'll try these out, thanks a lot.

Xtek


After trying this out, I found although while useful not my goal. I'm basically trying to create a live Atlas-enabled TCP terminal. This way the text box can be edited live while the TCP Socket receives/sends data.

Thanks in advance,
Xtek


In that case you have to use some sort of a polling mechanism. You can also use sockets in JavaScript but it is a little tricky. Look at the following:

http://ajaxian.com/archives/true-javascript-sockets

But this requires a flash adapter. I have not used it so I don't have any opinions about it. I will still suggest you to go for polling.


Just what I was looking for, thanks a lot.

Xtek

My early adoption experiences.

Hi guys, this is my first post here.

I'm developing a Portuguese Travel Agency website, asp.net 2.0 powered backed by filemaker 7 server database.http://www.queroviagens.com is the original website without atlas features. I have atlas powered version herehttp://www.queroviagens.com/queroviagens/test.aspx with autocomplete in a textbox, and without postback having partial updates instead.

I have some triggers on 2 hidden buttons that make the choices, and in the javascript tree and other links i call a javascript function that puts in hidden textboxes the values of the selected Id's and make a button.click() so it can raise the event.

One thing i would like to do is to have distinct progressbars, one for each updatepanel, and not only one. Is it possible yet ?

Another thing: let's supose i want to update the javascript tree, and I have a webservice that returns the javascript code. I can inject that in a span but it will not load. Any javascript code is not executed. Any way to fix it ?

Thanks in advance, and happy coding

hello.

well, i'm assuming that you want 2 distinct progress bars so that the info message is different. if this is the case, you don't really need two bars since you can change what's shown with code similar to this one:

<%

@.PageLanguage="C#" %>

<!

DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<

scriptrunat="server">void h(object sender,EventArgs args)

{

info.Text = ((

Button)sender).ID +" " +DateTime.Now.ToString();

System.Threading.

Thread.Sleep(2000);

}

</

script>

<

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

<

headrunat="server"><title>Untitled Page</title>

</

head>

<

body><formid="form1"runat="server"><atlas:ScriptManagerrunat="server"id="manager"EnablePartialRendering="true"></atlas:ScriptManager><atlas:UpdatePanelrunat="server"ID="panel"><ContentTemplate><asp:Buttonrunat="server"ID="bt"Text="Submit"OnClick="h"/><asp:Literalrunat="server"ID="info"/></ContentTemplate></atlas:UpdatePanel><atlas:UpdatePanelrunat="server"ID="UpdatePanel1"><ContentTemplate><asp:Buttonrunat="server"ID="bt2"Text="Submit"OnClick="h"/><asp:Literalrunat="server"ID="Literal1"/></ContentTemplate></atlas:UpdatePanel><atlas:updateprogressrunat="server"ID="prog1"><ProgressTemplate>

progress 1

</ProgressTemplate></atlas:updateprogress><scripttype="text/xml-script">

<page xmlns:script=

"http://schemas.microsoft.com/xml-script/2005">

<components>

<button id=

"bt">

<click>

<setProperty target=

"prog1" property="associatedElement" propertyKey="innerText" value="updatePanel1" />

</click>

</button>

<button id=

"bt2">

<click>

<setProperty target=

"prog1" property="associatedElement" propertyKey="innerText" value="updatePanel2" />

</click>

</button>

</components>

</page>

</script></form>

</

body>

</

html>
Totally off-topic reply but...

I like the javascript-powered treeview for the "Escolha o Destino" menu. Is it a third-party control or...?

Thanks,

-Benton
Hi Bento. Its a free javascript script:
http://www.softcomplex.com/products/tigra_menu_tree/

But in pageload I dynamic build the tree, with contents of database, and in the link item i put a javascript function i created EscolheDestino(123);

this EscolheDestino what it does is :

function EscolheDestino(val){

var t = document.getElementById('DestinoId');
t.value=val;
document.form1.btnEscolher.click();
}

So it puts the chosen Id in a hidden textbox field (DestinoId), and forces a hidden button (btnEscolher) to be clicked. This button is in the trigger of an update panel, and the datalist with the current offers for that destination are refreshed.

The problem I have is that the .click() does not raise the Click event on firefox. I will try change it to _dopostback() function to see if it fits.

Best regards

hello again.

sorry, i don't understand? what do you mean?


It's a free javascript available at:

http://www.softcomplex.com/products/tigra_menu_tree/

In pageload i dynamically generate the tree and in the link of each node i put a javscript function

EscolheDestino(id)

function EscolheDestino(val){

var t = document.getElementById('DestinoId');
t.value=val;

document.form1.btnEscolher.click();

}

What it does is selecting an id to a hidden textfield and simulate a click on a hidden button. This button is in a trigger that refreshes the datalist control.

The only problem is that this method of using .click() in firefox does not raise the Click event :|

Saturday, March 24, 2012

My Web Page Is Too Big After Use Asp.Net Ajax & Control Toolkit

I installed and using the Asp.Net Ajax & Control Toolkit in my web site.I am enjoy the cool features , except for one problem : the web page became too big to open,because the script file too large(one file is 255KB).

Yes, I know if a user opened my web page once ,it will be faster ,because the script file will not download again . But I think major new visitor will not wait for 1 or 2 min to open my web .

Is any body has the same problem? And is a solution ?

Thanks a lot !

I install the Asp.net Ajax and Copy Control Toolkit dll file to my web site bin folder, and add reference it in web.

the 255KB file is :

http://www.iam2ya.com/ScriptResource.axd?d=vrvSMawp_0WGqqmTGX1asI3T2R_vAVNchQRILcRhDeu99DMl7dd3CdOiSAo_o9GSoON-VrGYckQdXYdSTjo6zEIuvurZyzx_M44XRjh_GYU1&t=633056550088536400

the Ajaxextention version is "v1.0.61025"

the Control Toolkit version is "1.0.10123.0 "

Hi,

in the web.config file, do you have debug="true"? If so, change it to false. This results in using the production client javascripts instead of the debug ones that are quite larger.

Grz, Kris.

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 a double check on my options

I am not familiar with client side scripting.

My situation involves dynamic validation and masking of an asp.net textbox.

From reading articles and knowing what I think I know about server control, the only way to accomplish this is by using a client side raw javascript or using the new atlas clientside scripting functionality.

Just for verification, It is not possible to do it with just a server control, right?

Thanks for any input...

You could do it server-side but it would be an unberably bad user-experience. Any field masking should happen client side, and validation should happen on client and server side.

You usually do validation client sideand server side.

Masking involves the use of javascript. You need javascript to add and control the mask on the input element.

By the way, I am using the prototype version of MaskEdit control. It's included in the source code of Atlas Control Tookit.

It's very nice!

Cheers,

Leo


I will try the new control, thanx for the info.

One last question,

This is for a telephone number. I want to be able to mask on the insert template and display on the item template with the format (000) 000-0000.

The question is would you store it in the db as a nchar with formatting or as an integer and add and remove formatting on the server side?

Jamy

Need a way to reemember user selected checkboxes in a gridview in an update panel during a

I'm using ASP.NET 2.0 & Ajax. I have a gridview in an update panel. One of the templated columns in the gridview is a checkbox. In addition, two textboxes provide asynchronous triggers on their "TextChanged" event. I need to remember and re-apply the user selected checkboxes after an asynch postback. I've tried using ViewState as follows:

********************* aspx page code ******************************

<asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline"
OnUnload="GetCheckedStores" OnLoad="SetCheckedStores">
<ContentTemplate>
<asp:Panel ID="StoresPnl" runat="server" Height="50px" Width="608px">
<asp:GridView ID="grvStores" runat="server" AutoGenerateColumns="false" DataMember="DefaultView"
DataSourceID="dsStores" DataKeyNames="Store" EnableTheming="true" Width="400px">
<Columns>
<asp:TemplateField>
<ItemStyle Width="50px" />
<ItemTemplate>
<asp:CheckBox ID="chbStore" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Store" HeaderText="Store #">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="Name" HeaderText="Name">
<ItemStyle Width="150px" />
</asp:BoundField>
<asp:BoundField DataField="BatchCount" HeaderText="Batch Count">
<ItemStyle Width="80px" />
</asp:BoundField>
</Columns>
</asp:GridView>

</asp:Panel>
<!-- ID="StoresPnl" -->
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="txbFromDate" EventName="TextChanged" />
<asp:AsyncPostBackTrigger ControlID="txbToDate" EventName="TextChanged" />
</Triggers>

</asp:UpdatePanel>


******************************* code behind ******************************************

string reportDescription;
string reportCode;
ArrayList checkedStores;

ArrayList CreateCheckedStoresArray()
{
ArrayList result = new ArrayList();
foreach (GridViewRow row in grvStores.Rows)
{
result.Add(false);
}
return result;
}

protected void SetCheckedStores(object sender, EventArgs e)
{
int Ndx = 0;
checkedStores = (ArrayList)ViewState["checkedStoresArray"];

if (checkedStores != null)
{
foreach (GridViewRow row in grvStores.Rows)
{
CheckBox ckbx = row.FindControl("chbStore") as CheckBox;
ckbx.Checked = (bool)checkedStores[Ndx];
Ndx++;
}
}
}

protected void GetCheckedStores(object sender, EventArgs e)
{
int Ndx = 0;
checkedStores = (ArrayList)ViewState["checkedStoresArray"];

if (checkedStores != null)
{
foreach (GridViewRow row in grvStores.Rows)
{
CheckBox ckbx = row.FindControl("chbStore") as CheckBox;
checkedStores[Ndx] = ckbx.Checked;
Ndx++;
}
}
}

protected void Page_PreInit(Object sender, EventArgs e)
{
Page.Theme = Master.Theme;
}

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
checkedStores = CreateCheckedStoresArray();
ViewState.Add("checkedStoresArray", checkedStores);
ReportsPanelVisible();
}
}
*************************************************************************

I was hoping that the "OnLoad" and "OnUnload" attributes of the update panel would execute my code-behind to store/retrieve which checkboxes were checked over an async postback, but this did not work.

I'm not married to this approach, but I do need a clue how to get this done.

Thanks for your help.

To avoid extra effort can you please provide the db related script.


Hi,

If you mean the detailed data source code, data access is done via a Data Access Layer and custom data access objects. I can only post that the DataSourceID="dsStores" is

<mtx:WSDataSource runat="server" ID="dsStores" DataGroup="Report" SubDataGroup="Related">
<SelectParameters>
<asp:ControlParameter ControlID="txbFromDate" Name="DateFrom" PropertyName="Text" />
<asp:ControlParameter ControlID="txbToDate" Name="DateTo" PropertyName="Text" />
</SelectParameters>
</mtx:WSDataSource>

As you can see, this is a custom/propriatary data access. The data returned from this source is quite correct, and the checkbox values are not retrieved from the data base.


Hi,

Based on my understanding, you creat CheckedStoresArray when the gridview is first binded, and then store it in viewstate,when the page is postback,you GetCheckedStores and store them in the Array in viewstate, then update/rebind/change your gridview,then SetCheckedStores according to the value in the array in viewstate.

I think your logic is messed up, just do GetCheckedStores before the gridview rebinding and do SetCheckedStores after the gridview rebinding.

Best Regards

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 - Message: The remote host closed the connection. The error code is 0x80072746.

Message: The remote host closed the connection. The error code is 0x80072746.
Source: App_Web_xgkqs8rx
Offending URL:http://abc/asp.aspx
Stack trace: at MasterPage.MasterScriptManager_AsyncPostBackError(Object sender, AsyncPostBackErrorEventArgs e) at System.Web.UI.ScriptManager.OnAsyncPostBackError(AsyncPostBackErrorEventArgs e) at
System.Web.UI.PageRequestManager.OnPageError(Object sender, EventArgs e) at
System.Web.UI.TemplateControl.OnError(EventArgs e) at System.Web.UI.Page.HandleError(Exception e) at
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at
System.Web.UI.Page.ProcessRequest() at
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at
System.Web.UI.Page.ProcessRequest(HttpContext context) at
ASP.searchrequestasi_aspx.ProcessRequest(HttpContext context) at
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Can't duplicate this error - how do i find out exactly what's going on?

I have a session object that I am supplying the results of the grid to.

I also have<pagesenableViewState="true"validateRequest="false"viewStateEncryptionMode="Never"

enableViewStateMac="false"enableSessionState="true">

Found the problem. When they hit the button to search, it waits for the results. Then they can click on the button multiple times before the results come - or before the onclick event is even fired.

How can i disable the button - then reenable it when they get data?


I disabled the button - but it doesn't go through with the submit - how can i make it go throught with the submit even after the button is disabled?

It's in an updatepanel.

Dim x As String = "document.getElementById('ctl00$cphBody$btnSearch').disabled = true;"

btnSearch.Attributes.Add("onclick", x)

If you're using UpdatePanel, here is what you can do:

Please wait...

If your async call is not caused by an UpdatePanel, let me know and I'll show you how to handle the "async complete event" which will re-enable the button...


Awesome that worked. What does $get do? Do you have a tutorial on that?


$get('elementid') is the same asdocument.getElementById('elementid')

You can learn more here:

http://ajax.asp.net/docs/ClientReference/Global/default.aspx

If this solves your issue, please mark this thread as "Resolved".

Good luck!Wink


Problem it loads pleasewait - even if it doesn't pass the requiredfieldvalidator. So if i leave it blank then click - it says pleasewait - but i can't reenter the number and click on the button.
Figured it out -

if (Page_ClientValidate() == true)


Well, in this case you can do the following:


I want to put the processing status in the status bar when they click button. Which I did with window.status='Processing'. But I want it to go away or be blank when the search results are displayed. Any ideas?

Instead of the below - can i show this in the status bar instead?

<atlas:UpdateProgressID="Progress1"runat="server"DynamicLayout="true">

<ProgressTemplate><asp:ImageID="Image1"runat="server"SkinID="Indicator"/> Processing...</ProgressTemplate>

</

atlas:UpdateProgress>

Here is how you can accomplish this:

May be you should start a new thread so that other people may benefit from its title.Wink

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 from you all

Hello All,

I am pretty new to ASP.NET 2.0 and AJAX... I am working on a project.. which basically

provides the real time monitoring of our system...

I have various grids, labels.. text boxes.... on one single real time screen...

Currently I am using multiple update panels with one timer control...

Applications working fine.. but sometime at random places.. error occurs.. different kind

of errors...

i have various classess... like to populate grids.. i have a grid class.. similary.. for

labels.. i have seperate class.. methods in the classes basically use stored procedures to

fetch the data.

I dont know is this the right approach... or should i use web service... or what??


I am pretty confused how to go on with this?? what is the ideal solution in a situation

like this??

I am really looking forward to u all to help me in this problem.. My project's deadline is

approaching..

Best Regards,
Faisal Fareed

Hi Faisal,

I'd like to help you, but I'm not clear about your problem.
Can you elaborate your situation?

Dear Raymond,

Many thanks for your reply.

Actually I am developing an AJAX enabled web application using ASP.NET 2.0 (C#). I have number of webforms for different type of users (registered in my application's DB).

I will take one web form (branch.aspx) that will be for GENERAL USERS group.

I have 7 update panels, one timer control, 3 grids and various labels.. all these controls are divided in my update panels... each control's data is fetched from a seperate stored procedure..

I have implemented 3 classes (one for grid, one for labels and one for my graph) and methods in these classes throws me the data...

My question is.. is this the right approach to work AJAX enabled web applications or not?? Moreoever I am getting client side exceptions.. like PageRequestManagerTimeOutException, PageRequestManagerServerErrorException... I dont know how to handle them.. I want to avoid these popups..

I hope now you understand my problem.

Waiting for your response.

Best Regards,

Faisal


To make use?of UpdatePanel?is?the?easiest?way?of?making?a?Ajax?enabled?web?application.?And?most?of?time,?it's?the?best?choice.
But as you've said, it's a real time system. I think the the timer which fires too frequently may bring too much burdens?to?the?server.

I've the following suggestions for you:
1. Reduce the interval of the Timer control
2. Set the UpdatePanel's UpdateMode to conditional to avoid uncessory traffic.

Dear Raymond,

Ok, suppose I change the UpdatePanel's property UpdateMode from Always to Conditional.. Do I need to add up any extra code??

I have increased the timer control... now things looks pretty better than before...

One more thing.. the approach I mentioned in my last post to fetch the data and populater my controls on webform...is it ok? or do i need to use web services?? or any other approach.

Best Regards,


You need to explicitly call UpdatePanel's update method to have its data refreshed.

Basically, I think your current approach is OK. There will be more performance hit if you switch to web service.

Raymond,

thanks for your time and guidance on this. Can you tell me if there are any published publicly available performance analysis works which compare Updatepanels to other forms of asynchronous calls in an AJAX app?

thanks,

Paul


Raymond Wen - MSFT:

To make use of UpdatePanel is the easiest way of making a Ajax enabled web application. And most of time, it's the best choice.
But as you've said, it's a real time system. I think the the timer which fires too frequently may bring too much burdens to the server.

I've the following suggestions for you:
1. Reduce the interval of the Timer control
2. Set the UpdatePanel's UpdateMode to conditional to avoid uncessory traffic.

Hi Ramond,

We're getting the 'PageRequestManagerServerErrorException (Error 500)' error here too. TheAJAX v1.0 application is a customer numbering system (CSAS) where 14 counter clerks each hit a Web Service every 3 seconds. The VB data access Web Method that the client hits, caches for 8 seconds. The error occurs seeming randomly as many as 6 times in a work day – the same in two offices, each with there own server. It seems to affect all clerk PCs the same and usually occurs without keyboard activity. The clerk only needs to click OK to acknowledge the error – but none the less, the error needs to be fixed. The entire markup is within a single triggered UpdatePanel.

Other errors pop up once in a while too. The 500 error is the most prevalent and has our attention for now. We've watched the forums since 1/2007 and tried all of the recommended fixes and work a rounds, as best we could, but to no avail.

We previously hacked through a persistent PageRequestManagerParserErrorException error using btolly's java script work-around posted inhttp://forums.asp.net/thread/1602799.aspx .

We've written several other helper applications in our office using AJAX UpdatePanels and triggers, all working as expected. Admittedly the CSAS project code is crude and needs to be rewritten, but not until we're convinced that we're inside the envelop and convinced thatAJAX can handle the issue of such constant and repetitive activity using theAJAX timer and UpdatePanel.
Any comments?

Thanks,
Glenn Michael


We are getting the dreaded Sys.WebForms.PageRequestManagerServerErrorException with a 500 too and found the central issue. On one server we are using sessionState of mode="InProc" but on our load balanced webfarm we are using mode="SQLServer". On the InProc server we are not getting the Ajax error but we are on the SQLServer using theSAME CODE. We're researching the problem but wanted to know if anyone else was getting this error.

NEED HELP FROM U ALL

Hello All,

I am pretty new to ASP.NET 2.0 and AJAX... I am working on a project.. which basically

provides the real time monitoring of our system...

I have various grids, labels.. text boxes.... on one single real time screen...

Currently I am using multiple update panels with one timer control...

Applications working fine.. but sometime at random places.. error occurs.. different kind

of errors...

i have various classess... like to populate grids.. i have a grid class.. similary.. for

labels.. i have seperate class.. methods in the classes basically use stored procedures to

fetch the data.

I dont know is this the right approach... or should i use web service... or what??


I am pretty confused how to go on with this?? what is the ideal solution in a situation

like this??

I am really looking forward to u all to help me in this problem.. My project's deadline is

approaching..

Best Regards,
Faisal Fareed

This is a duplicated thread as http://forums.asp.net/thread/1703339.aspx

Need help getting javascript widget to work

I'm trying to get the following to work in my ASP .NET AJAX site:

dhtmlGoodies xpPane

I'd like to use it as a main menu for my site, so this is what my masterpage looks like:

<%@dotnet.itags.org. Master Language="C#" AutoEventWireup="true" CodeFile="Blah.master.cs" Inherits="Blah" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<link runat="server" type="text/css" rel="stylesheet" id="cssLink" />
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" >
<Scripts>
<asp:ScriptReference Path="/Blah/scripts/xpPane.js" />
</Scripts>
</asp:ScriptManager>
<div id="dhtmlgoodies_xpPane">
<div class="dhtmlgoodies_panel>">
<div>
<!-- Start content of pane --> Testing...<br />
Test 1<br />
Test 2<br />
Test 3
<!-- End content --> </div>
</div>
</div>
<script type="text/javascript">initDhtmlgoodies_xpPane(Array('Test Title'), Array(true), Array());</script>
<div>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</div>
</form>
</body>
</html>

I've seperated the the javascript and css and put them in their own files. I've also put the required images into /Blah/scripts/images/. I added the following to the end of the javascript file:

if (typeof(Sys) !=='undefined'){
Sys.Application.notifyScriptLoaded();
alert("Howdy! I'm an external file.");
}

When I view the page all I see isthis

I do not get any script errors on the page. Also the javascript alert I put in is being shown, so the script is definately being loaded. Any help would be much appreciated! Smile

Hello, i am actually dont know what are you tryting to accomplish from your post. but if you are trying to do the menus. Then just use ASP .NET menu control.

http://quickstarts.asp.net/QuickStartv20/aspnet/doc/navigation/default.aspx

and here is a great video about it:

http://asp.net/learn/videos/view.aspx?tabid=63&id=48


Is there no one here that can get this thing to work? Surely its possible...

Replace " <div class="dhtmlgoodies_panel>">"

with

<div class="dhtmlgoodies_panel">
!

You are so careless!!!!!


I must've read over that line 100 times without noticing the out-of-place angle bracket. Its not so much about carelessness - sometimes it just takes another pair of eyesWink


Thanks for pointing it out, I'll try it later and let you know if it works!!


I've tested it,and found that it worked very well:)

Do you have any question?


Yup it works fine now. Thanks for the help!Big Smile

Need help getting started

Ok, I'm quite new with AJAX and it seems cool... I'm running ASP.NET 2.0 and I believe I have ASP.NET AJAX - I say believe because I went to apply the "convert" instructions and the mods already seem to be in place...

If I underatand correctly, AJAX allows us to put display type controls inside UpdatePanels and then have them update with new information based on receiving events from user input type controls - like buttons. I have several UpdatePanels with AsyncPostBackTriggers referencing other controls like buttons.

Is the implecation here that we no longer need these controls to participate in that VIEWSTATE hidden field? I have a rather large TreeView control in an update panel and it is in fact updated when its trigger is hit. I then use the "SelectedNodeChanged" event from the tree control to update some other UpdatePanel. And I've taken the TreeView off the VIEWSTATE... When I then click one of the nodes in the TreeView, the TreeView disappears and the panel I expect to be updated isnt. But if I put the TreeView back in the VIEWSTATE list, everything works - it just takes so dog-gone long for the page to load... So what's the relationship between all these UpdatePanels and the VIEWSTATE?

Curt

Treeview is not actually supported within update panels and thus may be the source of your frustration...

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 CalendarExtender Control

Hi,

I'm a beginner to ASP.NET AJAX and ASP.NET itself. I have a calendar extender for a textbox and it works fine until I click the 'Submit' button in my form. Apparently in the UI the date will show but when I do an insert to my database by using the Convert.ToDateTime function first, I get thrown an exception where it says:

'The string was not recognized as a valid DateTime. Tehre is a unknown word starting at index 0'

I would like to get some help to troubleshoot this problem.

Thanks in advance,
Nick

HI, probably your date format is not correct, the calendar extender format should be the same that the database format check that both formats be mm/dd/yy or mm/dd/yyyy or mm/dd/yyyy hh:mm:ss.


Hi, apparently something was wrong with the AJAX calendar extender. I didn't realise it until I deleted it and created a new one.

Thanks for the help anyway!Smile

Cheers,
Nick