locked
Consecutive DDL event firing RRS feed

  • Question

  • User-1131354861 posted

    Hi all,

    I have an application that is used globally, and from different countries. Before it was built using traditional asp.net form and it is based on an assumptions that it has to record local activities happening in a certain area. as ex. an activity happenning in Brooklyn, NewYork, USA has an ID from that location and an activity happening in Hackeny,London,UK has it's own ID. to be able to record activities I have used DropDownlist for user selection and these fire event based on the previous selection, while the apps works fine it is becming increasingly slow and one of the things that I am considering is using controls(I have used AJAX but still slow....) Can anyone point me to a proper resource with custom controls where for instance you have more than two DDL and one being populated by selectedItem from the previous one.

    Regards

    Friday, July 29, 2011 3:56 AM

Answers

  • User-1131354861 posted

    Hi All,

    I have found out what needed to be done, dump me! jus laughing @myself easy peasy.

    a typical example will be two ddl in control1 and three ddl in control2 of which two comes from control1 so strictly speaking it is control1 + one ddl= cntrol2.

    so because control1.ddl2.selectedValue need to be passed to control1 then make a public property ex.: 

    public int control1_ddl2
    
    {
    
    get{ddl2.selectedIndex>0? int.Parse(ddl2.SelectedValue): 0;}
    
    }

    and because this is public then you can have this value in control2 and use it as an input parameter to control2_ddl3.

    I hope that this will help one or two people!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 7, 2011 3:18 AM

All replies

  • User-16411453 posted

    All controls do is render a html tag to the browser. They do not speed things up, or slow things down.

    Populating the control, or in other words, fetching the data to populate the rendered tag can slow things down, especially if your downloading the entire page markup just to populate a drop down list.

    The microsoft ajax uses an update panel, that you can wrap a section of the form in, in which updates are isolated to the contents of the update panel container, reducing the amount of markup that is recieved.

    Actually it's system.web.extensions. and not the ajax toolkit, but you still need a script manager.

    The advanced way to do it is to use jquery/json to just make a pure ajax call, to just populate the dropdownlist, and shift rendering to the client side.

    Saturday, July 30, 2011 11:58 PM
  • User-1131354861 posted

    Hi,

    I had considered using controls to remove repetitive codes and probably increase response time. Jquery has been used in this project.  do you have any idea as to where I can find a documentation about DDL in a custom control everything I found out is remotely irrelevant to what I am trying to achieve.

    Regards

    Thursday, August 4, 2011 6:16 AM
  • User-1131354861 posted

    Hi,

    I had considered using controls to remove repetitive codes and probably increase response time. Jquery has been used in this project.  do you have any idea as to where I can find a documentation about DDL in a custom control everything I found out is remotely irrelevant to what I am trying to achieve.

    Regards

    Thursday, August 4, 2011 6:18 AM
  • User-16411453 posted

    Your looking for jquery to populate an existing asp.net server control?

    Could you be more specific as to what your looking for? ,

    Keep in mind tha all server controls do is render or create html at the browser. There isn't much information out there on most of the controls, so you have to kind of experiement with what the limitations are.

    Just ahead and ask your questions, I will anwser them by sunday
    Friday, August 5, 2011 7:03 PM
  • User-1131354861 posted

    Hi,

    I was looking at different way of removing duplication in code and increasing SOC, that is why I resulted in using custom controls, the product couldn't use MVC for the moment(administraion issues).

    So basicall three DDL from three different controls, how can I get their events to fire considering state persistance?

    I have opted for the wrong way and used three complete controls but deep down I know It is wrong.

    Wednesday, August 31, 2011 8:42 AM
  • User-16411453 posted

    I have a credit card program, in which you select the country first, and then I populate the states or provinces after that.

    It has taken years to refine the process, or the mechanics and perception of the control.

    So a asp.net server control is just a collection of controls, I have several dropdown listboxes in them.

    First I used asp.net, full page round trips to the server. Then I used update panels for partial page round trips to the server. Now I use JQuery and JSON, to make a tiny request to a webservice, to get the data.

    Speed is somthing that you can alter by changing the perception. Take a magician for example, if the user is watching the left hand, while the magic is done on the right hand, their perception of speed will never register in their brain, because they are pre-occupied watching the left hand. So speed is not an issue any more.

    So in essence, I shifted the cpu or processing cycles back to the client side, in which their computer has to grind through the code, and not my servers.

    This is an asp,net control, in which I dumped the microsoft ajax and the update panel, and replaced it with Jquery. It's experimental right now, but so far so good. It's one giant control, with embedded JQuery. It's just an example of perception.

    If you like the results, let me know, I can tnhem post an example of how to populate a ddl via jquery ajax.

    http://www.troxellusa.com/Product/EN-US/ProductDisplay.aspx?item=06-BULLY38R&cid=45&scid=44&enc=utf8

    Saturday, September 3, 2011 1:56 AM
  • User-1131354861 posted

    Hi,

    From me it sounds like a brilliant idea, I have tried the partial update and went further to using serialisation of DB returns but I am now open to suggestions.

    The reason I need this is that from time to time we need to add new states, province, Sectors etc.... and I wanted this operation to be done on the web instead of using a Winform.

    Due to repetition issues, I am limiting myself to using different functions for different operation eg: AddState,AddProvince/County(which use already existing state)AddTown(has to use state and province). You could say that I can use findControl but this doesn't sound as an answer to me.

    Regards

    PS: I think you can blog about the DDL and JSON and JQUERY maybe it will help one or more people.

    Saturday, September 3, 2011 2:47 PM
  • User-1131354861 posted

    Hi All,

    I have found out what needed to be done, dump me! jus laughing @myself easy peasy.

    a typical example will be two ddl in control1 and three ddl in control2 of which two comes from control1 so strictly speaking it is control1 + one ddl= cntrol2.

    so because control1.ddl2.selectedValue need to be passed to control1 then make a public property ex.: 

    public int control1_ddl2
    
    {
    
    get{ddl2.selectedIndex>0? int.Parse(ddl2.SelectedValue): 0;}
    
    }

    and because this is public then you can have this value in control2 and use it as an input parameter to control2_ddl3.

    I hope that this will help one or two people!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 7, 2011 3:18 AM