Wednesday, March 28, 2012

update several textboxes from different services

I am trying to write my first application using atlas. what i want is to have 3 labels and one textbox. and one button.

the user enters a word into the textbox and clicks the button. what i then want to happen is for all 3 labels to be populated by calls to 3 separate webservices. sounds simple enough but..

these webservices may take some time to return, and i don't want to postback the entire page and then the user have to wait for each service to return before the page reloads.

What i want is for each label to be updated independently, so label1 migth be updated before 2 and 3
and 3 might be updated before 2. but at least the time the user has to wiat before something is returned is only as long as it takes for the first label to be updated.

i've read the following article on codeproject
http://www.codeproject.com/Ajax/HelloAtlas.asp

but this just deals with a partial postback to the same page, which isn't what i need to do.

If anyone can help or point me in the direction of an article that does something similar to what i would like to do, i'd appreciate it loads.

hello.

well, the scenario you describe can be easilly achieved by using the client portion of atlas. check this page:

http://atlas.asp.net/docs/atlas/doc/services/consuming.aspx#simple


Thanks for the reply. funnily enough i'd just started reading that tutorial.

I have made some progress. i enter a value in a texbox click a button. then 2 webservices are called asyncronously (ws1 sleeps for 5 seconds and returns a string ws sleeps for 2 seconds and returns a string) the results from these ws are then displayed in 2 textboxes.

However in order for the results to update these textboxes i've had to use standard html tags, not asp.net labels, i guess because they are generated server side.

What i would like to do is combine what i have so far with the display opf a progress animation like in this codeproject article.

http://www.codeproject.com/Ajax/HelloAtlas.asp

i think what i'm asking is how can i control an update panel and updateprogress cotnrol via javascript.

all i want it to be able to is whilst the webservice is being called, display a little .gif, and then when the webservice returns output the results within a dif

below is my code so far. any help would be appreciated

<atlas:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true"><Services><atlas:ServiceReferencePath="WebService.asmx"/><atlas:ServiceReferencePath="WebService2.asmx"/></Services></atlas:ScriptManager><div></div><inputid="inputName"/><inputid="buttonGo"type="button"value="GO"onclick="return OnbuttonGo_click()"/><atlas:UpdatePanelID="wsOne"runat="server"><ContentTemplate><inputid="Label1"type="text"/>

<inputid="Label2"type="text"/>

</ContentTemplate>

</atlas:UpdatePanel>function OnbuttonGo_click()

{

//Oh yes. method one gets called first but 2 returns first oh yes as ws one sleeps for 5 secs and ws2 only sleeps for 2.//now need to look at batching//and also need to look at how to update sections of the html page with the results.//can i use updatepanels?

requestSimpleService = WebService.testAsync(

document.getElementById(

'inputName').value,//params

OnCompleteOne,

//Complete event

OnTimeout

//Timeout event

);

//Call script proxy passing the input element data

requestSimpleService = WebService2.testAsync(

document.getElementById(

'inputName').value,//params

OnCompleteTwo,

//Complete event

OnTimeout

//Timeout event

);

returnfalse;

}

function OnCompleteOne(result)

{

document.getElementById(

'Label1').value = result;

}

function OnCompleteTwo(result)

{

document.getElementById(

'Label2').value = result;

}

function OnTimeout(result)

{

alert(

"Timed out");

}


Ok, made a bit more progress. i can now output my results to separate divs.

All i need to be able to do now is to display a .gif in each div until the function returns.

function OnCompleteOne(result)

{

document.getElementById(

'wsone').innerHTML = result;

}

function OnCompleteTwo(result)

{

document.getElementById(

'wstwo').innerHTML = result;

}

<atlas:UpdatePanelID="wsOnePanel"runat="server"><ContentTemplate><divid="wsone"></div><divid="wstwo"></div></ContentTemplate></atlas:UpdatePanel>


hello.

first, you don't need to use an updatepanel in this scenario. the updatepanel let's you refresh a portion of the page but it should only be used when you're transforming an aspx page into an atlas page. second, you can do what you want easilly: to do that, you just need to show the icon during the start method and hide it during the end method.


aha well i've got it working. basically after each webservice call i set the inner html of the divs to the animated gif.

Then on completion the oncomplete function is called, which overwrites the innerhtml with the result.

requestSimpleService = WebService.testAsync(

document.getElementById(

'inputName').value,//params

OnCompleteOne,

//Complete event

OnTimeoutOne

//Timeout event

);

//display .gif

document.getElementById(

'wsone').innerHTML ='<img src=blue_forward.gif />'//Call script proxy passing the input element data

requestSimpleService = WebService2.testAsync(

document.getElementById(

'inputName').value,//params

OnCompleteTwo,

//Complete event

OnTimeoutTwo

//Timeout event

);

//display .gif

document.getElementById(

'wstwo').innerHTML ='<img src=blue_forward.gif />'

Update textbox value

Dear friends,


I'm trying to update a textbox value by values that occour in a for each statement.
Ex.:

List<string> words = new List<string>();
words.Add("Test1<br>");
words.Add("Test2<br>");
words.Add("Test3<br>");
words.Add("Test4<br>");
words.Add("Test5<br>");

foreach (string s in words)
{
txtOcorrencias.Text += s;
System.Threading.Thread.Sleep(2000);
}

I want that each word appear for time, but when the function runs, all the words at the same time.

How I code this?

It's because you are doing this on the server. The server doesn't return the page to the browser every time it sleeps. It runs all of the code and then renders the page.

Have you considered doing this in javascript?


Yes, I try to use javascript but I used Thread to simulate other methods that the application have to execute on the server.


This is one way of doing it:http://encosia.com/2007/10/03/easy-incremental-status-updates-for-long-requests/


gt1329a

I'm using the code you recommend to me, It works 100%.

Thanks.

update the contents of the update panel

i have an update panel that fetches data from the database...what i want to achieve is that whenever the database is updated, the contents of the update panel will also update. pretty much like gmail.Big Smile but im not sure if this is possible with the update panel. thank you.

Yes. this is possible. You have to use timer control to periodically check the database for new records. integrate your update panel with timer control.

or else check the below link

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

Please Don't forget to 'Mark as Answered' if your problem get solved.

Update the gridview by using AJAX.

Hi,

Can anyone help me regarding update data in the gridview by using AJAX. Once enter the values textboxes and saved into Database, then gridview has to update the new changes. I am using C#.

Pls help me to know about this.

Thank you.

Call the Update method of the UpdatePanel which contains the GridView programmatically after you save values to the database.

...// Save to database

UpdatePanel1.Update();

Thanks

Update to Beta 2.0 and can not run on Server

I have recently upgraded my Web Page to use the new AJAX 2.0 beta. I have also included the November CTP. This works fine on my local PC, but when I run it on my Server, it blows up.

I had initially included all of my DLL's in the Bin folder. After reading many of the posts, I decided to install the ASPAJAXExtSetup.msi and ASPAJAXCTP.msi onto my server. No joy.

I get the following error message:

Server Errorin'/EDCC_Test' Application.------------------------Index was outside the bounds of the array. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack tracefor more information about the error and where it originatedin the code. Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identifiedusing the exception stack trace below. Stack Trace: [IndexOutOfRangeException: Index was outside the bounds of the array.] EDCC.PageBase.curUser() +687 File_Home.Page_Load(Object sender, EventArgs e) +92 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061 ------------------------Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

I am not sure where to start debugging this code. As I stated above, it works fine on my machine, but not from the server.

Can someone help point me in the correct direction? Is there a way to "Debug" the page from the server side like from within Visual Studio? Maybe allowing me to "step" through the code? Is there a way to show a more verbose error message that will point me in a better direction?

Thanks,

Bryan

PS: Before I upgraded my site to the Beta 2.0, it was running fine. (Thank goodness I had the foresite to try to install it onto a "test" site before making it live.) Big Smile

hello.

well, it looks like you're passing an index too big for an array.

to see how to get more info about the error on an asp.net, take a look at the <customerrors> element.


Hello,

I agree with Luis. I mean i'm not completely sure that by upgrading you broke something. You probably have a dropdownlist or maybe an array that isn't getting data put into it. What does your code look like? What does the data access layer look like?

Not sure of any way to actually do debugging on the server like you can in the VS2005 IDE, unless you can recreate the environment on your local machine (Database, Web Application etc.)

VS2005 Team System Developer includes the ability to do unit tests. This allows for you to actually step through your code and make sure that all of the pieces are logical and you don't have issues that would show up until you actually loaded up the website onto the server and tested.

Good luck and happy thanksgiving.

JoeWeb


Thanks all for your replies.

I figured out my problem by republishing a million times with different "Response.Write" and "Response.End" statements until I found the error.

I am developing an Intranet site, and I rely on the Windows user name to authenticate. When I created a "test" web site on my server, I had the "Allow Anonymous Logins" box checked somewhere in the properties. Once I removed this, it worked flawlessly. Jeesh, newbie mistake.

Bryan

Update to the latest Control Toolkit

If I want to update to the latest AJAX Control Toolkit and install the ASP.NET Future, what are the steps that I need to take?

For installation of Ajax toolkit watch this video and documentation at

http://ajax.asp.net (last video as of todays posting)

For futures which is still in development

http://www.asp.net/downloads/futures/default.aspx, select quickstarts from there


I already know how to install AJAX toolkit. I just wanted to how to update to the latest version. Some of the question are: Do I need to delete anything? If yes, what? If not, will it automatically update the controls in my Toolbox?

As for the Future, I already watch the video there...but it was not helpful nor does it answer my question. My question was, and I will repeat again, if I don't already have a Dynamic Data Website, what do I need to modify or configure my site so that I can go ahead and use the Future components? Second of all, the video is not in C# so it is pretty much useless to me because I don't program in python.


Well if you do exact installation in same folder where you extracted your zip files and installation, then it will overwrite, I usually keep a copy of previous dll just in case. However I did a check two weeks ago and the old toolkit is exactly the same as new one.

As for futures is concerned, I would suggest you to wait, but the choice is yours? However play with it if you want. you can always convert python to c#, logic remains the same. Hope that helps pal


Thanks for the response. I'll keep that in mind.


Mark that as answer for other people looking for the same question or put a response and mark as an answer


Sorry. I thought I did. I have been having so much problem with the asp.net website lately. The page kept going blank or not loading at all.


Infact this forum page crashes everynow and then too..


So just to clarify for the hard of thinking, to install the latest toolkit on top of the previous one, all I have to do is:

download the latest version zip file


On your server, just replace the old AjaxControlToolkit.dll with the new one. That's it.

On your dev box, replace the old files with the new files, run the VSI, and update your Toolbox if you've added the Toolkit there. That should be it.

Update Trigger and GridView problem

Hi!

I have an Accordion on my page. In one AccordionPane, i have an UpdatePanel containing a GridView and a button under. When i try to access my gridview in the code-behind, i encounter a problem. The trigger of my button doesn't work, the method associated with my button isn't called. If i click a second time and the button, it postback my page and i lose all the data and the page. if i click a third time, the trigger associated with the button finally works.

I only get this problem when i try to access my GridView in my page.

I add my code and underlined the line which causes the problem, i remove it everythin works fine

aspx file:

<asp:UpdatePanelID="UpdatePanelGridStartSecurities"runat="server"UpdateMode="Conditional"ChildrenAsTriggers="false">

<ContentTemplate>

<divclass="ContentPaneDetails">

<%-- GridView : Supports de depart--%>

<divclass="ContentPaneElement">

<asp:GridViewID="GridViewGainOption_StartSecurities"runat="server"AutoGenerateColumns="false"BackColor="White"

BorderStyle="None">

<Columns>

<%-- Inclure --%>

<asp:TemplateField>

<HeaderTemplate>

<labelid="LbGainOption_Include">

Include

</label>

</HeaderTemplate>

<HeaderStyleBackColor="#D5DAE0"BorderStyle="None"/>

<ItemTemplate>

<asp:RadioButtonID="GainOption_Include"runat="server"BackColor="ActiveCaptionText"GroupName="IncludeExclude"

Checked='<%# ((bool)DataBinder.Eval(Container.DataItem, "IsExcluded"))?false:true %>'/>

</ItemTemplate>

<ItemStyleBorderColor="Black"BorderWidth="1px"HorizontalAlign="Center"/>

</asp:TemplateField>

<%-- Exclure --%>

<asp:TemplateField>

<HeaderTemplate>

<labelid="LbGainOption_Exclude">

Exclude

</label>

</HeaderTemplate>

<HeaderStyleBackColor="#D5DAE0"BorderStyle="None"/>

<ItemTemplate>

<asp:RadioButtonID="GainOption_Exclude"runat="server"BackColor="ActiveCaptionText"GroupName="IncludeExclude"

Checked='<%# DataBinder.Eval(Container.DataItem, "IsExcluded") %>'/>

</ItemTemplate>

<ItemStyleBorderColor="Black"BorderWidth="1px"HorizontalAlign="Center"/>

</asp:TemplateField>

<%-- Valeur mobilière --%>

<asp:TemplateField>

<HeaderTemplate>

<labelid="LbGainOption_SecurityName">

Valeur mobilière

</label>

</HeaderTemplate>

<HeaderStyleBackColor="#D5DAE0"BorderStyle="None"/>

<ItemTemplate>

