If your dropdowns are truly dynamic, then you are going to have to make a request from the server to get the next dropdown's values. In the most technical sense, that is a post to the server. I assume that you mean that you don't want to do a page refreshing style of a postback. In other words, you want an ajax call to load the data for the next dropdown. You have two general schools of thought you can go with: 1. UpdatePanel. This lets you run things through your server side events, and it disguises the postbacks so they don't make the page refresh. Pros are that it is simpler to implement. You basically can implement it as you would if you wanted the dropdowns to do a postback to load the next one. Then you wrap the dropdowns in an update panel, and set a few things and you are done. The update panel makes all those postbacks become ajax calls that don't refresh the page. Cons are that it is far less efficient in terms of bandwidth and server resources, and it can lead to some difficult debugging if you aren't familiar with the .net life cycle. Update panels result in a massive amount of auto generated javascript and additional markup being rendered to the browser which is not really ideal. Also, update panels only work for web forms applications, and are not available for MVC. I assume from what I saw in your question that you are doing web forms. 2. Ajax calls to web methods. Pros are that this is clean and efficient. You save tons on bandwidth consumption which can be a big deal for slow connection users. You also take a much lighter load on the server resources, which is a big deal for higher traffic solutions. You also are in much better control of what is rendered to the browser. Cons are that you have to know javascript a lot better than you would with update panels, and you have to take care of a few specifics that update panels abstract or take care of for you. I vastly prefer the 2nd option. If you go with the ajax option, then I can give you some additional pointers and things to look out for. I would suggest you use jquery and set up something like: in javascript: $("#myDropDown1Id").change(function(){ $.ajax({...//look at jquery.com for your specifics. You set your address, and send your parameters success:function(data){ //receive the data from your server and populate dropdown2 }, error:function(data){ //notify the user in some way });//end of .ajax });//end of change function Then you need to have a function exposed to be called as a web ser
DannyStaten
Posts
-
Dynamic dropdowns enable without post back -
Is it me or is UI development the red headed step child of the programing world?Distind wrote:
it worked in 1/10th the time, dropped the load on the SQL server to a tiny fraction of what it was, more responsive, more intuitive
Amen to that! That's exactly the kind of thing that a developer who applies the same disciplines, design principles and elegance of coding to the UI development can do. That is a perfect case study for why UI development should be given equal care and consideration as all other aspects of development. Unfortunately, it so rarely is given much importance. It also demonstrates how UI development is so much more than applying CSS styles.
-
Is it me or is UI development the red headed step child of the programing world?harold aptroot wrote:
Ok for a moment here I'll pretend this isn't the backroom..
Yeah I have been reminded many times that this ought to have been in the lounge. I wasn't sure being that it was leaning towards expressing regret or frustration about the state of UI development in many places. With regards to your current project, you have my sympathies. I dodged a bullet recently when I turned down one opportunity in exchange for my current project... The one I turned down was said to be WPF, C#, WCF and Silverlite when I interviewed so it was right down my alley. I felt nuts to turn it down but went with my gut.... I later found out that most of the needed work is in Java (which I haven't done in years) but they didn't even mention that. So I know how things can feel deceptive when interviewing etc. Good luck.
-
Is it me or is UI development the red headed step child of the programing world?Erudite__Eric wrote:
but if you want to sell the beast, a good UI is WAY more important than an optimised bit of code, or a tuned coms pipe.
Can anyone say Mac? Elegant UI and brilliant Marketing are the two keystones to that company's success in my opinion, though that is another discussion entirely.
-
Is it me or is UI development the red headed step child of the programing world?harold aptroot wrote:
Anyway, as a computer scientist I care about complex algorithms and data structures. Screw the UI. If you start taking away development time from the Real Deal and putting it into UI, you get Windows Live products and Vista - a nicely wrapped piece of crap that sells well to the unwashed.
Not to be antagonistic, but that's exactly the attitude that I find frustrating. There are complexities in organization, data structure, and algorithm that all are part of UI development. I am not saying one discipline is superior to another, or more important. I am saying that UI development is generally looked on with this kind of attitude. However you have to maintain the UI just like you have to maintain any other layer of code. The most functional business logic is useless if the user interfaces don't function just like the most functional UI is useless if it doesn't connect into real functionality. So it just seems frustrating that as a general attitude, developers say "screw the UI." To me that is just as dumb as saying "screw the database." It's all important.
-
Is it me or is UI development the red headed step child of the programing world?This is my first real discussion on code project and I thought it was more about airing a grievance than general discussion. I guess I should have put it in the lounge.
-
Is it me or is UI development the red headed step child of the programing world?I may not have been clear in how I worded it, but I was not suggesting that UI should be given higher priority than any other aspect of software design. I am just mourning two things: 1. The tendency for UI to be pushed to the back burner compared to other aspects of development. 2. The attitude by many that UI development is a lesser discipline that doesn't require the same design patterns and prowess as other development.
-
Is it me or is UI development the red headed step child of the programing world?I have always had a preference and a fascination for UI development. I consider myself a very capable developer in all layers of an n-tier application, but I am a visual person by nature and I love solving usability problems and creating good UI (having worked in WPF, Flash(actionscript), and Web Forms and MVC). However it often seems like many developers automatically consider a UI developer to be a CSS or a script monkey. Good UI work in any platform requires the same dedication to proper development patterns and practices, and throws plenty of considerable brain teasers your way. Yet consistently, I see UI development kind of pushed to the lowest priority, or slapped together in painfully bad ways. Why is it that most developers will cringe and crucify someone who slaps together their data access and business logic, but then give the interface code that kind of lazy treatment? I am curious what others thoughts are on this. Do you see a different story? Are you fortunate enough to have consistently been on projects where the UI is coded well?
-
You know you've been coding too much when...Give it time and you will find that MVVM can be developed with similar costs in time. One of the benefits I love about MVVM is how reusable things are. If you can't do something via databinding to an existing property on a control, then you extend the control in question and add the properties you need. If you do it that way you then have a control you can use everywhere. Doing things in code behind which feels quicker ultimately can cost you more time.