Member 12617709 Ответов: 1

Неизвестный веб-метод btnsaveassessment_click. Имя параметра: methodname


плз подскажите мне решение для этого

и мой метод

protected void btnSaveAssessment_Click(object sender, EventArgs e)
{
    string[] strSettingKey = new string[34];
    string[] strSettingValue = new string[33];
    SetAssessmentSettings();
    //Assign key
    strSettingKey[0] = "DateFormat";
    strSettingKey[1] = "EnableFirstLogin";
    strSettingKey[2] = "ApplicationTheme";
    strSettingKey[3] = "EnableTestAudio";
    strSettingKey[4] = "EnablePreviousButton";
    strSettingKey[5] = "FileUploadSize";
    strSettingKey[6] = "DeleteUserDetails";
    strSettingKey[7] = "SemesterName";//key for userdefined semestername.
    strSettingKey[8] = "IsIntegratedWithKlassAktOnline";//key for lms is integrated with online
    strSettingKey[9] = "GenerateCertificateUponCompletionOfCourse";//key for generate certificate upon completion of course
    strSettingKey[10] = "IsSendAccessNotification";//key for send access notification
    strSettingKey[11] = "IsAutoReassignedInterruptedAssessment";//key for auto reassign interrupted assessment
    strSettingKey[12] = "IsAutoReassignedFailedAssessment";//key for auto reassign failed assessment
    strSettingKey[13] = "MaxAttemptForReassignFailedAssessment";//key for max attempt for auto reassign assessment
    strSettingKey[14] = "ShowMarquee";
    strSettingKey[15] = "MarqueeText";
    strSettingKey[16] = "EnableAuthenticationInWMS";
    strSettingKey[17] = "AdminEmail";//key for admin email
    strSettingKey[18] = "AdminMailPassword";//key for admin email password
    strSettingKey[19] = "AdminMailPort";//key for admin email port
    strSettingKey[20] = "MailServer";//key for mail server ip
    strSettingKey[21] = "IsMailServerAvailable";//key for is mail server available
    strSettingKey[22] = "CompanyName";//key for company name
    strSettingKey[23] = "EmailNotification";//key for email notification
    strSettingKey[24] = "IsGlickoRatingEnabled";//key for is glicko rating enabled
    strSettingKey[25] = "AssessmentRatingType";//key for assessment rating type
    strSettingKey[26] = "GlickoMessage";//key for Glicko score message
    strSettingKey[27] = Convert.ToString(Convert.ToInt32(LMSConstants.InsertUpdateApplicationSetting.InsertUpdateAssessmentSetting));//key for InsertUpdate Assessment Setting
    strSettingKey[28] = "IsAudioLabEnabled";//key for audiolab type
    strSettingKey[29] = "VideoRecordingType";//key for video recording type
    strSettingKey[30] = "IsAzureEnabled";//key for azure enable
    strSettingKey[31] = "AzureAccountName";//key for AzureAccountName
    strSettingKey[32] = "AzureAccountKey";//key for AzureAccountKey
    strSettingKey[33] = "AzureStorageKey";//key for AzureStorageKey

    //Assign value
    strSettingValue[0] = null;
    strSettingValue[1] = null;
    strSettingValue[2] = null;
    strSettingValue[3] = objChangeApplicationSettings.EnableTestAudio.Trim();
    strSettingValue[4] = objChangeApplicationSettings.EnablePreviousButton.Trim();
    strSettingValue[5] = null;
    strSettingValue[6] = null;
    strSettingValue[7] = null;
    strSettingValue[8] = null;
    strSettingValue[9] = null;
    strSettingValue[10] = null;
    strSettingValue[11] = objChangeApplicationSettings.AutoReassignInterruptedAssess.Trim();
    strSettingValue[12] = objChangeApplicationSettings.AutoReassignFailedAssess.Trim();
    strSettingValue[13] = objChangeApplicationSettings.MaxAutoReassignAssess.Trim();
    strSettingValue[14] = null;
    strSettingValue[15] = null;
    strSettingValue[16] = null;
    strSettingValue[17] = null;
    strSettingValue[18] = null;
    strSettingValue[19] = null;
    strSettingValue[20] = null;
    strSettingValue[21] = null;
    strSettingValue[22] = null;
    strSettingValue[23] = null;
    strSettingValue[24] = objChangeApplicationSettings.IsGlickoRatingEnabled.Trim();
    strSettingValue[25] = objChangeApplicationSettings.AssessmentRatingType.Trim();
    strSettingValue[26] = objChangeApplicationSettings.GlickoScoreMessage.Trim();
    strSettingValue[27] = null;
    strSettingValue[28] = null;
    //for azure
    strSettingValue[29] = null;
    strSettingValue[30] = null;
    strSettingValue[31] = null;
    strSettingValue[32] = null;

    objChangeApplicationSettings.UpdateApplicationSettings(strSettingKey, strSettingValue);

    LMS.Utilities.CommonFunctions.ResetConfigurationSettings();
    //radio_design();

    ShowMessagePanel("", "success", Resources.Language.saved_successfully);

    ScriptManager.RegisterStartupScript(this, this.GetType(), "", "radio_design(); insclick();", true);
}


Что я уже пробовал:

$.Аякс({
тип: "пост",
contentType: "application/json",
данные: "",
URL-адрес: "ManageApplicationSettings.aspx-и btnSaveAssessment_Click",
успех: radio_design()

})

F-ES Sitecore

Ваш код ошибочен по слишком многим причинам, чтобы перечислять их. Google "write webmethod c#" для статьи о том, как вы пишете веб-метод, а также обратите внимание, что некоторые вещи, которые вы делаете, не могут быть сделаны из веб-метода, например элементы управления доступом на странице, менеджер сценариев и т. д. Updatepanel может быть именно тем решением, которое вам нужно использовать.

Karthik_Mahalingam

неправильный подход, см. Jquery asp.net событие нажатия кнопки через ajax-Stack Overflow[^]

1 Ответов

Рейтинг:
1

ZurdoDev

F-ES Sitecore находится на месте. Вам действительно нужно следовать этому совету.