Showing posts with label control. Show all posts
Showing posts with label control. Show all posts

Wednesday, March 28, 2012

Changing focus when date selected in CalendarExtender control

This may fall more within the realm of general ASP.NET web development, but since it's regarding an AJAX Control Toolkit control, I thought it'd be best posted here.

I'm finding a "feature" of the calendar extender behavior to be be quite annoying. It seems that by default when a date is selected on the calendar and the selected date displays in the associated textbox, the calendar itself stays displayed and the only way I've found to get rid of it is to click anywhere outside the calendar itself. You can't tab out of it to the next textbox, Enter won't get rid of it, etc.

I'm sure there's a way to have the calendar collapse when the date is changed, but I just don't know how - could someone provide a way to do this?

Here's the code for my calendarextender:

<asp:TemplateField HeaderText="Date"><ItemTemplate><asp:Label ID="lblWeatherDate" runat="server" Text='<%# Bind("WeatherDate", "{0:dd-mm-yyyy}")%>' /></ItemTemplate><EditItemTemplate><%-- OnTextChanged="txtWeatherDate_OnTextChanged" --%><asp:TextBox ID="txtWeatherDate" Text='<%# Bind("WeatherDate")%>' runat="server"TabIndex="0" Width="80px" Font-Size="10px" /><ajaxToolkit:MaskedEditExtender ID="editExtWeatherDate" runat="server" TargetControlID="txtWeatherDate" Mask="99/99/9999" MaskType="Date" MessageValidatorTip="True" OnFocusCssClass="MaskedEditFocus" OnInvalidCssClass="MaskedEditError" ErrorTooltipEnabled="True" /><ajaxToolkit:MaskedEditValidator ID="editValidatorWeatherDate" runat="server" ControlExtender="editExtWeatherDate" ControlToValidate="txtWeatherDate" IsValidEmpty="True" InvalidValueMessage="Invalid entry. Select a date from the calendar or enter the format "mm\dd\yyyy"" Display="Dynamic" InvalidValueBlurredMessage="Error" /><ajaxToolkit:CalendarExtender ID="calExtWeatherDate" runat="server" Enabled="True" TargetControlID="txtWeatherDate" Format="MM/dd/yyyy" /></EditItemTemplate></asp:TemplateField>

As you can see I tried messing with the OnTextChanged of the textbox and started up with this code:

Sub txtWeatherDate_TextChanged(ByVal senderAs Object,ByVal eAs EventArgs)Handles txtWeatherDate.TextChangedDim txtWeatherDateAs TextBox =Me.gvWeather.FindControl("txtWeatherDate")txtWeatherDate.End Sub

But I couldn't figure out where to go with that. I was looking for something to do with changing the focus of the textbox, but couldn't figure that out.

Any help would be greatly appreciated.

Thanks!

this is in c# but this is how i get the calendar extender to close on date click

to close the calendar onClick i set this up in the code behind

//Hide the calendarprotected override void OnLoad(EventArgs e) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"hideCalendar", @."function hideCalendar(cb) { cb.hide(); }",true);base.OnLoad(e); }

and this is what the asp code looks like

 <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDate" OnClientDateSelectionChanged='hideCalendar'>

Hey, keyboardcowboy

Thanks for the code. It was pretty much a copy-paste thing. The C# converted nicely in a code converter. After selecting the date, the calendar disappears, as it should.

However, the oddest thing is happening now: The date displays in the date label as "dd-00-yyyy". I.e. the proper date number,two zeros for the month, then the proper year. This is regardless of what formatting I use for either the extender or the textbox (I was usingFormat="MM/dd/yyyy" in the extender). The date in the sql table it's coming from is correct and the date can be changed and saved (this is in a gridview) properly and it is even displayed properly when the textbox is showing while the gridview is in edit mode. It's just messed up in the label.

I was using the following for the bound text value for the date label:Text='<%# Bind("WeatherDate", "{0:dd-mm-yyyy}")%>'.When I remove the formatting string the date displays properly, but with the time as well. I can't get the date formatted to mm-dd-yyyy now!

Any thoughts?

Thanks


Okay, I caught one thing I was doing wrong: I was using two different formats: dd-mm-yyyy in the label and mm-dd-yyyy in the textbox.

But unfortunately, getting those two to the same format didn't fix the display problem. It's still displaying the month as two zeros (00). And that's regardless of whether I set the format as dd-mm-yyyy or mm-dd-yyyy.

Weird...


weird. maybe if that format string you are trying doesnt work you can try this .ToShortDateString(); that will display a date but without the time. it works in c# in sure it does in vb also so try this (not sure if it will work because i think casting types is different in vb)

Text='<% # ((DateTime)Bind("WeatherDate")).ToShortDateString()%>'


Yeah - I tried just putting it in my label, but got a build error, saying "DateTime" is a type and cannot be used as an expression. I don't know quite enough to know how to change it to work for my VB code.


Okay - found out CDate is used for casting dates. But I can't find quite the right syntax. I've tried: Text='<%# Bind(CDate("WeatherDate")).ToShortDateString() %>' , and Text='<%# CDate(Bind("WeatherDate")).ToShortDateString() %>' and even Text='<%# Bind((CDate("WeatherDate")).ToShortDateString()) %>' so far, but got build errors saying the Bind was not well formed.

Anyone know what the correct syntax would be in this case?

Thanks


I would make a new topic for the problem with your date and give it a title about the date. Some people will know how to do this in vb but will not check this post because it is about calendar stuff :P


Good idea. Will do. Thanks for your help - you got me further than I was an hour ago!

Regards

Changing dynamically a user control within an UpdatePanel

I have a page that (using ajax), will dynamically route someone through a bunch of survey questions. Each survey page is written as a user control as each page needs to have a lot of flexibility, etc to visually add/edit HTML, blah, blah, but that's not the problem. I'm having a problem with loading the question too late in the page life cycle, so our respondent will see the following...

