Showing posts with label pages. Show all posts
Showing posts with label pages. Show all posts

Wednesday, March 28, 2012

Why must I double-click the Confirm/Cancel Buttons of a ConfirmButtonExtender

Hello everybody

I'm using ConfirmButtonExtenders in my pages, but I have got an issue with them: I must double click the confirm or cancel buttons in order for something to happen.

I've typed no code but

<ajaxControlToolkit:ConfirmButtonExtender runat="server" ID="CBESupprimerIB" TargetControlID="LBSupprimerAnnonce" ConfirmText="<%$ Resources:Resource, RLConfirmSuppression%>"></ajaxControlToolkit:ConfirmButtonExtender>

Why is this ?


Thanks for your help

Hi,

It's hard to tell why from your description. I tried it, and can't reproduce the issue.

Can you investigate more and be more specific about how to reproduce it?


Simple error that concentration would have helped me to catch:

I simply had two Extenders and both extended the same Button so that I needed two click twice to validate my choice.

Thank you for telling me to investigate more, this helped me find where the issue came from...

Why use Asp.Net Ajax

I am debating between using Asp.Net Ajax and "regular" Ajax. As of now I have used Ajax by writing the javascript files and the web service/web pages that does the XmlHttpRequest.

So my question is what benefit would I get from using Asp.Net Ajax.

For the most part, AJAX is AJAX. ASP.NET would be your deciding factor, over a different technology. But if you're currently using ASP.NET and creating the AJAX functions by hand, the toolkit will alleviate the need for hand coding.

Jeff


How does the toolkit render the page, if I add some Asp.Net Ajax tools to an already existing Asp.Net page will my viewstate get bigger, will Microsoft add some code to the page to make it work that I don't know about.

ASP.NET AJAX - it's easy, quick and it's fun. :)

You can use notepad to write your .NET application, but you can use the Visual Studio ...

You can do AJAX functionality by hand, but you can use ASP.NET AJAX...


with asp.net you pass beyonde web pages u build web applications wth easy use of ADO.NET and so on... I would suggest you to try asp.net.. enjoy exploring cause this is basicliy what I'm doing...


It's a good question.

The thing is ASP.NET AJAX gives you all these things with a Microsoft Support team behind it:

1) Client side AJAX API - probably much like the one you've written but almost certainly far, far bigger. It can also call SOAP Web Services, Static aspx Page methods, serialize and deserialize objects and supports "classical class inheritance" with interfaces. It's a pretty good client side API and has had some very clever people develop it. The CTP also has a taster of even more ambitious Client APIs like XmlScript, DataTables and DataSources. Its not perfect by any means but I understand the next version of Visual Studio will include full Javascript intellisense for it which could be very cool indeed - especially if it alo makes it into the Express versions of that product (which I would expect it to).

2) Server Side API - Based around the Script Manager and UpdatePanels mostly. Update Panels are rediculously easy to use although FAR from optimal AJAX but have the huge benefit of "degrading" to a normal postback if Javascript is disabled. Conversely, the Bandwidth used for SOAP WebMethods could hardly *BE* more optimal, using pure Json up and down the pipe - fantastic value for money!!

3) Client Server integration: easily pass objects from client to server and back again.

4) Ajax Control toolkit - a set of Widgets to easily add cross browser GUI controls that take advantage of AJAX

5) Provides a defined Ajax Framework which is backed by microsoft, something non of the other frameworks can offer. The more popular ASP.NET AJAX becomes, the more community it gets and the better it gets. Dojo, Prototype, Bindows are all great but will always remain a little marginalised by something like ASP.NET AJAX.

6) This community and others like it.

I think it's fair to say that given where ASP.NET 2 used to be, with its postback architecture to where it is now (with ASP.NET AJAX) I think is a great improvement indeed, just the act of popping an update panel on an existing ASP.NET page can transform it from being humdrum and ordinary to something with much greater response and even "Wow" factor as it will only do a partial render (less bandwidth), there is no flicker (as the page does not get discarded) and the page scroll position does not need to be affected. 100% better already.

I would also say that although much of it comes across as "Ajax for dummies" (although you could also say that about the other Ajax frameworks out there) I think there is plenty of scope there also to create nice, optimal interfaces, additional toolkit widgets and other reusable AJAX enabled objects but the real key is the support and the continued development by some very, very talented people. Fundamentally I think the "ASP.NET" thing gets in the way of the "AJAX" thing and can make things far more complex than they need to be but ultimately, if you are using Visual Studio (full or express) and are creating Web Applications or dynamic sites then ASP.NET AJAX is the way to go.

Or to put i another way, what do you think will get you your next job in a programming team, saying you've written this killer AJAX framework and use it all the time and it "works great form me", or saying that you have mastered the "industry standard" AJAX toolkit and can leverage the knowledge therein, and which may well be the AJAX toolkit your next employer is already using? Trust me when I say I was in that position offering the former, I showed them my widgets, my treeview, my resizer bars, my fake windows, my serialization objects, my lazy loading, my drag and drop, my menuing system, my eventing system, my animation system, even my 2D and 3D graphics engine, all pure javascript and all built in - yes I got the job but had to promise to learn ASP.NET AJAX straight away if I wanted to do that kindof thing (ie: it's industry standard and the other developers can then work on my code, ie I remain dispensible, which is what they want).


