Click here to Skip to main content
15,896,348 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: How do I fix "This page can't be displayed" error in asp.net c#? Pin
Richard Deeming10-Sep-13 1:00
mveRichard Deeming10-Sep-13 1:00 
QuestionRetreive JSON Data from HttpRequestMessage Pin
AnalogNerd9-Sep-13 6:53
AnalogNerd9-Sep-13 6:53 
QuestionSecuring asmx web service for JS Pin
SerNovik9-Sep-13 1:43
SerNovik9-Sep-13 1:43 
AnswerRe: Securing asmx web service for JS Pin
Abhinav S9-Sep-13 6:57
Abhinav S9-Sep-13 6:57 
QuestionDeploying MVC 4 Intranet on IIS Pin
nitin_ion8-Sep-13 21:01
nitin_ion8-Sep-13 21:01 
AnswerRe: Deploying MVC 4 Intranet on IIS Pin
Abhinav S9-Sep-13 6:58
Abhinav S9-Sep-13 6:58 
QuestionCheckbox in the Gridview in asp.net application using VS 2005 & Or VS 2008 Pin
dash20208-Sep-13 19:46
dash20208-Sep-13 19:46 
QuestionjQuery jTable update : data base side won't be updated Pin
Member 101874186-Sep-13 9:25
Member 101874186-Sep-13 9:25 
I'm using the jTable plugin of jQuery in my CRUD application. My problem is, when I click on the update icon, the changed values appear in the jtable , but on the data base side nothing seems to be changed. I just can't figure out.... what's the source of this problem ??? here's the script for my view :
VB
@ModelType jTableSampleDatabaseLayer.Hik.JTable.Models.Concour

@Code
ViewData("Title") = "Filtering"
End Code


@section CssImport
<style>
    div.filtering {
        border: 1px solid #999;
        margin-bottom: 5px;
        padding: 10px;
        background-color: #EEE
    }
</style>
 end section

<div class="filtering">
<form>
    <label>Numéro: <input type="text" name="numero" id="numero" />
          <label> Type: @Html.DropDownList("numero_type", DirectCast(ViewBag.types,    IEnumerable(Of SelectListItem)), New With { .id = "numero_type" })
           Nature: @Html.DropDownList("numero_nature", DirectCast(ViewBag.natures, IEnumerable(Of SelectListItem)), New With { .id = "numero_nature" })</label></label>


    <button type = "submit" id="LoadRecordsButton">Rechercher</button>
  </form>
 </div>

 <div id="Tableau" ></div>
    <script >

   $(document).ready(function () {

    //Initialize jTable
    $('#Tableau').jtable({
        title: 'Liste des concours',


        actions: {

            listAction: '@Url.Action("ConcoursListByFiter")',
            deleteAction: '@Url.Action("DeleteConcours")',
            updateAction: '/DefaultPage/UpdateConcours',
            createAction: '@Url.Action("CreateConcours")'
        },

        fields: {
            numero_concours: {
                title: 'numéro',
                width: '21%',
                key: true,
                create: true,
                edit: false,
                columnResizable: true,
                columnSelectable: true
            },     

            numero_type: {
                title: 'type',
                width: '12%',
                options: '@Url.Action("GetTypeOptions")'
            },
            numero_nature: {
                title: 'nature',
                options: '@Url.Action("GetNatureOptions")',
                width: '21%'
            },

            numero_etape: {
                title: 'Etape',
                options: { '1': 'En cours de programmation', '2': 'soumission', '3':      'validé', '4': 'sorti' },
                width: '21%'
            },
            titre_concours: {
                title: 'titre',
                width: '21%'
            },
            date_de_sortie: {
                title: 'date ',
                width: '21%',
                type: 'date',
                displayFormat: 'yy-mm-dd',
                inputClass: 'validate[required,custom[date]]'
            },
            nbre_rangs: {
                title: 'Rang',
                width: '21%'
            },
            nbre_matchs: {
                title: 'Matchs',
                width: '21%'
            }
        }

    });
    //Re-load records when user click 'load records' button.       

    $('#LoadRecordsButton').click(function (e) {
        e.preventDefault();
        $('#Tableau').jtable('load', {
            numero: $('#numero').val(),
            typeId: $('#numero_type').val(),
            natureId: $('#numero_nature').val()

        });
    });

    //Load all records when page is first shown
    $('#LoadRecordsButton').click();



});
  </script>


the script from the controller :

