Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Wednesday, March 28, 2012

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 Update Panel Animation Extenders on one page

Hi there!

I'm developing a web user control that contains an Update Panel and uses an Update Panel Animation Extender.
The animation is quite simple: while the panel is updating, it fades out the contents of the update panel and fades in the "please wait while processing..." message...then the animation reverses the process when the panel is Updated. The animation works quite nicely.

The problem I'm facing is when I have more than one of these web user controls on the page at a time (I'm using 8 of these on one page at a time).
If one web user control's update panel does an asynchronous postback, all of the animations are run!

Does anyone know how to get around this problem?

Thanks in advance,

-Frinny

Hi,

Would you please provide with any code of ypur usercontrol?

Or create a simple repro of this problem?

Thanks,


I forgot that I had posted this question.
I found the solution to my problem a while ago.

The problem I was describing is not actually a problem, it is how the UpdatePanelAnimationExtender works.

Anyways, to get around this problem I ended up using regular Animations instead of the UpdatePanelAnimationExtender.

Cheers!

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.

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 UpdatePanels cause Validation controls to Fail

I'm new to web development in general, and have run into a problem with the UI I'm trying to design. I'm sure that I could lay out the UI in a different fashion to achieve the same ends, but am trying to maintain a simple one-page UI using AJAX for the simple task of entering one word description lookups into a table called TestLookups with only two varchar fields called Category and Description, neither of which allow NULLs. I am trying to use built-in ASP/AJAX controls and functionality as much as possible in order to limit my need to write client-side javascript which I have no experience in.

My page is simple: A DropDownList (and a DataSource for filling it) for selecting the Category of lookups to be entered. A DetailsView whose DefaultMode is Insert for adding new records to the current Category. And a GridView for listing current lookups from the selected Category, along with providing functionality for Editing and Deleting. I have a second DataSource on the page which filters the TestLookups table to the current Category and which serves both the DetailsView and GridView for database access.

As part of this, I simply want to make sure that when users enter a new lookup or edit an existing one, that they not be allowed to leave the description blank; for this I am trying to use RequiredFieldValidators.

The form initially works fine, including appropriate behaviour for the validators. The only exception is that if I edit an item in the GridView, the validator for the field in the DetailsView fires as well, which is undesirable. A perfect place for partial rendering, I think! So I add two update panels, one around the GridView with a trigger to fire when the DropDownList changes, and a second one around the DetailsView to separate its validation from whatever occurs in the GridView.

Now we come to my problems...

First... At this point the DetailsView works fine for data entry, with the exception that the validator only works if it's the first thing that gets fired on the form. For example, I fire up the form and click Insert right off the bat and the validator fires; however, if I fire up the form and do anything else (i.e. change the DropDownList, Delete an item, Edit an item, etc.), then the validator won't fire! Not sure why this is happening...

Second... The Edit functionality won't work! The Edit button gets me into edit mode, I type in my changes, but when I click Update, nothing happens! If I change the Update button's CasesValidation property to False, then it magically starts working, but then of course I've lost my ability to validate the textbox with the RequiredFieldValidator!