Just the answer I was looking for.

VR2 you said:

"yes I got the job but had to promise to learn ASP.NET AJAX straight away if I wanted to do that kindof thing"

For you to learn straight away what books/websites, if any, did you use to move from your old way of writing ajax apps to Asp.net Ajax?


Another question:

Is there any speed difference when using Asp.Net Ajax compared to other Ajax Frameworks, and does anyone know if search engines look at the pages differently.


You can start from

http://ajax.asp.net/docs/

http://ajax.asp.net/documentation/default.aspx?tabid=47


"For you to learn straight away what books/websites, if any, did you use to move from your old way of writing ajax apps to Asp.net Ajax?"

I got a book called "Programming Atlas" which I nearly threw out in disgust until I was told that the stuff it talks about still exists but in the CTP (and in a modified form). Also this website has been invaluable. I have to say though that I'm still just finding my feet not only with this but with ASP.NET also (I previously used COM, VB6, asp classic & javascript).

As to the speed of ASP.NET AJAX - I'd imagine that it depends what you are comparing it with and *how* you are doing it.

In general UpdatePanels will be slow and clunky (by comparison) but will offer extreme ease of use and a server based event architecture using the well established and frankly huge ASP.NET 2. And it will degrade for the mobiles etc!

Web Services and Static Page Methods will be fast and nimble but - what do you DO with the data once you have it? This is where you need a strong client side API (widgets) to display and allow the user to manipulate the data WITHOUT needing update panels to post back the viewstate every click (so that server events can fire and update the server version of the page DOM and send it all back again).

And this is where the CTP could come into play, just so long as you don't need to be able to downgrade for Mobile Phones! For example, I did an experiment using the CTP client side DataSource and DataTable - and a server side DataService or WebService (wrapping calls to a TableAdapter) where you could simply instatiate these objects on the client and have a grid that was effectively 2 way databound to the datasource, meaning that the user could update any data in the grid they wanted and the DataSource would post only the changes back to the server using JSON. The custom grid object tool a while to write as an extender in the AjaxToolkit but once written, in 2 minutes you could have this up and running and it was as optimal as you like.

Why web robots cant request aspx pages in Ajax project ?

When Icreate aspx pages in Ajaxproject googlebot, yahoo-slurp and other crawlers can’t see these pages.

I’vecreated two test sites to show the problem:

Pagewithout Ajax:http://test.cky.pl/noajax/Default.aspx

Page with Ajax:http://test.cky.pl/ajax/Default.aspx

