ASP.Net Onclick event doesn't work with ajaxcontroltoolkit - asp.net

I designing a web application using vs2008 and c#.
I already have done many versions of it and all of them seems to be working fine.
Yesterday i decided to replace de vs calendar with a ajax calendar and to do so i used ajaxcontroltoolkit. The new calendar is also working fine.
But the buttons i have in my form stoped to work.
The onclick event just do nothing.
i've already change back to the older calendar and everything works ok.
The button calls a method on code behind.
So, any of you guys have a clue about what i'm doing wrong?
Is there other ways of doing this?
Tks in advance

thanks for yours answers
my problem is that i'm using this onsubmit="return setHourglass(); on my form so the user know when the page is waiting for a response.
Something like this:
Bellow the script code
function setHourglass() {
document.body.style.cursor = 'wait';
}
i removed that and is working ok, but i really don't know the motive for this behaviour :|

Related

ASP.NET - Refreshing GridView Data on Page After Button Click

I've been working with C# and .NET for quite some time now, but am currently working on my first ever web application with ASP.NET. It took me quite some time playing around to realize that the Page_Load function was getting called before my button event handler, though, at this point I've got the application working properly around this behavior. However, the issue I'm having is this:
I have a GridView control that is bound to a SortedList in my application. The button click event handler saves data in a form to the database (actually, saves data via a SOAP service), then updates the list that the GridView is bound to in order to reflect the most up-to-date data (again, updates the list from the SOAP service). However, because the page refreshes before my button click event handler fires, the data doesn't actually appear updated on the page. What is the proper way to handle a situation like this? How can I get the data on the page to be refreshed, or at least up-to-date, after the button handler saves data even though the page has already refreshed? I've been struggling with this for quite awhile now, so any code example or links that'll help explain this would be much appreciated.
Thanks in advance!
try inside Page_Load
if (!IsPostBack)
{
//Bind your Grid
}
just write your code in below if condition.
if(!IsPostBack)
{
write your code here in formload.
}
I want to correct Harag's link to the resource regarding the page lifecycle. It can be found here: http://msdn.microsoft.com/en-us/library/ms178472(v=vs.100).aspx.
Though not an answer to the OP's question, I restate it because it's such an important concept to know once you start programming web forms on a more serious basis.

Navigate back in visual webgui

I'm a newbie of ASP.NET world. I'm developing an app with asp.net and insiede of an aspx page i'm using a window form developed with visual webgui.
I've this problem: inside my form, i have a button wich has to rise an event equals to the page back button of the browser.
I tried to search informations about this, but i can't find anything unfortunately.
I think that i've to do something with the HttpContext. I tried with the Redirect function but my "previous page" is open always in a new browser window.
Can someone tell me a way on how to do this thing please?
Thank's
Marco
EDIT SOLVED
button.RegisterClientAction("history.go( -1 )", "");
Cant you do this:
Response.Redirect(Request.UrlReferrer.ToString());

Has anybody had any experience with getting Uploadify file uploader to work within an asp.net updatepanel

I'm having problems getting Uploadify to work in an ASP.NET UpdatePanel. I'm not getting the "Browse" button displayed and so am unable to select any images for update.
It works perfectly outside of the UpdatePanel proving I have hooked everything up correctly.
Any Ideas ?
check the URLs are correctly formatted:
/uploadify/Uploader.ashx
try with
uploadify/Uploader.ashx,
Without seeing any code the first thing that pops up in my mind is, is you ClientIDMode set to Static?

ImageButton OnClick Event not firing

I am really confused about this one. I have some code that runs fine on my development server but I am now trying to get the site working on the sales guys new laptop. None of the image buttons on the website seem to be working for him (they just redirect me back to the websites homepage) whereas they used to on his previous machine.
The only difference between each machine is that his old one was Vista and the new one is Windows 7.
Has anyone come accross this issue?
Some code:
The form:
<div class="form_text"></div>
<div class="form_box_link">
<asp:ImageButton id="LoginSubmitButton" onClick="FLoginWebService" ImageURL="~/Images/login.png" runat="server" />
The code behind (delphi):
procedure TMemberLogin.FLoginWebService(Sender: TObject; e: System.EventArgs);
begin
//Code Removed but using OutputDebugString shows nothing is being done in here
end;
As mentioned, this works everywhere else except on his windows 7 machine.
EDIT: Ok, I have some more information that has helped me. It seems ALL the post back URLs are incorrect. I manually set the PostBackUrl against the ImageButton control and got this part working but ALL other controls that require post backs on the website do not work properly and are posting to the wrong URL's. I am using IIS's rewrite module but this is the only machine that I am having an issue with it on.
I have managed to sort this issue out. It turns out the problem was the URLs ASP.NET was using for the post back. I am not sure what caused this issue (there must be a different setting somewhere) but I have added some JavaScript to the top of my page to sort the issue. ASP.NET initializes a var called theForm so I just did:
theForm.action = window.location.href;
and that sorted the issue out.
Thanks for any comments people have made.

AJAX Dropdown Extender Question

Ok, so I got my extender working on a default.aspx page on my website and it looks good. I basically copied and pasted the code for it into a user control control.ascx page. When I do this I completely loose the functionality (just shows the target control label and no dropdown, even upon hover). Is there any reason why it doesn't work in a custom user control inside a masterpage setup?
Edit:
Didn't quite do the trick. Any other suggestions?
Its in a master page setup, using eo web tabs (I tried it inside the tabs and outside the tabs but on the same page as the tabs, to no avail), and its in a custom user control. Think there are dependency issues?
Apparently EO has compatibility issues with MS Ajax Control Toolkit. http://www.essentialobjects.com/Forum/Default.aspx?g=posts&t=1319
I guess I'll leave this question open to see if anyone figures out some sort of workaround.
After a few days of looking I found a call to a modal popup extender .show() in the code behind. After commenting it out everything worked fine.
I don't know if this helps, but I had the same problem with the autocomplete extender and determined that the server-side function could not be in the user control, but needed to be on the page (or in a webservice, I guess). Once I moved the function, it worked fine.
Check the DocType. Here is what I have found useful
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" >
Place this in your user control (or the page that uses it) and all should be well. I had a similar problem with a collapsible extender and this worked for me.
Edit: Here is a link to my question for further details.
Hmm all that functionality on the loose! careful you don't lose it (sorry!)
Are you using something like Firebug (firefox plug-in) so you can see what ajax calls the page is trying to make? If it is making the call but the server is behaving oddly then you will see the error there too. IE users maybe able to use dev toolbar.

Resources