If I ignore my desire for required field validation messages, then I'm OK: the DetailsView simply won't do anything when Insert is clicked (fine behaviour) and the GridView will return an error about an invalid NULL value (not a great behaviour, but it's an internal website and my users would be able to figure it out).

I'm hoping someone will tell me what I can do to properly hook these pieces together, or let me know if I'm simply trying to do too much on a single web page (doesn't seem like it though). If there are any workarounds for this out there, I haven't seen anyone talking about them.

I'll include my simple web page below (the final non-working version that I think should work). All anyone needs to do to get this working is create the simple table I described and set themselves up with a Connection.

Thanks for any help anyone can provide!

- Ronn

Source Code:

<%@dotnet.itags.org. Page Language="VB" AutoEventWireup="false" CodeFile="zzzTest1.aspx.vb" Inherits="zzzTest1" %><!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 id="Head1" runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> <asp:SqlDataSource ID="dsTestLookupCategories" runat="server" ConnectionString="<%$ ConnectionStrings:LabTestingConnectionString%>" SelectCommand="SELECT DISTINCT Category FROM TestLookups ORDER BY Category"></asp:SqlDataSource> <asp:SqlDataSource ID="dsTestLookups" runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:LabTestingConnectionString%>" DeleteCommand="DELETE FROM TestLookups WHERE Category = @dotnet.itags.org.Category AND Description = @dotnet.itags.org.Original_Description" InsertCommand="INSERT INTO TestLookups (Category, Description) VALUES (@dotnet.itags.org.Category, @dotnet.itags.org.Description)" OldValuesParameterFormatString="Original_{0}" SelectCommand="SELECT Description FROM TestLookups WHERE (Category = @dotnet.itags.org.Category) ORDER BY Description" UpdateCommand="UPDATE TestLookups SET Description = @dotnet.itags.org.Description WHERE Category = @dotnet.itags.org.Category AND Description = @dotnet.itags.org.Original_Description"> <SelectParameters> <asp:ControlParameter ControlID="ddlCategory" Name="Category" PropertyName="SelectedValue" Type="String" /> </SelectParameters> <InsertParameters> <asp:ControlParameter ControlID="ddlCategory" Name="Category" PropertyName="SelectedValue" Type="String" /> <asp:Parameter Name="Description" Type="String" /> </InsertParameters> <UpdateParameters> <asp:ControlParameter ControlID="ddlCategory" Name="Category" PropertyName="SelectedValue" Type="String" /> <asp:Parameter Name="Description" Type="String" /> <asp:Parameter Name="Original_Description" Type="String" /> </UpdateParameters> <DeleteParameters> <asp:ControlParameter ControlID="ddlCategory" Name="Category" PropertyName="SelectedValue" Type="String" /> <asp:Parameter Name="Original_Description" Type="String" /> </DeleteParameters> </asp:SqlDataSource> </div> <asp:ScriptManager ID="ScriptManager" runat="server" EnablePartialRendering="True"> </asp:ScriptManager> <asp:DropDownList ID="ddlCategory" runat="server" AutoPostBack="True" DataSourceID="dsTestLookupCategories" DataTextField="Category" DataValueField="Category" Width="175px"> </asp:DropDownList><br /> <br /> <asp:UpdatePanel ID="UpdatePanel2" runat="server"> <ContentTemplate>   <asp:DetailsView ID="dvTestLookups" runat="server" AutoGenerateRows="False" DataSourceID="dsTestLookups" DefaultMode="Insert"> <Fields> <asp:TemplateField HeaderText="Add New Lookup" ShowHeader="False" SortExpression="Description"> <InsertItemTemplate> <asp:TextBox ID="txtDescriptionInsert" runat="server" Text='<%# Bind("Description")%>' Width="165px"></asp:TextBox><br /> <asp:RequiredFieldValidator ID="rfvDescription" runat="server" ControlToValidate="txtDescriptionInsert" CssClass="validationtext" Display="Dynamic" ErrorMessage="Lookup text is required"></asp:RequiredFieldValidator> </InsertItemTemplate> <ItemStyle BackColor="#9CBACE" /> </asp:TemplateField> <asp:TemplateField ShowHeader="False"> <InsertItemTemplate> <asp:Button ID="btnInsert" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" Width="60px" /> <asp:Button ID="btnCancel" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" Width="60px" /> </InsertItemTemplate> <ItemStyle BackColor="#9CBACE" HorizontalAlign="Left" /> </asp:TemplateField> </Fields> </asp:DetailsView> </ContentTemplate> </asp:UpdatePanel>   <br /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate>  <asp:GridView ID="gvTestLookups" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataSourceID="dsTestLookups" PageSize="15" Width="550px"> <Columns> <asp:TemplateField HeaderText="Current Lookups" SortExpression="Description"> <EditItemTemplate> <asp:TextBox ID="txtDescription" runat="server" Text='<%# Bind("Description")%>' Width="425px"></asp:TextBox><br /> <asp:RequiredFieldValidator ID="rfvDescription" runat="server" ControlToValidate="txtDescription" CssClass="validationtext" Display="Dynamic" ErrorMessage="Lookup text is required"></asp:RequiredFieldValidator> </EditItemTemplate> <ItemTemplate> <asp:Label ID="lblDescription" runat="server" Text='<%# Bind("Description")%>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField ShowHeader="False"> <EditItemTemplate> <asp:LinkButton ID="btnUpdate" runat="server" CausesValidation="True" CommandName="Update" Text="Update"></asp:LinkButton> <asp:LinkButton ID="btnCancel" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"></asp:LinkButton> </EditItemTemplate> <ItemTemplate> <asp:LinkButton ID="btnEdit" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit"></asp:LinkButton> <asp:LinkButton ID="btnDelete" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete"></asp:LinkButton> <ajaxToolkit:ConfirmButtonExtender ID="cbeDelete" runat="server" ConfirmText="You are about to delete the current lookup. Are you sure?" TargetControlID="btnDelete"> </ajaxToolkit:ConfirmButtonExtender> </ItemTemplate> <ItemStyle HorizontalAlign="Right" Width="100px" /> </asp:TemplateField> </Columns> </asp:GridView> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="ddlCategory" EventName="SelectedIndexChanged" /> </Triggers> </asp:UpdatePanel>  <br />   </form></body></html>

The proper way to isolate validation areas in a page is to use the ValidationGroup property on controls. Set one validationGroup for the controls and validators in the detailsView, and another for the controls and validators in the gridView. You shouldn't need to use UpdatePanels.
This worked great... Thanks!
Validators are not compatable with final version of AJAX
http://weblogs.asp.net/scottgu/archive/2007/01/25/links-to-asp-net-ajax-1-0-resources-and-answers-to-some-common-questions.aspx

Multiple UpdatePanels with Animations

I have three UpdatePanels on a web page. Each of them has an Animation that makes them fade out and back in when updating. I have set the UpdateMode to conditional but when I update one of the panels the other two fade out and don't come back. Does any one have an idea of what's going on here?

Thanks in Advance!!!!!!

I have the same problem ...


This works for me

<body> <form id="form1" runat="server"> <asp:ScriptManager runat="server" ID="ScriptManager" /> <div> <asp:UpdatePanel runat="server" ID="up1" UpdateMode="conditional"> <ContentTemplate> 1:<%=DateTime.Now.ToLongTimeString%> </ContentTemplate> <Triggers><asp:AsyncPostBackTrigger ControlID="Button1" EventName="click" /></Triggers> </asp:UpdatePanel> <asp:UpdatePanel runat="server" ID="up2" UpdateMode="conditional"> <ContentTemplate> 1:<%=DateTime.Now.ToLongTimeString%> </ContentTemplate> <Triggers><asp:AsyncPostBackTrigger ControlID="Button2" EventName="click" /></Triggers> </asp:UpdatePanel> <asp:UpdatePanel runat="server" ID="up3" UpdateMode="conditional"> <ContentTemplate> 1:<%=DateTime.Now.ToLongTimeString%> </ContentTemplate> <Triggers><asp:AsyncPostBackTrigger ControlID="Button3" EventName="click" /></Triggers> </asp:UpdatePanel> <asp:Button runat="server" ID="Button1" Text="Button1" /> <asp:Button runat="server" ID="Button2" Text="Button2" /> <asp:Button runat="server" ID="Button3" Text="Button3" /> <ajaxToolkit:UpdatePanelAnimationExtender ID="ae" runat="server" TargetControlID="up1"> <Animations> <OnUpdated> <Color Duration="1" StartValue="#FF0000" EndValue="#ffffff" Property="style" PropertyKey="backgroundColor" /> </OnUpdated> </Animations></ajaxToolkit:UpdatePanelAnimationExtender><ajaxToolkit:UpdatePanelAnimationExtender ID="UpdatePanelAnimationExtender1" runat="server" TargetControlID="up2"> <Animations> <OnUpdated> <Color Duration="1" StartValue="#00FF00" EndValue="#ffffff" Property="style" PropertyKey="backgroundColor" /> </OnUpdated> </Animations></ajaxToolkit:UpdatePanelAnimationExtender><ajaxToolkit:UpdatePanelAnimationExtender ID="UpdatePanelAnimationExtender2" runat="server" TargetControlID="up3"> <Animations> <OnUpdated> <Color Duration="1" StartValue="#0000FF" EndValue="#ffffff" Property="style" PropertyKey="backgroundColor" /> </OnUpdated> </Animations></ajaxToolkit:UpdatePanelAnimationExtender> </div> </form></body>

Thanks!!! It works great.

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

MultiRequestHandler removing FORM POST parameters

Hi,


My page can not find any parameters sent using the POST methed when the following ATLAS code is contained in the web.config file:

<!-- The MultiRequestHandler enables multiple requests to be handled in one roundtrip to the server. Its use requires Full Trust.-->
<add verb="*" path="atlasbatchcall.axd" type="Microsoft.Web.Services.MultiRequestHandler" validate="false"/>
<add verb="*" path="atlasglob.axd" type="Microsoft.Web.Globalization.GlobalizationHandler" validate="false"/>
<add verb="*" path="*.asbx" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>

All GET parameters are not effected.

Does anyone know how I can resolve this?

Regards

Parlster

Got it.

I misinterpretated the issue.

POST variables are removed when the Session state management is set to Cookieless:

<sessionStatecookieless="true"/>

The lost variables can be found by using GET submission or using Cookies to manage the Session:

<sessionStatecookieless="AutoDetect"/>

Regards

Parlster

Multi-UpdatePanel Problem?

I have a imagebutton and a GridView on a simple web form. The GridView's datasource is a SqlDataSource that has a simple select statement in it. The GridView is inside an UpdatePanel, the ImageButton is not. There is no masterpage. EnablePartialRendering is set to true. When I run it, on the buttons click the GridView is made visible. When displayed the gridview sorts and pages correctly. However, once I add an UpdatePanel to the ImageButton the GridView displays as it should but will not sort or page. I have tried ever scenario I can think of, with Triggers, without Triggers, Mode Conditional, Mode Always. I am at a complete stand still. If anyone can explain what is happening here. I thought you could put as many Update Panels on a page as you wanted.

Thanks!

hello.

are you saying that when you put the linkbutton inside a panel it just stops working? any chance of building a small demo page with this?


Thanks for responding. I have included a test page with two updatepanel and one with only one update panel. I am still stumped. Please let me know what you think...Thanks again

1>>>>>>>>>>>Two UpdatePanel Page234<%@. Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" Title="Untitled Page" %>56<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">7<html xmlns="http://www.w3.org/1999/xhtml" >8910<atlas:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server">1112</atlas:ScriptManager>13<head id="Head1" runat="server">1415</head>16<body>17<form id="form1" runat="server">18<div>19<table style="width: 100%; height: 100%; vertical-align: top; text-align: left;" >202122 <tr align="left">2324 <td valign="top" align="left">252627 <table style="width: 100%; border-right: thin solid;28 border-top: thin solid;29 border-left: thin solid;30 border-bottom: thin solid;">31 <tr style="border-right: thin solid;32 border-top: thin solid;33 border-left: thin solid;34 border-bottom: thin solid;35 width: 100%;36 height: 75px;">37 <td style="width: 25%; vertical-align: middle; text-align: left;">3839 <atlas:UpdatePanel ID="up1" runat="server" Mode="Always">40 <ContentTemplate>41 <asp:ImageButton ID="imbStart" runat="server" ImageUrl="~/images/Approve_32.jpg" OnClick="imbStart_Click" />42 </ContentTemplate>43 </atlas:UpdatePanel>4445 </td>4647 </tr>4849 <tr style="border-right: thin solid; border-top: thin solid; border-left: thin solid;50 width: 100%; border-bottom: thin solid">51 <td colspan="2" style="vertical-align: top; height: 100%; text-align: left">52 <atlas:UpdatePanel ID="UpdatePanel7" runat="server" Mode="Always">53 <ContentTemplate>5455  <asp:GridView ID="gvTrk" runat="server" Width="100%" Caption="Duplicates Trackers" AllowPaging="True" CaptionAlign="Top" Font-Bold="True" AllowSorting="True" AutoGenerateSelectButton="True" DataSourceID="SqlDataSource1" style="position: static" AutoGenerateColumns="False" OnSelectedIndexChanged="gvTrk_SelectedIndexChanged" Visible="False" >56 <Columns>57 <asp:BoundField DataField="UPS185_E_FF_ProdSvcU_ID" HeaderText="UPS185_E_FF_ProdSvcU_ID"58 InsertVisible="False" ReadOnly="True" SortExpression="UPS185_E_FF_ProdSvcU_ID" />59 <asp:CheckBoxField DataField="PrimaryPS_LG" HeaderText="PrimaryPS_LG" SortExpression="PrimaryPS_LG" />60 <asp:BoundField DataField="PkgType_VC" HeaderText="PkgType_VC" SortExpression="PkgType_VC" />61 <asp:BoundField DataField="ChargeCategoryCode_CH" HeaderText="ChargeCategoryCode_CH"62 SortExpression="ChargeCategoryCode_CH" />63 <asp:BoundField DataField="ChargeCategoryDetailCode_CH" HeaderText="ChargeCategoryDetailCode_CH"64 SortExpression="ChargeCategoryDetailCode_CH" />65 <asp:BoundField DataField="ChargeClassificationCode_VC" HeaderText="ChargeClassificationCode_VC"66 SortExpression="ChargeClassificationCode_VC" />67 <asp:BoundField DataField="ChargeDescriptionCode_VC" HeaderText="ChargeDescriptionCode_VC"68 SortExpression="ChargeDescriptionCode_VC" />69 <asp:BoundField DataField="SvcDesc_VC" HeaderText="SvcDesc_VC" SortExpression="SvcDesc_VC" />70 <asp:BoundField DataField="PS_Mstr_ID" HeaderText="PS_Mstr_ID" SortExpression="PS_Mstr_ID" />71 <asp:BoundField DataField="ModeCat_ID" HeaderText="ModeCat_ID" SortExpression="ModeCat_ID" />72 <asp:BoundField DataField="CWTByPkg_PS_ID" HeaderText="CWTByPkg_PS_ID" SortExpression="CWTByPkg_PS_ID" />73 <asp:BoundField DataField="Fuel_ID" HeaderText="Fuel_ID" SortExpression="Fuel_ID" />74 <asp:BoundField DataField="WgtLo_IN" HeaderText="WgtLo_IN" SortExpression="WgtLo_IN" />75 <asp:BoundField DataField="WgtHi_IN" HeaderText="WgtHi_IN" SortExpression="WgtHi_IN" />76 <asp:BoundField DataField="ZoneLo_IN" HeaderText="ZoneLo_IN" SortExpression="ZoneLo_IN" />77 <asp:BoundField DataField="ZoneHi_IN" HeaderText="ZoneHi_IN" SortExpression="ZoneHi_IN" />78 <asp:BoundField DataField="DIFSEX_CH" HeaderText="DIFSEX_CH" SortExpression="DIFSEX_CH" />79 <asp:CheckBoxField DataField="IsCWT_LG" HeaderText="IsCWT_LG" SortExpression="IsCWT_LG" />80 <asp:CheckBoxField DataField="IsRES_LG" HeaderText="IsRES_LG" SortExpression="IsRES_LG" />81 <asp:CheckBoxField DataField="ReRate_LG" HeaderText="ReRate_LG" SortExpression="ReRate_LG" />82 <asp:BoundField DataField="OStPv_CD" HeaderText="OStPv_CD" SortExpression="OStPv_CD" />83 <asp:BoundField DataField="DStPv_CD" HeaderText="DStPv_CD" SortExpression="DStPv_CD" />84 </Columns>85 <SelectedRowStyle BackColor="#FFC080" />86 <HeaderStyle BackColor="SandyBrown" Font-Names="Arial" Font-Size="8pt" />87 <AlternatingRowStyle BackColor="#E0E0E0" />88 </asp:GridView>89 </ContentTemplate>9091 </atlas:UpdatePanel>92 </td>93 </tr>9495 </table>96 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:myEDIConnectionString%>"97 SelectCommand="SELECT UPS185_E_FF_ProdSvcU_T.* FROM UPS185_E_FF_ProdSvcU_T"></asp:SqlDataSource>98 </td>99 <td valign="top" align="left" style="width: 25px">100 </td>101 </tr>102 </table>103</div>104</form>105</body>106</html>107108109>>>>>>One Update Panel Page>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>110111112<%@. Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" Title="Untitled Page" %>113114<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">115<html xmlns="http://www.w3.org/1999/xhtml" >116117118<atlas:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server">119120</atlas:ScriptManager>121<head id="Head1" runat="server">122123</head>124<body>125<form id="form1" runat="server">126<div>127<table style="width: 100%; height: 100%; vertical-align: top; text-align: left;" >128129130 <tr align="left">131132 <td valign="top" align="left">133134135 <table style="width: 100%; border-right: thin solid;136 border-top: thin solid;137 border-left: thin solid;138 border-bottom: thin solid;">139 <tr style="border-right: thin solid;140 border-top: thin solid;141 border-left: thin solid;142 border-bottom: thin solid;143 width: 100%;144 height: 75px;">145 <td style="width: 25%; vertical-align: middle; text-align: left;">146147148149 </td>150151 </tr>152153 <tr style="border-right: thin solid; border-top: thin solid; border-left: thin solid;154 width: 100%; border-bottom: thin solid">155 <td colspan="2" style="vertical-align: top; height: 100%; text-align: left">156 <atlas:UpdatePanel ID="UpdatePanel7" runat="server" Mode="Always">157 <ContentTemplate>158159  <asp:GridView ID="gvTrk" runat="server" Width="100%" Caption="Duplicates Trackers" AllowPaging="True" CaptionAlign="Top" Font-Bold="True" AllowSorting="True" AutoGenerateSelectButton="True" DataSourceID="SqlDataSource1" style="position: static" AutoGenerateColumns="False" OnSelectedIndexChanged="gvTrk_SelectedIndexChanged" Visible="False" >160 <Columns>161 <asp:BoundField DataField="UPS185_E_FF_ProdSvcU_ID" HeaderText="UPS185_E_FF_ProdSvcU_ID"162 InsertVisible="False" ReadOnly="True" SortExpression="UPS185_E_FF_ProdSvcU_ID" />163 <asp:CheckBoxField DataField="PrimaryPS_LG" HeaderText="PrimaryPS_LG" SortExpression="PrimaryPS_LG" />164 <asp:BoundField DataField="PkgType_VC" HeaderText="PkgType_VC" SortExpression="PkgType_VC" />165 <asp:BoundField DataField="ChargeCategoryCode_CH" HeaderText="ChargeCategoryCode_CH"166 SortExpression="ChargeCategoryCode_CH" />167 <asp:BoundField DataField="ChargeCategoryDetailCode_CH" HeaderText="ChargeCategoryDetailCode_CH"168 SortExpression="ChargeCategoryDetailCode_CH" />169 <asp:BoundField DataField="ChargeClassificationCode_VC" HeaderText="ChargeClassificationCode_VC"170 SortExpression="ChargeClassificationCode_VC" />171 <asp:BoundField DataField="ChargeDescriptionCode_VC" HeaderText="ChargeDescriptionCode_VC"172 SortExpression="ChargeDescriptionCode_VC" />173 <asp:BoundField DataField="SvcDesc_VC" HeaderText="SvcDesc_VC" SortExpression="SvcDesc_VC" />174 <asp:BoundField DataField="PS_Mstr_ID" HeaderText="PS_Mstr_ID" SortExpression="PS_Mstr_ID" />175 <asp:BoundField DataField="ModeCat_ID" HeaderText="ModeCat_ID" SortExpression="ModeCat_ID" />176 <asp:BoundField DataField="CWTByPkg_PS_ID" HeaderText="CWTByPkg_PS_ID" SortExpression="CWTByPkg_PS_ID" />177 <asp:BoundField DataField="Fuel_ID" HeaderText="Fuel_ID" SortExpression="Fuel_ID" />178 <asp:BoundField DataField="WgtLo_IN" HeaderText="WgtLo_IN" SortExpression="WgtLo_IN" />179 <asp:BoundField DataField="WgtHi_IN" HeaderText="WgtHi_IN" SortExpression="WgtHi_IN" />180 <asp:BoundField DataField="ZoneLo_IN" HeaderText="ZoneLo_IN" SortExpression="ZoneLo_IN" />181 <asp:BoundField DataField="ZoneHi_IN" HeaderText="ZoneHi_IN" SortExpression="ZoneHi_IN" />182 <asp:BoundField DataField="DIFSEX_CH" HeaderText="DIFSEX_CH" SortExpression="DIFSEX_CH" />183 <asp:CheckBoxField DataField="IsCWT_LG" HeaderText="IsCWT_LG" SortExpression="IsCWT_LG" />184 <asp:CheckBoxField DataField="IsRES_LG" HeaderText="IsRES_LG" SortExpression="IsRES_LG" />185 <asp:CheckBoxField DataField="ReRate_LG" HeaderText="ReRate_LG" SortExpression="ReRate_LG" />186 <asp:BoundField DataField="OStPv_CD" HeaderText="OStPv_CD" SortExpression="OStPv_CD" />187 <asp:BoundField DataField="DStPv_CD" HeaderText="DStPv_CD" SortExpression="DStPv_CD" />188 </Columns>189 <SelectedRowStyle BackColor="#FFC080" />190 <HeaderStyle BackColor="SandyBrown" Font-Names="Arial" Font-Size="8pt" />191 <AlternatingRowStyle BackColor="#E0E0E0" />192 </asp:GridView>193 </ContentTemplate>194195 </atlas:UpdatePanel>196 </td>197 </tr>198199 </table>200 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:myEDIConnectionString%>"201 SelectCommand="SELECT UPS185_E_FF_ProdSvcU_T.* FROM UPS185_E_FF_ProdSvcU_T"></asp:SqlDataSource>202 </td>203 <td valign="top" align="left" style="width: 25px">204 </td>205 </tr>206 </table>207</div>208</form>209</body>210</html>211

Saturday, March 24, 2012

my page is slower with ajax than without it. Help!

Hi,

I am using ajax extensions 1.0 and ajaxcontroltoolkit in my web pages. I only use the calendarextender and the tabcontainer of the toolkit.

On the other hand I use an updatepanel that contains my controls and grid in the page.

When I test the web page with ajax, it is slower than when I test it without the scriptmanager and updatepanel, etc.

I have in the web config:

<compilationdebug="false">

<scriptResourceHandlerenableCompression="true"enableCaching="true"/>

Is it common that ajax is slower than the normal page?

What can I do to make ajax faster?

thanks in advance,

Daniel.

Take a look at this post:http://encosia.com/2007/07/11/why-aspnet-ajax-updatepanels-are-dangerous/

That's not to say you should never use an UpdatePanel, but you need to understand how it works and use it appropriately. Without knowing more about your particular page's design, it's hard to give more specific advice.


Ok, thank you for the information.

I have a question:

Is it bad to have only one updatepanel that surrounds all the controls in the web page? or it is better to have several updatepanels in the web page?

Is not there any other way to put faster the perfomance in ajax to have it the same speed that the web page without ajax?

thanks a lot,

Daniel.


If your page has more than just a few controls on it, I would definitely recommend using multiple UpdatePanels. You can't avoid the ViewState and page reinstantiation, but you can at least cut down on how much HTML is returned and how much work the PageRequestManager has to put into parsing and updating that content. Make sure to use an UpdateMode of Conditional when working with multiple UpdatePanels.

If you want faster performance, try to use web methods or page methods as I describe in my post. When using light weight mechanisms like that, you can both achieve huge performance gains and reduce server load.


Hi,

I am still having the problem: my page is slower with ajax, than without it.

I have an updatepanel for the page. I tried to put the updatepanel only for the gridview but everything was the same, so I think my problem is not that I'm using only one updatepanel for the whole page.

Can you see my code below and help me, please?

I have several panels, objectdatasource, one gridview, code in HTML.

thanks a lot,

Daniel.

<%@.PageLanguage="C#"MasterPageFile="~/_plantillas/plantillamain.master"AutoEventWireup="true"CodeFile="clientesabc.aspx.cs"Inherits="clientes_clientesabc"Title="Untitled Page" %>

<asp:ContentID="Content1"ContentPlaceHolderID="ContentPlaceHolder1"Runat="Server">

<asp:ScriptManagerID="ScriptManager1"runat="server">

</asp:ScriptManager>

<asp:UpdatePanelID="UpdatePanel1"runat="server"UpdateMode="conditional">

<ContentTemplate>

<asp:PanelID="pnlExterior"runat="server"Width="100%">

HTML

<asp:PanelID="pnlDatos"runat="server"Width="100%"Visible="false">

HTML

</asp:Panel>

<asp:PanelID="pnlResumenVentasCompras"runat="server"Width="100%"Visible="false">

HTML

</asp:Panel>

<asp:LabelID="lblTituloGrid"runat="server"CssClass="LabelRealizado"></asp:Label>

<asp:LinkButtonID="lbtQuitarFiltro"runat="server"OnClick="lbtQuitarFiltro_Click"CausesValidation="False">Quitar Filtro</asp:LinkButton><br/>

<asp:GridViewID="gvw1"runat="server"Width="100%"AllowPaging="True"AllowSorting="True"AutoGenerateColumns="False"DataKeyNames="intIDCodigoCliente_fl"DataSourceID="odsClientes"GridLines="Horizontal"CaptionAlign="Left"CssClass="CeldaFondoMasClara"BorderColor="Silver"BorderWidth="1px"OnPageIndexChanged="gvw1_PageIndexChanged"OnPageIndexChanging="gvw1_PageIndexChanging"OnRowDataBound="gvw1_RowDataBound"OnSelectedIndexChanged="gvw1_SelectedIndexChanged"OnSorted="gvw1_Sorted"OnSorting="gvw1_Sorting"PageSize="20">

<Columns>

<asp:TemplateFieldShowHeader="False">

<ItemTemplate>

<asp:ImageButtonID="ibtEliminar"runat="server"CausesValidation="false"CommandName="Delete"ImageUrl="~/_archivos/iconos/gridEliminar.gif"ToolTip="Eliminar"BorderWidth="0"ImageAlign="AbsMiddle"/>

</ItemTemplate>

<ItemStyleWidth="20px"/>

</asp:TemplateField>

<asp:CommandFieldButtonType="Image"ShowSelectButton="True"SelectImageUrl="~/_archivos/iconos/gridSeleccionar.gif"SelectText="Seleccionar">

<ItemStyleWidth="20px"/>

</asp:CommandField>

<asp:TemplateFieldHeaderText="# Cliente"SortExpression="intIDCodigoCliente_fl">

<ItemTemplate>

<asp:LabelID="lblNumeroCliente"runat="server"Text='<%# Bind("intIDCodigoCliente_fl") %>'></asp:Label>

</ItemTemplate>

<ControlStyleCssClass="TextBoxNormal"/>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Sucursal"SortExpression="vchNombreSucursal_fl">

<ItemTemplate>

<asp:LabelID="lblSucursal"runat="server"Text='<%# Bind("vchNombreSucursal_fl") %>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Razón Social"SortExpression="vchRazonSocial_fl">

<ItemTemplate>

<asp:LabelID="lblRazonSocial"runat="server"Text='<%# Bind("vchRazonSocial_fl") %>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="RFC"SortExpression="vchRFC_fl">

<ItemTemplate>

<asp:LabelID="lblRFC"runat="server"Text='<%# Bind("vchRFC_fl") %>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Contacto">

<ItemTemplate>

<spanclass="LabelSubrayado">Telef</span>:<asp:LabelID="lblTelefono1"runat="server"Text='<%# Bind("vchTelefono1_fl") %>'></asp:Label> ,<asp:LabelID="lblTelefono2"runat="server"Text='<%# Eval("vchTelefono2_fl") %>'></asp:Label><br/>

<spanclass="LabelSubrayado">Email</span>:<asp:HyperLinkID="hlkEmail"Text='<%# Bind("vchEmail_fl") %>'NavigateUrl='<%# Correo(Eval("vchEmail_fl")) %>'CssClass="EnlaceSinNegrita"runat="server"></asp:HyperLink><br/>

<spanclass="LabelSubrayado">Contacto</span>:<asp:LabelID="lblContacto"runat="server"Text='<%# Bind("vchContacto_fl") %>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Persona">

<ItemTemplate>

<asp:LabelID="lblPersona"runat="server"Text='<%# TipoPersona(Eval("bitPersonaFisica_fl"))%>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderImageUrl="~/_archivos/iconos/gridusuarioActivar.gif"HeaderText="Activo">

<ItemTemplate>

<asp:CheckBoxID="ckbActivo"runat="server"Checked='<%# ValorBoolean(Eval("IsApproved")) %>'Enabled="false"/>

</ItemTemplate>

<HeaderStyleHorizontalAlign="Center"/>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Tipo de Venta">

<ItemTemplate>

<asp:LabelID="lblTipoVenta"runat="server"Text='<%# Bind("ClienteEstatusVenta")%>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldShowHeader="False"HeaderText="CAMPOS OCULTOS">

<ItemTemplate>

<asp:LabelID="lblNombreCliente"runat="server"Text='<%# Bind("vchNombreCliente_fl") %>'></asp:Label>

<asp:LabelID="lblCalle"runat="server"Text='<%# Bind("vchCalle_fl") %>'></asp:Label>

<asp:LabelID="lblNumExterior"runat="server"Text='<%# Bind("vchNumeroExterior_fl") %>'></asp:Label>

<asp:LabelID="lblNumInterior"runat="server"Text='<%# Bind("vchNumeroInterior_fl") %>'></asp:Label>

<asp:LabelID="lblEntreCalle1"runat="server"Text='<%# Bind("vchEntreCalle1_fl") %>'></asp:Label>

<asp:LabelID="lblEntreCalle2"runat="server"Text='<%# Bind("vchEntreCalle2_fl") %>'></asp:Label>

<asp:LabelID="lblColonia"runat="server"Text='<%# Bind("vchColonia_fl") %>'></asp:Label>

<asp:LabelID="lblEstado"runat="server"Text='<%# Bind("Estado") %>'></asp:Label>

<asp:LabelID="lblMunicipio"runat="server"Text='<%# Bind("Municipio") %>'></asp:Label>

<asp:LabelID="lblPoblacion"runat="server"Text='<%# Bind("vchPoblacion_fl") %>'></asp:Label>

<asp:LabelID="lblFax"runat="server"Text='<%# Bind("vchFax_fl") %>'></asp:Label>

<asp:LabelID="lblCP"runat="server"Text='<%# Bind("vchCodigoPostal_fl") %>'></asp:Label>

<asp:LabelID="lblPrecioLista"runat="server"Text='<%# Bind("sinPrecioListaFacturar_fl") %>'></asp:Label>

<asp:LabelID="lblDescuento"runat="server"Text='<%# Bind("monDescuento_fl") %>'></asp:Label>

<asp:LabelID="lblDiasPlazo"runat="server"Text='<%# Bind("sinDiasPlazoPago_fl") %>'></asp:Label>

<asp:LabelID="lblDescuentoProntoPago"runat="server"Text='<%# Bind("monDescuentoProntoPago_fl") %>'></asp:Label>

<asp:LabelID="lblComision"runat="server"Text='<%# Bind("monComisionVenta_fl") %>'></asp:Label>

<asp:LabelID="lblLimiteCredito"runat="server"Text='<%# Bind("monLimiteCredito_fl") %>'></asp:Label>

<asp:LabelID="lblIDClienteEstatusVenta"runat="server"Text='<%# Bind("sinIDClienteEstatusVenta_fl") %>'></asp:Label>

<asp:LabelID="lblIDClienteMedioEmbarque"runat="server"Text='<%# Bind("sinIDClienteMedioEmbarque_fl") %>'></asp:Label>

<asp:LabelID="lblUserId"runat="server"Text='<%# Bind("UserId") %>'></asp:Label>

<asp:CheckBoxID="ckbCambiaPassword"runat="server"Checked='<%# ValorBoolean(Eval("bitCambiaPassword_fl")) %>'/>

<asp:CheckBoxID="ckbRevLu"runat="server"Checked='<%# ValorBoolean(Eval("bitRevisionLunes_fl")) %>'/>

<asp:CheckBoxID="ckbRevMa"runat="server"Checked='<%# ValorBoolean(Eval("bitRevisionMartes_fl")) %>'/>

<asp:CheckBoxID="ckbRevMi"runat="server"Checked='<%# ValorBoolean(Eval("bitRevisionMiercoles_fl")) %>'/>

<asp:CheckBoxID="ckbRevJu"runat="server"Checked='<%# ValorBoolean(Eval("bitRevisionJueves_fl")) %>'/>

<asp:CheckBoxID="ckbRevVi"runat="server"Checked='<%# ValorBoolean(Eval("bitRevisionViernes_fl")) %>'/>

<asp:CheckBoxID="ckbRevSa"runat="server"Checked='<%# ValorBoolean(Eval("bitRevisionSabado_fl")) %>'/>

<asp:CheckBoxID="ckbPagLu"runat="server"Checked='<%# ValorBoolean(Eval("bitPagoLunes_fl")) %>'/>

<asp:CheckBoxID="ckbPagMa"runat="server"Checked='<%# ValorBoolean(Eval("bitPagoMartes_fl")) %>'/>

<asp:CheckBoxID="ckbPagMi"runat="server"Checked='<%# ValorBoolean(Eval("bitPagoMiercoles_fl")) %>'/>

<asp:CheckBoxID="ckbPagJu"runat="server"Checked='<%# ValorBoolean(Eval("bitPagoJueves_fl")) %>'/>

<asp:CheckBoxID="ckbPagVi"runat="server"Checked='<%# ValorBoolean(Eval("bitPagoViernes_fl")) %>'/>

<asp:CheckBoxID="ckbPagSa"runat="server"Checked='<%# ValorBoolean(Eval("bitPagoSabado_fl")) %>'/>

<asp:LabelID="lblmonVenta01"runat="server"Text='<%# Bind("monVenta01_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta02"runat="server"Text='<%# Bind("monVenta02_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta03"runat="server"Text='<%# Bind("monVenta03_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta04"runat="server"Text='<%# Bind("monVenta04_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta05"runat="server"Text='<%# Bind("monVenta05_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta06"runat="server"Text='<%# Bind("monVenta06_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta07"runat="server"Text='<%# Bind("monVenta07_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta08"runat="server"Text='<%# Bind("monVenta08_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta09"runat="server"Text='<%# Bind("monVenta09_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta10"runat="server"Text='<%# Bind("monVenta10_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta11"runat="server"Text='<%# Bind("monVenta11_fl") %>'></asp:Label>

<asp:LabelID="lblmonVenta12"runat="server"Text='<%# Bind("monVenta12_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado01"runat="server"Text='<%# Bind("monPagado01_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado02"runat="server"Text='<%# Bind("monPagado02_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado03"runat="server"Text='<%# Bind("monPagado03_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado04"runat="server"Text='<%# Bind("monPagado04_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado05"runat="server"Text='<%# Bind("monPagado05_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado06"runat="server"Text='<%# Bind("monPagado06_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado07"runat="server"Text='<%# Bind("monPagado07_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado08"runat="server"Text='<%# Bind("monPagado08_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado09"runat="server"Text='<%# Bind("monPagado09_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado10"runat="server"Text='<%# Bind("monPagado10_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado11"runat="server"Text='<%# Bind("monPagado11_fl") %>'></asp:Label>

<asp:LabelID="lblmonPagado12"runat="server"Text='<%# Bind("monPagado12_fl") %>'></asp:Label>

</ItemTemplate>

<ControlStyleCssClass="oculto"/>

<ItemStyleCssClass="oculto"/>

<HeaderStyleCssClass="oculto"/>

<FooterStyleCssClass="oculto"/>

</asp:TemplateField>

</Columns>

<SelectedRowStyleCssClass="CeldaFilaBrillante"/>

<PagerSettingsMode="NumericFirstLast"/>

<PagerStyleCssClass="GridPaging"/>

<HeaderStyleHorizontalAlign="Left"CssClass="CeldaFondoClara"/>

</asp:GridView>

8 ObjectDataSource

</asp:Panel>

</ContentTemplate>

</asp:UpdatePanel>

</asp:Content>


have you tried to evaluate why the page is slow by using fiddler? This could give you an indication of where the slow down is occuring and also ensure that everything is being cached where it can be.

Also, if you have a large viewstate, you may want to look at overriding the PageStatePersister property and save your viewstate to session using theSessionPageStatePersister object.

my web service call works from one page, not from the other.

have a user control that uses Atlas to call a web service. I drop
this control on a page in the root directory and it works with no
problem. I then add the control to another control, which is on
another page and it will not work. It does not seem to know what the
webService is.

My web service is in the same project and the ascx control and is named
meterCommunication.asmx in a folder called webService.

The control is a button ond onClick it callas a javascript function
that has the following line for calling the web service:
meterCommunication.sendMessage(meterID, commType, _onRequestComplete);

The error that I get is a javascript error that says:
meterCommunication is undefined

I can't figure out what is different between the two pages. Since this
is on a user control they should be identical.

How does the javascript know what meterCommunication is?
I don't know enough about this to troubleshoot the problem.

You need to make sure that you import the web service proxy, either in your page or in the user control. This is done using:
<scriptsrc="/yourapp/subdir/YourService.asmx/js"type="text/javascript"></script>
Maybe you have that only on the page that works?

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.

MyNamespace.MyWebService has no properties error helpp!

Hi all, i have been having trouble getting this to work: Im using masterpages, i set the web reference on the scriptmanager in the masterpage, and the scripreference on the content page, also have a modalpoup IN the content page, a link button in a gridview template and on the clik event (kind of) i call the jscript function to show the modal and execute the webservice(shown below)

HAve a Webservice, that doas a sql query to get certain values from a database:

1using System;2using System.Web;3using System.Collections;4using System.Web.Services;5using System.Web.Services.Protocols;6using System.Web.Script.Services;7using System;8using AjaxControlToolkit;9using System.Data;10using System.Data.SqlClient;11using System.Collections;12using System.Collections.Generic;13using System.Collections.Specialized;1415/// <summary>16/// Summary description for CargarDatos17/// </summary>18[WebService(Namespace ="http://tempuri.org/")]19[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]20[ScriptService]21public class CargarDatos : System.Web.Services.WebService {2223//public CargarDatos () {2425 // //Uncomment the following line if using designed components26 // //InitializeComponent();27 //}2829 [WebMethod()]30 [ScriptMethod()]31 public string GetDynamicContent(string ID_Cliente)32 {33 System.Data.SqlClient.SqlConnection Conn1 = new System.Data.SqlClient.SqlConnection("Data Source=DESKTOP;Initial Catalog=Encuestas;User ID=sa;Password=lf654");34 System.Data.SqlClient.SqlDataAdapter da1 = new System.Data.SqlClient.SqlDataAdapter("SELECT Nombre FROM Clientes WHERE ID_Cliente=@dotnet.itags.org.ID_Cliente", Conn1);35//System.Data.SqlClient.SqlCommand Cmnd = new System.Data.SqlClient.SqlCommand();36 //Cmnd.CommandText = "SELECT Nombre FROM Clientes WHERE ID_Cliente=@dotnet.itags.org.ID_Cliente";37 //Cmnd.Connection = Conn1;38 System.Data.DataSet ds = new System.Data.DataSet();39 try40 {41 da1.SelectCommand.Parameters.AddWithValue("@dotnet.itags.org.ID_Cliente",int.Parse(ID_Cliente));42 Conn1.Open();43 da1.SelectCommand.ExecuteNonQuery();44 da1.Fill(ds);45 Conn1.Close();46return ds.GetXml();47 }48catch (Exception ex)49 {50 Console.WriteLine(ex.Message);51return null;52 }53 }5455}

A Java script function that calls that web service (or at least try:P)

function ShowMyModalPopup(customerid){ var modal = $find('ModalPopupExtender1');

modal.show();

"http://tempuri.org/".CargarDatos.GetDynamicContent(customerid,DisplayResult);

 }

used to show a modalpopup and to pass on values to the web service, and if it works to call another jscript function to populate texboxes in the modalpopup panel.

Have 2 problems: im using firebug to debug client side, and its says to me: "http://tempuri.org/".CargarDatos has no properties...

i get this on the jsdebug:

var CargarDatos=function() {

2CargarDatos.initializeBase(this);

3this._timeout = 0;

4this._userContext = null;

5this._succeeded = null;

6this._failed = null;

7}

8CargarDatos.prototype={

9GetDynamicContent:function(ID_Cliente,succeededCallback, failedCallback, userContext) {

10returnthis._invoke(CargarDatos.get_path(),'GetDynamicContent',false,{ID_Cliente:ID_Cliente},succeededCallback,failedCallback,userContext);}}

11CargarDatos.registerClass('CargarDatos',Sys.Net.WebServiceProxy);

12CargarDatos._staticInstance = new CargarDatos();

13CargarDatos.set_path = function(value) {

14vare = Function._validateParams(arguments, [{name: 'path', type:String}]); if (e) throw e; CargarDatos._staticInstance._path = value; }

15CargarDatos.get_path = function() { return CargarDatos._staticInstance._path; }

16CargarDatos.set_timeout= function(value) { var e = Function._validateParams(arguments, [{name:'timeout', type: Number}]); if (e) throw e; if (value < 0) { throwError.argumentOutOfRange('value', value, Sys.Res.invalidTimeout); }

17CargarDatos._staticInstance._timeout = value; }

18CargarDatos.get_timeout = function() {

19return CargarDatos._staticInstance._timeout; }

20CargarDatos.set_defaultUserContext = function(value) {

21CargarDatos._staticInstance._userContext = value; }

22CargarDatos.get_defaultUserContext = function() {

23return CargarDatos._staticInstance._userContext; }

24CargarDatos.set_defaultSucceededCallback = function(value) {

25vare = Function._validateParams(arguments, [{name:'defaultSucceededCallback', type: Function}]); if (e) throw e;CargarDatos._staticInstance._succeeded = value; }

26CargarDatos.get_defaultSucceededCallback = function() {

27return CargarDatos._staticInstance._succeeded; }

28CargarDatos.set_defaultFailedCallback = function(value) {

29vare = Function._validateParams(arguments, [{name:'defaultFailedCallback', type: Function}]); if (e) throw e;CargarDatos._staticInstance._failed = value; }

30CargarDatos.get_defaultFailedCallback = function() {

31return CargarDatos._staticInstance._failed; }

32CargarDatos.set_path("/sovi1/CargarDatos.asmx");

33CargarDatos.GetDynamicContent=function(ID_Cliente,onSuccess,onFailed,userContext){CargarDatos._staticInstance.GetDynamicContent(ID_Cliente,onSuccess,onFailed,userContext);}

For the type of info there, i assume that it finds the web service, and i can see the method name there, so that should mean that im accesing the WS, but i still dont get why it fails, i never used jscript before neither web services, so its all new to me... so if anyone could point me in the right direction ill be more than gratefull.

Also, im having a Nullreference when i try to invoke the .show method from modalpopup, could this mean that im not finding the modalpopup control?

Plz i have been stuck at this point for over 4 days now.

Tnks in advance.


hi, you just need to drop the http://tempuri.org/" bit from the callback method name, so the method call would be CargarDatos.GetDynamicContent(customerid,DisplayResult);

Cheers Si


Tnks a millon man, it worked!! BUT for a reason... i previously had it that way, and i get the "web service not found error", this was while i was having both, the service reference and the script reference in a scriptmanagerproxy in a content page, i moved those references to a scriptmanager in the master page and then i was hable to find the web service (Mynamespace.mywebservice) but i was getting the above error. Now. i have all the references in the master page, and without the "MyNamespace" i got(U did actuallyStick out tongue) the web service to work.

So the web service issue its fixed, but im still having the modalpopup error, saying that has null on it, i also tryed using:

var modal=document.getElementById('<%=ModalPopupExtender1.ClientID%>');

and still no luck, the modal its on a content page inside a template field in a gridview, if someone can give me a clue on this than it′ll be a completely solved issue.

Tnks again for the rsponse dj Big Smile


No worries dude,

In respsone to your modalpopup problem

var modal=document.getElementById('<%=ModalPopupExtender1.ClientID%>');

This line will not work with the .show() method as it is trying to reference a DOM object not the modalpopup "Behavior" which controls a DOM element. It is the behavior that contains the .show() method. You were correct with this line
var modal = $find('ModalPopupExtender1');

But i'm guessing 'ModalPopupExtender1'is the wrong ID. I guessing if you use $find('<%=ModalPopupExtender1.ClientID%>') this might work, otherwise a quick and dirty way is to view source and look for a line like this(this is from the toolkit samples)

$create(AjaxControlToolkit.ModalPopupBehavior, {"BackgroundCssClass":"modalBackground","DropShadow":true,"PopupControlID":"ctl00_SampleContent_programmaticPopup","PopupDragHandleControlID":"ctl00_SampleContent_programmaticPopupDragHandle","dynamicServicePath":"/AJAX/AjaxControlToolkit/Samples/ModalPopup/ModalPopup.aspx","id":"programmaticModalPopupBehavior","repositionMode":2}, null, null, $get("ctl00_SampleContent_hiddenTargetControlForModalPopup"));

look for this property "id":"programmaticModalPopupBehavior" to find the ID you need to use in the $find() method, in this case it would be $find("programmaticModalPopupBehavior")

Cheers Si


Hi again... as before, u where right on that one too, i was hable to find the modalpopup using the behaviorIDBig Smile, and i need ur wisdom another time to finally get this thing to work, and also ill share a little revelation i had(im sounding like agent Smith...)anyway...im having a lot of trouble finding the textboxes to fill with my jscript function i tryed all this:

document.getElementById('ctl00_ContentPlaceHolder1_TxBxNombreCliente').value=xmlvalue;
document.getElementById('TxBxNombreCliente').value=xmlvalue;
document.getElementById('<%=ContentPlaceHolder1.TxBxNombreCliente.ClientID%>').value=xmlvalue;
document.getElementById('ContentPlaceHolder1.TxBxNombreCliente').value=xmlvalue;
$find('TxBxNombreCliente').value=xmlvalue;
$find('<%=TxBxNombreCliente.ClientID%>').value=xmlvalue;

and absolutely none worked (im trying to set a texbox value).

My revelation its the next... have a masterpage and a few contentpages the thing its that i needit to pass on some values from a content page to another, so i used the Server.Transfer("page2.aspx") on the source page, and virtual path and context.handler on the destination page, being in that one where i was invoking my javascript... and i realized that when y pass on from one webform to the other... the url didnt change so im seeing the content of page2... with the url of page1... so i moved the modalpopup panel to page 1... and was hable to get the thing to work using the

document.getElementById('ctl00_ContentPlaceHolder1_TxBxNombreCliente').value=xmlvalue;

VERY weird... but.. i dont want to use this solution... i want to be hable to find the textbox correcty (also tryed all the above options and none but this one worked)... im clueless by now... u have any idea to share?

Tnks again for the modalpopup thingBig Smile

Farewell

Leandro


HI all again... ill response myself on this matter, cause i was hable to find its solution.

After a lot(A LOT) of testing i manage to locate the control i was searching wothout using the $100_etc_etc_etcMyControl, how? i decided to stop using an external jscript file, and i embbeded the jscript whitin the content tags of the content page, then.. and ONLY then, i could find the textbox using the document.getElementById('<%=TxBxNombreCliente.ClientID%>').value=xmlvalue;

BUT i still cant do it from an external jscript file.... hope that this helps someone else with my same trouble.

Best regards and thns for all...See you all people soonStick out tongue


Farewell

Navigation between pages without refreshing entire page.

Hi

How can i do page navigation without out getting any refresh on web page, LikeNikhil Kothari's Weblog www.nikhilk.net/ .

is there any atlas control to do that ? or How is it possible to enable this ?

Regards,

Gopinath, gopinathnet@dotnet.itags.org.gmail.com

That's not AJAX. It's just a fancy way of transitioning a page. You can google for "web page transition" or check out the following page for some samples:

http://www.hypergurl.com/transition.html

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 async post back from 1 user ctrl to another user ctrl in same master page.

Hi,

I have 3-4 web user ctrl in a Master page. Now this Master Page is being hosted by a page: ViewProductCategories.aspx. Among the userctrls on the MasterPage, I have got an ImageButton (asp:ImageButton) in one of the userctrl (ProductCtrl.ascx). Instances of ProductCtrl.ascx is being loaded dynamically on the ViewProductCategories.aspx dependng on the number of product under a category. So I have to dynamically assign the event handler for the image button click. What I want is: On the click of the asp:ImageButton (AddToCart) there should be a AsyncPostBack that only refreshes the CartCtrl.ascx which is another user ctrl on the same MasterPage, but not the other userctrls on the same master page. Situation is complex. Please let me know if any more info is needed.

Thanks,

Subhadip

Hi

You can check out this link for solution:AsyncPostBackTrigger from another user control

Please check out these linka for more information:

Trigger PostBack to an UpdatePanel from a separate UserControl?

Can I specify a UserControl custom event as a Trigger for update panel on Parent page?

Bubble Event from UserControl

Best Regards

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 about socket programming

hello ,

I tried to create client-server based web site including two page, webserver page is behaves as a server and webclient page as a client of this server..

I try to listen and accept to all clients wants to connect to the server when server page is loading.. but while it begun to listening for client pages, execution of server goes to slow then my server page couldn't open..

I also checked this codes in vb.net ad c# net ,it work correctly.

do you have any idea where can I download a good socket connection sample for asp.net?. I found code written for vb.net or c# desktop applications but I am not able to run this codes in asp.net..

Thank you in advance

im looking for something similar, have u had any luck?

hi aal27

i couldn't find anythin,g i thougth there is no chance to todo this...

send me a message if you find something useful

Wednesday, March 21, 2012

need help Atlas bridge error

hello,

I use atlas framework for my web aplication to prevent refreshing on the page. I had develop my project in my local folder and ran it then it was ok. but when I carry the atlas folder to the iis I faced with a problem like:

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

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

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

Source Error:

Line 63: -->
Line 64: <compilation debug="true">
Line 65: <buildProviders >
Line 66: <add extension=".asbx" type="Microsoft.Web.Services.BridgeBuildProvider"/>
Line 67: </buildProviders
Source File: C:\Inetpub\wwwroot\mos\rac\web.config Line: 65

--------------------

I tried both compiled(published) files and precompiled files to open in iis I had same error.

Please, it is critical for me to solve this problem otherwise I could not publish this site on the net.

I need your help, (I use .net 2005+atlas framework)
Thank you from in advance

Hi,

please check thisthread.

garbin,

I really want thank you again, because I was looking for the solution of this problem for 2 days and found lots of documents but not related to solve this..

thank you again,

Need help Publishing Ajax Web Project

Hello everyone,

My name is Fred and I am new in this site. I want to try out Ajax Control toolkit which I downloaded from this site. I have an issue. I can install the toolkit on my desktop but cannot install on the server. My friend told me that I need to install Ajax Control toolkit on the test/production server as well.

Is it possible to put the toolkit assembly files (or something that I don't know) into my web application setup package? So the sys admin will install it without any special question. Thank you.

Fred.

I went ahead and made a setup package including System.Web.Extensions assembly in the package. After Sys Admin install the package at the server, we got the following message. Please help me.

Parser Error Message:Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (C:\inetpub\wwwroot\Ajax\web.config line 39)

</httpHandlers>Line 38: <httpModules>Line 39: <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>Line 40: </httpModules>Line 41: </system.web>

Hi,

SeeCould not load file or assembly System.Web.Extensions for more information and find out a solution.

This error have many different causes.

A lot of people run into it,and most of them finally figured out it and post up their solution.

Best Regards,