In browserI can see both of these pages. But when I try to saw what web robot can seewhen it requests my page (I was using this page and other tools (result wasthis same):http://www.smart-it-consulting.com/internet/google/googlebot-spoofer/index.htm

For Ajax page I was gettingerror massage:Invalid URL or serverdoes not respond, HTTP return code: 500

For normalaspx page everything is ok.

If someone couldshow me solution for this problem and could explain me why robots can’t requestAjax pages Iwould be very thankful.

Have you found a solution for this yet? I also noticed the same problem. If you point the W3C link validator at an AJAX site, it just says HTTP 500 internal server error. You get the same problem if you use an link checking package such as Xenu. If you view the page in your browser, it's fine.

This concerns me as I'm heavily involved in SEO - will Googlebot see the same and not index the site...


OK, found a workaround. Add this to Page.Init:

if (Request.Browser.Crawler ==true || Request.Browser.W3CDomVersion.ToString() !="1.0" || Request.Browser.Type.ToString().Contains("Opera")){ ScriptManager1.EnablePartialRendering =false;}else{ ScriptManager1.EnablePartialRendering =true;}

Thanks a lot, it's helps.

Wierd Error if page is left alone for too long... (ajax pages)

I have a wierd error that only occours if there has been no interaction with the webserver for too long. (over 30 mins)

The specific error that is returned is

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occoured while processing the request on the server. The status code returned from the server was: 504

This seems to happen to any page that has a script manager and update panel in it. I have tried adjusting the session timeout period, but this doesn't seem to help. It is almost like the page is loosing it's reference to the script files required by the ScriptManager. Is there some caching parameter I could add to the page to extend the cache time?

Any other ideas are welcome. This is a strange one. So far the workaround is to add a timer to the page that just keeps it alive.. (updates the page every minute or so with a meaningless value...)

TIA

Rob

See:http://forums.asp.net/p/1134743/1809108.aspx#1809108

-Damien


Hi,

Please see this post:504 Gateway Timeout occuring for very small number of users

504 Gateway Timeout
The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server it accessed in attempting to complete the request.

Best Regards

Monday, March 26, 2012

Windows 2000 Server

Does ATLAS run on Windows Advanced server 2000?

This server is now serving up ASP.NET pages and I dont need any additional functionality ?

But using ATLAS would be greet.

I can see in the specs for the March CTP it only runs on 2003 Server and higher but is this realy the case?

Atlas will run on any platform that can run ASP.NET 2.0, so you should be fine.

David

Wednesday, March 21, 2012

Writing Ajax Rating to DB

Hi

Well Heres what I want to happen


1. User rates page via rating control, selecting 1- 5

2. 1,2,3,4,5 get stored in a DB

3. The top five pages with the most votes (highest number), a link gets displayed to the web page on the home page

http://www.codeproject.com do something almost identical to this, but the one thing I dont understand is that the website will have around 1k of pages, therefore wont this be really slow?

Thanks

If the database tables are indexed properly then a few thousand records in a table will run very quickly.

In your other post on this (http://forums.asp.net/t/1128872.aspx) I included a script you could run on SQLExpress, this should run find with 1k of pages and 5-10k of ratings.


Thanks for that, I havent got that far yet, as I am having some trouble intergrating ajax into an existing asp.net app. That script looks great though!


Richard Line,

Well done.Big Smile

XHTML Validation

Pages that previously validated as XHTML no longer do after adding the DropShadowExtender. The validator is complaining about undeclared elements such as "behaviors" in the output from the Atlas controls.

Any solution to this?

Mike Hanson

Is it just the DropShadow extender, or is it the addition of any extender? I suspect it's the latter and that it's due to the XML Script that Atlas adds. If so, this question may be better posed in one of the Atlas forums?

Thanks for the response David.

I have had a look at the source that was validated and you are correct, all of the errors point to the xml-script section appended to the end of the document, so I will go look through the Atlas forums to see if anyone else has raised the issue, if not I will post my original question there.

Thanks again
Mike Hanson

xmlhttprequest "post"

hi there...

i started to using xmlhttprequest and i able to write few pages using "get"

but wondering how can i do using "post"

i have a data-entry page and i grab all the values and post to db

any sample code?

thanks.

from googling.

top 2 of the search

http://www.openjs.com/articles/ajax_xmlhttp_using_post.php
http://www.devx.com/DevX/Tip/17500


busyweb:

from googling.

top 2 of the search

http://www.openjs.com/articles/ajax_xmlhttp_using_post.php
http://www.devx.com/DevX/Tip/17500


i did google and i have seen the above two links but its not complete and i'm still looking for the part where/how do i put the data into db

what i mean by this below code:

var objHTTP, strResult;
objHTTP = new ActiveXObject('Microsoft.XMLHTTP');
objHTTP.Open('POST',"OtherPage.asp",false);
objHTTP.setRequestHeader('Content-Type',
'application/x-www-form-urlencoded');

objHTTP.send("id=1&user="+txtUser.value+"&password="+txtPassword.value);

strResult=objHTTP.responseText;<<<< after you havestrResult do you split the data ?


If you're using the asp.net ajax framework (as posting on this forum would indicate), then by far your easiest method is to use the Sys.Net.WebRequest javascript method that you can find inhttp://ajax.asp.net/docs

paul.vencill:

If you're using the asp.net ajax framework (as posting on this forum would indicate), then by far your easiest method is to use the Sys.Net.WebRequest javascript method that you can find inhttp://ajax.asp.net/docs


paul.vencill:

If you're using the asp.net ajax framework (as posting on this forum would indicate), then by far your easiest method is to use the Sys.Net.WebRequest javascript method that you can find inhttp://ajax.asp.net/docs


paul.vencill:

If you're using the asp.net ajax framework (as posting on this forum would indicate), then by far your easiest method is to use the Sys.Net.WebRequest javascript method that you can find inhttp://ajax.asp.net/docs

i'm usingxmlhttprequest


Yeah, that's the object; I'm talking about the .js library / framework... Sys.Net.WebRequest fires an XmlHttpRequest under the hood, it just abstracts the interface for you to make it easier (like most ajax frameworks do)...


paul.vencill:

Yeah, that's the object; I'm talking about the .js library / framework... Sys.Net.WebRequest fires an XmlHttpRequest under the hood, it just abstracts the interface for you to make it easier (like most ajax frameworks do)...

i dont know if we are on same page

my questions is pretty simple..

i just need an example: how to insert data into db usingxmlhttprequest.

thanks.


Hello,

I'm from Earth too..

Really, good to see you here.

I think that you don't add data with result from server at the client side (web browser).

But you have(might, may be not) to utilize the data posted with xmlhttprequest at the SERVER.

This is the way of EARTH People doing, just joke!!!


Unless you're talking about something I'm not familiar with, XmlHttpRequest is an object that is exposed by modern browsers which allows you to communicate with the server without doing a full page postback. The AsP.Net ajax extensions Javascript object called Sys.Net.WebRequest is a wrapper around the XmlHttpRequest object which allows you to access it without necessarily knowing all the gory details.

As the other poster said, you don't insert data into a database using XmlHttpRequest, typically, what you do is make a request to your web server using XmlHttpRequest, and then the web server resource that you called w/ the XmlHttpRequest object parses that request and does 'something' with it, potentially inserting a record in the database. There's loads of examples of this under the docs of this site. http://ajax.asp.net/docs