<asp:TextBoxID="GainOption_SecurityName"runat="server"BorderStyle="None"Text='<%# GetSecurityName(Convert.ToInt32(DataBinder.Eval(Container.DataItem, "SecurityId"))) %>'></asp:TextBox>

</ItemTemplate>

<ItemStyleBorderColor="Black"BorderWidth="1px"/>

</asp:TemplateField>

<%-- Isin Code --%>

<asp:TemplateField>

<HeaderTemplate>

<labelid="GainOption_IsinCode">

Isin

</label>

</HeaderTemplate>

<HeaderStyleBackColor="#D5DAE0"BorderStyle="None"/>

<ItemTemplate>

<asp:TextBoxID="GainOption_IsinCode"runat="server"BorderStyle="None"Text='<%# GetIsinCode(Convert.ToInt32(DataBinder.Eval(Container.DataItem, "SecurityId"))) %>'></asp:TextBox>

</ItemTemplate>

<ItemStyleBorderColor="Black"BorderWidth="1px"/>

</asp:TemplateField>

<%-- Seuil --%>

<asp:TemplateField>

<HeaderTemplate>

<labelid="LbGainOption_Threshold">

Seuil %

</label>

</HeaderTemplate>

<HeaderStyleBackColor="#D5DAE0"BorderStyle="None"/>

<ItemTemplate>

<asp:TextBoxID="GainOption_Threshold"runat="server"BorderStyle="None"Text='<%# DataBinder.Eval(Container.DataItem, "TriggerringThreshold") %>'></asp:TextBox>

</ItemTemplate>

<ItemStyleBorderColor="Black"BorderWidth="1px"/>

</asp:TemplateField>

<%-- Supprimer --%>

<asp:TemplateField>

<HeaderTemplate>

</HeaderTemplate>

<HeaderStyleBackColor="#D5DAE0"BorderStyle="None"/>

<ItemTemplate>

<asp:LinkButtonID="GainOption_Delete"runat="server"CommandName="Delete">Supprimer</asp:LinkButton>

</ItemTemplate>

<ItemStyleBackColor="#D5DAE0"BorderStyle="None"/>

</asp:TemplateField>

</Columns>

</asp:GridView>

</div>

</div>

<divclass="ContentPaneDetails">

<divclass="ContentPaneElement">

<%-- Ajouter un nouveau support de départ --%>

<asp:LinkButtonID="GainOption_AddStartSecurity"runat="server"Text="Ajouter une valeur"OnClick="GainOption_AddStartSecurity_Click">

</asp:LinkButton>

<br/>

<%-- Nom du support --%>

<asp:LabelID="LbGainOption_StartSecurityName"runat="server"Visible="false"Text="Valeur moblière :"></asp:Label>

<asp:TextBoxID="GainOption_StartSecurityName"runat="server"Visible="false"></asp:TextBox>

<asp:ImageButtonID="ImgGainOption_StartSecurityName"runat="server"ImageUrl="~/Images/Directory.gif"Visible="false"/>

<ajaxToolkit:AutoCompleteExtenderID="AutoCompleteGainOption_StartSecurityName"runat="server"TargetControlID="GainOption_StartSecurityName"

ServicePath="WebServices/AutoComplete.asmx"ServiceMethod="GetSecuritiesListByLongName"CompletionSetCount="3"MinimumPrefixLength="3"

CompletionListCssClass="autocomplete_completionListElement"CompletionListItemCssClass="autocomplete_listItem"

CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"UseKeyValuePairs="true"

KeyHiddenFieldID="HiddenModify_SecurityId">

</ajaxToolkit:AutoCompleteExtender>

<%-- Isin du support --%>

<asp:LabelID="LbGainOption_StartIsinCode"runat="server"Visible="false"Text="Isin : "></asp:Label>

<asp:TextBoxID="GainOption_StartIsinCode"runat="server"Visible="false"></asp:TextBox>

<asp:ImageButtonID="ImgGainOption_StartIsinCode"runat="server"ImageUrl="~/Images/Directory.gif"Visible="false"/>

<ajaxToolkit:AutoCompleteExtenderID="AutoCompleteGainOption_StartIsinCode"runat="server"TargetControlID="GainOption_StartIsinCode"

ServicePath="WebServices/AutoComplete.asmx"ServiceMethod="GetSecuritiesListByIsinCode"CompletionSetCount="3"MinimumPrefixLength="3"

CompletionListCssClass="autocomplete_completionListElement"CompletionListItemCssClass="autocomplete_listItem"

CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"UseKeyValuePairs="true"

KeyHiddenFieldID="HiddenModify_SecurityId">

</ajaxToolkit:AutoCompleteExtender>

<%-- Seuil du support --%>

<asp:LabelID="LbGainOption_StartThreshold"runat="server"Visible="false"Text="Seuil : "></asp:Label>

<asp:TextBoxID="GainOption_StartThreshold"runat="server"Visible="false"></asp:TextBox>

<%-- Insert --%>

<asp:LinkButtonID="InsertGainOption_StartSecurity"runat="server"Visible="false"Text="Insert"OnClick="InsertFromSecurity_Click"></asp:LinkButton>

</div>

<divclass="Clear">

</div>

</div>

</ContentTemplate>

<Triggers>

<asp:AsyncPostBackTriggerControlID="GainOption_AddStartSecurity"EventName="Click"/>

<asp:AsyncPostBackTriggerControlID="InsertGainOption_StartSecurity"EventName="Click"/>

</Triggers>

</asp:UpdatePanel>

cs file:

protectedvoid Page_Load(object sender,EventArgs e)

{

if (IsPostBack ==false)

{

HiddenModify_NavigationMode.Value ="1";

//HiddenModify_NavigationMode.Value = "2";

//HiddenModify_MonitoringMandateId.Value = "7";

LogicMonitoringMandates monitorings =LogicMonitoringMandates.getInstance();

LogicGainMandateOptions gainOptions =LogicGainMandateOptions.getInstance();

LogicLossMandateOptions lossOptions =LogicLossMandateOptions.getInstance();

LogicSellMandateOptionDetails sellDetails =LogicSellMandateOptionDetails.getInstance();

LogicBuyMandateOptionDetails buyDetails =LogicBuyMandateOptionDetails.getInstance();

LogicPortfolios portfolios =LogicPortfolios.getInstance();

LogicSecurities securities =LogicSecurities.getInstance();

LogicPortfolioPositions positions =LogicPortfolioPositions.getInstance();

LogicPortfolioPositionDetails details =LogicPortfolioPositionDetails.getInstance();

securities.GetSecurities();

if (HiddenModify_NavigationMode.Value =="1")

{

/*

RadioButton gainOption_AutomaticPerimeter = (RadioButton)AccordionPaneGainOption.FindControl("GainOption_AutomaticPerimeter");

RadioButton gainOption_00007Threshold = (RadioButton)AccordionPaneGainOption.FindControl("GainOption_00007Threshold");

gainOption_AutomaticPerimeter.Checked = true;

gainOption_00007Threshold.Checked = true;

*/

}

if (HiddenModify_NavigationMode.Value =="2")

{

int l_intMonitoringMandateId =Convert.ToInt32(HiddenModify_MonitoringMandateId.Value);

monitorings.GetMonitoringMandateByMonitoringMandateId(l_intMonitoringMandateId);

gainOptions.GetMandateOptionsByMonitoringMandateId(l_intMonitoringMandateId);

HiddenModify_GainMandateOptionId.Value =Convert.ToString(gainOptions.GetMandateOptionFromIndex(0).MandateOptionId);

GridView gridViewGainOption_StartSecurities = (GridView)AccordionPaneGainOption.FindControl("GridViewGainOption_StartSecurities");

The problem comes if I add the line above

//sellDetails.GetMandateOptionDetailsByMandateOptionId(Convert.ToInt32(HiddenModify_GainMandateOptionId.Value));

//gridViewGainOption_StartSecurities.DataSource = sellDetails.TABLE;

//gridViewGainOption_StartSecurities.DataBind();

AccordionPaneSignaletique_DataBind();

AccordionPaneGainOption_DataBind();

}

}

}

Does anyone know what i can do? Can i add the trigger of the updatePanel in the code behind in the pageload method ?

Thanks in advance,

I've been looking for this problem for all my weekend and i found what was the problem!!!!!!!

The problem comes from the Accordion component, during the Page_Load, the Accordion and the child component doesn't exists, but in my case i didn't get any error of "not found controls".

I found a fix on this page :

http://couldbedone.blogspot.com/2007/07/what-wrong-with-accordion-control.html

Thanks a lot to this guy!

i just added Accordion.FindControl("nothing") on a Page_Init and it works great now!

Update trigger in AccordianPane - How to find Control

Hi, I have an accordian with 3 panes. I have buttons and controls in those panes. One of these buttons is used to update an UpdatePanel. I have tried setting theAsyncPostBackTriggerEventName="Click"ControlID="SearchButton", but because the button is in a Accordian it has a different id ID assume.

How can i assign this in the code? What would my findControl() need to be? I get ErrorObject reference not set to an instance of an object.

I have been trying stuff like :

Dim SearchBtnAsNew AsyncPostBackTrigger

SearchBtn.ControlID =Me.FindControl("MyAccordion").FindControl("AccordionPane1").FindControl("SearchButton").ClientID.ToString

MsgBox(Me.FindControl("MyAccordion").FindControl("AccordionPane1").FindControl("SearchButton").ClientID.ToString)

SearchBtn.EventName ="Click"

Me.gridViewUpdate.Triggers.Add(SearchBtn)

You are on the right path, but you are going about it all wrong. You are getting the Error because anytime you use FindControl, you need to cast it to a particular object type:

