|
Oh that works!
I would figured it out eventually, maybe within 3 months
Just read the link, did not know that.
I was thinking perhaps I had to preprocess that variable before echoing it out to the presentation layer.
Well that solves another 500 errors in this project, about 1000 more to go.
Thanks Richard, really appreciate the help. This project is really beating me up mentally, but it will be worth it in the end.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
Hello,
Sorry if i post this message at the wrong place.
I am making a website with a CMS. On this CMS i add my own little functions. For one of them i used an Ajax script to refresh a div but it doesn’t worked. I asked to the CMS creator he told me to use Pjax. Is it possible to do that ? (i don’t know pjax).
If someone can help me , it would be kind.
Thanks
modified 6-Feb-21 16:22pm.
|
|
|
|
|
This is the wrong place - try here: Ask a question[^] but try to give us actual information rather than your vague description. Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
Or better, go back to your CMS creator and ask him to elaborate.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
This is going to be really generic, but...
ASP.Net website hitting a sql server database.
Our web site hits a database and according to the sql server profiler, the stored proc is returning the requested data, but the response that we're seeing is a 500 error.
What might cause that?
".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
|
|
|
|
|
Any kind of unhandled exception in the code that follows on from calling the stored procedure.
Check the event log on the server - hopefully at least some details of the error should be logged there.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
We have five db/web server combinations running the same code. This is the only one that exhibits the problem. We found out that it was a 500 error by checking the logs. That's the first thing we checked to see if it was happening on the other servers.
We've been trying to resolve this for a week... non-stop...
".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
|
|
|
|
|
Assuming this isn't ASP.NET Core, the Windows application event log on the affected server should contain an entry for every unhandled exception thrown by your application.
Eg:
Log Name: Application
Source: ASP.NET 4.0.30319.0
Date: 05/02/2021 08:33:24
Event ID: 1309
Task Category: Web Event
Level: Warning
Keywords: Classic
User: N/A
Computer: ...
Description:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 05/02/2021 08:33:24
Event time (UTC): 05/02/2021 08:33:24
Event ID: 3517ee43b6ef4766b78e33194f895134
Event sequence: 19833
Event occurrence: 3
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/2/ROOT-1-132569484930082141
Trust level: Full
Application Virtual Path: /
Application Path: ...
Machine name: ...
Process information:
Process ID: 4920
Process name: w3wp.exe
Account name: IIS APPPOOL\.NET v4.5 (64-bit)
Exception information:
Exception type: InvalidOperationException
Exception message: Request format is unrecognized for URL unexpectedly ending in '/CountProducts'.
at System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath)
at System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Request information:
Request URL: ...
Request path: ...
User host address: ...
User:
Is authenticated: False
Authentication Type:
Thread account name: IIS APPPOOL\.NET v4.5 (64-bit)
Thread information:
Thread ID: 89
Thread account name: IIS APPPOOL\.NET v4.5 (64-bit)
Is impersonating: False
Stack trace: at System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath)
at System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Have you got health monitoring enabled? It works for WebForms and MVC.
ASP.NET Health Monitoring Overview | Microsoft Docs[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
We figured out what it was - database permissions. F*ckin DBA's...
".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
|
|
|
|
|
<pre>Hi,
I am using the Live Server app, with VS Code. The issue I have is, as soon as I start coding, in the left column, the browser disappears, from the right.
Everything works fine, if I position/size VS Code/restore down Browser, side by side. Unfortunately that's with the browser working externally, from VS Code, not within its environment, the essence of the app.
The browser does automatically refresh but to see the refreshed/edited code, I have to access the browser from the taskbar, on laptop, unless I position the VS Code/browser together.
The whole concept of Visual Server, is to see edited code immediately, as I code.
Any suggestions would be greatly appreciated.
Ian
</pre>
|
|
|
|
|
Hi all...
just testing my new webhost, I made a new web project (Blazor, .NET5), clicked deploy and selected "FTP Passive" move.. what does the passive stands for...
It seems super slow.. going to try the.. "active"? deploy next!
EDIT
Seems marginally faster with "passive off"/"active". But maybe it's because I already built my app?
modified 4-Feb-21 8:14am.
|
|
|
|
|
On my customer PHP project, I've been tasked with upgrading it from PHP 4.7 to PHP 7.4.14. I decided not to take baby steps and do a giant leap since the app is so primitive, meaning it doesn't use any of the extensions such as image or anything clever.
I have 1000's of database queries using mssql_query, but I need to establish a connection first. Before I try to reinvent the wheel, thought it would be better to look at the wheels out there already first.
I'm not a PHP developer, nor do I work on WordPress, but could use a nudge in the right direction. Hoping there is something global. I saw something where I can add a PHP files called dbConnect, and PHP will load it on startup. But the documentation was kind of fuzzy to me.
All I've done so far was to do a test connection first, setup the environment, and start research on this.
I'm using PHP Storm
If it ain't broke don't fix it
Discover my world at jkirkerx.com
modified 2-Feb-21 14:54pm.
|
|
|
|
|
Hi,
My son is interested in coding and would like to learn web development. Which would be the best web development course for kids? Could someone please help me?
|
|
|
|
|
|
Whilst I try to refrain from printing emails, some are required and normally I use print pre-view to check what page(s) I need and select accordingly. If too complex as quick ctl A and copy paste to Word (or your favourite editor) and edit to the smallest number of pages possible.
However, just been caught out with a blood test appointment printed without checking and yes, three lines on the second page (of two sided print) that are not needed. Do Web designers have a secret contract with printer supplies for paper and ink? By the way, the email had masses of White Space!
Bah Humbug, waste of a sheet of paper.
|
|
|
|
|
I'm SMH on this.
Normally I really never look at the HTTP response payload and just assume it works. But this is a total hack on PHP 4.7 to tweak it to do modern things. I'm confused here, and really just looking for an explanation of why, so here goes.
I wrote this in PHP 4.7; being limited with what I can do, I hand crafted some JSON, and used a hack to encode it.
header('Content-Type: application/json; charset=utf-8');
$json = '{
"projectNumber":' . $sess_proj_no . ',
"projectStage":"' . $sess_proj_stage . '",
"newVersion":' . $new_version_no . ',
"undefinedValue":{
"projectNumber":"' . $projectNumber . '",
"variableContingencyCost":"' . $variableContingencyValue . '",
"variableContingencyValue":"' . $variableContingencyRate . '",
"actualPlusContingencyCost":"' . $actualPlusContingencyCost . '"
}
}';
$jsonTest = '{ "test": "result" }';
$jsonEncode = json_encode($jsonTest);
echo $json;
ob_end_flush();
With encoding, adding slashes to the double quotes,
SyntaxError: JSON.parse: expected property name or '}' at line 2 column 13 of the JSON data
"{
\"projectNumber\":2549,
\"projectStage\":\"engineering\",
\"newVersion\":0,
\"undefinedValue\":{
\"projectNumber\":\"\",
\"variableContingencyCost\":\"\",
\"variableContingencyValue\":\"\",
\"actualPlusContingencyCost\":\"\"
}
}"
Without encoding, no slashes to the double quotes, I get a clean HTTP response payload without errors.
{
"projectNumber": 2549,
"projectStage": "engineering",
"newVersion": 0,
"undefinedValue": {
"projectNumber": "",
"variableContingencyCost": "",
"variableContingencyValue": "",
"actualPlusContingencyCost": ""
}
}
I always thought JSON had to be encoded during transport, and then decoded to consume it.
Unless json_encode is meant to convert JSON created with a class, into a string without slashes. or it has something to do with echo and just spitting out text.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
According to my reading of the PHP manual, json_encode() didn't exist before PHP 5.2.0.
So I have no idea what you're using in 4.7....
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
|
It looks like you are creating a string in JSON format, then passing it to json_encode() where it is trying to turn it into more JSON. Unless you are actually trying to embed your JSON in the JSON that json_encode() produces, that doesn't make much sense.
This is how json_encode() is supposed to work:
$data = array(
"projectNumber" => $sess_proj_no,
"projectStage" => $sess_proj_stage,
"newVersion" => $new_version_no,
"undefinedValue" => array(
"projectNumber" => $projectNumber,
"variableContingencyCost" => $variableContingencyValue,
"variableContingencyValue" => $variableContingencyRate,
"actualPlusContingencyCost" => $actualPlusContingencyCost,
),
);
$json = json_encode($data);
|
|
|
|
|
Oh!
Wow thanks, I had no idea. That makes sense.
Will give it a try!
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
I'm using Firefox 68.0.2 (64 bit) and a habit that I have been forming involves "bookmarking" webpages on a daily basis by pulling the site URL directly from the displayed address in the control at the top of the page as it appears in the browser onto the Bookmarks Toolbar (which is loaded with titled folders, as you would imagine, accounting for the passage of time/greater utility/etc). If a user does what I do in this way, he can right-click on any "saved" url and get a PROPERTIES dialog box to pop up and allow access to four things "Name", "Location", "Tags", and "Keyword".
So, a shortcut with properties. Considering a shortcut ... unless I saved a whole webpage to disk and then opened that local page in the browser and THEN pulled the URL to my Bookmarks Toolbar and then set about adding KEYWORDS to that local reference through the PROPERTIES/Keywords control, I would expect that by adding keywords to a link like this, to a REMOTE webpage on some server somewhere on the internet, that such a "save" would involve tracking those added keywords locally (I know it's through a SQLite database in the Mozilla folder) and I can assume that this is indeed what the local SQLite database keeps track of, among other things.
Well the behavior I observe is odd then; why does saving a webpage (as .html document for instance) to a location on a drive on my computer, placing a link to it in the bookmarks toolbar folder of choice, altering the links Properties/Keyword by adding a descriptive component, then saving that add, CHANGE THE PROPERTY OF THAT LOCAL WEBPAGE ... NOT just the link of the bookmark toolbar? It does. Somehow.
Try this yourself by saving a webpage to disk, opening that saved webpage in firefox browser, sliding a link from the address control to the browser toolbar, then opening that link. Once the page is verified "here" right-click the link again, choose Properties, see the Keywords control box, and type in some new/other term. AND now, this is the important part, copy this link, paste it somewhere else in the toolbar (behind a folder perhaps), open it so the local webpage is displayed, click once again on the link, get the properties/keyword control ... see that duplicate keyword you just typed in for the original, DELETE that keyword, and type in another keyword then save.
See my confusion:
Load the original link again, look at properties/keyword and see that the original now has the changed keyword (the original keyword has been erased and replaced with the copy's keyword).
This shouldn't be happening. Despite the fact that the link on the toolbar is connected to a local webpage and not some remote page address found in the browser's lookup under SQLite/Mozilla database, the keyword should still be associated with the LINK ALONE, NOT THE LOCAL FILE.
Yes?
Is not a webpage keyword (remote) stored in the SQLite database? Is not the sole keyword lookup for a given Bookmarked URL on my firefox toolbar being facilitated by a browser's delve into that SQLite data to return the keyword in that property's keyword {space} (for lack of a proper name for an association that a database uses to link such things under cover of it's functionality)?
How could I possibly be dis-explaining this to myself?
|
|
|
|
|
Is it possible to write libraries that contain controls/markup for use by multiple MVC5 apps?
".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
|
|
|
|
|
|
We're not using Core
".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
|
|
|
|
|
I know - that's why I suggested RazorGenerator.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Well, I installed it and finally figured out how to get it working (the docs aren't exactly forthcoming - or complete).
In any case, it looks like this is my only choice if I want to try doing what I need, so I 5'd you., Thanks for the info.
".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
|
|
|
|
|