VB
<HttpPost>
    Public Function UpdateConcours(concours As Concour) As JsonResult
        If (Not (ModelState.IsValid)) Then

            Return Json(New With {Key .Result = "ERROR", Key .Message = "Form is not valid! Please correct it and try again."})
        End If
        Try


            _repository.ConcoursRepository.UpdateConcours(concours)
            Return Json(New With {Key .Result = "OK"})

        Catch ex As Exception

            Return Json(New With {Key .Result = "ERROR", Key .Message = ex.Message})
        End Try
    End Function


and the script for the UpdateConcours in my MemoryConcours Repositroy :

VB
Public Sub UpdateConcours(concours As Concour) Implements IConcoursRepository.UpdateConcours
        Dim foundConcours As Concour = _dataSource.Concours.FirstOrDefault(Function(s) s.numero_concours = concours.numero_concours)
        If IsNothing(foundConcours) Then

            Return
        End If
        foundConcours.numero_concours = concours.numero_concours
        foundConcours.nbre_matchs = concours.nbre_matchs
        foundConcours.nbre_rangs = concours.nbre_rangs
        foundConcours.numero_etape = concours.numero_etape
        foundConcours.date_de_sortie = concours.date_de_sortie
        foundConcours.numero_type = concours.nbre_rangs
        foundConcours.titre_concours = concours.titre_concours
        foundConcours.numero_nature = concours.numero_nature
        Dim e As Concour = (From o In x.Concours Where o.numero_concours = concours.numero_concours Select o).First()
        x.Entry(e).OriginalValues().SetValues(concours)
        x.ChangeTracker.DetectChanges()
        x.SaveChanges()



    End Sub



ps: while the updating there's no error message it is just that the values are updated on the table but not on the data base side !!
QuestionCalendar control in month view,week view and day view Pin
Member 102290555-Sep-13 20:20
Member 102290555-Sep-13 20:20 
GeneralRe: Calendar control in month view,week view and day view Pin
Richard MacCutchan5-Sep-13 22:23
mveRichard MacCutchan5-Sep-13 22:23 
QuestionMULTI LANGUAGE WEBSITE IN ASP.NET USING C# Pin
abdul subhan mohammed5-Sep-13 4:33
professionalabdul subhan mohammed5-Sep-13 4:33 
AnswerRe: MULTI LANGUAGE WEBSITE IN ASP.NET USING C# Pin
Forbiddenx6-Sep-13 7:04
Forbiddenx6-Sep-13 7:04 
AnswerRe: MULTI LANGUAGE WEBSITE IN ASP.NET USING C# Pin
Abhinav S8-Sep-13 18:15
Abhinav S8-Sep-13 18:15 
Questionupdate a formview that allows paging (dynamic data website)‏ Pin
marounmm5-Sep-13 3:24
marounmm5-Sep-13 3:24 
AnswerRe: update a formview that allows paging (dynamic data website)‏ Pin
Codes DeCodes10-Sep-13 0:46
Codes DeCodes10-Sep-13 0:46 
Questionradio button Pin
Member 102315013-Sep-13 23:08
Member 102315013-Sep-13 23:08 
AnswerRe: radio button Pin
TheUltimateDebugger3-Sep-13 23:15
professionalTheUltimateDebugger3-Sep-13 23:15 
AnswerRe: radio button Pin
Bernhard Hiller3-Sep-13 23:17
Bernhard Hiller3-Sep-13 23:17 
AnswerRe: radio button Pin
jitendra kumar upadhyay5-Sep-13 1:47
jitendra kumar upadhyay5-Sep-13 1:47 
AnswerRe: radio button Pin
Forbiddenx6-Sep-13 7:17
Forbiddenx6-Sep-13 7:17 
AnswerRe: radio button Pin
Dholakiya Ankit10-Sep-13 0:15
Dholakiya Ankit10-Sep-13 0:15 
QuestionAsp.Net Query Pin
ShobhitGupta3-Sep-13 4:27
ShobhitGupta3-Sep-13 4:27 
AnswerRe: Asp.Net Query Pin
jkirkerx3-Sep-13 11:02
professionaljkirkerx3-Sep-13 11:02 
AnswerRe: Asp.Net Query Pin
Bernhard Hiller3-Sep-13 23:24
Bernhard Hiller3-Sep-13 23:24 
Questionunrecognized tag webpartmanager Pin
risingsun2k3-Sep-13 3:28
risingsun2k3-Sep-13 3:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.