ProtectedSub Page_PreRender(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMe.PreRender

Dim SearchButtonAs Button
SearchButton =CType(MyAccordion.FindControl("AccordionPane1").FindControl("Button1"), Button)

Dim TrggrAsNew AsyncPostBackTrigger
Trggr.ControlID = SearchButton.UniqueID'UniqueID, not ClientID.
Trggr.EventName ="Click"
gridViewUpdate.Triggers.Add(Trggr)

EndSub


Yep that sorted it, Thanks a bunch DisturbedBudda

Update UpdatePanel from Thread

Hi,

I am currently investigating the functionality provided by the ASP.NET AJAX UpdatePanel. I am trying to update the content of a label placed inside an UpdatePanel, from a seperate thread. I have a Thread.Sleep(2000) in my second thread, and nothing happens to the label after waiting 2s. If I remove the sleep command, the label do get updated. What do I need to do in order to make this work?

hello.

can you give more info on what you'tr trying to do here?


I am trying to simulate a process that takes a while to comples. This could be some kind of data-manipulation, calculations or whatever. The problem is then that I want the page to load normally, and the start a new thread. Then the thread should just show the content when is's done.

Update UpdatePanel contents from a web method async call back

Hi,

I have several asp label controls contained in an UpdatePanel.

An asp button control has code behind that calls a web service method using an AsyncCallBack.

When the callback occurs, I need to show the results by setting the text property on the label controls but I cant get the label controls to update.

Does anyone know how to get this working??

Thanks,

Hi, not much use to you I'm afraid but I have a very similar problem. My callback event is from a remoting object rather than a web service and I need to update a gridview rather than text boxes.The callbacks fire at irregular intervals so I can't use a timer to generate a partial postback.

Thanks


Well, you can't really force a client refresh based on a server-side event, unfortunately. The best you can do is use a timer of some sort, despite the fact that the response is irregular. Now, something to realize is that the updatepanel sends all the same form data that you'd normally send for a full postback, so that's a fairly heavy way to do it when you're not sure if you need to or not.

What I'd do instead is have that AsyncCallBack's server-side 'on complete' handler update a variable at the appropriate scope (there's any number of choices to make there as to where to place that variable scope-wise, and what info it should contain; but those decisions are domain specific to your app). Anyway, do that and then set up a simple web service that provides a read-only view of that variable. Personally, I'd use a 'last updated' kind of thing, and have that in the update panel as well, that way you can compare the two times in the next step.

On the client side, create a simple script that fires at a set interval (again, whatever time is appropriate) using setTimeout or the Sys.Preview.Timer object (the latter being a lot easier to use, imo). That javascript function fires off a request to the web service you set up, and in its oncomplete handler, you check the response. If that variable's value indicates that a refresh is needed, then you have the javascript function initiate the updatepanel's asynch postback to refresh all the data.

Now, all that said, I probably would do the whole thing w/ web services myself, but I'm assuming that you need some of the major server-side features that the updatepanel technique allows you to use.

Hope that helps,

Paul

Update UpdatePanel using JavaScript

Hi Everybody,

i want to load dynamically content from some user controls (with forms,or some data-controls) using atlas. So i use an UpdatePanel for loadingthe user control into a placeholder.

Using buttons for loading new content works fine. But i still want touse a function which is callable per javascript. I think this way ismore flexable than using the Buttons, becaus every button needs it'sown Sub-Routine. But i want to have a function with an Parameter forloading the new content.

Has anybody a good idea how to realize this? Working with Update()-Function of UpdatePanel-Control doesn't logically work.

Here is some code:

At first my test-function

1 <WebMethod()> _
2Public Function Test(ByVal intIdAs String)As Boolean
3 Dim contentNameAs String = intId &".ascx"
4Dim contentControlAs Control = Page.LoadControl(contentName)
5
6 PlaceHolder.Controls.Add(contentControl)
7
8 UpdatePanel.Update()
9Return True
10 End Function

I called this per JS-Function ...

1function test(intId) {
2 PageMethods.Test(intId);
3}

... per onClick-Method of a Link

1<a href="#" onclick="test(1);">Test</a>
2
3 <atlas:UpdatePanel ID="UpdatePanel" runat="server">
4 <ContentTemplate>
5 <asp:PlaceHolder ID="PlaceHolder" runat="server">
6 </asp:PlaceHolder>
7 </ContentTemplate>
8 <Triggers>
9 <atlas:ControlEventTrigger ControlID="Button1" EventName="Click" />
10 <atlas:ControlEventTrigger ControlID="Button2" EventName="Click" />
11 </Triggers>
12 </atlas:UpdatePanel>

But it doesn't work. I have tried so much.

Is there a possibilty to get User Controls generated HTML Code?
Or has anybody an idea for realizing this with an other way?

Thanks for all hints.

Regards,

AndréHi Andre,

The main problem with what you are attempting to do is that you are attempting to make a modification to the page without actually performing a postback. Executing the web service method "Test" from Atlas using the PageMethod.Test statement will execute your web method, but doesn't actually perform a postback and therefore you can't modify your page. The web method can really only return data, not have ASP.NET re-render part of the page.

A simple, but maybe not the best way of accomplishing this, is to use a hidden text field and a button to provide postback data. You set the value of the hidden text box to the data needed to create the user control (i.e. intId) and then click the button programmatically (i.e. button1.click). Then you have a common routine on the server, like your web method "test", that alters the page as necessary based upon the postback information.

HTH
Hi,

thank you. But isn't there another method for loadig content dynamically per ATLAS?
Or is there a possibility to create a new event, bind the UpdatePanel-Trigger and raise it with JavaScript?

I believe there must be a cleaner method than using a hidden textfield and call a button's sub.
How do you this?

Best regards,

André
Hi,

I am relatively new to ASP.NET and Atlas but have a similar question. Is there any way to generate an Update event on the UpdatePanel using client side Javascript?

I have a situation where I need to have two separate web applications for security reasons, but I want both applications to use a common search page. I can create a link on the first page (parent) to open the search page as a popup window easily enough. What I want to do is return the found item id back to the parent window and trigger an asynchronous update when the popup window is closed.

If I use javascript only, I can have a function in the parent window called 'Update()' and use it to create the xmlhttprequest object etc. I would prefer to use an Atlas UpdatePanel in the parent window and trigger an update from the popup window using the onunload event. (Note: the popup window page is not in the same application as the UpdatePanel)

Is this possible? Is there a better way to achieve this?

Regards,
Trevor.
OK, so I think we agree that a web method isn't going to do the trick for you as the page needs to go through its lifecycle and process the new UserControl and render it into Html.

There is no magic bullet in Atlas to load content dynamically. An UpdatePanel requires a postback to do any updating. You can use a web method to return an Html string to you and then parse it and place it where you want in the DOM, but that really is a lot of work and doesn't require an UpdatePanel.

That being said I'll assume that we agree that a postback needs to occur in order to load your user control into the page.

I believe you need a generalized method of posting back data that is not really related to a server control. The question remains; how to get the data back to the server on which control to load? The data has to be part of the post data. I suggest using a hidden text box as the transport mechanism as it's easy to work with and is fairly light weight and then telling that UpdatePanel to update through the use of clicking a hidden button. To be honest, I've used this pattern on a multi-million dollar application and have good success with it. I'm not saying it's perfect and maybe I'll see a better pattern that Ishould'veused, but it provides the flexibilty that you and I require.

Happy Coding
"Is there any way to generate an Update event on the UpdatePanel using client side Javascript?"

You need to have whatever is defined as a trigger of the UpdatePanel or a server control contained within the UpdatePanel cause a postback.

Happy Coding
Thanks for explaining that. I wasn't aware of the PageMethods collection until just now.

Trevor.

BUMP!!!

That worked Marvellously :)

I used it with a calendar control. I wanted to have different controls in a date cause a postback. WELL as far as I know adding sever controls doesn't work because they don't cause post backs when added inside a Day Cell.

SO dropped some anchors in the day. Had the onclick of the anchor fill a hidden field and click a button outside the updatepanel. Which triggered it :)

Works great.

Update UserControl from another UserControl in an UpdatePanel

I've got 2 usercontrols on my webpage (let's call them uc1 and uc2). In uc1 is a button. When I click on the button I bubble up the event to the main page. In the main page I handle the event. In the event handler on the main page I set a property of uc2 which sets the text of a label in uc2. I want this interaction to happen in an UpdatePanel so that the screen doesn't postback, but I can't seem to get it to work. Any direction would be greatly appreciated. I have a sample app if someone wants to see it.

Hi

I use that technique in nblogr. You can download nblogr's source from codeplex.

Basically you expose a method in your uc2 something like void DoUpdate()
And in that method you call myUpdatePanelID.Update()

and that should do the trick

Hope this helps you a little


Thanks so much! That did the trick!

Could you be a bit more specific? I downloaded that code but there is a lot of code there. Looking for a snippet....

Thanks.

Jeff


What part are you having trouble with? Bubbling up the event from the first control and modifying the second one, or having the UpdatePanel refresh after the changes have occurred?

I was having a similar issue. I've got two controls in two separate panels on one page and I'm using the event bubbling to get the two controls to communicate and toggle their visibility. I was forced to click the first control's button twice before the intended result would take place, even though all the code would execute while debugging. It seemed the first click wasn't updating the client but the second one did. Then I took a closer look at my container page, I didn't have the two controls in an UpdatePanel, even though the container page was setup for ajax. Wrapping the all the controls and panels in an UpdatePanel got it sorted.

Just thought it would be useful to note here.

-jason


Hi, What i have done in my application is like i have a combo inside a usercontrol , another control includes

a login page type controls , Now when ever the user selects any thing from the combo control the text on the login control also changes without full page refresh. If this is your prob. then below is how i did it.

Put your combo control inside UpdatePanel and contentTemplate tag. Dont do any thing with login control just put both of them on aspx page inside a Scriptmanager tag. and on page load of Login control put your logic . If this is not sufficient then i can send you the code .

Can you tell me how to stop the mail of Posts from this site to my mail box, or how to unsubscribe. becoz this thing has filled my personal ID.

Shrikant

Update/Add records without postbacks

Hi i have been seriuosly stuck for 2 months on this. I have created a sample project so you can see how i have tried to relsove this problem.

Aims

Load records into a gridView

Click record in gridView

play animation, opens panel

retrieve data for clicked record

Update the record

Use same animation to create new record

Click button

play animation, opens panel

Add new data

Save data

Default.aspx - Shows how i successfully retrieve data from grid and load it in the panel

Sam.aspx - Shows how i add and edit the data, but without call backs. Click on the edit linkbutton then press the new button to open panel.

Sam2.aspx - Shows how i swap the animations between one button and the other

I don't understand your question, when you add the controls under an UpdatePanel does not hide the postbacks?


Hi Sanson,

Based on your description, I think you are sharing your experience. But I think you have missed the URL. Would you please add it ? Thanks.

Best regards,

Jonathan


I bulit a mini project that i thought i could upload with my post, but i cant. I will have to upload the example project so you guys can see it.

Sorry, I could have sworn that there was an option to upload .doc

Updated Atlas info?

Wish Atlas guys had included the timestamp on this web page, so that one would know when it was updated last.

http://atlas.asp.net/docs/default.htm

Rightnow, I'm looking for the most uptodate (Dec 05) documentation & Hands-on labs for Atlas and I'm not sure if the above link is the right one.

-Rach

The Last-Modified HTTP Header indicates:

Mon, 19 Dec 2005 16:05:28 GMT

Plus the example for the AutoComplete stuff uses the new AutoCompleteExtender (http://www.nikhilk.net/Entry.aspx?id=100) stuff. So yes, it has been updated for this new build.

Updated control KIT

I downloadedhttp://atlas.asp.net/default.aspx?tabid=47 this tool kit and I copied .dll file to my existing Atlas project and I still dont see new control like (dropshadow, roundcorners,modalpopup etc)
How to fix it?

Even when I create new application using atlast template I dont see new controls?

What dll did you copy?

It could be that you've reinstalled Atlas ... not the Atllas Control Toolkit , they are different.


I downloaded the new tool kit and than extracted and copied the bin folder from sample project to my project.

If this is wrong download what I need to dowload and from where? (Note: I already have old atlas running on my current project)


The atlas assembly is: Microsoft.Web.Atlas.dll ... no update since April 6.

The latest control toolkit is: AtlasControlToolkit.dll ... and some of the samples need Microsoft.AtlasControlExtender.dll as well (like the Modal dialog sample).

Have you tried running the sample website that comes with the toolkit? If not, you should try ... it has working examples of all of the controls.

If it's a pre-existing project, you'll also need to add a new directive to your pages in order to start referencing the toolkit controls.

<%@. Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="atlasToolkit" %
Hope I'm not repeating myself ... but the toolkit controls are open source samples of things that you can build on top of Atlas. I don't work for Microsoft ... so know idea if these things will be rolled into the core Atlas at somepoint. But at this point the goal is clearly to seed the developer community with cool things that you can do on top of the Atlas framework, get developers to submit new controls, etc.


Updated RoundedCornersExtender

Thought I'd share an update I made to the RoundedCornersExtender. As a summary, I added support to have the corners rounded outward or not at all. In addition, you can apply a different style to each corner individually.

Details are here:http://kyle.baley.org/NewPropertiesOnTheRoundedCornersExtender.aspx

Hi Kyle,

Very nice work!

Thanks,
Ted


The corner chooser is a must for the rounded corners extender!
Can we get this into an official build?
Please put this on a to do list somewhere!

Chris


I've created work item 5611. Thanks a bunch!!

I'd like to start by saying these changes are definitely an advantage, and as a Toolkit user I'd love to see them in the official release. I have another recommendation which I am amazed no one has attempted (correct me if I'm wrong).

In my opinion, anti-aliasing techniques should be applied (perhaps as an optional setting) to remove the "Microsoft Paint" feel from the rounded edges of the control's output. I know of several JavaScript methods to apply anti-aliasing techniques, and there are several algorithms available from a simple Google search.


one million thank yous!

I would like to suggest another feature for the RoundedCornersExtender:

In some cases it would be extremly nice if it would be possible to draw only a rounded outline around a panel. Guess I have a panel with white background and a blue border - and this border should become rounded. Until now, the extender draws solid regions (means: completely filled by a color) above and below the target panel - so it is not possible to use it for creating a rounded outline.

Or should I be mistaken and itIS already possible?

Regards,

ReneMT

Updated to latest release - profile now broken

I just upgraded my web application to the latest release of Ajax and now the app hangs on the login. I paused the code and it is hanging on getting a profile property. I even tried creating an entierly new membership database and it still does the same thing. The Website Configuration Tool still connects to the membership database, so I know its not a problem with the users or roles. Any help would be greatly appreciated.

MORE INFO -

When I pause the app, it always stops on one of two lines:

The first is in a generated code file -

ReturnCType(Me.GetPropertyValue("LastName"),String)

This is what lead me to believe it is a profile issue - this generated code file has all of my profile properties in it. When I set a watch on Me.getPropertyValue("LastName"), its value is "Cannot evaluate expression because we are stopped in a place where garbage collection is impossible...etc"

If I start running and then pause again, it stops on a line that begins:

IfNotMy.User.IsInRole("Administration")

So, naturally I set a watch on My.User - which yields a value of "error: cannot obtain value"

I have NO IDEA what to do next? Anybody?

We upgraded to the latest version of the toolkit a few days ago, and now are seeing a lot of things either not working, or working sometimes and sometimes not. I almost suspect there is a problem in this version, but I cannot find the old version to go back to...

TIA,

Bill


Figured it out...had an error infinite loop going. Had nothing to do with membership.

Updated to IE7 and have some formating error.

I had Ajax enabled website working with IE6 perfectly as soon as I updated my IE to IE7 I have problem with my formatting. All the data grids labels and text (controls) are all around. Panels are not working the same as before.

Any idea?

It's probably having to do with the fact that IE6 was horrible in terms of following the standards. If you look at your site in Firefox or Opera, it probably will look the same as in IE7. Without code, it's hard to pinpoint the problem, but you should invest some time in the various CSS sites like alistapart and csszengarden to start debugging. Also, install IE Developer Toolbar so that you can see where your objects are in the browser's view and what styles they are responding to at runtime.

Updated WebDev Helper

Thanks Nikhil.

http://www.nikhilk.net/WebDevHelperHTTPTracingUpdates.aspx

Wally

awesome!

UPDATED: AJAX FAQ? And: How to Style the AJAX tab controls tabs: complete information

UPDATE: see step #8 for updated information about the fix for the styles.

First of all, I would like to suggest that the AJAX section of the ASP.NET forums have its own FAQ section. I was going to post this in the general ASP.NET FAQ, but it didn't really fit, and there was no AJAX FAQ, so I'm posting it here.


Next: I have been looking for details on how to style the Tabs in the AJAX Toolkit's Tab control for over a week now. I have found information that is misleading, incomplete, outdated, and just plain wrong. And nowhere have I come across all the information needed to make it work in one place. So, I am posting this here. I hope that an AJAX FAQ can be created, and this post moved there.

I am including some background information, about the difficulties people are having in finding information on styling the tabs, first; after that I will include the complete instructions for styling the tabs.

First: the information on the documentation page for styling the tabs is misleading at best, as well as incomplete. The docs tell you that you can simply add your styles to your project as CSS, and neglect to tell you that you must add a "CssClass" attribute pointing to your new styles. They also state that, if you do not specify a style for a given element of the tabs, the "default" style will be used. What they don't say is that the default style isnot the style you see when you first drop a tab control on a form! That style is actually the "XP style" you can see in the "tabs.css" file in the source for the AJAX toolkit.
Actually, what the docs refer to as the default style is an extremely bare-bones style, with no tab images at all! Your first impression on seeing this style is likely to be what mine was: "something must be broken- or I must have done something wrong."

The docs lead you to believe that you can just specify a style for one element -- such as setting the font for the tab body -- and you will then see the style you set, and the rest of the styles will be the "normal" style (aka the XP style). Not so! What you will get if you try this is what looks like plain tabs, with your font - and no actual tab images! Instead, you will have the names of the tabs above, looking like plain text, with no tab images at all. As noted, this is because the default style is not the "XP style", but rather is an extremely plain style with no images. While the docs are technically correct, the average user is not going to understand that the default style is not the one the control "comes with".

Next, you will find suggestions on some web sites that you download the source code for the toolkit controls, and copy the styles from the "tabs.css" file as a starting point for your own styles. The problem is, when you download the source code, the 'tab-line.gif' image in the .ZIP archive is either corrupt or incorrect, and there is a problem with the .CSS. Apparently the latest version of the Toolkit has a corrected image, but the .CSS is still a problem. This causes a blank spot to appear in a line along the right edge of each tab. You can see this by copying the XP style from the tabs.css file in the source code and pasting it into a .CSS file in your project, then editing the URL references for the images to point to the images you extracted from the source code .ZIP file. There is a fix for this that HalH discovered:http://forums.asp.net/p/1067200/1972639.aspx#1972639

Some sites, and even some posts on this forum, that suggest you use the styles from the toolkit source - and then they list some of the code,but have incorrect syntax when referencing the images that are embedded in the controls! For the record, if you want to change some styles but not the images themselves, you'll want to keep the references to the embedded images; use the syntax in the "tabs.css" file in the source code. But be warned that you'll need to apply HalH's fix linked in above (it also appears below as item #8).

There are other issues, but the above three alone make it very difficult for someone to get started styling the tabs.

How to Style the AJAX tab control:

The method for changing the style of the tab control thatactually works is as follows:

    Download the source code for the AJAX toolkit from this page:http://www.codeplex.com/AtlasControlToolkit/Release/ProjectReleases.aspx?ReleaseId=4941 - make sure you grab the version with the source code!

    Open the .ZIP archive and extract the tabs.css file, and the tab images - get all 10 of the .gif files that start with "tab".

    Place the .gif files into a folder in your website, then right-click that folder in Solution Explorer and "Add Existing item..." for each image file.

    Open the "tabs.css" file and Copy the entire XP style. Paste it into a .CSS file in your project, such as the one you are already using.

    In the .CSS file in your project, edit this first part of each entry for the tab control:.ajax__tab_xp . You want to change it slightly, such as to.ajax__tab_xp2 - that is, add the number 2 to the end. Do this for each entry in the XP style; do itonly for the first item on each line.

    Go through each entry that contains a URL reference to a .gif file, and edit it to point to the .gif files you added to your project in step 3. If you placed them into a folder called "images" in your website's root folder, the reference should look like this (be sure you don't accidentally erase any style text from the end of each line):

    background:url(../images/tab.gif)

    At this point, if you view the page in a browser, you will see the issue mentioned above: the "blank spot", or missing pixels, along the right edge of each tab image.

    Next, apply HalH's fix as mentioned above (I'm quoting him here, for the most part): remove the reference to 'tab-line.gif' from the '.ajax__tab_header' definition - that is, delete the entire "background" portion of the style. Then, remove "padding-right:4px;" from the definition of '.ajax__tab_outer'. [EDIT- I have discovered that, at least with the latest version of the toolkit, you can leave the reference to the image in place, which restores the line along the top of the tabs.]

    Finally, open the page(s) in which you placed the tab controls in Source view. Edit the opening TabContainer tag in each file to add a CssClass reference to your new style. For the example above in step 5, the tag would look like this:

    <cc1:TabContainerID="TabContainer1"runat="server"ActiveTabIndex="1"CssClass="ajax__tab_xp2">

