Navigation

    Lanka Developers Community

    Lanka Developers

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

    ASP.NET Razor Pages

    Back-End Development
    asp.net c sharp html5 mvc
    2
    3
    341
    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 last edited by

        dotner core razor or dotnetframework razor?

        1 Reply Last reply Reply Quote 0
        • tnlthanzeel
          tnlthanzeel 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
          • Privacy
          • Terms & Conditions
          • Donate
          • Contact Us

          © Copyrights and All right reserved Lanka Developers Community

          Made with in Sri Lanka

          | |