Showing posts with label working. Show all posts
Showing posts with label working. Show all posts

Wednesday, March 28, 2012

Multiple update panels: content disappears when modalpopup is used

Hello there,

I'm experiencing a rather annoying issue at the moment. I'm working on a webapplication, which contains quite a big page. This page contains multiple updatepanels, which in their turn contain dropdownlists/checkboxes. The page also uses a TextboxWatermarkExtender on one textbox control, and a ModalPopup which is shown conditionally by calling .Show() from the codebehind.

The ModalPopupExtender and TextboxWatermarkExtender are not on an updatepanel or anything.

Everything seems to work as it should, but I'm having a rather annoying cosmetic issue: at the moment the modalpopup is shown on my page, all the content of the updatepanels dissapears: none of the dropdownlistboxes are visible anymore!

Something weird also happens when I do any action in any of the updatepanels: when I do this, the TextboxWatermarkExtender seems to "refresh" its text (you see the text "flash").

I'm thinking these issues might be connected somehow... Has anyone got any idea on how to solve this issue, or has anyone else ran into this?

I took a few screnshots to illustrate the problem.

This is how the page looks without the modal popup:

This is with the modal popul:

As you can see, all the dropdownboxes have disappeared. Also, I noticed not only the dropdownboxes in updatepanels diasppear, but those that aren't also disappear.

Any ideas/suggestions? Tnx!


