|
The dictionary is parameters going to the controller and is working ok. The params make it to the controllwe.
The problem is the JSON coming back is empty
|
|
|
|
|
Kevin Marois wrote:
public async Task<T> GetAsync<T>(string action, Dictionary<string, dynamic> parameters)
{
...
HttpResponseMessage response = _client.GetAsync(queryString).Result; Why? You're in an async method, so don't use the potentially deadlock-inducing .Result to synchronously get the result of a task. Just await the task.
HttpResponseMessage response = await _client.GetAsync(queryString);
Also, your controller can be simplified to:
[HttpGet]
public IEnumerable<Person> GetPersonList(int personTypeId = 0, int clientRepId = 0)
{
return Repository.GetPersonList(personTypeId, clientRepId);
} If an unhandled exception is thrown, the framework will return an error response for you.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Message Closed
modified 13-Jul-22 13:12pm.
|
|
|
|
|
A completely empty response, or an empty JSON array?
If it's an empty JSON array, that would suggest your repository isn't returning any data.
If it's a completely empty response, that would suggest a different problem.
Either way, you'll probably need to compare the raw network request made by your code to the working one sent via Postman to see what's different.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I solved the issue. Thank you for your help.
I'd like to post my finished class to get everyone's thoughts. I'd like your opinion on it. I'll post it later today
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Hi, we are about to begin using Angular and some people would like to use Visual Studio 2022 whereas others favour Visual Studio Code. I assumed Visual Code to be the standard and hasn't realised it was possible to develop Angular sites using Visual Studio 2022.
Are there any clear advantages of using either? Thanks.
|
|
|
|
|
Depends and or Preference.
I haven't used VS 2022 yet. I have installed VS Code in my personal laptop since it's faster one comparing to IDE. Personally VS Code is more suitable for lightweight, Frontend things(Not just Angular). VS IDE can do these things Plus Backend heavyweight things.
Here some Info you might want to see
Visual Studio Vs Visual Studio Code | The Difference You Need to Know[^]
|
|
|
|
|
For web development VS Code wins hands down. Let's ignore the fact it's just leaner and faster, but the amount of plugins for it cannot be beat.
I'll just you one example of out of hundreds. If I want to edit markdown but ensure it'll look correctly oh GihtHub (using GitHub styles) I can do this directly from VS Code.
It's the plugins that make it shine.
Jeremy Falcon
|
|
|
|
|
I think VS code is slow than VS 2022
There is little bit latency(micro micro seconds) because VS code is based on HTML/css
and
VS 2022 is native code
I feel VS2022 is better for angular
=====================================================
The grass is always greener on the other side of the fence
|
|
|
|
|
Good Day!
Asking for Help about Asp.Net (vb code) Search Error.
The Scenario is When I search for data, I get it. Then when I search again, I get the error "System.NullReferenceException: 'Object reference not set to an instance of an object.'"
How to fix this error?
Thanks and advance.
Here's my code below:
Dim strKeyWord As String
Dim str As String
Dim cmd As New MySqlCommand
Dim da As New MySqlDataAdapter
Dim ds As New DataSet
Dim objConn As New MySqlConnection
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
strKeyWord = Me.txtSEARCH.Text
End Sub
Sub BindData()
Try
strConnString = "Host=;userid=;password=;database=;port=3306;"
str = "SELECT * FROM DataDB WHERE (sc_last_name Like '%" & strKeyWord & "%')"
objConn.ConnectionString = strConnString
With cmd
.Connection = objConn
.CommandText = str
.CommandType = CommandType.Text
End With
da.SelectCommand = cmd <---- The error is here when I search again Error: 'Object reference not set to an instance of an object.'
da.Fill(ds)
myGridView.DataSource = ds
myGridView.DataBind()
da = Nothing
objConn.Close()
objConn = Nothing
cmd.Dispose()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Sub myGridView_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim lblID As Label = CType(e.Row.FindControl("lblID"), Label)
If Not IsNothing(lblID) Then
lblID.Text = e.Row.DataItem("ID")
End If
Dim lblLN As Label = CType(e.Row.FindControl("lbLN"), Label)
If Not IsNothing(lblLN) Then
lblLN.Text = e.Row.DataItem("sc_last_name")
End If
Dim lblFN As Label = CType(e.Row.FindControl("lblFN"), Label)
If Not IsNothing(lblFN) Then
lblFN.Text = e.Row.DataItem("sc_first_name")
End If
Dim lblBDAY As Label = CType(e.Row.FindControl("lblBDAY"), Label)
If Not IsNothing(lblBDAY) Then
lblBDAY.Text = e.Row.DataItem("sc_dob")
End If
End Sub
Sub ShowPageCommand(ByVal s As Object, ByVal e As GridViewPageEventArgs)
myGridView.PageIndex = e.NewPageIndex
BindData()
End Sub
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
BindData()
End Sub
modified 7-Jun-22 6:59am.
|
|
|
|
|
You have posted this question in the wrong forum. This forum is intended for people asking questions about articles. Please ask this in the correct forum.
|
|
|
|
|
I'm trying to interact with a select element, in order to find out which element is selected (at least as text). Searching I found solutions like:
getAllSelectedOptions()
But I couldn't make use of it or at least return some value with it.
I exported the select library (no success). I'm using selenium, if anyone knows how to solve this using it or some other library help me plis ;)
|
|
|
|
|
Which programming language you work?
|
|
|
|
|
Using VS2017 - I created a new MVC5 app (.Net framework), (with single user authentication), and immediately ran update-package on the whole solution.
One of the updates was from Bootstrap 3.3.1 to v5.n.
When I ran the app (with no changes to the template-generated code), the first thing I found was that somehow, updating to bootstrap 5.n actually breaks the code in bundleconfig.cs. I had to change this line:
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include("~/Scripts/bootstrap.js")); to this:
bundles.Add(new Bundle("~/bundles/bootstrap").Include("~/Scripts/bootstrap.js"));
After fixing that, I ran the app again, and noticed that the nav bar at the top of the page was completely missing. This meant there were no links to the home, about, contact, or login actions. The code was indeed in _loginpartial.cshtml and loginpartial was referenced in _latoutpartial.cshtml, but the nav bar was not displayed.
So, I downgraded bootstrap to 4.6.1, and saw no visual change n the running app.
So I downgraded to 3.4.1, and now the navbar is displayed as expected.
The primary difference I've noticed is that bootstrap 4 and newer uses flexbox for styling, and the original MVC5 template that comes with Visual Studio is NOT compatible with that version of bootstrap.
Has anybody else seen this behavior?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
The ScriptBundle tries to minify the Javascript files if optimizations are enabled. Unfortunately, the engine it uses to do that is quite old, and fails for a lot of modern JS files. I generally tend to use a Bundle pointing directly to the .min.js files instead, which works much better.
There were a lot of changes between BS v3 and v4:
Migrating to v4 · Bootstrap[^]
Probably even more between v4 and v5.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
You might want to look at
Migrating to v5 · Bootstrap v5.2
and
Migrating to v4 · Bootstrap v4.6
There are a number of changes, some very subtle that with break your layouts.
A lot of the classes have changed and the required layout for components is different in a lot of cases.
Also, the JavaScript in V5 doesn't need jQuery as current CSS and DOM/JavaScript can do almost all of what jQuery was required to do.
I find V5 a little easier to read and write, but haven't found snippets for VS2022 yet.
If you are generating HTML in any of your JavaScript or components, you may have some work to do. In that case, you may decide it is better to just keep using V3 of Bootstrap. The change to V4 or V5 is not adding any value if you already have working layouts.
"Time flies like an arrow. Fruit flies like a banana."
|
|
|
|
|
I've already fixed the problems it caused, but it was completely unexpected.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
What is IMAP and SMTP Server?
|
|
|
|
|
|
Does anyone know if the source code is available to the MVC5 project template that's available in Visual Studio?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Dear i just wanted to know how to send email From multiple SMTP to multiple Recipients.I know we can send multiple recipient by using Add CC, or BCC, But my question is suppose i have 150 Different Gmail SMTP, And i want to send Email from all Sender in one shot,thx for helping me.If any solution in Sqlerver,Winforms or MVC i am ok with any technologies.Some one is doing this, but i don't know hows so its 100% possiable.
modified 12-May-22 7:12am.
|
|
|
|
|
You've posted this in the wrong forum. Your question has absolutely nothing to do with writing a CodeProject article.
And quite frankly, from the description of what you're trying to do, I suspect nobody will want to help you. We all get plenty of spam already, without helping someone else set up a spam farm.
And even if you somehow manage to get it working, Google will hopefully detect the malicious activity and suspend your 150 GMail accounts.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi everyone
This isn't so much a question, I guess I'm just after peoples impressions or something like that.
I have noticed of late a tendency for a lot of web sites having a background colour of white or something like that and a font colour being a kind of soft grey.
Now for me, that combination of colours makes it quite hard to read. I'm sure that I'm not Robinson Crusoe.
Actually, on one occasion there was this page that was pale yellow and the font was canary yellow. The only reason I picked that up was that I was certain there was writing, so I copied and pasted it then changed the font colour to black.
What do other people think about this?
Kind regards
Ross
|
|
|
|
|
I think that they might be trying to be "different" thus noticed, but not so different that they are seen as outside of all groups, thus using colors like that might make them feel part of a group that uses hard-to-read colors, thus different but similar enough to not feel like an entire outsider.
Sometimes when I find that text/background colors result in unreadability I then click Control-A or select-all.
Yes.
|
|
|
|
|