CurlyRed(Serzhio)
CurlyRed(Serzhio)
CC#
Created by CurlyRed(Serzhio) on 12/9/2023 in #help
Hello. I am facing an issue with null exception after calling OnPost method in my razor pages site.
After i click the button inside Post on page, it throws an error that Property is null, but breakpoint is not hit
60 replies
CC#
Created by CurlyRed(Serzhio) on 12/9/2023 in #help
Hello. I am facing an issue with null exception after calling OnPost method in my razor pages site.
But it didnt hit
60 replies
CC#
Created by CurlyRed(Serzhio) on 12/9/2023 in #help
Hello. I am facing an issue with null exception after calling OnPost method in my razor pages site.
yes, i put the breakpoint everywhere inside OnPost
60 replies
CC#
Created by CurlyRed(Serzhio) on 12/9/2023 in #help
Hello. I am facing an issue with null exception after calling OnPost method in my razor pages site.
yep, i also have another 2 OnPost methods
60 replies
CC#
Created by CurlyRed(Serzhio) on 12/9/2023 in #help
Hello. I am facing an issue with null exception after calling OnPost method in my razor pages site.
<form method="post" asp-page-handler="CalculateMortgage">
60 replies
CC#
Created by CurlyRed(Serzhio) on 12/9/2023 in #help
Hello. I am facing an issue with null exception after calling OnPost method in my razor pages site.
I feel like it dont even get to the OnPost method
60 replies
CC#
Created by CurlyRed(Serzhio) on 12/9/2023 in #help
Hello. I am facing an issue with null exception after calling OnPost method in my razor pages site.
same error
60 replies
CC#
Created by CurlyRed(Serzhio) on 12/9/2023 in #help
Hello. I am facing an issue with null exception after calling OnPost method in my razor pages site.
this is the method, i cropped out all of the properties of the objects
60 replies
CC#
Created by CurlyRed(Serzhio) on 12/9/2023 in #help
Hello. I am facing an issue with null exception after calling OnPost method in my razor pages site.
using (SqlConnection connection = new SqlConnection(connectionString))
{
connection.Open();

string query = "SELECT * FROM Properties WHERE PropertyID = @id";

using (SqlCommand command = new SqlCommand(query, connection))
{
command.Parameters.Add(new SqlParameter("@id", id));

using (SqlDataReader reader = command.ExecuteReader())
{

while (reader.Read())
{
List<string> urlList = !string.IsNullOrEmpty(urls) ? urls.Split(';').ToList() : new List<string>();

return new Property(pId, name, location, price, type, description, urlList, lat, lng);
}
}
}
return null;
}
using (SqlConnection connection = new SqlConnection(connectionString))
{
connection.Open();

string query = "SELECT * FROM Properties WHERE PropertyID = @id";

using (SqlCommand command = new SqlCommand(query, connection))
{
command.Parameters.Add(new SqlParameter("@id", id));

using (SqlDataReader reader = command.ExecuteReader())
{

while (reader.Read())
{
List<string> urlList = !string.IsNullOrEmpty(urls) ? urls.Split(';').ToList() : new List<string>();

return new Property(pId, name, location, price, type, description, urlList, lat, lng);
}
}
}
return null;
}
60 replies
CC#
Created by CurlyRed(Serzhio) on 12/9/2023 in #help
Hello. I am facing an issue with null exception after calling OnPost method in my razor pages site.
nothing like that
60 replies
CC#
Created by CurlyRed(Serzhio) on 12/9/2023 in #help
Hello. I am facing an issue with null exception after calling OnPost method in my razor pages site.
lenght of method exceeds max allowed here
60 replies
CC#
Created by CurlyRed(Serzhio) on 12/9/2023 in #help
Hello. I am facing an issue with null exception after calling OnPost method in my razor pages site.
Just SQL query that retrieves Property object with given id
60 replies
CC#
Created by CurlyRed(Serzhio) on 12/9/2023 in #help
Hello. I am facing an issue with null exception after calling OnPost method in my razor pages site.
same for service, just returns result of this method
60 replies
CC#
Created by CurlyRed(Serzhio) on 12/9/2023 in #help
Hello. I am facing an issue with null exception after calling OnPost method in my razor pages site.
It is just method that returns Property type object
60 replies
CC#
Created by CurlyRed(Serzhio) on 12/9/2023 in #help
Hello. I am facing an issue with null exception after calling OnPost method in my razor pages site.
public Property GetPropertyDetails(int? id)
public Property GetPropertyDetails(int? id)
60 replies
CC#
Created by CurlyRed(Serzhio) on 12/9/2023 in #help
Hello. I am facing an issue with null exception after calling OnPost method in my razor pages site.
It is the method of PropertyService, where I inject PropertyDAL of interface IPropertyDAL
60 replies
CC#
Created by CurlyRed(Serzhio) on 12/9/2023 in #help
Hello. I am facing an issue with null exception after calling OnPost method in my razor pages site.
i have unittest for it and i debugged it in OnGet, it returns correct property object with correct properties belonging to object
60 replies
CC#
Created by CurlyRed(Serzhio) on 12/9/2023 in #help
Hello. I am facing an issue with null exception after calling OnPost method in my razor pages site.
And actually i got the same error among all of my POST requests in my website and unfortunately i cant solve it with chat gpt or bing
60 replies
CC#
Created by CurlyRed(Serzhio) on 12/9/2023 in #help
Hello. I am facing an issue with null exception after calling OnPost method in my razor pages site.
same null ex thrown
60 replies
CC#
Created by CurlyRed(Serzhio) on 12/9/2023 in #help
Hello. I am facing an issue with null exception after calling OnPost method in my razor pages site.
I am calling 'GET' before returning Page()
60 replies