At this point, you will have a tab control that looks exactly the way an un-styled tab control would look! However, the difference is that you can now add/change the styles, and the changes you make will show up in the web page. Note: if you are happy with the image files that come with the stock XP style, don't change the background URL file references; you will still need to use HalH's fix, though.

It's surprising this control was released with a corrupt image [NOTE: THIS APPEARS TO BE FIXED IN THE LATEST VERSION] and broken CSS. Clearly the problem was fixed internally in the control's code and its internal image, since the control works when simply dropped unchanged on a webform, but the fix didn't get propagated to the publicly released source code... It would be nice to see Microsoft fix this issue, or at least postall of this information in the docs for the tab control...

Because I had so much trouble finding all this information, I am posting this here, in addition to posting this in the thread mentioned above.

Hopefully this will help someone else avoid the solid week I spent digging up this information from the few pages that have any info at all about this issue...

-Andrew

This is great stuff, thanks so much for sharing it. I see questions all the time wanting to know more about this topic.

I do have one problem and it may just be that you did this with a slightly older version of the toolkit, but my tabs.css does not reference xp anywhere. I have classes like.ajax__tab_default.ajax__tab_header and there is no reference to xp. Is there something I am missing?


Hi Chris-

AFAIK I am working with the latest version of the toolkit. I don't know why the XP style would be missing from your "tabs.css" file.

For the record, I will post the .CSS styles from my "tabs.css" file, and you can use them as a basis. Remember to remove the problem style as in my post above, and, if necessary, the reference to the problem .gif file:

/* xp theme */.ajax__tab_xp0 .ajax__tab_header {font-family:verdana,tahoma,helvetica;font-size:11px;background:url(WebResource.axd?d=enSUOcaa7DLBDplOv1agOWCbl483FKJyVuuGamtrdbsYLV5lPgufcLNwW9J6abY1rmrJJ7SjYIGSDdAdtNw1Ew2&t=633167421400000000) repeat-x bottom;}.ajax__tab_xp0 .ajax__tab_outer {padding-right:4px;background:url(WebResource.axd?d=enSUOcaa7DLBDplOv1agOWCbl483FKJyVuuGamtrdbsYLV5lPgufcLNwW9J6abY1yrs7q_zNUWaBBHgGRYOHKQ2&t=633167421400000000) no-repeat right;height:21px;}.ajax__tab_xp0 .ajax__tab_inner {padding-left:3px;background:url(WebResource.axd?d=enSUOcaa7DLBDplOv1agOWCbl483FKJyVuuGamtrdbsYLV5lPgufcLNwW9J6abY133ijxBIREEOoObFED_Bhzw2&t=633167421400000000) no-repeat;}.ajax__tab_xp0 .ajax__tab_tab {height:13px;padding:4px;margin:0;background:url(WebResource.axd?d=enSUOcaa7DLBDplOv1agOWCbl483FKJyVuuGamtrdbv_dPXVoiLJ4geaEoszM6Zx7A4pJ2521Vwp4VsPeLe2fQ2&t=633167421400000000) repeat-x;}.ajax__tab_xp0 .ajax__tab_hover .ajax__tab_outer {background:url(WebResource.axd?d=enSUOcaa7DLBDplOv1agOWCbl483FKJyVuuGamtrdbsYLV5lPgufcLNwW9J6abY1rJjD_WkIfACTs9HQKpeKUA2&t=633167421400000000) no-repeat right;}.ajax__tab_xp0 .ajax__tab_hover .ajax__tab_inner {background:url(WebResource.axd?d=enSUOcaa7DLBDplOv1agOWCbl483FKJyVuuGamtrdbsYLV5lPgufcLNwW9J6abY1rMUVO7awInbuj7kuhms0Aw2&t=633167421400000000) no-repeat;}.ajax__tab_xp0 .ajax__tab_hover .ajax__tab_tab {background:url(WebResource.axd?d=enSUOcaa7DLBDplOv1agOWCbl483FKJyVuuGamtrdbsYLV5lPgufcLNwW9J6abY1v5hLjjGOCMpBlMfF8JzFbA2&t=633167421400000000) repeat-x;}.ajax__tab_xp0 .ajax__tab_active .ajax__tab_outer {background:url(WebResource.axd?d=enSUOcaa7DLBDplOv1agOWCbl483FKJyVuuGamtrdbsYLV5lPgufcLNwW9J6abY11YFCEA-F1KrZBMAZZJHpInefUOk0Ib7CmvpoDZVzyh41&t=633167421400000000) no-repeat right;}.ajax__tab_xp0 .ajax__tab_active .ajax__tab_inner {background:url(WebResource.axd?d=enSUOcaa7DLBDplOv1agOWCbl483FKJyVuuGamtrdbsYLV5lPgufcLNwW9J6abY1jldUXO80Ye5rs84ruU2hGw2&t=633167421400000000) no-repeat;}.ajax__tab_xp0 .ajax__tab_active .ajax__tab_tab {background:url(WebResource.axd?d=enSUOcaa7DLBDplOv1agOWCbl483FKJyVuuGamtrdbsYLV5lPgufcLNwW9J6abY1rn-Bcdsd-Psg-56pH8vCFg2&t=633167421400000000) repeat-x;}.ajax__tab_xp0 .ajax__tab_body {font-family:verdana,tahoma,helvetica;font-size:10pt;border:1px solid #999999;border-top:0;padding:8px;background-color:#ffffff;}

/****************************** END STYLES ********************************************************/

Here is the syntax for referencing a .gif file that is in a folder in your website- for this example, the file is in a folder named "images" which is in the root of the site:

background:url(../images/tab-line.gif)

Since I had such a rough time finding info on this, I am going to post a few links I found of use:

Ron Buckton, creator of the Tab control, has a page on styling the calendar and tabs:http://blogs.msdn.com/rbuckton/pages/ajaxskinning.aspx - I actually found several references to this article, but apparently his original domain went down or something, so I never did get to read it; but he contacted me with this updated link.

OK, this one pushed me over the edge.

I had such an irritating time getting the Tab control styled, that I have stopped resisting the flow, and I have started my own blog about ASP.NET and other related and unrelated stuff at:

http://acushen.spaces.live.com/blog/

I re-posted the how-to above, and am adding a series of additional posts detailing why it was so difficult to find out how to style the tabs. Rants? Maybe a little... :-)

I will also have some additional links and hints on styling the tab control...

-Andrew


This is great work Andrew. Thanks for sharing your learnings with the rest of the community.


andrew:

your post saved me a lot of time.

i had no tab styles because i embedded a tab container in a updatepanel. with the information from your post it took about 15 minutes to solve and get the styles working with the tab container inside the updatepanel.

thanks, chad


Guys-

I'm glad I was able to help.

I know how frustrating it was forme when I was trying to dig up this information, and very few sites hadanything on it. Those sites thatdid have something generally had only one piece of the puzzle, and/or part of their info was wrong...

Feel free to check out my brand-new Blog at:http://acushen.spaces.live.com/blog/. It was started as a direct result of my difficulties with the Tab control, and I have posted a bit more about my experiences with styling the Tab control...

-Andrew

Updatemode=Conditional still updatepanel is refreshing

Dear all...

I have two update pannel in my page. And both have some controlls and its update progress controll. I have given the updatemode property to conditional for both update pannels. Al also i have assigned the triggers properly. The problem i am facing now is..

We can refer as follows

First update pannel as - [A] and Seccond update pannel as - [B]

I want to update the [B] when i am clicking on a button which resides in [A] , But when i am clicking on the button its refreshing both. And also its showing both updateprogress ..

Thank you very much

hi,

I think both progress bar will be showing because you might not assign associateupdatepanelid in updateprogress.

If u assign this could it will possible for you share your code.


hello.

well, take a look at the childrenastriggers property of the updatepanel control. if you set it to false, your button won't refresh that panel. the problem is that if you have other controls that need to refresh their "parent" panel, then you'll need to register those controls as async postback controls (scriptmanager.registerasyncpostbakcontrol) and refresh the panel during a partial postback started by one of those controls (by calling the update method).


I have asisgned associateupdatepanelid in both updateprogress and also I marked childrenastriggers = false. Still its happening.

hello again.

can you build a really simple page that reproduces this problem and post it here?


I have made almost a same sample... In this sample app also i am facing the same problem...

-----The HTML Part

=================================================================================

<body>

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

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

<divstyle="width: 359px; height: 274px">

<asp:UpdatePanelID="UpdatePanel1"runat="server"ChildrenAsTriggers="False"UpdateMode="Conditional">

<ContentTemplate>

<divstyle="width: 315px; height: 185px; background-color: inactivecaptiontext">

<br/>

<asp:ButtonID="butRefresh1"runat="server"Height="36px"Text="To Refresh the update panel 1"Width="203px"OnClick="butRefresh1_Click"/>

<br/>

<br/>

<asp:TextBoxID="text1"runat="server"></asp:TextBox><br/>

