Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

asp.net - Stop HTML/Javascript page from loading mid initialization -


so imagine piece of javascript first script on page along lines of

var mysuperobject = new (function () {     this.superobjectinit(); })(); 

now imagine proceeds script (or large portion therein) requires superobject have met load conditions , loaded correctly.

assuming whatever reason loading of object fails need abort loading rest of page , scripts in particular.

i know majority of going scream why not have function issue callback onsuccess , onfailed problem in asp.net project masterpages, nestedmasterpages, usercontrols , forth (each of have own dependencies , scripts); rendering such approach problematic.

the other option (i assume) use window.location = "myerrorpage.html"; dont idea of having create page error message or fact causes redirect.

what hoping along lines of

stoploadingpage(); document.write("error has occurred"); 

but not sure how might accomplished.

what you're trying achieve isn't how web pages designed, far know not possible. logically, can stop in javascript started in javascript, workaround can think of load dependent scripts asynchronously.

i know isn't solution you're looking for, if there's no other alternative (and don't think there is), have @ requirejs, handles js dependencies (no need callbacks etc...): http://requirejs.org/


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -