Click here to Skip to main content
15,890,336 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How to solve HTTP Error 403.14 - Forbidden error in web service project Pin
sudipta saha6-Aug-18 22:24
sudipta saha6-Aug-18 22:24 
GeneralRe: How to solve HTTP Error 403.14 - Forbidden error in web service project Pin
dan!sh 6-Aug-18 22:28
professional dan!sh 6-Aug-18 22:28 
GeneralRe: How to solve HTTP Error 403.14 - Forbidden error in web service project Pin
sudipta saha6-Aug-18 22:59
sudipta saha6-Aug-18 22:59 
Questionjquery ajax Pin
Member 139369243-Aug-18 2:57
Member 139369243-Aug-18 2:57 
AnswerRe: jquery ajax Pin
dan!sh 3-Aug-18 3:31
professional dan!sh 3-Aug-18 3:31 
GeneralRe: jquery ajax Pin
Member 139369243-Aug-18 4:33
Member 139369243-Aug-18 4:33 
GeneralRe: jquery ajax Pin
Richard Deeming3-Aug-18 4:39
mveRichard Deeming3-Aug-18 4:39 
QuestionWant to prevent button posting the Data for add or Update Pin
indian1432-Aug-18 14:11
indian1432-Aug-18 14:11 
Hi all,

I have a Kendo Grid as below, it creates a Popup that will submit the Data entered by using into a Controller Action method, my need is, I have a jQuery function that will be called at RequestStart, which has some validations, what I want is, to prevent calling of the calling of the Controller Action method if Validation fails like in the jQuery method <2, or < 3 or etc, any help would be very very helpful, I am using Kendo grid for it, my Kendo grid is as below:
<div class="row  table-responsive " style="padding-left: 3%">
    <div id="datalist">
        @(Html.Kendo().Grid<DHCS.BH.Provider.Models.LookupTable>()
                        .Name("LookupGrid")
                .EnableCustomBinding(true)
                .AutoBind(true)
                .Columns(columns =>
                {
                    columns.Bound(p => p.Id).Hidden();
                    columns.Bound(p => p.Code).Width(120);
                    columns.Bound(p => p.Description).Width(280);
                    columns.Bound(p => p.CreatedDate).ClientTemplate("#=DateFormat(CreatedDate)#").Width(130);
                    columns.Bound(p => p.CreatedBy).Width(150);
                    columns.Bound(p => p.ModifiedDate).ClientTemplate("#=DateFormat(ModifiedDate)#").Width(140); ;
                    columns.Bound(p => p.ModifiedBy).Width(150);
                    columns.Bound(p => p.Status).Width(100);
                    columns.Bound(p => p.IsValid).Width(100).Hidden();<br />
                    columns.Command(command => { command.Edit().UpdateText("OK").CancelText("Cancel");}).Width(100);
                    columns.Bound(p => p.LookupTableId).Hidden();
                    columns.Bound(p => p.ForeignKeyId).Hidden();
                })<br />
                 .ToolBar(toolbar =>
                        {
                            toolbar.Create().Text("Add New");
                        })
                                    .Editable(editable => { editable.Mode(GridEditMode.PopUp).TemplateName("_EditLookupCode").DisplayDeleteConfirmation(false); })
                    .Pageable()
                           .Resizable(resize => resize.Columns(true))
                    .Sortable()
                    .Scrollable()
                             .Resizable(resize => resize.Columns(true))
                            .Filterable(x => x.Extra(false).Operators(O => O.ForString(str => str.Clear().StartsWith("Starts With"))))
                    .HtmlAttributes(new { style = "height:550px;" })

<pre>
                            .Events(events => events.Edit("LookupPopUpTitle")
                                                            .DataBound("dataBoundAdmin")
                                            )
            .DataSource(ds => ds
                .Ajax()
                .PageSize(10)
                    .Model(model => { model.Id(p => p.Id); })
                    .Read(read => read.Action("GetLookupValues", "Admin").Data("GetLookupTableId"))
                    .Create(create => create.Action("AddLookupRecord", "Admin").Data("GetLookupTableId")).Events(e => e.Sync("GetLookupTableValue1"))                 
                    .Update(update => update.Action("UpdateLookupRecord", "Admin"))                       
                                   .Events(e => e.RequestStart("onRequestStart"))
                )
    )
</div>




