Lanka Developers Community

    Lanka Developers

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Shop

    ASP.NET Razor Pages

    Back-End Development
    asp.net mvc c sharp html5
    2
    3
    672
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Dinuwan Kalubowila
      Dinuwan Kalubowila last edited by

      ASP.NET MVC architecture eke razor page ekakata bootstrap select ekak daganne kohomada?? stackoverflow walath tiakk baluwa..eth harigiye nehe

      me tiyenne normal text box ekak

      <div class="form-group form-floating-label">
      @Html.EditorFor(model => model.UserEmail, new { htmlAttributes = new { @class = "form-control input-border-bottom" } })
      @Html.LabelFor(model => model.UserEmail, htmlAttributes: new { @class = "placeholder" })
      </div>

      model eke select eke options tika damma me widiyata

      public IEnumerable <SelectListItem> TypeList
      {
      get
      {

                  return new List <SelectListItem>
      
          {
              new SelectListItem { Text = "Factory Engineering", Value = "Factory Engineering"},
              new SelectListItem { Text = "Production Engineering", Value = "Production Engineering"},
              new SelectListItem { Text = "Autonomation", Value = "Autonomation"},
      
      
          };
              }
          }
      

      dn meka razor ekata render karaganna widiyak dannawada?

      1 Reply Last reply Reply Quote 0
      • tnlthanzeel
        tnlthanzeel Web Development last edited by

        dotner core razor or dotnetframework razor?

        1 Reply Last reply Reply Quote 0
        • tnlthanzeel
          tnlthanzeel Web Development last edited by tnlthanzeel

          with dotnet framewor mvc 4 and above u can use

          @{
          List<SelectListItem> listItems= new List<SelectListItem>();
          listItems.Add(new SelectListItem
          {
          Text = "Exemplo1",
          Value = "Exemplo1"
          });
          listItems.Add(new SelectListItem
          {
          Text = "Exemplo2",
          Value = "Exemplo2",
          Selected = true
          });
          listItems.Add(new SelectListItem
          {
          Text = "Exemplo3",
          Value = "Exemplo3"
          });
          }

          @Html.DropDownListFor(model => model.tipo, listItems, "-- Select Status --")

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post

          1
          Online

          3.6k
          Users

          1.3k
          Topics

          5.3k
          Posts

          • Privacy
          • Terms & Conditions
          • Donate

          © Copyrights and All right reserved Lanka Developers Community

          Powered by Axis Technologies (PVT) Ltd

          Made with in Sri Lanka

          | |