No-one? :( I've been looking all over the internet for this, but I can't seem to find anyone having the same issue. I do find issues with dropdownboxes floating "on top of" a layer when using Internet Explorer, but that's not the problem I have here... Also, I noticed this behaviour doesn't appear in Firefox: everything looks ok when using that browser...

My DDL(s) also disapeer with modal popup!!

And I had another problem with them when the modal popup causes a postback.

So I solved that by wrapping my DDL in another update panel... (with updatemode="always", dunno if that was necessary...)

But it seems to be working now...


And another update: I installed IE7 recently, and in that browser, the problem seems to be solved: the dropdownboxes don't disappear anymore.

So, this really seems to be an IE6-browser issue. I tried putting the ddl's in updatepanels (some of them already were), but that didn't help...

Browser-specific issues... gotta hate 'em ;-)

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

Monday, March 26, 2012

MultiView inside UpdatePanel - Validators not working

Hi All,

I have a problem with a page I'm building at the moment. Basically it includes a multiview with a number of views, in which where there is a usercontrol that contains a number of text fields with custom validators.

Without an updatepanel around the multiview, all works fine. However, when I put an updatepanel around the multiview to prevent full page rendering on postback, the valdidators fail. I have included a very simplified example below to explain my point.

My ASPX Page:

1<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>23<%@dotnet.itags.org. Register src="http://pics.10026.com/?src=WebUserControl.ascx" TagName="WebUserControl" TagPrefix="uc1" %>4<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">5<html xmlns="http://www.w3.org/1999/xhtml">6<head runat="server">7 <title>Untitled Page</title>8</head>9<body>10 <form id="form1" runat="server">11 <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />12 <br />13 <asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline" UpdateMode="Always">14 <ContentTemplate>15 <asp:Button ID="Button1" runat="server" Text="View 1" OnClick="Button1_Click" CausesValidation="false" />16 <asp:Button ID="Button2" runat="server" Text="View 2" OnClick="Button2_Click" CausesValidation="false" />17 <asp:Button ID="Button3" runat="server" Text="View 3" OnClick="Button3_Click" CausesValidation="false" />18 <br />19 <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">20 <asp:View ID="View1" runat="server">21 <asp:Label ID="Label1" runat="server" Text="View 1"></asp:Label>22 <uc1:WebUserControl ID="WebUserControl1" runat="server" />23 </asp:View>24 <asp:View ID="View2" runat="server">25 <asp:Label ID="Label2" runat="server" Text="View 2"></asp:Label>26 <uc1:WebUserControl ID="WebUserControl2" runat="server" />27 </asp:View>28 <asp:View ID="View3" runat="server">29 <asp:Label ID="Label3" runat="server" Text="View 3"></asp:Label>30 <uc1:WebUserControl ID="WebUserControl3" runat="server" />31 </asp:View>32 </asp:MultiView>33 </ContentTemplate>34 </asp:UpdatePanel>35 </form>36</body>37</html>38
Code Behind:
1public partialclass _Default : System.Web.UI.Page {2protected void Page_Load(object sender, EventArgs e) {3 }4protected void Button1_Click(object sender, EventArgs e) {5this.MultiView1.ActiveViewIndex = 0;6 }7protected void Button2_Click(object sender, EventArgs e) {8this.MultiView1.ActiveViewIndex = 1;9 }10protected void Button3_Click(object sender, EventArgs e) {11this.MultiView1.ActiveViewIndex = 2;12 }13}
 The User Control:
 
1<%@dotnet.itags.org. Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs"2 Inherits="WebUserControl" %>34<script type="text/javascript">5 function v(sender, args) {6 var v1 = $get("<%=TextBox1.ClientID%>");7 alert(v1);8 }9</script>1011<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>12<asp:Button ID="Button1" runat="server" Text="Button" CausesValidation="true" />13<asp:CustomValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1"14 Font-Bold="True" Font-Size="X-Large" Text="*" ClientValidationFunction="v" ValidateEmptyText="true" />15

Create the project and add the user control and the default.aspx page. Run it. Try the validator in the View1 (selected by default), it works fine, alerting an [object] to denote the field was found ok.

Switch to another view and all you get alerted is [null] showing the control was not found.

Can anyone get this code to work with the updatepanel?

Andy.

Hi;

Hi;

I had this problem with Ajax Asp.NET Beta 2;
So.. this is a bug, and it was fixed on Features November CTP

http://go.microsoft.com/fwlink/?LinkID=77294

You need download, install and configure the the web.config;
Join it;

[]'s

I was sure I was using the Nov issue. I will check...

Andy.

Multiview, modalPopup, updatepanel, popupcontrolextender

Hello,

I have a multiview that contains six views. Two of the views have update panels on them. I had it working with a popupcontrolextender (for a calender) and using updatepanel to move between the views without postback.

However, I added modalPopup to one of my views and now it doesn't switch between the views anymore. If I take the modalPopup out, it works again.

Has anyone run into this before? If so, how did you get around it?

Check the JavaScript debugger window for script errors, maybe?

MutuallyExclusiveCheckBoxExtender doesnt work if elements are added dynamically

I create my table on the fly and added checkboxes as well as MECBextenders.

The client script is not working on the page. It works as expected if the MECBs are added during design time.

Here is some code to demonstrate population:

1string extenderKey ="AllTheSameKey";23foreach (MvpPoint pointin _selected.FolderPoints)4 {5678switch (point.PointType)9 {10case tPointType.DO:11case tPointType.CP:12 {13continue;14 }15default:16 {17 trow =new TableRow();1819 CheckBox chkSelected =new CheckBox();20string sPointId = point.Handle.ToString();21 chkSelected.ID ="chk" + sPointId;22 chkSelected.Visible =true;23if (point.PointType == tPointType.AI)24 chkSelected.Enabled =true;25else26 chkSelected.Enabled =true;2728 AjaxControlToolkit.MutuallyExclusiveCheckBoxExtender chkExtender =new AjaxControlToolkit.MutuallyExclusiveCheckBoxExtender();29 chkExtender.ID ="chkExt" + sPointId;30 chkExtender.TargetControlID = chkSelected.ID;31 chkExtender.Key = extenderKey;32

The problem ONLY exists if the MutuallyExclusiveCheckBoxExtender is cointeined inside a TabPanel. The IDs get changed by the cointeiner control and the jscript fails to find them.

My ASP.Net Ajax dont work with my localhost server

when i test my ajax page in visual studio debuger , working without any problem ,

but when i try to use in my localhost server, the page cause postback , why

I tested Ajax website in my PC and found it works.But if you specify?asp:PostBack?not?asp:AsyncPostBack,there?will?be?the?
whole?web?page?post?back.

Saturday, March 24, 2012

My host havent got Ajax

Hi;

I want to use Ajax (codename atlas) , my project is working in my computer but my host isn't work (because my host havent got Ajax Confused )

my hosting administrator doesnt allow for setup ajax

What can I do ?please help

THANKS

Sel?uk Ak

Add the needed assemblies to your Bin folder.

Which file I must add \bin directory for standart using ?

Thanks


For RC 1 add: System.Web.Extensions.dll & System.Web.Extensions.Designer.dll usally located C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025 and if you are using the toolkit you must also add: AjaxControlToolkit.dll and this is located where ever the samplewebsite is that came with the Control Toolkit.

I can't found System.Web.Extensions.dll but in this directory (:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025)

I found microsoft.web.extensions.dll and other so I copy this file to my web aplication from the host but after that I take this mistake :(

What Can I do

Thanks

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:Could not load file or assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 37: <compilation debug="true">Line 38: <assemblies>Line 39: <add assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>Line 40: <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies>Line 41: </compilation>


Source File:C:\Inetpub\vhosts\osozluk.com\httpdocs\osozluk\web.config Line:39

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.

WRN: Assembly binding logging is turned OFF.To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.Note: There is some performance penalty associated with assembly bind failure logging.To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210


You're not using the latest version. See here: http://ajax.asp.net/files/AspNet_AJAX_CTP_to_RC_Whitepaper.aspx

I uninstall ajax Ctp and setup new versiyon after I want try new ajax so I make new project ,in this projet there are only one button and a label

when I click buton label text is change, this project is working my computer but when I copy my host still this is not working (and also I make bin directory and copy System.Web.Extensions.dll ,System.Web.Extensions.Design.dll )

I take this mistake again and againSuper Angry

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

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: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.

Source Error:

Line 37: <compilation debug="true">Line 38: <assemblies>Line 39: <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>Line 40: </assemblies>Line 41: </compilation>


Source File:C:\Inetpub\vhosts\osozluk.com\httpdocs\ajaxyeni\web.config Line:39

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.

WRN: Assembly binding logging is turned OFF.To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.Note: There is some performance penalty associated with assembly bind failure logging.To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

my javascript method not working with update panel

Hi All,

The gridview (inside a user control) i am using in my screen (.aspx page) have a Checkbox column in the end. When i click the checkbox in the header all the checkboxes are selected. (A long javascript code has been written for that in the user control)

Now I have applied a scriptmanager and update Panel on this user control, and since then the javascript which selects all the checkboxes is not working properly.

I would like to know what i can do to resolve this javascript issue. And also would like to know why using the basic tools of ASP.NET AJAX control is stopping my own javascript from firing.

Please Note: On leaving a validation on page, the page postback and shows the validation. After this the javascript of Gridview works fine.

I have tried searching on google, but was not able to find any satisfactory explanation to my problem. It would be great if you people can help me.

Thanks,

Shikha

Please post your source code.


Hi,

Thank you for your post!

It is normal when you place inline javascript in an undatepanel/

For more information and solution, seeUpdatePanel and Rendered (Inline)Javascript

It seems that the UpdatePanel essentially replaces the InnerHTML of a DIV with the delta returned from the server. If you try this yourself you will notice that any javascript elements in the html are not fired.

All javascript registered on the server-side (if you are using .NET) with the ScriptManager is put into a separate section of the returned delta. The atlas runtime obviously then loads these scripts into the document manually.

What if the returned HTML has Javascript tags already rendered in it? Nothing.:(
Such was our predicament and we had no control over the HTML that would be returned to the UpdatePanel (ReportViewer Control). Could we manually load the javascript ourselves when the UpdatePanel returns the payload? As it turns, we could.

You can create script elements on the fly and they get evaluated as you do. Atlas has the ScriptLoader object that will do it for you if your JavaScript is an external reference. Tweaking this idea we got a solution that found all the new Script elements and added them to the document.

If you have further questions,let me know.

Best Regards,

Need an idea for clientside-loaded control container

I am working on an Expandable Row Extender that ideally youwould apply on a gridview (or any other databound control that renders a table)to give it an expandable row functionality. However, I want to do as much aspossible in client side (I've seen the approach of adding an item in thedataset, override onitembound to draw it accordingly and then rebind the datato the control to redraw it, and place it all in an update panel but I don'tlike this approach - obvious reasons). Nor do I like the idea of having every"details" row rendered and hidden.

I kind of like how this feels:http://www.codeproject.com/aspnet/MasterDetail.asp and I very much like how asimilar implementation on www.titlez.com.

That being said, I am trying to make the control as genericas possible (and as easy to use as possible), therefore I think the easiest foranybody to use for the details row would be a usercontrol (so that you can useyour own control, which eventually you might reuse as a webpart as well).

Here is where I need the idea: how to dynamically render thecontrol triggered from the client side (to render it in the expanded row).

The trivial solution would be to use an iframe and load aweb form that would load the control, but there is something that doesn't feelright about this approach.

Any ideas?

I think you can embed user controls to a GridView and implement a inline GridView similar to the demo in www.titlez.com.Besides,maybe a third party user control can be used in a GridView,specially about Chart/Graph controls.
Try to take a look at Ajax website - http://Ajax.asp.net.There are a lot of useful Ajax controltoolkit which can help you to implement it and get a nice web page.

Hi Jasson and thank you for your reply.

I know you can embed user controls in a gridview but what I am trying toachieve is a control that does as much as possible on client side (so when youwould expand a row I wouldn't want to hit the server to add a control in thegrid and rebind the grid, even if this would be in an updatepanel especially asyou might have some time-consuming info in the details row and if you wouldhave several open at the same time this architecture would severely affectperformance. Nor do I want to pre-render everything in one go and initiallyhide the rows for the same reason). Also I am not interested at this time aboutthe graphs and other nice things in those rows, I am just down to the very ideaof the extender control. I am well aware of the ajax controls toolkit and what I am doing isan extender using the same framework, actually extending the extenderbase inthe toolkit.

What I have done so far uses IFrames to render the details row and lets youdefine a usercontrol that will be rendered in the expanded row. It goes througha complicated process of autogenerating a form to host the control at runtime.I was looking for ideas of how to do this without IFrames, using somethingsimilar to an updatepanel that would be able to add the user control atruntime.

Hope this makes sense ..


If you would like to achieve a control as much as possible on the client side,javascript is the unique selection.Ajax control toolkit gives us a good direction to this,however,it can not implement what we need now.I believe it can be done in the near future.I agree with you that if we load too many user controls at runtime in the server side and embed them in a complicated control such as Grivew,DetailsView or FormView,it will affect the server performance. Do you mind MagicAjax which also provides a Ajax framework for us to do further development?MagicAjax is open source and we can extend it to meet our requrements.I don't know if you are inerested in it.

Try to take a look at this reading about MagicAjax for your reference -http://www.c-sharpcorner.com/UploadFile/mosessaur/magicajax02112006060506AM/magicajax.aspx?ArticleID=ddd4757e-7ab7-49da-a3f2-d88b340230c3

Wish this can give you some ideas.


Thanks for sharing the idea. I am afraid I am familiar with MagicAjax as well but I don't see it solving this particular issue. MagicAjax is actiong more like the UpdatePanel control in Ms. Ajax. That wouldn't work without rebinding the grid on the server which wouldn't be any faster. Further more, MagicAjax stores everything on the session so it might bring even more concerns.

Wednesday, March 21, 2012

need help for UpdatePanel

Hi

I created one page with AJAX.Net. My page is as follow. It is working fine. but When I click on Save button It save the data into the database and reset the Controls value[using ResetControls() methods]. this method is fired but it is not reset the controls value. I do not know why? Can Any body help me? I put my .aspx and Save button event.

<

asp:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true"></asp:ScriptManager>

<

asp:UpdatePanelID="UpdatePanel1"runat="server">
<ContentTemplate>

<tablecellspacing="0"cellpadding="2"width="97%"border="0"align="center">
<tr><tdalign="right"style="height: 28px"width="18%"></td><tdstyle="height: 28px"width="2%"></td><tdclass="ItemDetail"style="height: 28px"width="80%">
<asp:LabelID="lblMessage"runat="server"SkinID="errorLable"></asp:Label></td></tr></table>

</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTriggerControlID="btnSave"EventName="Click"/>
</Triggers>

</asp:UpdatePanel>

<tablecellspacing="0"cellpadding="2"width="97%"border="0"align="center">
<tr><tdwidth="18%"style="height: 28px"align="right"><asp:LabelID="lblDate"runat="server"Text="Date"SkinID="requiredLabel"></asp:Label></td>
<tdwidth="2%"style="height: 28px"> </td><tdwidth="80%"class="ItemDetail"style="height: 28px">
<asp:TextBoxID="txtDate"runat="server"Columns="15"MaxLength="12"></asp:TextBox>
<asp:Imagerunat="Server"ID="Image1"ImageUrl="~/images/cal.gif"ToolTip="Click to show calendar"style="border-width:0px;"DescriptionUrl="#"/>
<cc1:CalendarExtenderID="CalendarExtender1"runat="server"Format="MMMM d, yyyy"TargetControlID="txtDate"BehaviorID="CalendarExtender1"PopupButtonID="image1">
</cc1:CalendarExtender>
</td></tr><tr><tdalign="right"><asp:LabelID="lblSpeaker"runat="server"Text="Speaker"SkinID="requiredLabel"></asp:Label></td><td> </td><tdclass="ItemDetail">
<asp:TextBoxID="txtSpeakerName"runat="server"Columns="30"MaxLength="50"></asp:TextBox></td></tr>

<tr><tdalign="right"><asp:LabelID="lblTopic"runat="server"Text="Topic"></asp:Label> </td><td> </td><tdclass="ItemDetail">
<asp:TextBoxID="txtTopic"runat="server"Columns="45"MaxLength="100"></asp:TextBox></td></tr
<tr><tdvalign="top"align="right"><asp:LabelID="lblComments"runat="server"Text="Comments"></asp:Label> </td><td> </td><tdclass="ItemDetail">
<tablecellpadding="2"cellspacing="0"border="0"><tr><td>
<FTB:FreeTextBoxID="txtComments"runat="server"AllowHtmlMode="True"BreakMode="LineBreak"
ButtonSet="OfficeXP"ConvertHtmlSymbolsToHtmlCodes="True"DisableIEBackButton="True"Height="175px"SupportFolder="/CRRoot/FreeTextBox/"ToolbarLayout="ParagraphMenu,FontFacesMenu,FontSizesMenu,FontForeColorsMenu|Bold,Italic,Underline,Strikethrough;Superscript,Subscript,RemoveFormat|JustifyLeft,JustifyRight,JustifyCenter,JustifyFull;BulletedList,NumberedList,Indent,Outdent;CreateLink,Unlink,InsertImage,InsertRule|Cut,Copy,Paste;Undo,Redo,Print,InsertImageFromGallery"></FTB:FreeTextBox> </td></tr></table></td></tr
<tr><tdclass="ItemHeading"valign="top"align="right"></td><td></td><tdclass="ItemDetail"></td></tr
<tr><tdcolspan="3"class="CommandBar"> <asp:ButtonID="btnSave"runat="server"Text=" Save "OnClick="btnSave_Click"AccessKey="S"/>
<asp:ButtonID="btnCancel"runat="server"Text=" Cancel "CausesValidation="False"OnClick="btnCancel_Click1"AccessKey="C"/></td></tr
</table
===============================

protectedvoid btnSave_Click(object sender,EventArgs e){

string Errors = validation();
if (Errors.Length > 0)
{
lblMessage.Text = Errors;
lblMessage.Visible =true;
return;}DateTime SpeakerDate =DateTime.Today;
DateTime.TryParse(txtDate.Text.Trim(),out SpeakerDate);
string SpeakerName = txtSpeakerName.Text.Trim();
string Topic = txtTopic.Text.Trim();
string Comments = txtComments.Text.Trim();
string Action = ((Utilities.ProcessStatus)this.ProcessMode).ToString();
int Success =Speaker.SpeakerAddEditDelete(CookiesInfo.ClubId,this.SpeakerId, SpeakerDate,
SpeakerName, Topic, Comments, Action);
if (Success == -1)
{
lblMessage.Text =" - Record has not been saved. Please check the inputs.";
lblMessage.Visible =true;
}else{
ResetControls();
lblMessage.Text =" - Record has been saved successfully.";
lblMessage.Visible =true;
}
}privatevoid ResetControls(){

txtDate.Text =String.Format("{0:MMMM d, yyyy}",DateTime.Today);
txtSpeakerName.Text =string.Empty;
txtComments.Text =string.Empty;
txtTopic.Text =string.Empty;

}

The textboxes are not part of the UpdatePanel's ContentTemplate.

hence , inaccessible from the server.

Move them inside the UpdatePanel and they will be accessible .

Hope this helps

need help for vb populate drop down

Hello,

making progress in trying to get atlas working...But not quite there yet...

To populate the dropdownlists from a database:

Public Function populateProjectDDL()
Dim knownCategoryValues As String
Dim category As String
(...)
(Filled my dataset called ds1.)

For Each datarowitem As DataRow In ds1.Tables(0).Rows
?!?!?!?!

Next

return ?!?!?!
end function

What do I return, how do i fill the whatever i return?

(http://atlas.asp.net/atlastoolkit/Walkthrough/CCDWithDB.aspx[^]
was trying to follow that example but they lost me in the c++)

Please help me?

Made more progress, but [method error 500] in the first drop down list...

Here is my code so far:

File "Webservice.asmx":

<%@.WebServiceLanguage="VB"Class="WebService" %>

Imports System.Web

Imports System.Web.Services

Imports System.Web.Services.Protocols

Imports AtlasControlToolkit

Imports System.Collections.Generic

Namespace Wells_KM_System

<WebService(Namespace:="http://tempuri.org/")> _

<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _

PublicClass WebService

Inherits System.Web.Services.WebService

Protected ds1As DataSet

Protected dbComponent1AsNew DataBase

<WebMethod()> _

PublicFunction populateProjectDDL(ByVal knownCategoryValuesAsString,ByVal categoryAsString)As CascadingDropDownNameValue()

'Dim knownCategoryValues As String

'Dim category As String

'Which projects to show:

If Session("admin") = 1Then

ds1 = dbComponent1.selectOneCondition("Project","active", 1)

'info1.InnerText = "As admin, you see inactive projects, wells, sections and Drilling units as well."

Else

Dim querystr ="SELECT DISTINCT P.project_id, P.project_name FROM Project as P, UserRole as UR WHERE "

querystr = querystr +"UR.user_id = " & Session("active_user") &" AND "

querystr = querystr +"UR.project_id = P.project_id AND "

querystr = querystr +"P.active = 1"

ds1 = dbComponent1.query(querystr)

EndIf

Dim objTableAs System.Data.DataTable

objTable = ds1.Tables(0)

If ds1.Tables(0).Rows.Count > 0Then'user can set defaults

With objTable

Dim intRowAsInteger

Dim valuesAs List(Of CascadingDropDownNameValue) =New List(Of CascadingDropDownNameValue)

For intRow = 0To .Rows.Count - 1

values.Add(New CascadingDropDownNameValue(.Rows(intRow).Item("project_name").ToString, .Rows(intRow).Item("project_id")))

Next

Return values.ToArray

EndWith

ReturnNew CascadingDropDownNameValue() {}

'Return knownCategoryValues

'Return category

Else

ReturnNothing

EndIf

ds1.Clear()

EndFunction

EndClass

EndNamespace

And the aspx file with the drop downs:

<%@.PageLanguage="VB"AutoEventWireup="false"CodeFile="MyDefaults.aspx.vb"Inherits="Wells_KM_System.Personal_MyDefaults" %>

<%@.RegisterAssembly="AtlasControlToolkit"Namespace="AtlasControlToolkit"TagPrefix="atlasToolkit" %>

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

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

<headrunat="server">

<title>Set my defaults</title>

<METAhttp-equiv="Content-Type"content="text/html; charset=windows-1252">

<metacontent="Microsoft Visual Studio .NET 7.1"name="GENERATOR">

<metacontent="Visual Basic .NET 7.1"name="CODE_LANGUAGE">

<metacontent="JavaScript"name="vs_defaultClientScript">

<metacontent="http://schemas.microsoft.com/intellisense/ie5"name="vs_targetSchema">

<LINKhref="../Wells_KM_System_Styles.css"type="text/css"rel="stylesheet">

</head>

<body>

<formid="form1"runat="server">

<div>

<asp:LabelID="Label1"runat="server"CssClass="label"Style="z-index: 100; left: 35px;

position: absolute; top: 156px"Text="Select your default well:"></asp:Label>

<asp:LabelID="Label2"runat="server"CssClass="label"Style="z-index: 101; left: 33px;

position: absolute; top: 96px"Text="Select your default project:"></asp:Label>

<asp:LabelID="Label3"runat="server"CssClass="heading"Style="z-index: 102; left: 35px;

position: absolute; top: 24px"Text="Set your default values:"></asp:Label>

<asp:LabelID="Label4"runat="server"CssClass="label"Height="6px"Style="z-index: 103;

left: 35px; position: absolute; top: 214px"Text="Select your default section:"

Width="161px"></asp:Label>

<asp:LabelID="Label5"runat="server"CssClass="label"Height="1px"Style="z-index: 104;

left: 36px; position: absolute; top: 273px"Text="Select your default drilling unit:"

Width="178px">

</asp:Label>

<asp:DropDownListID="projectDDL"runat="server"CssClass="label"Style="z-index: 105;

left: 281px; position: absolute; top: 92px"AutoPostBack="True"TabIndex="1">

</asp:DropDownList>

<asp:DropDownListID="wellDDL"runat="server"CssClass="label"Style="z-index: 106;

left: 281px; position: absolute; top: 154px"AutoPostBack="True"TabIndex="2">

</asp:DropDownList>

<asp:DropDownListID="sectionDDL"runat="server"CssClass="label"Style="z-index: 107;

left: 281px; position: absolute; top: 214px"TabIndex="3">

</asp:DropDownList>

<asp:DropDownListID="drillingunitDDL"runat="server"CssClass="label"Style="z-index: 108;

left: 282px; position: absolute; top: 271px"TabIndex="4">

</asp:DropDownList>

<asp:ButtonID="Save"runat="server"CssClass="button"Style="z-index: 109; left: 34px;

position: absolute; top: 340px"Text="Save defaults"TabIndex="5"/>

<asp:LabelID="Label6"runat="server"CssClass="normal"Height="3px"Style="z-index: 110;

left: 237px; position: absolute; top: 27px"Text="(These values will be used to automatically set these values when you use the application, but you will still be able to change them)"

Width="325px"></asp:Label>

<divid="info1"runat="server"class="notice"style="display: inline; z-index: 111;

left: 578px; width: 303px; color: red; position: absolute; top: 89px; height: 54px">

</div>

<divid="info2"runat="server"class="notice"style="display: inline; z-index: 112;

left: 178px; width: 200px; color: red; position: absolute; top: 342px; height: 15px">

</div>

<atlas:ScriptManagerid="ScriptManager1"EnablePartialRendering="true"runat="server"></atlas:ScriptManager>

<atlasToolkit:CascadingDropDownID="CascadingDropDown1"

runat="server">

<atlasToolkit:CascadingDropDownProperties

TargetControlID="projectDDL"

Category="Project"

PromptText="Select a project"

ServicePath="WebService.asmx"

ServiceMethod="populateProjectDDL"/>

<atlasToolkit:CascadingDropDownProperties

TargetControlID="wellDDL"

ParentControlID="projectDDL"

PromptText="Select a well"

ServiceMethod="populateWellDDL"

ServicePath="WebService.asmx"

Category="Well"/>

<atlasToolkit:CascadingDropDownProperties

TargetControlID="sectionDDL"

ParentControlID="wellDDL"

PromptText="Select a section"

ServiceMethod="populateSectionDDL"

ServicePath="WebService.asmx"

Category="Section"/>

</atlasToolkit:CascadingDropDown>

</div>

</form>

</body>

</html>

(Only trying to populate the first drop down list for now)


Have you seenFAQ#20?

Hi,

thx for reply, but I tried that (read the faq, searched forum, read a lot of posts: that's how I got that far...)

Sometimes it gives me [Method error 12031] as well in the drop down list. And so far, as I wrote, I'm only trying to get the first drop down to populate... Think I should be good once I get one to work.

Now I'm thinking the WebService.asmx file is not even kicking in: put a breakpoint on the line:

PublicFunction populateProjectDDL(ByVal knownCategoryValuesAsString,ByVal categoryAsString)As CascadingDropDownNameValue()

But it never kicks in...

I would be very gratefull if someone manages to spot what goes wrong, I'm really eager to see this working and have been sweating on this for 4 days now...


Ok!

I watched this:

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

And I noticed he populated the first one with a PageMethod, and a script on the aspx page.

I tried that and it got my first DDL populated!!! (which resulted in a little cry of joy)

Sorry about the double post, but there's no edit button, and I don't want anyone wasting time here when I solved it!

But I have no idea why this was the way to do it... But it worked...

Moving on to the next drop downs...

Microsoft #1 !!! Developpers!Developpers!Developpers! :P


Moving on to the second drop down:

1. With a breakpoint in the asmx file, it seems it's never kicking in either...

2. How would I get the first drop downs selected value (needed for the sql query for second drop down, in vb of course...)

Complete WebService.asmx:

<%@.WebServiceLanguage="VB"Class="WebService" %>

Imports System.Web

Imports System.Web.Services

Imports System.Web.Services.Protocols

Imports AtlasControlToolkit

Imports System.Collections.Generic

Namespace Wells_KM_System

<WebService(Namespace:="http://tempuri.org/")> _

<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _

PublicClass WebService

Inherits System.Web.Services.WebService

Protected ds1As DataSet

Protected dbComponent1AsNew DataBase

<WebMethod()> _

PrivateFunction populateWellDDL(ByVal knownCategoryValuesAsString,ByVal categoryAsString)As AtlasControlToolkit.CascadingDropDownNameValue()

'populate:

Dim conditionFAsString() = {"project_id","active"}

Dim conditionVAsString() = {projectDDL.SelectedValue, 1}

ds1 = dbComponent1.selectMultipleCondition("Well", conditionF, conditionV)

If ds1.Tables(0).Rows.Count > 0Then

Dim objTableAs System.Data.DataTable

objTable = ds1.Tables(0)

With objTable

Dim intRowAsInteger

Dim valuesAs List(Of CascadingDropDownNameValue) =New List(Of CascadingDropDownNameValue)

For intRow = 0To .Rows.Count - 1

values.Add(New CascadingDropDownNameValue(.Rows(intRow).Item("well_name").ToString, .Rows(intRow).Item("well_id")))

Next

Return values.ToArray

EndWith

ReturnNew CascadingDropDownNameValue() {}

Else

ReturnNothing

EndIf

ds1.Clear()

EndFunction

EndClass

EndNamespace

<%@.WebServiceLanguage="VB"Class="WebService" %>

Imports System.Web

Imports System.Web.Services

Imports System.Web.Services.Protocols

Imports AtlasControlToolkit

Imports System.Collections.Generic

Namespace Wells_KM_System

<WebService(Namespace:="http://tempuri.org/")> _

<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _

PublicClass WebService

Inherits System.Web.Services.WebService

Protected ds1As DataSet

Protected dbComponent1AsNew DataBase

<WebMethod()> _

PrivateFunction populateWellDDL(ByVal knownCategoryValuesAsString,ByVal categoryAsString)As AtlasControlToolkit.CascadingDropDownNameValue()

'populate:

Dim conditionFAsString() = {"project_id","active"}

Dim conditionVAsString() = {projectDDL.SelectedValue, 1}

ds1 = dbComponent1.selectMultipleCondition("Well", conditionF, conditionV)

If ds1.Tables(0).Rows.Count > 0Then

Dim objTableAs System.Data.DataTable

objTable = ds1.Tables(0)

With objTable

Dim intRowAsInteger

Dim valuesAs List(Of CascadingDropDownNameValue) =New List(Of CascadingDropDownNameValue)

For intRow = 0To .Rows.Count - 1

values.Add(New CascadingDropDownNameValue(.Rows(intRow).Item("well_name").ToString, .Rows(intRow).Item("well_id")))

Next

Return values.ToArray

EndWith

ReturnNew CascadingDropDownNameValue() {}

Else

ReturnNothing

EndIf

ds1.Clear()

EndFunction

EndClass

EndNamespace

----- In the aspx file:

<asp:DropDownListID="projectDDL"runat="server"CssClass="label"Style="z-index: 105;

left: 281px; position: absolute; top: 92px"AutoPostBack="True"TabIndex="1">

</asp:DropDownList>

<asp:DropDownListID="wellDDL"runat="server"CssClass="label"Style="z-index: 106;

left: 281px; position: absolute; top: 154px"AutoPostBack="True"TabIndex="2">

</asp:DropDownList>

<asp:DropDownListID="sectionDDL"runat="server"CssClass="label"Style="z-index: 107;

left: 281px; position: absolute; top: 214px"TabIndex="3">

</asp:DropDownList>

<atlasToolkit:CascadingDropDownID="CascadingDropDown1"runat="server">

<atlasToolkit:CascadingDropDownProperties

TargetControlID="projectDDL"

Category="Project"

PromptText="Select a project"

ServiceMethod="populateProjectDDLPageMethod"/>

<atlasToolkit:CascadingDropDownProperties

TargetControlID="wellDDL"

ParentControlID="projectDDL"

PromptText="Select a well"

ServiceMethod="populateWellDDL"

ServicePath="WebService.asmx"

Category="Well"/>

<atlasToolkit:CascadingDropDownProperties

TargetControlID="sectionDDL"

ParentControlID="wellDDL"

PromptText="Select a section"

ServiceMethod="populateSectionDDL"

ServicePath="WebService.asmx"

Category="Section"/>

</atlasToolkit:CascadingDropDown>


1. Check that your web.config allows Atlas to use web services (I think there's a special entry in there).

2. Have a look at the AtlasControlToolkit.CascadingDropDown.ParseKnownCategoryValuesString method as used by CarsService.cs. This method returns the selected value of a CDD and all its parents.


My web.config is good...

And I got it working by putting all the populate drop down lists in the aspx file... Seems to work, but it's ugly; would have been nicer with a asmx file.. What I did feels like a workaround (and i would have liked to use that webservice.asmx to populate similar drop downs threw the rest of my project). The end result is still much better than the entire page with tons of controls blinking, which could make a user think the datagrid was being updated at every drop down selection.

I'll still be checking here just in case someone ever spots what's wrong, or if I find out I'll come post the solution (I'm sure someone will find it useful?)

But for now I have to move on, can't stay stuck on the webservice thing too long.


Ok, last (i hope) noob question:

What's the line to get the selected value with VB?

variable = ?

Or to set it...

? = variable


Hi,

Check outhttp://forums.asp.net/thread/1391360.aspx.

Thanks,
Ted

I had a similar problem this weekend, after changing the source code for CCDs I couldn't get any of them to populate, checked all my web service methods, source code numerous times and everything seemed right. Triple checked I had copied all of the web.config settings from the sample web site, but still no joy. Eventually I spotted a new attribute attached the the web service class in the sample app, copied this to my own project and voila everything works again.

This is what needs to be attached to the class that implements your web methods:

C#
[Microsoft.Web.Script.Services.ScriptService()]

VB.NET
<Microsoft.Web.Script.Services.ScriptService()>

This the definition of my class just to show it in context

[WebService(Namespace =http://virtualrealitycycling.com/)]
[WebServiceBinding(ConformsTo =WsiProfiles.BasicProfile1_1)]
[Microsoft.Web.Script.Services.ScriptService()]
publicclassSoftwareService : System.Web.Services.WebService
{

//methods in here

}

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 with a modal extender control

I am working on a project that has two modal extenders on one page, and two panels. Which have their own separate buttons which can trigger each panel to open. On the same form there is a gridview control, the user will select a row then in the code behind i trigger the click event for one of the button, so that it will oepn one of the panel it seemed to work fine before just using modalextender...1.show() when it stop working i added the code to raisethe click event for the control. After doing so it doesn;t open the panel instead, i have to click the button that that is setup as theTargetControlID two or three time just for the pop up menu to open. What is the right way to go about doing this. I wander if anyone else has had the same problem.

((IPostBackEventHandler)lnkPanel2).RaisePostBackEvent(null);

this.ModalPopupExtender2.Show();

Hi Lew26,

My suggestion is use Javascript to show the ModalPopupExtender directly. For example:

use $find("ModalPopupExtender's BehaviorID ").show(); to show the Panel and use $find("ModalPopupExtender's BehaviorID ").hide(); to hide the showing Panel. The Buttons which will lead the ModalPopupExtender to shown or to hidden should be put inside a hidden div. Take an example: <div style="display:none">your Buttons</div>. Here is my sample:

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<script runat="server"
protected void Page_Load(object sender, EventArgs e)
{
//Attach a Javascript funtion to the LinkButton.
LinkButton myLinkButton;
for (int i = 0; i < GridView1.Rows.Count; i++)
{
myLinkButton = (LinkButton)GridView1.Rows[i].Cells[4].FindControl("LinkButton1");
myLinkButton.Attributes.Add("onclick", "shopModalPopup('" + GridView1.Rows[i].Cells[0].Text + "');return false;");
}
}
</script
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<style>
.modalBackground {
background-color:Gray;
filter:alpha(opacity=70);
opacity:0.7;
}

.modalPopup {
background-color:#FFD9D5;
border-width:3px;
border-style:solid;
border-color:Gray;
padding:3px;
width:250px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="EmployeeID"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="EmployeeID" HeaderText="EmployeeID" InsertVisible="False"
ReadOnly="True" SortExpression="EmployeeID" ItemStyle-Width="0" />
<asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" />
<asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" />
<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server">Click On Me</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NORTHWNDConnectionString%>"
SelectCommand="SELECT [EmployeeID], [LastName], [FirstName], [Title] FROM [Employees]">
</asp:SqlDataSource>
<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Height="200px" Width="300px" style="display:none">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
EmployeeID:<asp:TextBox ID="tbEmployeeID" runat="server"></asp:TextBox> <br/>
Reason:<asp:TextBox ID="tbReason" runat="server"></asp:TextBox>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Button ID="btnCancel" runat="server" Text="Cancel" />
</asp:Panel>
<div style="display: none">
<asp:Button ID="Button1" runat="server" Text="Button" /></div>
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="Button1"
PopupControlID="Panel1" CancelControlID="btnCancel" BackgroundCssClass="modalBackground">
</ajaxToolkit:ModalPopupExtender>
<script type="text/javascript" language="javascript">
function shopModalPopup(employeeID){
//show the ModalPopupExtender
$get("<%=tbEmployeeID.ClientID%>").value = employeeID;
$get("<%=tbReason.ClientID%>").value ="";
$find("<%=ModalPopupExtender1.ClientID%>").show();
}
</script>
</form>
</body>
</html>

I hope this help.

Best regards,

Jonathan

Need Help with Ajax Examples

Hi..

can anybody provide a working example of using the dropdownlist and grid view control and saving the data with a button using AJAX..

please help..

The page requirements:
1) Table/Grid displays a list of states (U.S. states) with a column for the state name and a column that contains a dropdown list of the state's cities.
2) Upon selecting a city, the page will display the city name (and perhaps futher lookup some information specific to the city).

The basic ASP.NET flow here is (using 2.0 here, but works similarly in 1.1 using DataGrid):
1) Create a GridView with a bound column for state and a template column for the DropDownList
2) Create a label to display the city name upon selecting it in the DropDownList.
3) Bind the GridView to an array of state objects (could be bound to many other things as well, but keeping it simple for this example). State contains properties for Name and for Cities.
4) Hookup RowCreated event on the GridView so that we can populate the cities into the particular row's DropDownList.
5) Add postback event for getting the selected city and populating the label with it.

Here's what the aspx code looks like:

<asp:GridView ID="gvStates" AutoGenerateColumns="false"
runat="server" OnRowCreated="gvStates_RowCreated">
<Columns>
<asp:BoundField HeaderText="State" DataField="Name" />
<asp:TemplateField HeaderText="Cities">
<ItemTemplate>
<asp:DropDownList ID="ddlCities"
AutoPostBack="true" runat="server"
OnSelectedIndexChanged="ddlCities_SelectedIndexChanged">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView
<asp:Label ID="lblCity" runat="server" Text="Label">
</asp:Label
And here's the code behind:

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// Create states array and bind it to Grid
ArrayList states = new ArrayList();

string[] cities =
new string[] { "Portland", "Salem", "Eugene" };
State state = new State("OR", cities);
states.Add(state);
cities =
new string[] { "Seattle", "Tacoma", "Olympia" };
state = new State("WA", cities);
states.Add(state);

this.gvStates.DataSource = states;
this.gvStates.DataBind();
}
}

protected void gvStates_RowCreated(object sender,
GridViewRowEventArgs e)
{
if (!IsPostBack)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
// Bind drop down to cities
DropDownList ddl =
(DropDownList)e.Row.FindControl("ddlCities");
ddl.DataSource = ((State)e.Row.DataItem).Cities;
ddl.DataBind();
}
}
}

protected void ddlCities_SelectedIndexChanged(object sender,
EventArgs e)
{
this.lblCity.Text = ((DropDownList)sender).SelectedValue;
}

In Ajax framework,you can place them in a asp:UpdatePanel and specify asynchronous postback in the triggers of the asp:UpdatePanel.

Wish this can help you.