CoffeeZombie
CoffeeZombie
CC#
Created by CoffeeZombie on 1/10/2023 in #help
Javascript/JQuery 3.6.0 help [Self-Resolved]
I have to be missing something silly. The idea is there are three levels of cascading dropdowns: Categories have Subcategories and, depending on the combination of Category and Subcategory there's a list of Resolutions. Razor CSHTML snippet:
<td>
@Html.DropDownListFor(m => m.contactModel.CategorySID, Model.CallCategoryList, "--Select--", new { @id = "ddlCategory" })
</td>
<td id="Subcategory">
@Html.DropDownListFor(m => m.contactModel.SubcategorySID, new List<SelectListItem>(), "--Select--", new { @id = "ddlSubcategory" })
</td>
<td id="Resolution">
@Html.DropDownListFor(m => m.contactModel.ResolutionSID, new List<SelectListItem>(), "--Select--", new { @id = "ddlResolution" })
</td>
<td>
@Html.DropDownListFor(m => m.contactModel.CategorySID, Model.CallCategoryList, "--Select--", new { @id = "ddlCategory" })
</td>
<td id="Subcategory">
@Html.DropDownListFor(m => m.contactModel.SubcategorySID, new List<SelectListItem>(), "--Select--", new { @id = "ddlSubcategory" })
</td>
<td id="Resolution">
@Html.DropDownListFor(m => m.contactModel.ResolutionSID, new List<SelectListItem>(), "--Select--", new { @id = "ddlResolution" })
</td>
Javascript:
$(document).ready(function () {

$('#ddlCategory').change(function () {
$.ajax({
type: "post",
url: "/LogPhoneCalls/GetSubcategories",
data: { selectedCategoryID: $('#ddlCategory').val() },
datatype: "json",
traditional: true,
success: function (data) {
var subcategory = "<select id='ddlSubcategory'>";
subcategory = subcategory + '<option value="">--Select--</option>';
for (var i = 0; i < data.length; i++)
{
subcategory = subcategory + '<option value=' + data[i].Value + '>' + data[i].Text + '</option>';
}
subcategory = subcategory + '</select>';
$('#Subcategory').html(subcategory);
}
});
});

$('#ddlSubcategory').change(function () {
$.ajax({
type: "post",
url: "/LogPhoneCalls/GetResolutions",
data: {
selectedCategoryID: $('#ddlCategory').val(),
selectedSubcategoryID: $('#ddlSubcategory').val()
},
datatype: "json",
traditional: true,
success: function (data) {
var resolution = "<select id='ddlResolution'>";
resolution = resolution + '<option value="">--Select--</option>';
for (var i = 0; i < data.length; i++) {
resolution = resolution + '<option value=' + data[i].Value + '>' + data[i].Text + '</option>';
}
resolution = resolution + '</select>';
$('#Resolution').html(resolution);
}
});
});



});
$(document).ready(function () {

$('#ddlCategory').change(function () {
$.ajax({
type: "post",
url: "/LogPhoneCalls/GetSubcategories",
data: { selectedCategoryID: $('#ddlCategory').val() },
datatype: "json",
traditional: true,
success: function (data) {
var subcategory = "<select id='ddlSubcategory'>";
subcategory = subcategory + '<option value="">--Select--</option>';
for (var i = 0; i < data.length; i++)
{
subcategory = subcategory + '<option value=' + data[i].Value + '>' + data[i].Text + '</option>';
}
subcategory = subcategory + '</select>';
$('#Subcategory').html(subcategory);
}
});
});

$('#ddlSubcategory').change(function () {
$.ajax({
type: "post",
url: "/LogPhoneCalls/GetResolutions",
data: {
selectedCategoryID: $('#ddlCategory').val(),
selectedSubcategoryID: $('#ddlSubcategory').val()
},
datatype: "json",
traditional: true,
success: function (data) {
var resolution = "<select id='ddlResolution'>";
resolution = resolution + '<option value="">--Select--</option>';
for (var i = 0; i < data.length; i++) {
resolution = resolution + '<option value=' + data[i].Value + '>' + data[i].Text + '</option>';
}
resolution = resolution + '</select>';
$('#Resolution').html(resolution);
}
});
});



});
Category -> Subcategory works fine.
Subcategory -> Resolution doesn't seem to fire at all and I'm lost to the reason why since it's a copy and paste job. Thank you in advance for your help.
2 replies
CC#
Created by CoffeeZombie on 8/18/2022 in #help
Microsoft, SMTP, and OAuth2.0 [Workaround proposed]
Less of a C# question and more of a Microsoft question: MS has advised that they're deprecating SMTP basic auth starting October 1st. (https://docs.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/deprecation-of-basic-authentication-exchange-online) We have services sending automated emails using SMTP. There's no SMTP permission for the Office365 Exchange API and Graph doesn't have it available as an application permission (it's delegated only, meaning a user must be present, which defeats the purpose of automation) So how are we supposed to send automated emails under the OAuth 2.0 paradigm?
8 replies