And my jQuery method is:
    function onRequestStart(e)
    {
        var v = $("#txtLookupTableId").val();

        if ((v == 3) || (v == 20))
        {           
            if ($('#idTxtForCodeLookupCode').val().length<2)
                e.preventDefault();
        }
        else if ((v == 6) || (v == 7) || (v == 8) || (v == 9) || (v == 12) || (v == 23))
        {           
            if ($('#idTxtForCodeLookupCode').val().length < 2)
                e.preventDefault();
        }
        else if ((v == 11) || (v == 13))
        {            
            if ($('#idTxtForCodeLookupCode').val().length < 3)
                e.preventDefault();
        }
        else if ((v == 15))
        {            
            if ($('#idTxtForCodeLookupCode').val().length < 3)
                e.preventDefault();
        }
        else if (v == 2)
        {            
            if ($('#idTxtForCodeLookupCode').val().length < 15)
                e.preventDefault();
        }
        else if ((v == 16) || (v == 17) || (v == 18))
        {           
            if ($('#idTxtForCodeLookupCode').val().length < 25)
                e.preventDefault();
        }
        else if (v == 22)
        {            
            if ($('#idTxtForCodeLookupCode').val().length < 10)
                e.preventDefault();
        }
        else if (v == 26)
        {
            if ($('#idTxtForCode').val().length < 2)
                e.preventDefault();           
        }
        else
        {
            $('#idTxtForCodeLookupCode').NoCondition();
            $('#lblCodeValidationMessage').text("");
        }
    }
Any help please? Thanks in advance.

Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."
AnswerRe: Want to prevent button posting the Data for add or Update Pin
Vincent Maverick Durano2-Aug-18 19:01
professionalVincent Maverick Durano2-Aug-18 19:01 
GeneralRe: Want to prevent button posting the Data for add or Update Pin
indian1433-Aug-18 6:06
indian1433-Aug-18 6:06 
GeneralRe: Want to prevent button posting the Data for add or Update Pin
Vincent Maverick Durano3-Aug-18 6:17
professionalVincent Maverick Durano3-Aug-18 6:17 
AnswerRe: Want to prevent button posting the Data for add or Update Pin
dan!sh 3-Aug-18 1:57
professional dan!sh 3-Aug-18 1:57 
GeneralRe: Want to prevent button posting the Data for add or Update Pin
indian1433-Aug-18 6:04
indian1433-Aug-18 6:04 
GeneralRe: Want to prevent button posting the Data for add or Update Pin
dan!sh 4-Aug-18 6:44
professional dan!sh 4-Aug-18 6:44 
QuestionWCF service with sql server stored procedure for android Pin
Member 103645162-Aug-18 2:07
Member 103645162-Aug-18 2:07 
AnswerRe: WCF service with sql server stored procedure for android Pin
Vincent Maverick Durano2-Aug-18 4:58
professionalVincent Maverick Durano2-Aug-18 4:58 
GeneralRe: WCF service with sql server stored procedure for android Pin
Member 103645166-Aug-18 8:22
Member 103645166-Aug-18 8:22 
AnswerRe: WCF service with sql server stored procedure for android Pin
Mycroft Holmes6-Aug-18 14:39
professionalMycroft Holmes6-Aug-18 14:39 
QuestionHTML2PDF: does it support HTML OL tag type? Pin
Member 137012511-Aug-18 0:38
Member 137012511-Aug-18 0:38 
AnswerRe: HTML2PDF: does it support HTML OL tag type? Pin
Vincent Maverick Durano1-Aug-18 8:16
professionalVincent Maverick Durano1-Aug-18 8:16 
GeneralRe: HTML2PDF: does it support HTML OL tag type? Pin
Member 137012511-Aug-18 20:02
Member 137012511-Aug-18 20:02 
GeneralRe: HTML2PDF: does it support HTML OL tag type? Pin
Vincent Maverick Durano2-Aug-18 4:52
professionalVincent Maverick Durano2-Aug-18 4:52 
QuestionOpen ChildPage's Modal on Parent Page Pin
kktt28-Jul-18 7:55
kktt28-Jul-18 7:55 
AnswerRe: Open ChildPage's Modal on Parent Page Pin
Vincent Maverick Durano30-Jul-18 11:17
professionalVincent Maverick Durano30-Jul-18 11:17 
QuestionWant to Hide a span element using class selector using CSS Pin
indian14327-Jul-18 9:10
indian14327-Jul-18 9:10 

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.