Introduction, Q1 (where they answer), Q1 again (as their answers aren't remembered), Q2 (Q1 answers were remembered this time), Q2 (again, cause Q2 answers weren't remembered first time again)... and so on, etc.

I know what the problem is, but I'm drawing a blank on how I can execute what I want properly. I've attached the code for my controlling page below. Thank you for any advice anyone can offer!!!

<%@dotnet.itags.org. Page Language="C#" MasterPageFile="~/survey.master" Title="Surveys" %>
<%@dotnet.itags.org. Import Namespace="SurveyWebControls" %><script runat="server">
const string SurveyStart ="SurveyStart";

SurveyPageBase currentSurveyPage;

protected void Page_PreInit(object sender, EventArgs e)
{
Page.Theme ="SurveyDefault";
}

protected void Page_Load(object sender, EventArgs e)
{
lblErrorMessage.Text ="";

if (txtCurrentSurveyPage.Value =="")
LoadSurveyPage(SurveyStart);
else LoadSurveyPage(txtCurrentSurveyPage.Value); }protected void btnNext_Click(object sender, ImageClickEventArgs e)
{
if (currentSurveyPage.Validated)
LoadSurveyPage(currentSurveyPage.NextPage);
else lblErrorMessage.Text = currentSurveyPage.ErrorMessage; }private void LoadSurveyPage(string QId)
{
Survey.Controls.Clear();
currentSurveyPage = (SurveyPageBase)LoadControl(QId +".ascx");
Survey.Controls.Add(currentSurveyPage);
txtCurrentSurveyPage.Value = currentSurveyPage.QId;
btnNext.Visible = currentSurveyPage.ShowNext;
}

</script
<asp:Content ID="SurveyBody" ContentPlaceHolderID="SurveyBody" Runat="Server">
<asp:UpdatePanel ID="SurveyUpdatePanel" runat="server">
<ContentTemplate>
<asp:HiddenField runat="server" ID="txtCurrentSurveyPage" />
<asp:Label runat="server" ID="lblErrorMessage" SkinID="ErrorMessage" />
<asp:PlaceHolder ID="Survey" runat="server" />
<br /><br />
<asp:ImageButton ID="btnNext" SkinID="NextButton" runat="server" OnClick="btnNext_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
Try to use the template of asp:Wizard to load?user?controls?dynamically.?Try?to?take?a?look?at?the?following?materials?for?details.
http://msdn2.microsoft.com/en-us/library/fs0za4w6(VS.80).aspx
http://aspnet.4guysfromrolla.com/articles/061406-1.aspx
http://support.microsoft.com/kb/180405
http://weblogs.asp.net/sushilasb/archive/2004/03/31/104939.aspx
http://aspalliance.com/766_Working_with_the_Wizard_Control_Using_Visual_Studio_2005

Wish the above can help you.
I had thought of that, but it would still have to be dynamic. Sometimes there are literally hundreds of pages where someone might only go through 5 of them, based on how they answer previous questions.

Changes are applied several times

Hello,

Here is the situation: a control that isoutside the UpdatePanel passes its changes to the server through a hidden field. A button that isinside the UpdatePanel causes partial posts back. When a full post back occurs the changes that are made to the control are applied as many times as the partial post back was triggered.

Looks like the update panel actually grabbing all of the hidden fields on the page and brings them to the server (which sounds ok) and modified ViewState is fed back to the client (that should not happen, I think) and then reused for next posts.

Is there a way to around that?

Thanks!

Alex

i dont know if i got you correctly .....but why dont you destroy the value of the hidden filed once your work is done...this way it wont go back

Changed control prefix doesnt apply when dragging control from toolbox

Hello,

due to problems with Intellisense not recognizing the new ajax controls such as updatepanel and scriptmanager I tried to give them a different prefix. I thought ajax would be nice instead of asp, so I specified this in my web.config

<add tagPrefix="ajax" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
However, when I drag 'n drop an Ajax control from the toolbox it will still get the asp prefix. Now I've done some custom control development, so I know you can give a control an attribute called ToolboxData where you can use a placeholder for the actual prefix. So did the Ajax developers not use this, or do I need to do something else to get my new prefix when I select a control from the toolbox?

hello.

well, I'm thinking that they've only used the tagprefixattribute to set the default attribute of the controls...


Yes, but the design surface and intellisense will normally use the prefix that is specified in the web.config. However, I think I may have found a bug. It seems there might be a problem is there's a newline character in the assembly attribute. Maybe you could try this out to confirm this?

Thanks!

Change the event that causes the popupcontrol to shows the control

I want to use popupcontrol with a textbox, but I want it shows the popup just when the onKeyDown event fires. How can I do it (if it can be done)?You'll want to look at modifying the way PopupControlBehavior.js's this.initialize function attaches its events. You'll probably need to customize the events a little, but it shouldn't require many changes.

Change in behavior of RegisterStartupScript

In Beta 1, it is requried to use the ScriptManager.RegisterStartupScript method, and this method requires that a control that is within the partial update is passed as the first parameter.

All my pages inherit the same BasePage, and I wan't to register a startup script every time a partial update occurs, regardless of where the update is done.

Please change this back so that the Page.ClientScript.RegisterStartupScript method can be used!

Einar

I need a page based RegisterStartupScript as well. I haven't seen anything from Microsoft mentioning that they would bring this back. Is there a way to run Java Script from a class file?

Thanks,

Jennifer


We can't properly support RegisterStartupScript itself since there's no way to know what people registered. However, we're considering an option to allow people to call a new method (or perhaps change an existing method) to register scripts that should always get included in the async post.

Thanks,

Eilon


Thats great news Eilon, crossing my fingers, would simplify things a great deal :-)

By the way, big thanks to the team for all the great sessions in Barcelona last week!

Einar


Eilon,