<br/>

<asp:ButtonID="Button2"runat="server"Height="31px"Text="To refresh the update panel 2"

Width="200px"OnClick="Button2_Click"/> <br/>

</div>

</ContentTemplate>

<Triggers>

<asp:AsyncPostBackTriggerControlID="butRefresh1"EventName="Click"/>

</Triggers>

</asp:UpdatePanel>

<asp:UpdateProgressID="UpdateProgress1"runat="server"AssociatedUpdatePanelID="UpdatePanel1"DisplayAfter="10">

<ProgressTemplate>

Loading ....

</ProgressTemplate>

</asp:UpdateProgress>

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

<divstyle="width: 582px; height: 229px">

<asp:UpdatePanelID="UpdatePanel2"runat="server"ChildrenAsTriggers="False"UpdateMode="Conditional">

<ContentTemplate>

<divstyle="width: 521px; height: 115px; background-color: lightgoldenrodyellow">

<br/>

<asp:TextBoxID="text2"runat="server"Height="23px"Width="313px"></asp:TextBox>

<br/>

<br/>

<asp:UpdateProgressID="UpdateProgress2"runat="server"DisplayAfter="10">

<ProgressTemplate>

<divstyle="width: 368px; height: 100px; background-color: #ffccff">

<asp:LabelID="Label1"runat="server"Font-Bold="True"Font-Italic="False"Font-Size="X-Large"

Font-Underline="True"Height="75px"Text="Loading ...."Width="325px"></asp:Label></div>

</ProgressTemplate>

</asp:UpdateProgress>

</div>

</ContentTemplate>

<Triggers>

<asp:AsyncPostBackTriggerControlID="Button2"EventName="Click"/>

</Triggers>

</asp:UpdatePanel></div></div></form></body>

=================================================================================

VB.NET Source code...

=================================================================================

ProtectedSub butRefresh1_Click(ByVal senderAsObject,ByVal eAs System.EventArgs)

Dim iAs Int32

For i = 1To 10000000

text1.Text ="Pannel1 refreshed ..."

Next

EndSub

ProtectedSub Button2_Click(ByVal senderAsObject,ByVal eAs System.EventArgs)

Dim iAs Int32

For i = 1To 10000000

text2.Text ="Pannel2 refreshed ..."

Next

EndSub

=================================================================================

I hope youi will try your level best for me to getrid of from this problem...

Thank you


hello.

well, you're getting refresh because you've also set up the buttons as triggers. this will force a postback. I'm putting here a very simple example of how you can refresh the panel through code:

<%@. 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">
void c(object sender, EventArgs e)
{
panel.Update();
}

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:scriptmanager runat="server" id="manager" />
<asp:Updatepanel runat="server" id="panel" UpdateMode="conditional" ChildrenAsTriggers="false">
<ContentTemplate>
<asp:Button runat="server" ID="bt" Text="refresh" OnClick="c" /><br />
<asp:Button runat="server" ID="Button1" Text="don't refresh" /><br />
<%=DateTime.Now.ToString() %>
</ContentTemplate>
</asp:Updatepanel>

<%=DateTime.Now.ToString() %>
</form>
</body>
</html>

UpdateMode Conditional updates always

Hi everybody. Using MasterPage with ContentPaceholders that contains UserControls, UpdatePanels wich are all assigned an UpdateMode to conditional and some ModalPopUp extenders.

When any trigger is fired all the UpdatePanels are refreshed.

I'm I doing something wrong. Thanks in advance

I was wrong. It updates only with update method, but, always loads page and controls. Is it possible to avoid in a simple manner.

I was wrong. It updates only with update method, but, always loads page and controls.

Is it possible to avoid in a simple manner?


I also have the same problem...

any body have any idea to solve this problem???


Hey I got the solution for this problem !!!!

Set RenderMode Property of UpdatePanel to "Inline" for each UpdatePanel on page.

Also assign TargetPanelID for each UpdateProgress on page.

Cheers ,

Shekhar


Hello, this didn't help. Do I need to set "Conditional" update mode to the panels?Also, TargetControlID, not TargetPanelID I suppose, right?

UpdateMode = Conditional still refreshes!

I have a web application project running Atlas, now Ajax, with a masterpage where I have a scriptmanager.On the default page I have a scriptmanagerproxy and some usercontrols. these have updatepanels inside of them, all with updatemode=conditional and triggers for ONE button to make them refresh.

No matter which button I press, the updatepanel refreshes. It doesn't really flicker, the problem is that it refreshes the content. I've tried removing everything, I've even tried with a new website project, and with and without masterpages, no matter the result is the same.

Can someone please explain this to me? I use the web_ctp.config and run on win 2003 server. please let me know what code you require, though the very basics aren't even working, I don't see the point of posting any now.

Solution found here...

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

Updateing from ATLAS to AJAX.NET?

Hey!

I have built a stie that uses a early version of ATLAS where a webservice was created and then by using java i could do callbacks and let the java change my page.

Now i want to update to AJAX.NET and AJAX control toolkit.

I have followed the fallowing steps:

    Download AJAX.NET Beta 1 and Ajax control toolkit.Executed the AJAX.NET setup where i choosed removeExecuted the AJAX.NET setup and choosed installUnpacked and executed the Ajax control toolkitRemoved the references in my projectFollowed the steps in the AJAX.NET migration doc witch involved some web.config editing and moved the scriptmanager in my masterpage from <HEAD> to form(runat="server").Included the Ajax control toolkit dll as a reference, the AJAX.net referens is not longer needed becource its placed in the GAC.

This simes to work fine, i havent tested the AJAX yet but the intellisens finds the toolkit/Ajax.net controls.

But there is some problems

    web.config have a schema(orginal) to fallow and it simes like this dosent know of the AJAX.NET syntax? i get alot of informations(over 100) about this, ex name do not exist. When i look in the exampel web.config from AJAX.NET there is no schema stated? should i remove my to?There was stated in the migration doc that the content of a searten tag should be moved to another. The contetn was 3 dataconverters. After moving this dataconverters tahy are not working any more(cant compile)??
Maby anyone here can help me?


I have now tested AJAX and its not working at all?

hello.

you should update to beta 2.

btw, can you tell us the errors you're having? migrating from the ctp to the current release envolves some work...


Sorry its Beta 2 i am using.

I will post the errors i get when the dataconvertersa active in the web.config as soon as i can(do not have the project here at work).

i have tryed to upload my site to the webhotel where it have worked before but it cant be displayed? instead i get an error(i have not show error i public turned on in then web.config so i dont know the error message right now but i will look in to it).

My Thought is that the webhotel needs to install AJAX.NET BETA 2 becource the dll is located in the GAC now instead of a simple reference?


Hey!

I have now examen my site some more.

I startated a new Ajax web project with Ajax control toolkit and changed my sites web.config according to this new Ajax test project but this didn′t help anything? My web.config looks like this:


"1.0"?> "microsoft.web" type="Microsoft.Web.Configuration.MicrosoftWebSectionGroup, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> "scripting" type="Microsoft.Web.Configuration.ScriptingSectionGroup, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> "webServices" type="Microsoft.Web.Configuration.ScriptingWebServicesSectionGroup, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> "jsonSerialization" type="Microsoft.Web.Configuration.ScriptingJsonSerializationSection, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" /> "profileService" type="Microsoft.Web.Configuration.ScriptingProfileServiceSection, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" /> "authenticationService" type="Microsoft.Web.Configuration.ScriptingAuthenticationServiceSection, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" />for the Atlas framework. -->"Microsoft.Web.Script.Serialization.Converters.DataSetConverter"/>"Microsoft.Web.Script.Serialization.Converters.DataRowConverter"/>"Microsoft.Web.Script.Serialization.Converters.DataTableConverter"/> --> "connectionString" connectionString="DRIVER={MySQL ODBC 3.51 Driver};SERVER=193.13.255.212;DATABASE=test;USER=test;PASSWORD=test;OPTION=3"/> "mainTheme"> "asp"namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> "asp"namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/> "System.Web.UI.WebControls.CompareValidator" mappedTagType="Microsoft.Web.UI.Compatibility.CompareValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> "System.Web.UI.WebControls.CustomValidator" mappedTagType="Microsoft.Web.UI.Compatibility.CustomValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> "System.Web.UI.WebControls.RangeValidator" mappedTagType="Microsoft.Web.UI.Compatibility.RangeValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> "System.Web.UI.WebControls.RegularExpressionValidator" mappedTagType="Microsoft.Web.UI.Compatibility.RegularExpressionValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> "System.Web.UI.WebControls.RequiredFieldValidator" mappedTagType="Microsoft.Web.UI.Compatibility.RequiredFieldValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> "System.Web.UI.WebControls.ValidationSummary" mappedTagType="Microsoft.Web.UI.Compatibility.ValidationSummary, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>"true" to insert debugging symbols into the compiled page. Becausethis affects performance,set this value totrue only during development. --> "true"> "System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> "System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> "System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> "System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> "System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> "System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> "System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> "System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> "System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> "Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>is mapped to anew handler so that proxy javascripts can also be served. --> "*" path="*.asmx"/> "*" path="*.asmx" validate="false" type="Microsoft.Web.Script.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> "WebResourceCompression" type="Microsoft.Web.Handlers.WebResourceCompressionModule, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> "ScriptModule" type="Microsoft.Web.UI.ScriptModule, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> "Windows"/> "40"/> "iso-8859-1" requestEncoding="iso-8859-1" responseEncoding="iso-8859-1" culture="sv-SE" uiCulture="sv-SE"> "test@.test.se "> "smtp.axentus.net" password="test" userName="test" defaultCredentials="false"/> "false"/> "ScriptModule" preCondition="integratedMode" type="Microsoft.Web.UI.ScriptModule, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> "WebServiceHandlerFactory-ISAPI-2.0"/> "ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="Microsoft.Web.Script.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


I have also looked in the java consol in Firefox to see whats happening when pressing the "Quote" button and apperently it cant find my webservice(dataservice.asmx)? This webservices is stated in the scriptmanager ?

 <asp:ScriptManager runat="server" EnablePartialRendering="true" ID="smScriptHandler"> <services> <asp:ServiceReference Path="dataService.asmx" /> </services> </asp:ScriptManager>

I have also looked at theuploding problem. When the site is uploaded and I tryes to visit it, it shows an error. The error are as fallows:

Server Error in '/' Application.Configuration ErrorDescription: 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 81: <add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>Line 82: <add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>Line 83: <add assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>Line 84: </assemblies>Line 85: </compilation>Source File: g:\webusers\31330-zni\bradspel.net\web.config Line: 83Assembly 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].

It simes like the webhotel will have to install AJAX.NET BETA 2 if i understud this error right?

Best regards

UpdatePanel

Hi, I am using an UpdatePanel, which I can send general text back but I would like to send JavaScript back to the client. For example, I would like to send the user a alert box.

Can someone help me out please.

Many thanks

Paul

Hi Paul,

I would think you could do this like you would normally in ASP.NET, but I'm not the best person to ask. Since this isn't a Toolkit question, you will get a better response in the"Atlas" Discussion and Suggestions forum.

Thanks,
Ted
Thank you, I will try there.

UpdatePanel

Hello group,

I have a gridview control that works fine displaying data and also include a row_updating handler . As I just said everything is okay BUT

When I wrapped it with the update panel ajax control the code in the row_updating control does not recognize the gridview. I used the Update panel FindControl method from the GridView1_rowUpdating methos but the record will not update...

any idea??

regards

did you try just using hte sender object?


Hi,shtrudel

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

To troubleshoot this issue, we really need the source code to reproduce the problem, so that we can investigate the issue in house. It is not necessary that you send out the complete source of your project. We just need a simplest sample to reproduce the problem. You can remove any confidential information or business logic from it.

Thank you.

updatepanel

Hi,

I am using updatepanel to update a message that's to be show to the user. I have a textbox with the submit button inside another updatepanel. Once the user hits a submit I have to display whatever he entered in the textbox.

The problem I am having is that the div (which displays result, can a server side control too), just appends the new text to the original value. So if I hit enter a multiple times, it goes on appending!

Am I missing something here?

Thanks!

Can you show the code that move the text from the textbox to the div?


Please show an example of what you are doing.


HtmlGenericControl DivControl = new HtmlGenericControl();

DivControl = (HtmlGenericControl)ResultsDiv;

DivControl.InnerHTML = txtReply.Text;

This comes up when the submit button's pressed.


Is there some reason you couldn't use a Label inside the div as your target? (I'm just trying to prevent the innerHTML thing from being the issue...)


hi, no, I tried label too. but did not work out. If you can paste the code for that, it would be really helpful.

Thanks!


I'm not sure why your code isn't doing what you expect it to, but here's some code that seems to work fine, using a Label:

<%@. 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 button_click(object sender, EventArgs e) { Label1.Text = TextBox1.Text; }</script><html xmlns="http://www.w3.org/1999/xhtml" ><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:TextBox ID="TextBox1" runat="server" /> <asp:Button ID="Button1" runat="server" Text="Submit" OnClick="button_click" /> <asp:Label ID="Label1" runat="server" /> </ContentTemplate> </asp:UpdatePanel> </form></body></html>

Just a Small Correction, As you want to append the Text each time the button is pressed, the click handler should be:

