Click here to Skip to main content
11,641,222 members (64,241 online)
   

ASP.NET

 
Questionasp.net Pin
Member 992520623-Mar-13 12:20
memberMember 992520623-Mar-13 12:20 
AnswerRe: asp.net Pin
frazzle-me23-Mar-13 13:41
memberfrazzle-me23-Mar-13 13:41 
AnswerRe: asp.net Pin
Rahul Rajat Singh24-Mar-13 19:47
mvpRahul Rajat Singh24-Mar-13 19:47 
Questionradiobutton Pin
mmmickyyy22-Mar-13 20:31
membermmmickyyy22-Mar-13 20:31 
AnswerRe: radiobutton Pin
Richard MacCutchan22-Mar-13 23:51
mvpRichard MacCutchan22-Mar-13 23:51 
QuestionCountdown timer Pin
Member 877289122-Mar-13 9:25
memberMember 877289122-Mar-13 9:25 
AnswerRe: Countdown timer Pin
dusty_dex22-Mar-13 9:56
memberdusty_dex22-Mar-13 9:56 
Questionprint list view Pin
atul_pune21-Mar-13 23:41
memberatul_pune21-Mar-13 23:41 
QuestionJquery Event in Ajax Loaded Table Only Works Once Pin
kruegs3521-Mar-13 10:10
memberkruegs3521-Mar-13 10:10 
AnswerRe: Jquery Event in Ajax Loaded Table Only Works Once Pin
Marco Bertschi22-Mar-13 1:38
memberMarco Bertschi22-Mar-13 1:38 
GeneralRe: Jquery Event in Ajax Loaded Table Only Works Once Pin
kruegs3522-Mar-13 1:57
memberkruegs3522-Mar-13 1:57 
GeneralRe: Jquery Event in Ajax Loaded Table Only Works Once Pin
kruegs3522-Mar-13 2:40
memberkruegs3522-Mar-13 2:40 
GeneralRe: Jquery Event in Ajax Loaded Table Only Works Once Pin
Marco Bertschi22-Mar-13 5:16
memberMarco Bertschi22-Mar-13 5:16 
QuestionProblem with WebMethod when it is called from Jquery Pin
Nafiseh Salmani20-Mar-13 12:50
memberNafiseh Salmani20-Mar-13 12:50 
Here is my code:

  $('.Status').click(function() {
                var divparent = $(this).closest('.tabs-content');
                var ruleid = divparent.attr('data-ruleid');
                var statusid;
                if (divparent.hasClass('inactive')) {
                    $(this).closest('.tabs-content').removeClass('inactive');
                    statusid = 1;
                }
                else {
                    console.log('active');
                    $(this).closest('.tabs-content').addClass('inactive');
                    statusid = 0;
                }
 
                $.ajax({ type: "POST", Url: "NewRules.aspx/SaveStatus",
                    data: "{strStatus:'" + statusid + "',strRuleID:'" + ruleid + "'}",
                    contentType: "application/json;charset=utf-8",
                    dataType: "json"
                });
 
            });
 



and here is the WebMethod:

