How To Create DropDownList In MVC With Example

Поделиться
HTML-код
  • Опубликовано: 30 ноя 2024

Комментарии •

  • @CodAffection
    @CodAffection  7 лет назад

    goo.gl/bPcyXW : Buy me a Coffee
    bit.ly/30fPDMg : AspNet Core MVC Tutorials
    bit.ly/3yTsztF : More AspNet Web Form Tutorials
    bit.ly/36IA1cH : CRUD in AspNet Core MVC
    bit.ly/2Z7PI3e : CRUD in Asp Web Form
    bit.ly/2TA9N14 : GridView CRUD in Asp Web Form
    bit.ly/2Z784pi : MySQL CRUD in Asp Web Form
    bit.ly/3Z5uWUR : jQuery DataTable Playlist with Asp Web Form
    bit.ly/2MlkMuM : Login in Asp Web Form

  • @mimeneilayda1763
    @mimeneilayda1763 6 лет назад +1

    thank you for sharing it worked pefectly ... but I have a question what should I do to save the ProductName in my Stock table not the ProductID ?

    • @CodAffection
      @CodAffection  6 лет назад

      instead selected value try selected text.

  • @mohamadalibrahim2995
    @mohamadalibrahim2995 7 лет назад

    thank you for your tutorials, i appreciate your hard work

  • @girijaprasad7517
    @girijaprasad7517 3 года назад

    Can you please provide the full video.
    Need to implement for create and delete.. Need help immediately. Thanks in advance.

  • @mohamadalibrahim2995
    @mohamadalibrahim2995 7 лет назад

    keep going, keep doing, we always wait for your tutorials.

  • @johnlloyddaguimol7570
    @johnlloyddaguimol7570 3 года назад

    Hi, Can this be done using stored Procedure?

  • @zerotobeing1
    @zerotobeing1 5 лет назад

    Will u tell me how can I get matching record entered in a textbox from database without using entity framework

  • @DjTitoxxVzla
    @DjTitoxxVzla 4 года назад

    hi, how can i send 2 collections from controller to view?? with this example?

  • @allanagaba5604
    @allanagaba5604 6 лет назад +1

    Thanks DOTNET MOB. It works fine and saves to the database. However, I get an error in the front-end.
    Value cannot be null.
    Parameter name: items
    Below is the line with an error:
    Line 22: @Html.DropDownListFor(model => model.Role_id, new SelectList(Model.RolesCollection, "Role_id", "Role_name"),"select")
    Assist.

    • @CodAffection
      @CodAffection  6 лет назад

      try to debug the application. model.Role_id cannot be null, by default it will be 0.

  • @rahim3070
    @rahim3070 7 лет назад

    Extremely awesome.

  • @MIS2000Lab
    @MIS2000Lab 6 лет назад

    Thanks for your kindly sharing! This sample is very useful and funny.

  • @nuhab1602
    @nuhab1602 3 года назад

    is dbModels the name of the database context?

  • @smf00027
    @smf00027 4 года назад

    Hi, is there anyway i could use this using DapperORM? Thanks

  • @LoganDu23
    @LoganDu23 6 лет назад

    What if I update the DB and models, is it going to lose your field ProductCollection? Any solution to keep it consistent?

  • @PrawMing
    @PrawMing 6 лет назад

    Thank you. it learn it ez

  • @suyogshelar7414
    @suyogshelar7414 4 года назад

    how can i update it into db after giving the values?

  • @mohamadalibrahim2995
    @mohamadalibrahim2995 7 лет назад

    I have a question please, how can i specific ID for dropdownlist. to use Jquery in dropdwonlist I must give dropdwonlist ID
    @Html.DropDownListFor( model => model.ProductID, new SelectList(Model.productCollection, "ProductID", "ProductName"),"select")

    • @CodAffection
      @CodAffection  7 лет назад +1

      you can one last parameter like this@Html.DropDownListFor(item => ...."select--",new { @id="myid", @class="myclass" })

    • @mohamadalibrahim2995
      @mohamadalibrahim2995 7 лет назад

      jquery.selectBox.js:1165 Uncaught ReferenceError: jQuery is not defined
      at jquery.selectBox.js:1165
      (anonymous) @ jquery.selectBox.js:1165
      AddOrEdit:35 Uncaught ReferenceError: $ is not defined
      at AddOrEdit:35

  • @deepanshumehta3584
    @deepanshumehta3584 5 лет назад

    plz share the tables also.... database tables query plz.. i am getting an error

  • @dotNet6
    @dotNet6 5 лет назад

    How to added left side space in dropdownlist

  • @adilshehbaz
    @adilshehbaz 7 лет назад

    I Want More Than One DropDown List, What Should I do?

    • @CodAffection
      @CodAffection  7 лет назад

      Suppose if you want two dropdownlist, then there will two list in model class and you can follow the same method. Hope I answered your question, if not let me know :)

  • @mohamadalibrahim2995
    @mohamadalibrahim2995 7 лет назад

    nice video

  • @mohamadalibrahim2995
    @mohamadalibrahim2995 7 лет назад

    nice

  • @mohamadalibrahim2995
    @mohamadalibrahim2995 7 лет назад

    awsome

  • @oguzberkcoskun7180
    @oguzberkcoskun7180 7 лет назад +1

    Hmmm Nice Bike sjsjsjsjsj

  • @kkkkk79
    @kkkkk79 5 лет назад +1

    here how i create a dropdownlist
    end of tutorial

  • @adilshehbaz
    @adilshehbaz 7 лет назад

    I Need One More Thing To Know, How To I Store DropDown Data in Database, Much Worried

    • @CodAffection
      @CodAffection  7 лет назад

      In this tutorial, we have created drop down list options from database table. so you can use the same procedure.

    • @adilshehbaz
      @adilshehbaz 7 лет назад

      i retrieve dropdown from one table like department in student, now i want to store selected department against student id, but this is not working

    • @adilshehbaz
      @adilshehbaz 7 лет назад

      can u please show me the code how to store department dropdown selected value to database against student

    • @adilshehbaz
      @adilshehbaz 7 лет назад

      When i create new student no data store from dropdown in database i use the same code

    • @CodAffection
      @CodAffection  7 лет назад

      In that case you can store drop down list data in cache memory or in a c# static list. you can even filter items from this store items. you need update this storage when there is a change in the related table.

  • @stephanegagne3565
    @stephanegagne3565 6 лет назад

    Not complete, does not save into database totally crap sorry!

    • @CodAffection
      @CodAffection  6 лет назад

      any error message ?

    • @konvictremix
      @konvictremix 6 лет назад +1

      It does an error. It's because the dropdown list needs to bind again when it submits the form.

  • @ranavitaln
    @ranavitaln 5 лет назад

    123455

  • @encryptor6710
    @encryptor6710 5 лет назад

    WTH was that?? 6:42