protected void button_click(object sender, EventArgs e)
{
Label1.Text += TextBox1.Text;
}

Everything else is fine with the above example.


I thought he explicitlydidn't want to append?

From original post: "The problem I am having is that the div (which displays result, can a server side control too), just appends the new text to the original value. So if I hit enter a multiple times, it goes on appending!"


Sorry my mistake, the Requirment is not to append.


Hi mate, works like a charm! Thanks!

UpdatePanel

Hello group,

I followed the instructions of converting my application to work with Ajax control's and I have a few questions.

The current situation is that I have a webform with drop down list control and a gridview control. I wrapped my GridView control with the updatePanel Ajax control and it works fine, when selecting a value from the ddl the gridview control updates with the correct data.

Where should I put javascript code to run after the grid view updates (the code were in the window.load event before the Ajax) ??

I use VS2005 and when I switch to source view the Ajax controls tags are underlined with red, anybody knows why??

regards
Tongue Tied

If you are trying to show a loadder for the time when the data is fetched according to selection change of the ddl, you may use Update progress. Place a .gif image in it. And all is done. When you change the ddl selection the image will be shown as long the gridview doesn't get updated fully. Below is a sample code.

<

asp:UpdateProgressid="UpdateProgress1"runat="server">
<progresstemplate>
<divstyle="BACKGROUND-COLOR: #424242;border:solid;border-width:2px;border-color:#FFCC99"id="divAjax" ">
<IMGid="imageAjax"alt="Updating"src="../images/Ajax.gif"style="margin-right:15px;"/> Updating Please Wait...</DIV>
</progresstemplate>
</asp:UpdateProgress>

Thanx

But this it not the case.

Where should I put the javascript code to run whenever the gridview has finished updating the rows?? .

The window.onloadis working as expected only the first time the page is loaded.

regards

UpdatePanel

Hi,

I have 3 update panels on my page. 1 is used for a submit button, 1 is for the rating control and the other is a message. Now if I click a button (which is under an updatepanel), it reloads the tool as well, which I realize is correct! :) I was wondering is it possible, I can control which update panel to fire off in a certain scenario? e.g clicking on the rating tool shouldn't reload the message or vice versa.

I would appreciate all help.

Thanks!

Set UpdateMode of the panel to Conditional, and then add triggers. The panel will only update when the events you specify occur. You may also need to set ChildrenAsTriggers=False.

UpdatePanel

hi,

i have web site in asp.net and i want ti use the ajax controls. i have changed my webConfig as it's described in http://www.asp.net/AJAX/Documentation/Live/default.aspx

my xml file webconfig has no error but when i add a updatepanel to an aspx page this make an error, the compiler can't identify the control.

please help me if u know waht is the problem.

thanks

Hi there

You also need to register the AJAX DLL in your web page at the top of your aspx file, e.g.


<%@. Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %
Cheers

Mike


hi

i have added what you have mentioned Mikey65 and i can execute the aspx page now. but there is an other problem, the compiler underlined the ajax element in the pages as errors!

i dont now why?


Do you also have references to the web.extensions dlls in your project references??

Cheers

Mike


Hi,

DO u have this in ur web.config.

make the tag prefix name to some thing else then asp if this code in ur applications has it asaddtagPrefix="asp"

I have made it to ajax.

try this and it may work

<pagestheme="DefaultTheme">

<controls>

<addtagPrefix="ajax"namespace="System.Web.UI"assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

</controls>

</pages>


<%@. Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="ajax" %>

http://www.asp.net/AJAX/Documentation/Live/ConfiguringASPNETAJAX.aspx

UpdatePanel

I am new to Ajax so please be patient. I have created a modal popup. The control has a simple textbox, button and gridview. When the user enters the search criteria the gridview is bound to a dataset with the results. There is a column in the grid that is a linkcolumn that is used to determine which result the user selected. The selected row info is placed into session in the code-behind click event, then there is a label on the form that kicks off javascript. This was all working well. I put all the controls into an updatepanel and everything is working great except the firing the javascript by placing the js code into the label. The Javascript never executes? Any help would be much appreciated.

Have you debug your code why javascript is not executing...

You can use RegisterClientScriptBlock Method to execute javascript..

See for more details...

http://ajax.asp.net/docs/mref/O_T_System_Web_UI_ScriptManager_RegisterClientScriptBlock.aspx


No luck. I am attempting to inject the javascript from code-behind into a label control. The label control is never updated with the Update Panel in place. Before the Update Panel this solution worked fine. I can put a button control on the page and it will execute the js fine. The big problem I see is getting the label text to update with the script.


Can you provide code details...

So if possible I'll try to find what exactly happens...

Updatepanel

hello,

i made alogin form wich is wrapped by an updatepanel.

it includes the usual stuff..

the thing is when i click the login button , it takes something like 10 seconds till the asyncPostBack is done.

you can imagine that not much work is done in the code behind function.. (it uses membership provider and all it does is validaing and set cookie)

can anybody please think of a reason for this delay ? (my tests are on localhost..)

thank u .

are you running in debug mode? on the form, click the script manager and goto the property "script mode" and set it to release :), that should speed it up. if not then you should post some code so we can see if you are doing anything wrong


I am not sure how does it working. It is specified in the documentation that the Login control is not compaitable in partial rendering unless it is converted to template. Check it out
http://ajax.asp.net/docs/overview/UpdatePanelOverview.aspx Control that are not compatible.


Documentation says that Login controls are not compatible with partial-page updates.

Set <compilation debug = "false" /> in web.config, so it will improve your application performance.

See for more details.

http://ajax.asp.net/docs/overview/UpdatePanelOverview.aspx

UpdatePanel - Input string was not in a correct format

I have a simple function to expand/contract a div in an update panel to show/hide the edit controls on a page:

protectedvoid btnExpand_Click(object sender,ImageClickEventArgs e){

divControls.Visible = !divControls.Visible;

}

most of the time it works, maybe 95%, but sometimes I get that error "Input string was not in a correct format". If I try to handle the error withOnAsyncPostBackError="ScriptManager1_AsyncPostBackError" , I can grab more info but I have no idea where the error is:
source: mscorlib
stack trace:at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at System.Int32.Parse(String s, IFormatProvider provider) at System.Web.UI.WebControls.ImageButton.LoadPostData(String postDataKey, NameValueCollection postCollection) at System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
targetsite: {Void StringToNumber(System.String, System.Globalization.NumberStyles, NumberBuffer ByRef, System.Globalization.NumberFormatInfo, Boolean)}

it may be an issue with trying to start a new request before finishing the last request. Any ideas?

We are running into the same problem. I've worked out that what's happening is, if an ImageButton is inside an UpdatePanel then something is happening when the user clicks on it.

If they click on the very top row of pixels, or the very left row of pixels on the button, the browser is posting "NaN" for the x or y coordinate of the click, and the server is barfing when it goes to parse it.

I can see this when I look at the request in Fiddler:

btnButton.x=55
btnButton.y=NaN

If the button isnot in an UpdatePanel, then it's fine (it posts 0 as the coordinate). If the user doesn't click on the very top or the very left of the image, then it's also fine.


There is another thread covering this issue here:http://forums.asp.net/thread/1458229.aspx

One on the ASP.NET team members has required some trace code, which I posted and I'm still waiting for an answer. They should be investigating the issue

Regards,

Juan


awesome, thanks guys, at least now I know why the problem was so intermittent, my button is + - so it's really small, now if only we can get M$ to fix it...

i saw a hundred of these threads, but most of them had people actually with type mismatches, hard to sift through them all


If you put BorderWidth="1px" and BorderColor="Background Color" in the <asp:ImageButton> properties I never got the error again. Hope this works for you.

Is there any update on this bug? I tried the border stuff, and it works nicely - I can't generate the error any more.

However, as a general solution, it's obviously not very good. In this particular case for us, a 1px background colour border is not a big deal, but I can certainly imagine cases where a 1 pixel borderisa big deal (like if we had a precise layout, or something).

So can someone from Microsoft please confirm that thisisan actual bug, and let us know when it'll be fixed (or has it already?)

I can provide a fairly simple test case if required.


Very useful information on this error guys, cheers. I'm eager to hear the reponse to this problem also as i'm one of those people which cannot add a 1px border to my image buttons because of the precise layout.

Smile

Thanks.


I've tried solution with 1px border but it didn't worked for me. Then I applied the following fix:

<asp:ImageButton ID="ImageButton1" runat="server" OnClientClick="if (event.offsetX==0 || event.offsetY==0) return false; " />

Very useful information

thnxSmile


Useful information......

thnxSmile


I am in SHOCK! I didn't think I would ever figure this one out. What a WEIRD bug!

Thanks for figuring this out! You deserve a raise.


For people that can't do the border hack the following may be useful.