This would be great. If the RegisterStartupScript of the ScriptManager did not require a reference to a control in an update panel, life would be much easier. Thanks,

Mark

Change full postback action from inner update panel...

Hi,

Is there a way to alter full postback to partial postback caused by outer update panels from usercontrol?Huh?Confused...I tried to add button control as an AsyncPostBackTrigger. No effect to change from a full page postback to partial one. No change whether I set properties like ChildrenAsTriggers to false/true and UpdateMode to Always/Conditional inner update panel, when a button or any control causes a postback action is pressed, it causes a full postback.


Parent:

<asp:UpdatePanel ID="upanelPage" ChildrenAsTriggers="false" UpdateMode="Conditional" runat="server">
<Triggers>
</Triggers>
<ContentTemplate>
<asp:UpdatePanel ID="upanelMainContent" ChildrenAsTriggers="false" UpdateMode="Conditional" runat="server">
<Triggers>
</Triggers>
<ContentTemplate>
<!-- Main Content --> <<-- my user control or other are displayed
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</asp:UpdatePanel>

User Control loaded to Parent...

<asp:UpdatePanel ID="updatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false" >
<ContentTemplate>
<ajaxToolkit:TabContainer ...>
<ajaxToolkit:TabPanel ...>
<asp:MultiView...>
<asp:View...>
...
<asp:LinkButton...></asp:LinkButton>
<asp:Button...></asp:Button>
<asp:UpdatePanel ...>
<Triggers>
<asp:AsyncPostBackTrigger ControlID=.../>
</Triggers>
<ContentTemplate>
...
<asp:GridView...>
</asp:GridView>
...
</ContentTemplate>
</asp:UpdatePanel>
...
</asp:View...>
<asp:View...>
...controls...
</asp:View>
</asp:MultiView>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ...>

</ajaxToolkit:TabPanel>
...
</ajaxToolkit:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>

UpdatePanel causes a Full Post Back no matter what properties you set on it.

If you are looking for better performing alternatives, look out for ScriptCallbacks or JSON Based Calls and this would require "some" work compared to ourmagic updatepanel!


Huh??ConfusedScriptCallbacks?ConfusedJSon Based Calls?Hmm...Does not know what are they or how to start with them? ..thanks for the reply..


Huh??ConfusedScriptCallbacks?ConfusedJSon Based Calls?Hmm...Does not know what are they or how to start with them? I was trying to control the postback action of outer update panel from the inside user control..thanks for the reply..


Hi,den2005

I found that the following code worked.

The Page:

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

<%@. Register src="http://pics.10026.com/?src=WebUserControl2.ascx" TagName="WebUserControl2" TagPrefix="uc1" %>
<!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>UpdatePanel Tutorial</title>
<style type="text/css">
#UpdatePanel2 {
position: relative;
margin: 2% 5% 2% 5%;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ChildrenAsTriggers="False" ID="UpdatePanel1" UpdateMode="Conditional"
runat="server">
<ContentTemplate>
<fieldset>
<legend>Parent UpdatePanel</legend>Last refresh
<%=DateTime.Now.ToString() %>
<br />
<asp:Button ID="Button1" runat="server" Text="Refresh Outer Panel" />
<uc1:WebUserControl2 ID="WebUserControl2_1" runat="server" />
</fieldset>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>

The UserControl:

<%@. Control Language="C#" ClassName="WebUserControl2" %>
<asp:UpdatePanel ChildrenAsTriggers="False" ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<fieldset>
<legend>Nested UpdatePanel</legend>Last refresh
<%=DateTime.Now.ToString() %>
<br />
<asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
</fieldset>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Calendar1" />
</Triggers>
</asp:UpdatePanel>

Hope this help.

Best regards.

Jin-Yu Yin

change FilteredTextBoxExtender filter type dynamically

Hi,

Im trying to change the Filter Type of FilteredTextBoxExtender on a checkbox onClick handler.

(The textBox which is my traget control is also a the target control of an AutoCompleteExtender control).

The user can switch between searching an item by its Number ID or by Its name)

therefore I need to change the type dynamically according to the checked property of a check box.

it works fine until I try to change the valid characters. I get the following exception on client side:

Microsoft JScript runtime error: Sys.ArgumentTypeException: Object of type 'String' cannot be converted to type 'AjaxControlToolkit.FilterTypes'.
Parameter name: value

HTML:

<ajaxToolkit:FilteredTextBoxExtenderID="FilteredTextBoxExtender1"runat="server"BehaviorID="FilteredTextBoxTxtStock"TargetControlID="txtStkNum"FilterType="Numbers, Custom">