[WebMethod]
        public static string SaveStatus(string strStatus,string strRuleID)
        {
            int status = int.Parse(strStatus);
            long RuleID;
            if (long.TryParse(strRuleID, out RuleID))
            {
 
                UploadScheduleDisplay display = UpSchDisp.Where(d => d.Id == RuleID).FirstOrDefault() as UploadScheduleDisplay;
 
                if (display != null)
                {
                    //pause or active the display
                    if (display.IsPaused)
                    {
                        display.Resume();
                    }
                    else
                    {
                        display.Pause();
                    }
                    //command will delete/add the rule from/to the module
                    CommandUtils.SendNewCommandAudit(CommandTypeEnum.ProgramUploadScheduleRules, 0, unitid,
                        1, 0, cmd_changeStatus, WebMethodLogin);
                }
            }
            else
            { //RuleID is not Valid 
                return "";
            }
            return RuleID.ToString() + "  " +status.ToString();
</pre>
 
The Jquery click works, but it never goes to WebMethod, do you have any idea what is wrong with my code?
 
Thanks

modified 21-Mar-13 17:41pm.

AnswerRe: Problem with WebMethod when it is called from Jquery Pin
jkirkerx20-Mar-13 16:40
memberjkirkerx20-Mar-13 16:40 
GeneralRe: Problem with WebMethod when it is called from Jquery Pin
Nafiseh Salmani20-Mar-13 18:41
memberNafiseh Salmani20-Mar-13 18:41 
GeneralRe: Problem with WebMethod when it is called from Jquery Pin
jkirkerx21-Mar-13 6:16
memberjkirkerx21-Mar-13 6:16 
GeneralRe: Problem with WebMethod when it is called from Jquery Pin
Nafiseh Salmani21-Mar-13 11:40
memberNafiseh Salmani21-Mar-13 11:40 
GeneralRe: Problem with WebMethod when it is called from Jquery Pin
jkirkerx21-Mar-13 11:52
memberjkirkerx21-Mar-13 11:52 
GeneralRe: Problem with WebMethod when it is called from Jquery Pin
Nafiseh Salmani21-Mar-13 12:15
memberNafiseh Salmani21-Mar-13 12:15 
GeneralRe: Problem with WebMethod when it is called from Jquery Pin
jkirkerx22-Mar-13 7:12
memberjkirkerx22-Mar-13 7:12 
QuestionHow do you debug a single ASPX file? Pin
Xarzu20-Mar-13 11:51
memberXarzu20-Mar-13 11:51 
AnswerRe: How do you debug a single ASPX file? Pin
jkirkerx20-Mar-13 12:49
memberjkirkerx20-Mar-13 12:49 
GeneralRe: How do you debug a single ASPX file? Pin
Xarzu20-Mar-13 16:38
memberXarzu20-Mar-13 16:38 
GeneralRe: How do you debug a single ASPX file? Pin
jkirkerx20-Mar-13 17:20
memberjkirkerx20-Mar-13 17:20 
GeneralRe: How do you debug a single ASPX file? Pin
Xarzu21-Mar-13 7:57
memberXarzu21-Mar-13 7:57 
GeneralRe: How do you debug a single ASPX file? Pin
jkirkerx21-Mar-13 10:16
memberjkirkerx21-Mar-13 10:16 
QuestionHow to open an existing excel file (not in the browser) in a new window from ASP.NET 3.5 with C# Pin
bnath00120-Mar-13 7:27
memberbnath00120-Mar-13 7:27 
AnswerRe: How to open an existing excel file (not in the browser) in a new window from ASP.NET 3.5 with C# Pin
dusty_dex20-Mar-13 9:52
memberdusty_dex20-Mar-13 9:52 
AnswerRe: How to open an existing excel file (not in the browser) in a new window from ASP.NET 3.5 with C# Pin
Bernhard Hiller20-Mar-13 23:47
memberBernhard Hiller20-Mar-13 23:47 
GeneralRe: How to open an existing excel file (not in the browser) in a new window from ASP.NET 3.5 with C# Pin
dusty_dex21-Mar-13 5:27
memberdusty_dex21-Mar-13 5:27 
QuestionASP.NET EXPORT TO EXCEL Pin
Mkanchha19-Mar-13 6:02
memberMkanchha19-Mar-13 6:02 
AnswerRe: ASP.NET EXPORT TO EXCEL Pin
Karthik Harve19-Mar-13 21:14
memberKarthik Harve19-Mar-13 21:14 
GeneralRe: ASP.NET EXPORT TO EXCEL Pin
Mkanchha20-Mar-13 23:37
memberMkanchha20-Mar-13 23:37 
GeneralRe: ASP.NET EXPORT TO EXCEL Pin
Bernhard Hiller20-Mar-13 23:50
memberBernhard Hiller20-Mar-13 23:50 
GeneralRe: ASP.NET EXPORT TO EXCEL Pin
Mkanchha21-Mar-13 0:59
memberMkanchha21-Mar-13 0:59 
QuestionMaintaining Variables Pin
clugsy6419-Mar-13 5:53
memberclugsy6419-Mar-13 5:53 
AnswerRe: Maintaining Variables Pin
jkirkerx19-Mar-13 8:39
memberjkirkerx19-Mar-13 8:39 
GeneralRe: Maintaining Variables Pin
clugsy6419-Mar-13 9:11
memberclugsy6419-Mar-13 9:11 
GeneralRe: Maintaining Variables Pin
jkirkerx19-Mar-13 10:14
memberjkirkerx19-Mar-13 10:14 
QuestionMVC 4 and WebForm Application: # symbol is appearing in URL Pin
David Mujica19-Mar-13 5:18
memberDavid Mujica19-Mar-13 5:18 
AnswerFound Solution Pin
David Mujica19-Mar-13 10:58
memberDavid Mujica19-Mar-13 10:58 
QuestionBAT FILE NOT GIVING PROPER RETURN VALUE in TXT file Pin
Nishant kumar electronics17-Mar-13 1:46
memberNishant kumar electronics17-Mar-13 1:46 
AnswerRe: BAT FILE NOT GIVING PROPER RETURN VALUE in TXT file Pin
Richard MacCutchan17-Mar-13 2:40
mvpRichard MacCutchan17-Mar-13 2:40 
GeneralRe: BAT FILE NOT GIVING PROPER RETURN VALUE in TXT file Pin
Nishant kumar electronics17-Mar-13 8:35
memberNishant kumar electronics17-Mar-13 8:35 
GeneralRe: BAT FILE NOT GIVING PROPER RETURN VALUE in TXT file Pin
Richard MacCutchan17-Mar-13 22:01
mvpRichard MacCutchan17-Mar-13 22:01 
QuestionComplete Editable Datagrid Pin
Girish_Sharma16-Mar-13 23:02
memberGirish_Sharma16-Mar-13 23:02 
AnswerRe: Complete Editable Datagrid Pin
Chris Hambleton18-Mar-13 4:30
memberChris Hambleton18-Mar-13 4:30 
Questionasp.net c# Pin
vishal415-Mar-13 20:11
membervishal415-Mar-13 20:11 
AnswerRe: asp.net c# Pin
Sandeep Mewara15-Mar-13 20:23
mvpSandeep Mewara15-Mar-13 20:23 

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

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


Advertise | Privacy | Mobile
Web01 | 2.8.150731.1 | Last Updated 30 Jul 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid