Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8249157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:26:26+00:00 2026-06-07T23:26:26+00:00

script $(document).ready(function () { $(#musteri_sno).change(function () { var strSayacID = ; strSayacID = $(this)[0].value;

  • 0

script

$(document).ready(function () {
    $("#musteri_sno").change(function () {
        var strSayacID = "";
        strSayacID = $(this)[0].value; // get the selected state id

        var url = "/SayacOkumalari/MusteriSayaclariniGetir/" + strSayacID ;
        // call controller's action
        $.getJSON(url, null, function (data) {
            // do something once the data is retrieved
            $("#sayac_no").empty();
            $.each(data, function (index, optionData) {
                $("#sayac_no").append("<option value='"
                 + optionData.sno
                 + "'>" + optionData.sayac_seri_no
                 + "</option>");
            });
        });
    })
.change(); // making sure the event runs on initialization for default value
});

html

<td>
    @Html.DropDownList("musteri_sno", (SelectList)ViewBag.musteri_id, "--Müşteri Seçiniz--", new { id = "musteri_sno" })
</td>
<td>
    @Html.DropDownList("sayac_no", Enumerable.Empty<SelectListItem>(), "-- Sayaç Seçiniz --", new { id = "sayac_no" })
</td>

action

[HttpGet]
public ActionResult MusteriSayaclariniGetir(int musteri_sno)
{
    var sites = entity.TblSayaclar.Where(x => x.musteri_id == musteri_sno).Select(x => new { sno = x.sno, sayac_seri_no = x.seri_no });
    return Json(sites, JsonRequestBehavior.AllowGet);
}

When I removed parameter musteri_no from MusteriSayaclariniGetir(int musteri_sno) action, my codes work correctly. Is there a problem with url var url = "/SayacOkumalari/MusteriSayaclariniGetir/" + strStateID; or different error?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T23:26:27+00:00Added an answer on June 7, 2026 at 11:26 pm

    It’s a problem of your routing. Use “id” instead of “musteri_sno” to use the default map or add one more routing map for your controller in Global.asax.cs

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

html <script type=text/javascript> $(document).ready(function () { $(#musteri_sno).change(function () { var strSayacID = ; strSayacID
I use this script: $(document).ready(function() { $page = jQuery.url.attr(file); alert(page); }); but I get
I have below script: $(document).ready(function () { $(#dpProject).change(function () { var idModel = $(this).val();
I have an website with URL`s like example.com/index.php?p=home An this script $(document).ready(function() { var
script <script type=text/javascript> $(document).ready(function () { $('musteri_sno').change(function () { $('form_sayac_secimi').submit(function () { if ($(this).valid())
I have this script: $(document).ready(function() { $('#Checkout1').addClass('disabled'); $('#voorwaarden').change(function() { $('#Checkout1').attr('disabled', $(this).is(':checked') ? null :
I have this simple script: $(document).ready(function(){ var $yoyo = window.location.hash; alert($yoyo); }); But I
I have the following jQuery script: $(document).ready(function() { $.ajax({ url: 'temp.ajax.php', type: 'GET', success:
This is my Jquery script $(document).ready(function() { $('#form').submit(function() { var number = $('#number').val(); $.ajax({
Script: $(document).ready(function() { //Change these values to style your modal popup var align =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.