using System.Collections.Specialized;using System.Runtime.InteropServices;using System.Web.UI;[assembly : TagPrefix("MS.Utilities.CustomControls","MS")]namespace MS.Utilities.CustomControls{/// <summary> /// To avoid issue when Update Panel can return NaN instead of 0 /// as discussed here http://forums.asp.net/thread/1450669.aspx /// </summary> [ToolboxData("<{0}:ImageButton runat=server></{0}:ImageButton>")] [ComVisible(false)]public class ImageButton : System.Web.UI.WebControls.ImageButton {protected override bool LoadPostData(string postDataKey, NameValueCollection postCollection) {string xKey;string yKey;string xValue = postCollection[xKey = (string.Format("{0}.x", UniqueID))];string yValue = postCollection[yKey = (string.Format("{0}.y", UniqueID))];if (!string.IsNullOrEmpty(xValue) && !string.IsNullOrEmpty(yValue)) { NameValueCollection postCollectionCopy =new NameValueCollection();int x;int y;int.TryParse(xValue,out x);int.TryParse(yValue,out y); postCollectionCopy.Add(xKey, x.ToString()); postCollectionCopy.Add(yKey, y.ToString());return base.LoadPostData(postDataKey, postCollectionCopy); }else {return false; } } }}

updatepanel - entire page posts back

I have a datagrid in an updatepanel. Clicking on anyrow in the datagrid changes the style to bold so the user knows they have selected it. On my development machine, clicking on the row updates only the panel as you would expect. Once on live server, clicking on a row in the datagrid posts back the entire page. Does anybody have any ideas as to what I can do to fix this.

<asp:UpdatePanelID="updatePanel" runat="server">

<ContentTemplate>

<asp:GridViewID="reconGrid"runat="server"CssClass="gridTable"AutoGenerateColumns="false" AllowPaging="true"

PagerSettings-Mode="NumericFirstLast"PagerStyle-HorizontalAlign="right"PageSize="15"OnPageIndexChanging="reconGrid_PageIndexChanging"

OnRowDataBound="reconGrid_RowDataBound"CellPadding="2"Width="450px"OnRowCommand="reconGrid_RowCommand">

<AlternatingRowStyleCssClass="gridAltItemTr"/>

<RowStyleCssClass="gridItemTr"/>

<HeaderStyleCssClass="gridHeaderTr"ForeColor="white"/>

<Columns>

<asp:ButtonFieldText="SingleClick"CommandName="SingleClick"Visible="false"ButtonType="link"/>

<asp:TemplateFieldHeaderText="Clr">

<ItemTemplate>

<asp:CheckBoxID="cleared"runat="server"Enabled="false"Checked='<%# Convert.ToBoolean(Eval("CheckCleared")) %>'/>

</ItemTemplate></asp:TemplateField>

<asp:TemplateFieldHeaderText="Date">

<ItemTemplate>

<asp:LabelID="dateLbl"runat="server"CssClass="ssLabel"Text='<%# ((DateTime)Eval("TransactionDate")).ToShortDateString() %>'></asp:Label>

</ItemTemplate></asp:TemplateField>

<asp:TemplateFieldHeaderText="Chk #">

<ItemTemplate>

<asp:LabelID="chkLbl"runat="server"CssClass="ssLabel"Text='<%# Eval("CheckNumber") %>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Payee">

<ItemTemplate>

<asp:LabelID="payeeLbl"runat="server"CssClass="ssLabel"Text='<%# Eval("VendorName") %>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Amount">

<ItemTemplate>

<asp:LabelID="amountLbl"runat="server"CssClass="ssLabel"Text='<%# Eval("Amount") %>'></asp:Label>

</ItemTemplate>

<ItemStyleHorizontalAlign="right"/>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Type">

<ItemTemplate>

<asp:LabelID="typeLbl"runat="server"CssClass="ssLabel"Text='<%# Eval("Type") %>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="FundTransactionsId"Visible="false">

<ItemTemplate>

<asp:LabelID="FundTransactionsId"runat="server"CssClass="ssLabel"Text='<%# Eval("Id") %>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="AccountTransactionsId"Visible="false">

<ItemTemplate>

<asp:LabelID="AccountTransactionsId"runat="server"CssClass="ssLabel"Text='<%# Eval("AccountTransactionsId") %>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

</Columns>

</asp:GridView>

</ContentTemplate>

</asp:UpdatePanel>

See this related post:http://forums.asp.net/p/1069974/1558261.aspx

-Damien


I did look at that post and it didn't help. All the other ajax on my site seems to work like they should.


You have aScriptManger control on your page, right?

-Damien


Yes I do have a script manager. All you have to do on the server is install the ajax framework right? That's all I did on the server. All my other ajax works fine.


For a server install, all you should need is the AJAX Framework, yes. For Visual Studio 2005, you need Visula Studio SP1.

-Damien


Here are the entire contents of my aspx page. Different parts are made hidden or visible as you go from top to bottom. I have 2 update panels on the page. When you click on any row in the datagrid, the amounts in the other updatepanel are updated. So they both post back at the same time, just that on server, the entire page posts back.

<%@.PageLanguage="C#"AutoEventWireup="true"EnableEventValidation="false"CodeBehind="AccountDetail.aspx.cs"Inherits="SchoolFunds.AccountDetail" %>

<%@.RegisterAssembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

Namespace="System.Web.UI"TagPrefix="asp" %>

<%@.RegisterAssembly="AjaxControlToolkit, Version=1.0.10618.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"

Namespace="AjaxControlToolkit"TagPrefix="ajax" %>

<%@.RegisterTagPrefix="uc1"TagName="Header"Src="../Share/controls/Header.ascx" %>

<!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>Account Details</title>

<scriptlanguage="javascript"src="../Share/css/util.js"></script>

<linkhref="../Share/css/global.css"type="text/css"rel="STYLESHEET">

<linkhref="../spreadsheet.css"rel="stylesheet"type="text/css"/>

</head>

<bodyclass="body"style="width: 100%">

<formmethod="post"runat="server">

<asp:ScriptManagerID="scriptmanger1"runat="server"></asp:ScriptManager>

<divclass="headerDiv"id="headers"><uc1:Headerid="ucHeader"runat="server"></uc1:header></div>

<ajax:AlwaysVisibleControlExtenderrunat="server"id="AlwaysVisibleControlExtender1"TargetControlID="allwaysOnMessage"VerticalOffset="117"HorizontalOffset="0"ScrollEffectDuration=".1"></ajax:AlwaysVisibleControlExtender>

<asp:PanelID="allwaysOnMessage"runat="server"BackImageUrl="~/bar1.gif"Width="755px"BorderWidth="1px"BorderStyle="Solid"BorderColor="buttonshadow">

<tablealign="left"style="vertical-align: middle; text-align: center; font-weight: bold;">

<tr>

<tdclass="dateLabel">Date</td>

<tdclass="typeLabel">Type</td>

<tdclass="numberLabel">Number</td>

<tdclass="dropdownLabel">Payee</td>

<tdclass="dropdownLabel">Account</td>

<tdclass="memoLabel">Memo</td>

<tdclass="ssMoneyTextBox">Increase</td>

<tdalign="right"style="width: 38px;">

<asp:Imagerunat="server"ID="aasdf"ImageUrl="~/images/check.gif"/>

</td>

<tdclass="ssMoneyTextBox">Decrease</td>

</tr>

</table>

</asp:Panel>

<br>

<asp:ValidationSummaryID="valSummary3"runat="server"ValidationGroup="valEdit"/>

<br>

<asp:ValidationSummaryid="valSummary"runat="server"ValidationGroup="validAdd"/>

<br>

<asp:ValidationSummaryid="valSummary1"runat="server"ValidationGroup="validEdit"/>

<br>

<asp:ValidationSummaryid="valSummary2"runat="server"ValidationGroup="validAddEmpty"/>

<asp:GridViewID="GridView1"runat="server"BorderColor="#DEDFDE"Width="750px"ShowHeader="true"HeaderStyle-BackColor="#FAFFF9"

BorderStyle="solid"BorderWidth="1px"AllowPaging="true"PageSize="15"CellPadding="4"ForeColor="Black"GridLines="Vertical"ShowFooter="false"

OnRowDataBound="GridView1_RowDataBound"OnPageIndexChanging="GridView1_PageIndexChanging"OnRowCommand="GridView1_RowCommand"AutoGenerateColumns="False"OnRowUpdating="GridView1_RowUpdating">

<RowStyleCssClass="row1"/>

<PagerStyleHorizontalAlign="right"BackColor="#E0F5E1"BorderStyle="solid"BorderWidth="1px"BorderColor="black"/>

<AlternatingRowStyleCssClass="row2"/>

<Columns>

<asp:ButtonFieldText="SingleClick"CommandName="SingleClick"Visible="false"FooterText="SingleClick"ButtonType="Link"CausesValidation="true"ValidationGroup="validEdit"/>

<asp:TemplateFieldVisible="false">

<HeaderTemplate>

</HeaderTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="AccountTransactionsId"HeaderStyle-CssClass="ssHeader"Visible="false">

<ItemTemplate>

<asp:LabelID="AccountTransactionsIdLabel"runat="server"Text='<%# Eval("AccountTransactionsId") %>'CssClass="ssLabel"></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="FundTransactionsId"HeaderStyle-CssClass="ssHeader"Visible="false">

<ItemTemplate>

<asp:LabelID="FundTransactionsIdLabel"runat="server"Text='<%# Eval("FundTransactionsId") %>'CssClass="ssLabel"></asp:Label>

</ItemTemplate>

<ItemStyleCssClass="ssCell"/>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="TransferAccountId"HeaderStyle-CssClass="ssHeader"Visible="false">

<ItemTemplate>

<asp:LabelID="TransferAccountIdLabel"runat="server"Text='<%# Eval("TransferAccountId") %>'></asp:Label>

</ItemTemplate>

<ItemStyleCssClass="ssCell"/>

</asp:TemplateField>

<asp:TemplateField>

<HeaderStyleCssClass="ssHeader"HorizontalAlign="left"VerticalAlign="bottom"/>

<HeaderTemplate>

<asp:TextBoxID="DateAdd"runat="server"CssClass="ssDateTextBoxAdd"Visible="true"Width="70px"></asp:TextBox>

<ajax:TextBoxWatermarkExtenderID="DateAddWME"runat="server"TargetControlID="DateAdd"WatermarkText="Date"WatermarkCssClass="dateTextBoxWM"></ajax:TextBoxWatermarkExtender>

<asp:ImageButtonrunat="server"ID="dateAddImgBtn"CausesValidation="false"TabIndex="-1"ImageUrl="~/images/calendar button.bmp"Visible="true"/>

<asp:RequiredFieldValidatorID="reqDateAdd"runat="server"ErrorMessage="You must enter a transaction date."ControlToValidate="DateAdd"Display="static"ValidationGroup="validAdd">**</asp:RequiredFieldValidator>

<asp:rangevalidatorid="valDateAdd"runat="server"ErrorMessage="Transaction date is out of range or is incorrect format (mm/dd/yyyy)."

ControlToValidate="DateAdd"MaximumValue="12/31/9999"MinimumValue="1/1/1753"Type="Date"Display="Dynamic"ValidationGroup="validAdd">**</asp:rangevalidator>

<ajax:CalendarExtenderID="AddCalendar"runat="server"TargetControlID="DateAdd"Animated="true"PopupButtonID="dateAddImgBtn"></ajax:CalendarExtender>

</HeaderTemplate>

<ItemStyleCssClass="ssCell"VerticalAlign="bottom"/>

<ItemTemplate>

<asp:LabelID="DateLabel"runat="server"Text='<%# ((DateTime)Eval("TransactionDate")).ToShortDateString() %>'ToolTip='<%# ((DateTime)Eval("TransactionDate")).ToShortDateString() %>'CssClass="dateLabel"Width="70px"></asp:Label>

<asp:TextBoxID="DateText"TabIndex="1"runat="server"Text='<%# ((DateTime)Eval("TransactionDate")).ToShortDateString() %>'ToolTip='<%# ((DateTime)Eval("TransactionDate")).ToShortDateString() %>'Visible="false"CssClass="ssDateTextBox"Width="70px"></asp:TextBox>

<ajax:CalendarExtenderID="EditCalendar"runat="server"TargetControlID="DateText"Animated="true"PopupButtonID="dateEditImgBtn"></ajax:CalendarExtender>

<asp:RequiredFieldValidatorID="reqDate"runat="server"ErrorMessage="You must enter a transaction date."ControlToValidate="DateText"Display="dynamic"ValidationGroup="validEdit">**</asp:RequiredFieldValidator>

<asp:rangevalidatorid="valDate"runat="server"ErrorMessage="Transaction date is out of range or is incorrect format (mm/dd/yyyy)."

ControlToValidate="DateText"MaximumValue="12/31/9999"MinimumValue="1/1/1753"Type="Date"Display="Dynamic"ValidationGroup="validEdit">**</asp:rangevalidator>

<asp:ImageButtonrunat="server"ID="dateEditImgBtn"CausesValidation="false"TabIndex="-1"ImageUrl="~/images/calendar button.bmp"Visible="false"/>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField>

<HeaderStyleCssClass="ssHeader"/>

<HeaderTemplate>

<asp:TextBoxID="typeAdd"CssClass="ssTypeTextBox"TabIndex="-1"runat="server"Width="33px"Enabled="false"></asp:TextBox>

</HeaderTemplate>

<ItemTemplate>

<asp:LabelID="TypeLabel"tabindex="-1"runat="server"Text='<%# Eval("TransactionType") %>'ToolTip='<%# Eval("TransactionType") %>'CssClass="typeLabel"Width="33px"></asp:Label>

<asp:TextBoxID="TypeText"TabIndex="-1"runat="server"Text='<%# Eval("TransactionType") %>'ToolTip='<%# Eval("TransactionType") %>'visible="false"CssClass="ssTypeTextBox"ReadOnly="true"></asp:TextBox>

</ItemTemplate>

<ItemStyleCssClass="ssCell"/>

</asp:TemplateField>

<asp:TemplateField>

<HeaderStyleCssClass="ssHeader"/>

<HeaderTemplate>

<asp:TextBoxID="CheckNumberAdd"runat="server"CssClass="ssNumberTextBoxAdd"Visible="true"Width="50px"></asp:TextBox>

<ajax:TextBoxWatermarkExtenderID="CheckNumberAddWME"runat="server"TargetControlID="CheckNumberAdd"WatermarkText="Number"WatermarkCssClass="numberTextBoxWM"></ajax:TextBoxWatermarkExtender>

</HeaderTemplate>

<ItemTemplate>

<asp:LabelID="CheckNumberLabel"runat="server"Text='<%# Eval("CheckNumber") %>'ToolTip='<%# Eval("CheckNumber") %>'CssClass="ssNumberTextBox"Width="50px"></asp:Label>

<asp:TextBoxTabIndex="2"ToolTip='<%# Eval("CheckNumber") %>'ID="CheckNumberText"runat="server"Text='<%# Eval("CheckNumber") %>'visible="false"CssClass="ssNumberTextBox"Width="50px"></asp:TextBox>

</ItemTemplate>

<ItemStyleCssClass="ssCell"/>

</asp:TemplateField>

<asp:TemplateField>

<HeaderStyleCssClass="ssHeader"/>

<HeaderTemplate>

<asp:DropDownListID="VendorNameAdd"runat="server"DataTextField="VendorName"DataValueField="Id"CssClass="ssDropDown"Visible="true"Width="150px"></asp:DropDownList>

</HeaderTemplate>

<ItemTemplate>

<asp:LabelID="VendorLabel"runat="server"Text='<%# Eval("VendorName") %>'ToolTip='<%# Eval("VendorName") %>'CssClass="dropdownLabel"Width="150px"></asp:Label>

<asp:DropDownListTabIndex="3"ID="VendorText"runat="server"Visible="false"DataTextField="VendorName"DataValueField="Id"CssClass="ssDropDown"Width="150px"></asp:DropDownList>

<asp:CustomValidatorrunat="server"ID="valVendor"ControlToValidate="VendorText"Display="dynamic">**</asp:CustomValidator>

</ItemTemplate>

<ItemStyleCssClass="ssCell"/>

</asp:TemplateField>

<asp:TemplateField>

<HeaderStyleCssClass="ssHeader"/>

<HeaderTemplate>

<br/>

<asp:DropDownListID="AccountNameAdd"runat="server"DataTextField="Account"DataValueField="Id"CssClass="ssDropDown"Visible="true"Width="150px"></asp:DropDownList>

<asp:RequiredFieldValidatorID="valAccountAdd"runat="server"InitialValue="-1"ControlToValidate="AccountNameAdd"ErrorMessage="You must select an account."ValidationGroup="validAdd">**</asp:RequiredFieldValidator>

<asp:CustomValidatorID="valAccountAddDDL"runat="server"Display="Dynamic"ControlToValidate="AccountNameAdd"ValidationGroup="validAdd">**</asp:CustomValidator>

</HeaderTemplate>

<ItemTemplate>

<asp:LabelID="AccountLabel"runat="server"Text='<%# Eval("Name") %>'ToolTip='<%# Eval("Name") %>'CssClass="dropdownLabel"Width="150px"></asp:Label>

<asp:DropDownListTabIndex="4"ID="AccountName"runat="server"Visible="false"DataTextField="Account"DataValueField="Id"CssClass="ssDropDown"Width="150px"></asp:DropDownList>

<asp:requiredfieldvalidatorid="RequiredfieldAccount"Display="Dynamic"ControlToValidate="AccountName"Runat="server"InitialValue="-1"ErrorMessage="You must select an account."ValidationGroup="validEdit">**</asp:requiredfieldvalidator>

<asp:CustomValidatorID="valAccountDDL"runat="server"Display="Dynamic"ControlToValidate="AccountName"ValidationGroup="valEdit">**</asp:CustomValidator>

</ItemTemplate>

<ItemStyleCssClass="ssCell"/>

</asp:TemplateField>

<asp:TemplateField>

<HeaderStyleCssClass="ssHeader"/>

<HeaderTemplate>

<asp:TextBoxID="MemmoAdd"runat="server"TextMode="multiline"CssClass="ssMemoTextBoxAdd"Visible="true"Width="110px"Height="50px"></asp:TextBox>

<ajax:TextBoxWatermarkExtenderID="MemoAddWME"runat="server"TargetControlID="MemmoAdd"WatermarkText="Memo"WatermarkCssClass="memoTextBoxWM"></ajax:TextBoxWatermarkExtender>

</HeaderTemplate>

<ItemTemplate>

<asp:LabelID="MemoLabel"runat="server"Text='<%# Eval("Memo") %>'ToolTip='<%# Eval("Memo") %>'CssClass="memoLabel"Width="110px"></asp:Label>

<asp:TextBoxTabIndex="5"ID="MemoText"runat="server"Text='<%# Eval("Memo") %>'ToolTip='<%# Eval("Memo") %>'visible="false"TextMode="multiline"CssClass="ssMemoTextBox"Width="110px"Height="50px"></asp:TextBox>

</ItemTemplate>

<ItemStyleCssClass="ssCell"/>

</asp:TemplateField>

<asp:TemplateField>

<HeaderStyleCssClass="ssHeader"/>

<HeaderTemplate>

<asp:TextBoxID="IncreaseAdd"runat="server"CssClass="ssMoneyTextBoxAdd"Visible="true"Width="65px"></asp:TextBox>

<ajax:TextBoxWatermarkExtenderID="IncreaseAddWME"runat="server"TargetControlID="IncreaseAdd"WatermarkText="Increase"WatermarkCssClass="moneyTextBoxWM"></ajax:TextBoxWatermarkExtender>

<asp:CustomValidatorrunat="server"ID="valIncreaseAdd"ControlToValidate="IncreaseAdd"Display="dynamic"ValidationGroup="validAdd">**</asp:CustomValidator>

<asp:RegularExpressionValidatorID="IncreaseAddRegExp"runat=serverDisplay="dynamic"ValidationExpression="\d*.?\d{2}"ControlToValidate="IncreaseAdd"ErrorMessage="Increase amount is not in a correct format. Enter all numbers without a '$' or commas."ValidationGroup="validAdd">**</asp:RegularExpressionValidator>

</HeaderTemplate>

<ItemTemplate>

<asp:LabelID="IncreaseLabel"runat="server"Text='<%# Eval("Increase") %>'ToolTip='<%# Eval("Increase") %>'CssClass="ssMoneyTextBox"Width="65px"></asp:Label>

<asp:TextBoxTabIndex="6"ID="IncreaseText"runat="server"Text='<%# Eval("Increase") %>'ToolTip='<%# Eval("Increase") %>'visible="false"CssClass="ssMoneyTextBox"Width="65px"></asp:TextBox>

<asp:RegularExpressionValidatorID="RegularExpressionValidator1"runat=serverDisplay="dynamic"ValidationExpression="^\d*?.\d{1,2}$"ControlToValidate="IncreaseText"ErrorMessage="Increase amount is not in a correct format. Enter all numbers without a '$' or commas."ValidationGroup="validEdit">**</asp:RegularExpressionValidator>

<asp:CustomValidatorrunat="server"ID="valIncrease"ControlToValidate="IncreaseText"Display="dynamic"ValidationGroup="validEdit">**</asp:CustomValidator>

</ItemTemplate>

<ItemStyleCssClass="ssCell"/>

</asp:TemplateField>

<asp:TemplateField>

<HeaderStyleCssClass="ssHeader"/>

<HeaderTemplate>

<asp:CheckBoxId="ClearedAdd"runat="server"CssClass="ssCheckBox"Visible="true"Width="28px"></asp:CheckBox>

</HeaderTemplate>

<ItemTemplate>

<asp:CheckBoxId="ClearedDisplay"runat="server"Checked='<%# Eval("CheckCleared") %>'Enabled="false"Width="28px"></asp:CheckBox>

<asp:CheckBoxTabIndex="7"Id="ClearedEdit"runat="server"Checked='<%# Eval("CheckCleared") %>'Visible=falseCssClass="ssCheckBox"Width="28px"></asp:CheckBox>

</ItemTemplate>

<ItemStyleCssClass="ssCell"/>

</asp:TemplateField>

<asp:TemplateField>

<HeaderStyleCssClass="ssHeader"HorizontalAlign="left"VerticalAlign="bottom"/>

<HeaderTemplate>

<asp:TextBoxID="DecreaseAdd"runat="server"CssClass="ssMoneyTextBoxAdd"Visible="true"Width="65px"></asp:TextBox>

<ajax:TextBoxWatermarkExtenderID="DecreaseAddWME"runat="server"TargetControlID="DecreaseAdd"WatermarkText="Decrease"WatermarkCssClass="moneyTextBoxWM"></ajax:TextBoxWatermarkExtender>

<asp:ButtonCommandName="Add"Text="Add"ID="btnAdd"Runat="server"CssClass="addButton"Visible="true"CausesValidation="true"ValidationGroup="validAdd"/>

<asp:RegularExpressionValidatorID="DecreaseAddRegExp"runat=serverDisplay="dynamic"ValidationExpression="\d*.?\d{2}"ControlToValidate="DecreaseAdd"ErrorMessage="Decrease amount is not in a correct format. Enter all numbers without a '$' or commas."ValidationGroup="validAdd">**</asp:RegularExpressionValidator>

</HeaderTemplate>

<ItemTemplate>

<asp:LabelID="DecreaseLabel"runat="server"Text='<%# Eval("Decrease") %>'ToolTip='<%# Eval("Decrease") %>'CssClass="ssMoneyTextBox"Width="65px"></asp:Label>

<asp:TextBoxTabIndex="8"ID="DecreaseText"runat="server"Text='<%# Eval("Decrease") %>'ToolTip='<%# Eval("Decrease") %>'visible="false"CssClass="ssMoneyTextBox"ValidationGroup="validEdit"Width="65px"></asp:TextBox>

<asp:ButtonTabIndex="9"Text="Add"ID="btnAddGrid"Runat="server"CssClass="addButton"CausesValidation="true"ValidationGroup="validEdit"OnClick="btnAddGrid_Click"visible="false"/>

<asp:RegularExpressionValidatorID="DecreaseRegExp"runat=serverDisplay="dynamic"ValidationExpression="\d*.?\d{2}"ControlToValidate="DecreaseText"ErrorMessage="Decrease amount is not in a correct format. Enter all numbers without a '$' or commas."ValidationGroup="validEdit">**</asp:RegularExpressionValidator>

</ItemTemplate>

<ItemStyleCssClass="ssCell"/>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="IsVoid"HeaderStyle-CssClass="ssHeader"Visible="false">

<ItemTemplate>

<asp:LabelID="IsVoidLabel"runat="server"Text='<%# Eval("IsVoid") %>'CssClass="ssLabel"></asp:Label>

</ItemTemplate>

</asp:TemplateField>

</Columns>

</asp:GridView>

<tableid="tblAddEmpty1"runat="server"Visible="false"width="750px"bgcolor="#FAFFF9"cellspacing="0">

<tr>

<tdclass="ssHeader"valign="baseline">

<asp:TextBoxID="DateAddEmpty"runat="server"CssClass="ssDateTextBoxAdd"Width="70px"></asp:TextBox>

<ajax:TextBoxWatermarkExtenderID="DateAddEmptyWM"runat="server"TargetControlID="DateAddEmpty"WatermarkText="Date"WatermarkCssClass="dateTextBoxWM"></ajax:TextBoxWatermarkExtender>

<asp:RequiredFieldValidatorID="reqDateEmpty"runat="server"ErrorMessage="You must enter a transaction date."ControlToValidate="DateAddEmpty"Display="dynamic"ValidationGroup="validAddEmpty">**</asp:RequiredFieldValidator>

<asp:rangevalidatorid="valDateEmpty"runat="server"ErrorMessage="Transaction date is out of range or is incorrect format (mm/dd/yyyy)."

ControlToValidate="DateAddEmpty"MaximumValue="12/31/9999"MinimumValue="1/1/1753"Type="Date"Display="Dynamic"ValidationGroup="validAddEmpty">**</asp:rangevalidator>

<asp:ImageButtonID="calendarImgBtnEmpty"runat="server"TabIndex="-1"CausesValidation="false"ImageUrl="~/images/calendar button.bmp"/>

<ajax:CalendarExtenderrunat="server"ID="DateAddEmtpyExtender"PopupButtonID="calendarImgBtnEmpty"TargetControlID="DateAddEmpty"Animated="true"></ajax:CalendarExtender>

</td>

<tdclass="ssHeader">

<asp:TextBoxID="typeAddEmpty"CssClass="ssTypeTextBox"TabIndex="-1"runat="server"visible="true"Width="33px"Enabled="false"></asp:TextBox>

</td>

<tdclass="ssHeader">

<asp:TextBoxID="CheckNumberAddEmpty"runat="server"CssClass="ssNumberTextBoxAdd"Width="50px"></asp:TextBox>

<ajax:TextBoxWatermarkExtenderID="CheckNumberAddEmptyWME"runat="server"TargetControlID="CheckNumberAddEmpty"WatermarkText="Number"WatermarkCssClass="numberTextBoxWM"></ajax:TextBoxWatermarkExtender>

</td>

<tdclass="ssHeader">

<asp:DropDownListID="ddlVendorAddEmpty"runat="server"DataTextField="VendorName"DataValueField="Id"CssClass="ssDropDown"Width="150px"></asp:DropDownList>

</td>

<tdclass="ssHeader">

<br>

<asp:DropDownListID="ddlAccountAddEmpty"runat="server"DataTextField="Account"DataValueField="Id"CssClass="ssDropDown"Width="150px"></asp:DropDownList>

<asp:RequiredFieldValidatorID="valAccountAddEmpty"runat="server"InitialValue="-1"ControlToValidate="ddlAccountAddEmpty"ErrorMessage="You must select an account."ValidationGroup="validAddEmpty">**</asp:RequiredFieldValidator>

</td>

<tdclass="ssHeader">

<asp:TextBoxID="MemoAddEmpty"runat="server"TextMode="multiline"CssClass="ssMemoTextBoxAdd"Width="110px"Height="50px"></asp:TextBox>

<ajax:TextBoxWatermarkExtenderID="MemoAddEmptyWME"runat="server"TargetControlID="MemoAddEmpty"WatermarkText="Memo"WatermarkCssClass="memoTextBoxWM"></ajax:TextBoxWatermarkExtender>

</td>

<tdclass="ssHeader">

<asp:TextBoxID="IncreaseAddEmpty"runat="server"CssClass="ssMoneyTextBoxAdd"Width="65px"></asp:TextBox>

<ajax:TextBoxWatermarkExtenderID="IncreaseAddEmptyWME"runat="server"TargetControlID="IncreaseAddEmpty"WatermarkText="Increase"WatermarkCssClass="moneyTextBoxWM"></ajax:TextBoxWatermarkExtender>

<asp:RegularExpressionValidatorID="valIncreaseAddEmpty"runat=serverDisplay="dynamic"ValidationExpression="\d*.?\d{2}"ControlToValidate="IncreaseAddEmpty"ErrorMessage="Increase amount is not in a correct format. Enter all numbers without a '$' or commas."ValidationGroup="validAddEmpty">**</asp:RegularExpressionValidator>

<asp:CustomValidatorrunat="server"ID="valIncreaseAddEmpty1"ControlToValidate="IncreaseAddEmpty"Display="dynamic"ValidationGroup="validAddEmpty">**</asp:CustomValidator>

</td>

<tdclass="ssHeader">

<asp:CheckBoxId="ClearedAddEmpty"runat="server"CssClass="ssCheckBox"Width="28px"></asp:CheckBox>

</td>

<tdclass="ssHeader"valign="baseline">

<asp:TextBoxID="DecreaseAddEmpty"runat="server"CssClass="ssMoneyTextBoxAdd"Width="65px"></asp:TextBox>

<ajax:TextBoxWatermarkExtenderID="DecreaseAddEmtpyWME"runat="server"TargetControlID="DecreaseAddEmpty"WatermarkText="Decrease"WatermarkCssClass="moneyTextBoxWM"></ajax:TextBoxWatermarkExtender>

<asp:RegularExpressionValidatorID="valDecreaseAddEmpty"runat=serverDisplay="dynamic"ValidationExpression="\d*.?\d{2}"ControlToValidate="DecreaseAddEmpty"ErrorMessage="Decrease amount is not in a correct format. Enter all numbers without a '$' or commas."ValidationGroup="validAddEmpty">**</asp:RegularExpressionValidator>

<asp:ButtonText="Add"ID="btnAddEmpty"Runat="server"CssClass="addButton"CausesValidation="true"ValidationGroup="validAddEmpty"OnClick="btnAddEmpty_Click"/>

</td>

</tr>

</table>

<asp:PanelID="pageExtender"runat="server"Height="200px"></asp:Panel>

</form>

</body>

</html>


I finally got it to work. From this post: http://forums.asp.net/p/1095746/1653605.aspx#1653605

All I had to do was add<xhtmlConformancemode="Transitional"/>to web.config under system.web