</ajaxToolkit:FilteredTextBoxExtender>

  
1function chkNameList_click()2 {34 var autoComplete = $find('AutoCompleteBehavior');5 var TextBoxFilter = $find('FilteredTextBoxTxtStock');67 $get('<%=txtStkNum.ClientID%>').value ="";89if($get('UserContext').checked ==true)//Names10 {11 $get('<%=txtStkNum.ClientID%>').className ="txtStockHeb";//right alignment (text box)12 TextBoxFilter.set_ValidChars("?????????????????????? ");1314 }15else//Numbers16 {17 $get('<%=txtStkNum.ClientID%>').className ="txtStockEng";//left alignment (text box)18 TextBoxFilter.set_FilterType("Numbers");19 }20 }

 Thanks,
Tal

Hi Tal88,

Based on my research , I think your problem is mainly caused by TextBoxFilter.set_FilterType("Numbers");

Below is the FilterTypes,

AjaxControlToolkit.FilterTypes.prototype = {
Custom : 0x1, //1
Numbers : 0x2, //2
UppercaseLetters : 0x4, //3
LowercaseLetters : 0x8 //4
}

So if you want to set the FilterTypes to Custom, you should use TextBoxFilter.set_FilterType(1);

Numbers will be TextBoxFilter.set_FilterType(2);

If the FilterTypes is set to "Custom,Numbers,LowercaseLetters", please use TextBoxFilter.set_FilterType(7); //1+2+4

My Ajax Control Toolkit's version is V10618.

I hope this help.

Best regards,

Jonathan

Change element on click

Hi,

I'm trying to create an AJAX-enabled control thas has the following functionality:

it's a Label that, when clicked, changes into a TextBox. The user can enter some text into the textbox en when he clicks outside the box (onblur) the textbox changes to a label again (now containing the entered text).

For this I created a server control inheriting from Label and a corresponding client control

The question is: can I change the displayed control in the _onClick event of the client control.

It should be something like:

_onClick : function(e){
this.element = $create(TextBox);
},

Does anyone know the right methods for this?

Thanks,

Thomas

Hmmm... I don't know if you can replace a control like that really. In that case, you would have to go to the parent element in the DOM tree, remove the label element and then add the text element. But that's very cumbersome.

What if you create both Label and TextBox and you toggle visibility on the two? Try changing the css attribute "display". Set it to block to show the element and none to hide it. Could help you with code in case you get stuck, just let me know. Good luck!

Change contents of an external update panel from within a seperate accordian panel?

I am trying to update the contents of an update panel from the event of changing the panel in the accordian control (located outside of the update panel I wish to update). When I try to creat a trigger the update panel does not see the button located inside the accordian control. Any suggestions?

Let me see if I can clarify my question further. I have a content container on a master page. Inside the content container I have a table with two cells. In the first cell I have am using the accordian control. when I click on one of the headers in the accordian control I want it to update an update panel in cell number 2. The content of the accordian panel will be just a brief headline and overview of what is displayed in the update panel in cell #2. My issue is that when trying to define triggers in the update panel in cell #2 it does not see any of the controls in cell #1. Any suggestions?

Thanks for any help you can provide.

Monday, March 26, 2012

Change AJAX Slider maximum

Hi:

Is there any easy way to change the Maximum values on a slider control dynamically using Javascript.

I have an application that uses one slider to set the maximum on another slider.

Thanks for any help.

Floydo

Try this:

this.SliderExtender1.Maximum -= 2;this.SliderExtender1.Minimum += 2;// Display max and min values.this.Label1.Text =this.SliderExtender1.Maximum.ToString();this.Label2.Text =this.SliderExtender1.Minimum.ToString();

HTH

Jonathan.


Hi Floydo,

Here is an example that increase the maximum value of slider by 10 using javascript. Please try it:

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="SliderExtender.aspx.cs" Inherits="AjaxToolKit_SliderExtender" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
.myclass {position:relative; background:url("../images/slider_h_rail.gif") repeat-x; width:100px;height:100px;}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<input type="button" value="Click" onclick="changeLength();" />
</div>
<asp:TextBox ID="TextBox1" runat="server" OnTextChanged="TextBox1_TextChanged"></asp:TextBox>
<ajaxToolkit:SliderExtender BehaviorID="slider" ID="SliderExtender1" runat="server" TargetControlID="TextBox1" Minimum="0" Maximum="100" RaiseChangeOnlyOnMouseUp="true" Steps="5" RailCssClass="myclass" HandleImageUrl="../images/edit.gif">
</ajaxToolkit:SliderExtender>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></form>
<script type="text/javascript">
function changeLength()

{

var slider = $find("slider");
var max = slider.get_Maximum();
slider.set_Maximum(max + 10);

}
</script>
</body>
</html>

Hope this helps.

Change active tab in Ajax tab container using javascript

I have been using the ajax tab control. I need to change the active tab index of the tab container through javascript.

Can please anyone tell me how can i do it

Cheers

Sohail Sayed

Hi,

you can use the following javascript function to set the active tab:

function SetActiveTab(tabControl, tabNumber)
{
var ctrl = $find(tabControl);
ctrl.set_activeTab(ctrl.get_tabs()[tabNumber]);
}

tabControl: ID from the TabContainer Controls
tabNumber: Number of the new Tab (starting at 0)

Regards
Marc André


Thanks Marc,

I did it and it works good

$find('<%=TabContainer1.ClientID%>').get_activeTabIndex();

and

$find('<%=TabContainer1.ClientID%>').set_activeTabIndex(2);

thnx for the reply

Cheers

Sohail SayedP>


Hi ,

I have a similiar issue with the post back under tab container.

I have tried to use the Java script u mentioned..

but no luck so far.

I have couple of tab panels inside a tab container. Each tab panel got a few data controls in it, which loads on post back.

But on page load it keep on going to the first tab.

Alternatively, once i clicked the button control inside any tab, it is showing that tab after it been clicked.

any suggesstion to work this out will be much appreciated.

Thanks in advance..

Cheers,

Barti...

Change Accordian SelectedIndex in the client

How do I changed the SelectedIndex of an Accordian control at runtime from the client in JavaScript. The SelectedIndex property doesn't appear to be there nor can I find a comparable in the attributes.Hi Vegivore,

You can just callmyAccordion.set_SelectedIndex(i);. If you're not seeing this property, you should try getting the latest version of the Toolkit.

Thanks,
Ted

I tried this a few different ways - but I always get "Object doesn't support this property or method"

I downloaded the latest (i think) - no difference.

Microsoft.Web.Atlas.dll - 9/19/06

AtlasControlToolkit.dll - 9/15/06

Microsoft.AtlasControlExtender.dll - 9/19/06

Do I have the right builds?

Here's the relevant code:

aspx file:

<atlasToolkit:Accordion

ID="accHost"

...

javascript file:

var accHost = document.getElementById('accHost');

accHost.set_SelectedIndex(i);


Hi Vegivore,

Okay - I see your problem now. You should usevar accHost = $object('accHost_AccordionProperties');. You need to get the "Atlas" behavior instance instead of the DOM element.

Also - I don't think you should have the Microsoft.AtlasControlExtender.dll anymore... we merged that in with the rest of the Toolkit's AtlasControlToolkit.dll.

Thanks,
Ted


Perfect! Works great.

Thanks Ted


Are old threads still checked? If so, how would one access the Accordion, client side, when it is embedded in a <UpdatePane>...<Multiview>...<View><Atlas:Accordion...

Using the code above I get 'undefined'. (Obviously I've changed accHost for my own control name)

var myAcc = $object('results_AccordionProperties');

myAcc is always undefined.

Angel


Hi Angel,

When responding to an old thread it bumps it to the top of the list. The three Microsoft team members had been neglecting the forums to get our last release out the door but we'll always try to answer each post eventually.

I'm guessing that yourAccordion'sClientID is something more complicated than justresults (because it's probably in a naming container). You should replace results with whatever itsClientID is to get it working. If that's not the issue, please keep posting.

Thanks,
Ted

Ted,

I'm having an issue also doing this. I've read your various posts around the forum and this is what my code currently boils down to:

"theAccordion"
runat="Server"
SelectedIndex="0"
HeaderCssClass="orderHeader"
ContentCssClass="orderContent"
AutoSize="None"
Width="500"
FadeTransitions="true"
TransitionDuration="250"
FramesPerSecond="40"
BehaviorID="theAccordion"
ClientID="theAccordion"
"orderHeader"
ContentCssClass="orderContent"
ID="AP1">
Choose your template:
Step 1 Content
"server" ID="step1next" Text="Next >"
"orderHeader"
ContentCssClass="orderContent"
ID="AP2">
Select Output Options:
Step 2 Content
"server" ID="step2prev" Text="< Prev">
"server" ID="step2next" Text="Next >"
"orderHeader"
ContentCssClass="orderContent">
Enter Details:
Step 3 Content
"server" ID="step3prev" Text="< Prev">
"server" ID="step3next" Text="Next >"
"orderHeader"
ContentCssClass="orderContent">
Preview Order:
Step 4 Content
"server" ID="step4prev" Text="< Prev">
"server" ID="step4next" Text="Next >"
"orderHeader"
ContentCssClass="orderContent">
Submit Order:
Step 5 Content
"server" ID="step5prev" Text="< Prev">
"server" ID="step5next" Text="Finish"
"javascript" type="text/javascript"> function GoNext() { var accordion = $find('theAccordion_AccordionBehavior'); accordion.set_SelectedIndex(1); }

I get a JS error of "accordion has no properties" on the "accordion.set_SelectedIndex(1);" line.

Help!


The code-paster botched my code - here it is sans-highlight:

<%@. Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" validateRequest="false" CodeFile="Order.aspx.cs" Inherits="_Default" Title="Order" EnableEventValidation="false" EnableViewState="false"%
<%@. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="PageTitle" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="JavaScript" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="SectionName" runat="server">Place/Edit Order</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="MainContent" Runat="Server"
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />
<asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional">
<ContentTemplate>
<asp:SqlDataSource runat="server" ConnectionString="<%$ ConnectionStrings: CappSql %>" ID="DSTemplateList" SelectCommand="SELECT TemplateID,TemplateName FROM (SELECT TemplateID,TemplateName FROM Templates UNION SELECT 0 as TemplateID, '' as TemplateName FROM Templates) A ORDER BY TemplateID"></asp:SqlDataSource>
<table width="85%">
<tr>
<td valign="top">
<asp:Wizard ID="Wizard1" runat="server" Width="100%" Height="100%" Visible="false" SideBarStyle-VerticalAlign="Top">
<HeaderStyle VerticalAlign="Top" />
<SideBarStyle Wrap="False" />
<WizardSteps>
<asp:WizardStep ID="WizardStep1" runat="server" Title="Choose a Template" StepType="Start">
Choose your template:
<asp:DropDownList ID="TemplateList" runat="server" AutoPostBack="True" DataSourceID="DSTemplateList" DataTextField="TemplateName" DataValueField="TemplateID"></asp:DropDownList>
</asp:WizardStep>
<asp:WizardStep ID="WizardStep2" runat="server" Title="Select Output Options">
Output Type:<br />
<asp:RadioButtonList ID="OutputType" runat="server" AutoPostBack="True">
<asp:ListItem Enabled="False" Value="pdf" Text="PDF"></asp:ListItem>
<asp:ListItem Enabled="False" Value="html" Text="HTML"></asp:ListItem>
</asp:RadioButtonList>
<asp:CheckBox ID="Printing" runat="server" Value="Printing" Text="Printing" Enabled="false" AutoPostBack="True"/>
<asp:Panel ID="PrintingDetails" runat="server" Visible="false">
Print details here
</asp:Panel>
</asp:WizardStep>
<asp:WizardStep ID="WizardStep3" runat="server" Title="Enter Details">
<table border="0" cellpadding="0" cellspacing="0">
<asp:Panel ID="DetailsPanel" runat="server" EnableViewState="true"></asp:Panel>
</table>
</asp:WizardStep>
<asp:WizardStep ID="WizardStep4" runat="server" Title="Preview Order">
<asp:HyperLink ID="PreviewOrder" runat="server" Target="_blank">Preview Order</asp:HyperLink>
</asp:WizardStep>
<asp:WizardStep ID="WizardStep5" runat="server" Title="Submit Order" StepType="Complete">
</asp:WizardStep>
</WizardSteps>
</asp:Wizard>
<asp:HiddenField ID="OrderID" runat="server" />
</td>
<td valign="top" width="300">
<asp:Label ID="Label1" runat="server" Text="Current Template" Visible="false" Font-Bold="true"></asp:Label><br />
<asp:Image ID="pdfImage" runat="server" Visible="false" Width="272" Height="352" BorderWidth="1" style="position:fixed"/>
</td>
</tr>
</table>
<table><tr><td><asp:Label ID="lblStateInformation" runat="server"></asp:Label></td></tr></table>
<div style="margin-left:auto; margin-right:auto;">
<cc1:Accordion
ID="theAccordion"
runat="Server"
SelectedIndex="0"
HeaderCssClass="orderHeader"
ContentCssClass="orderContent"
AutoSize="None"
Width="500"
FadeTransitions="true"
TransitionDuration="250"
FramesPerSecond="40"
BehaviorID="theAccordion"
ClientID="theAccordion">
<Panes>
<cc1:AccordionPane
HeaderCssClass="orderHeader"
ContentCssClass="orderContent"
ID="AP1">
<Header>Choose your template:</Header>
<Content> Step 1 Content <br /><asp:Button runat="server" ID="step1next" Text="Next >"></asp:Button></Content>
</cc1:AccordionPane>
<cc1:AccordionPane
HeaderCssClass="orderHeader"
ContentCssClass="orderContent"
ID="AP2">
<Header>Select Output Options:</Header>
<Content> Step 2 Content
<asp:Button runat="server" ID="step2prev" Text="< Prev"></asp:Button>
<asp:Button runat="server" ID="step2next" Text="Next >"></asp:Button>
</Content>
</cc1:AccordionPane>
<cc1:AccordionPane
HeaderCssClass="orderHeader"
ContentCssClass="orderContent">
<Header>Enter Details:</Header>
<Content> Step 3 Content
<asp:Button runat="server" ID="step3prev" Text="< Prev"></asp:Button>
<asp:Button runat="server" ID="step3next" Text="Next >"></asp:Button>
</Content>
</cc1:AccordionPane>
<cc1:AccordionPane
HeaderCssClass="orderHeader"
ContentCssClass="orderContent">
<Header>Preview Order:</Header>
<Content> Step 4 Content
<asp:Button runat="server" ID="step4prev" Text="< Prev"></asp:Button>
<asp:Button runat="server" ID="step4next" Text="Next >"></asp:Button>
</Content>
</cc1:AccordionPane>
<cc1:AccordionPane
HeaderCssClass="orderHeader"
ContentCssClass="orderContent">
<Header>Submit Order:</Header>
<Content> Step 5 Content
<asp:Button runat="server" ID="step5prev" Text="< Prev"></asp:Button>
<asp:Button runat="server" ID="step5next" Text="Finish"></asp:Button>
</Content>
</cc1:AccordionPane>
</Panes>
<HeaderTemplate></HeaderTemplate>
<ContentTemplate></ContentTemplate>
</cc1:Accordion>
</div>
<script language="javascript" type="text/javascript">
function GoNext()
{
// Find the behavior instance
//alert(MyAccordion.SelectedIndex);
//MyAccordion.set_SelectedIndex(MyAccordion.SelectedIndex + 1);
var accordion = $find('theAccordion_AccordionBehavior');
accordion.set_SelectedIndex(1);
//alert(accordion);
/*if (!behavior) continue;

// Open or close the panel
if (open)
{
behavior._doOpen();
}
else
{
behavior._doClose();
}*/
}
</script>
</ContentTemplate>
</asp:UpdatePanel>

</asp:Content


Hello, did you ever find out of your problem? i have the same problem. I am using the tab controll and when i change tabs i need to open the right accordian pane.

var accordion = $find('accEquityModels_AccordionBehavior');

accordion.set_SelectedIndex(2);


I'm hoping to get an answer on this question "how to change the index from javascript"

I've got and accordion with the id "Accordion1" inside a Content Page of a Master Page, and the full client ID of it is: "Master_MainContent_Accordion1" (That's according to the ".ClientID" property in code)

that ID is all through the generated HTML as is "Master_ctl04_Accordion1" (i have no idea what that is looking at, there for sure is only one ajaxToolKit:Accordion declared)

in my javascript, both

var accordion = $find('Master_MainContent_Accordion1_AccordionBehavior');
var accordion = $find('Master_ctl04_Accordion1_AccordionBehavior');

return "null"

any ideas?


Found my own answer: http://blog.benhall.me.uk/2007/01/aspnet-ajax-accordion-control-change.html

Hope that helps others down the road

Centering Modal Popup Extender? (Edited)

Hello again,
I have a problem: i cant get a modal popup control to be centered!
The problem occures in some resolutions...
The control isn't in any divs or something like that, but i tried to put it in center aligned divs, no effect...
Edit:see last reply.

At 1280*1024 resolution, no problem:

(Link:http://www.intensitysoft.info/txtFiles/1280,1024.JPG)

At 14490,900 resolution, no problem:

(Link:http://www.intensitysoft.info/txtFiles/14490,900.JPG)

At 1280*800 resolution... BIG problem :):

(Link:http://www.intensitysoft.info/txtFiles/1280,800.JPG)

As you can see the panel is totally left...

Thanks for any help,
Liran.


The page seems to work fine in all my resolutions, but I don;t have 1280 X 800 available on any of my box's. Could you please post your code, maybe something will jump out.

-Alan


<%@. Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="products.aspx.cs" Inherits="Default4"%>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="AccessDataSource1">
<SeparatorTemplate>
<br />
</SeparatorTemplate>
<ItemTemplate>
<table cellpadding="0" cellspacing="0" style="width: 100%; height: 10px; border-top-width: 1px; border-left-width: 1px; border-left-color: #33cccc; border-bottom-width: 1px; border-bottom-color: #33cccc; border-top-color: #33cccc; border-right-width: 1px; border-right-color: #33cccc;">
<tr>
<td style="font-weight: bold; font-size: 16px; text-transform: none; color: black; font-family: Arial; background-color: #3399cc; text-decoration: none;" colspan="2">
<%# Eval("siteName") %></td>
</tr>
<tr style="background-color: lightblue; font-size: 14px; color: black; font-family: Arial;">
<td style="width: 133px; height: 90%">
<asp:ImageButton ImageUrl='<%# Eval("thumbPicSrc") %>' ID="ImageButton1" runat="server" />
</td>
<td style="height: 90%" valign="top">
<%# Eval("description") %></td>
</tr>
</table>

<ajaxToolkit:ModalPopupExtender OkControlID="imgOk" BackgroundCssClass="modalBackground" ID="ModalPopupExtender1" TargetControlID="ImageButton1" runat="server" PopupControlID="Panel1" />
<asp:Panel ID="Panel1" runat="server" style="display: none">
<asp:ImageButton ImageUrl='<%# Eval("picSrc") %>' ID="imgOk" runat="server" />
<br />
</asp:Panel>

</ItemTemplate>
</asp:Repeater>
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="App_Data\instensUsersDB.mdb"
SelectCommand="SELECT * FROM [sites]"></asp:AccessDataSource>
<asp:ScriptManager id="ScriptManager1" runat="server" />

<br />

<br />
</asp:Content>


Just found out that the problem doesn't occur because of the resolution, it occures because of the browser!
With Internet Explorer 7 everything is fine, so on with FireFox... but with I.E. 6, it's just doesnt work.

Any solution?
Liran.

Centering AlwaysVisibleControl?

I'm using an update progress control inside of an always visible control to communicate to users when my application is loading data. I want to center the control on the screen but have seen no way by which to do this. Has anyone figured out a way to position the AVC in the center of the browser screen? Is there a better way to do this?

In the html for your panel you define an outer div with width and height set to 100%, a transparent background and text centered. An inner div is set with a solid background and the top attrib set to 50% or some offset. The inner div will then be centered within the outer div.

centered update progress

Hi;

I usually have my update progress control on the top of the page but on long pages, the user can't see it.

On codeplex.com, when i insert some text on "Search Projects" (upper right) and hit the search button, an "Updating" message is showed on the center of the page and the rest of the page becomes gray. Can i get this same result using AJAX update progress?

Thanks in advance;

If that is what you want, you should probably use the ModalPopup control. Try it at: http://asp.net/AJAX/Control-Toolkit/Live/ModalPopup/ModalPopup.aspx


Pls checkout this link, it got some cool example of Moal Popup extenderhttp://mattberseth.com/blog/modalpopupextender


See this link for AJAX Progress bar in the middle of page

http://www.ajaxium.com/ajax-for-asp.net.aspx

Catputing events in UpdatePanels

All,

Hopefully someone here will have an answer for something that's driving me crazy at the moment...

I have a control on a page that is within an update panel. The control has to be within the update panel as we need to change the control without a full page refresh.

All works well except a series of post backs that are generated that should perform some processing then redirect the user to a new page. As is logical this doesn't work as it's not the browser that is generating the postbacks but soem JavaScript in the page.

What I need to know is: Is it possible to tell the update panel to ognore events created by these controls? Or am I going to have find a different way around this problem?

TIA

Stu

Opps... Do I feel dum... Turns out it works just fine, I just assumed that the person who prototyped the page had wired up all the event handers, in fact he'd only wired up half. The reason the click did nothing was because there was no handler there to do anything...Embarrassed

Catching key press events. For example username control without postback

Hi atlas developers and implementers,

For example I have a textbox and I want that on every key press the written string will be controlled from database and it should say whether it is found on database or not. I'm using atlas 2.0. It is like username control without postback.

How can I do this..

Kind Regards,

Fatih U?AR.
Postglobal Ltd.
R&D ManagerHi,

basic example + bonus behavior:

<%@. Page Language="C#" %><%@. Import Namespace="System.Data" %><%@. Import Namespace="System.Web.Services" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> private DataTable data = null; protected void Page_Load(object sender, EventArgs e) { BuildData(); } private void BuildData() { data = new DataTable(); data.Columns.Add(new DataColumn("Username", typeof(string))); data.Rows.Add("garbin"); data.Rows.Add("leoscorpio82"); } [WebMethod] public bool CheckForUsername(string username) { bool userExists = data.Select("Username = '" + username + "'").Length > 0; return userExists; }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <atlas:ScriptManager ID="sm" runat="server"></atlas:ScriptManager> <div> <span>Username:</span> <asp:TextBox ID="txtUsername" runat="server"></asp:TextBox> </div> </form> <script type="text/javascript"> function txtUsername_Keypress(sender, e) { PageMethods.CheckForUsername($object('txtUsername').get_text(), onCheckComplete); } function onCheckComplete(result) { $object('txtUsername').get_style().backgroundColor = (result) ? '#ffffff' : '#ff0000'; } </script> <script type="text/xml-script"> <page> <components> <textBox id="txtUsername"> <behaviors> <keyUpBehavior keyup="txtUsername_Keypress" /> </behaviors> </textBox> </components> </page> </script> <script type="text/javascript"> // A behavior to handle the keyup event. Type.registerNamespace('AtlasExamples'); AtlasExamples.KeyUpBehavior = function() { AtlasExamples.KeyUpBehavior.initializeBase(this); // Private members. var _keyupHandler; // Events. this.keyup = this.createEvent(); // Initialize / Dispose. this.initialize = function() { AtlasExamples.KeyUpBehavior.callBaseMethod(this, 'initialize'); _keyupHandler = Function.createDelegate(this, keyupHandler); this.control.element.attachEvent('onkeyup', _keyupHandler); } this.dispose = function() { this.control.element.detachEvent('onkeyup', _keyupHandler); _keyupHandler = null; AtlasExamples.KeyUpBehavior.callBaseMethod(this, 'dispose'); } // Descriptor. this.getDescriptor = function() { var td = AtlasExamples.KeyUpBehavior.callBaseMethod(this, 'getDescriptor'); td.addEvent('keyup', true); return td; } // Event Handler. function keyupHandler() { //debug.trace(event.keyCode); this.keyup.invoke(this, Sys.EventArgs.Empty); } } AtlasExamples.KeyUpBehavior.registerClass('AtlasExamples.KeyUpBehavior', Sys.UI.Behavior); Sys.TypeDescriptor.addType('script', 'keyUpBehavior', AtlasExamples.KeyUpBehavior); </script></body></html>

hello ,

the answer is ok but where is the 'AtlasExamples' behavior

i'll be glad for you answer

kind regards,


Hi,

AtlasExamples is a namespace (defined with a call to Type.registerNamespace at the beginning of the Javascript code) while the behavior is the AtlasExamples.KeyUpBehavior class defined inside the Javascript code block (it inherits from the base Sys.UI.Behavior class).


hi garbin yes i know but i don't have the dll file of the namespace. so i can't get it work. I need necessary files.. I'll be glad if you send me the files tofatihu@.postglobal.com

regards,


Hi,

sorry, but what do you mean by "the dll of the namespace"?


I mean, I run the code you wrote but it didn't work, what should I do, it didn't validate

Hi,

ah, sorry, didn't notice that the code was written for CTPs :)

Here's the updated code:

<%@. Page Language="C#" %><%@. Import Namespace="System.Data" %><%@. Import Namespace="System.Web.Services" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> private static DataTable data = null; protected void Page_Load(object sender, EventArgs e) { BuildData(); } private void BuildData() { data = new DataTable(); data.Columns.Add(new DataColumn("Username", typeof(string))); data.Rows.Add("garbin"); data.Rows.Add("leoscorpio82"); } [WebMethod] public static bool CheckForUsername(string username) { bool userExists = data.Select("Username = '" + username + "'").Length > 0; return userExists; }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head id="Head1" runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="TheScriptManager" runat="server"> <Scripts> <asp:ScriptReference Assembly="Microsoft.Web.Preview" Name="PreviewScript.js" /> </Scripts> </asp:ScriptManager> <div> <span>Username:</span> <asp:TextBox ID="txtUsername" runat="server"></asp:TextBox> </div> </form> <script type="text/javascript"><!-- function txtUsername_Keypress(sender, e) { PageMethods.CheckForUsername($get('txtUsername').value, onCheckComplete); } function onCheckComplete(result) { $get('txtUsername').style.backgroundColor = (result) ? '#ffffff' : '#ff0000'; } //--> </script> <script type="text/xml-script"> <page xmlns="http://schemas.microsoft.com/xml-script/2005" xmlns:cc="AtlasExamples"> <components> <textBox id="txtUsername"> <behaviors> <cc:keyUpBehavior keyUp="txtUsername_Keypress" /> </behaviors> </textBox> </components> </page> </script> <script type="text/javascript"> // A behavior to handle the keyup event. Type.registerNamespace('AtlasExamples'); AtlasExamples.KeyUpBehavior = function(element) { AtlasExamples.KeyUpBehavior.initializeBase(this, [element]); } AtlasExamples.KeyUpBehavior.prototype = { // Initialize / Dispose. initialize : function() { AtlasExamples.KeyUpBehavior.callBaseMethod(this, 'initialize'); $addHandlers(this.get_element(), {'keyup':this._onKeyUp}, this); }, dispose : function() { $clearHandlers(this.get_element()); AtlasExamples.KeyUpBehavior.callBaseMethod(this, 'dispose'); }, // Event Handler. _onKeyUp : function(evt) { this._raiseEvent('keyUp', Sys.EventArgs.Empty); }, // Event add_keyUp : function(handler) { this.get_events().addHandler('keyUp', handler); }, remove_keyUp : function(handler) { this.get_events().removeHandler('keyUp', handler); }, _raiseEvent : function(eventName, eventArgs) { var handler = this.get_events().getHandler(eventName); if (handler) { if (!eventArgs) { eventArgs = Sys.EventArgs.Empty; } handler(this, eventArgs); } } } // Descriptor. AtlasExamples.KeyUpBehavior.descriptor = { events: [{name: 'keyUp'}] } AtlasExamples.KeyUpBehavior.registerClass('AtlasExamples.KeyUpBehavior', Sys.UI.Behavior); </script></body></html>

Catch the active tab changed event in javascript

Hi,

I have been using the ajax tab control.

I need to catch the activetab changed event of javascript.

I want to do some processing when the users goes to a specific tab.

It would be very helpful if someone can tell me how i can do it.

Cheers

Sohail

Hi,

Well looks like i got how to catch the activetab changed event

the tab container has OnClientActiveTabChanged event.

However i still need to get some way to acces the active index in the javascript so based on it i can do some processing.

Please let me know the soltn

Cheers

Sohail Sayed


Hi Sohail,

You can use the following script to get the index of active tab:


var tc = $find("TabContainer1"); // "TabContainer1" is the client id of the TabContainer control.

var index = tc.get_activeTabIndex();

Hope this helps.


Hi,

Thx i am now able to get the active index

Catch a Sys.WebForms.PageRequestManagerServerErrorException that occurs when server is dow

Hello,

I have an ajax timer control that updates an update panel every couple of seconds. When/if the server is down, there is an error message in a popup that says

"Sys.WebForms.PageRequestManagerServerErrorException: An unknown error ocurred while processing the request
on the server. The status code reutrned from the server was: 12029"

Basically I want to be able to catch this exception so that the popup does not continue to occur.

Is this possible?

Thanks in advance.

Take a look at the following posts on my blog:

http://fredrik.nsquared2.com/viewpost.aspx?PostID=395&showfeedback=true

http://fredrik.nsquared2.com/viewpost.aspx?PostID=394&showfeedback=true

You can also use the PageRequestManager, for example (This code should be located on the client):

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function EndRequestHandler(sender, args)
{
if (args.get_error() != undefined)
{
var errorMessage;
if (args.get_response().get_statusCode() == '200')
{
errorMessage = args.get_error().message;
}
else
{
errorMessage = 'An unspecified error occurred. ';
}
args.set_errorHandled(true);
alert(errorMessage);
}
}


That's just what I needed. Thank you.