|
Hi to all,
I am having live web application, which some times log out due to post back in firefox only.
At that time Session become null and Log Out.
In Other browsers working fine. I am using Firefox 69.0.2 (Latest) version.
Log Out happnes into Live Clients or in Production server only. In web developement working fine.
I am having Old Web Application around 12 years old web site (Product) and successfully using 150+ clients.
Some clients facing this issue. I have checked at my end. Issue still persist in some pages of web site.
Any one faced same issue?
Is there any thing that i can check that issue in otherway ?
Thank You
|
|
|
|
|
Siddharth Chudasama wrote: which some times log out due to post back What does that mean? How does a postback cause a session timeout?
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Currently I want to grab the name of my uploaded file in Ajax and pass it to my APIController and pass it to my parameter.
1.Here is my controller :
public class ApiSampleUploadController : ApiController
{
[HttpPost]
public string Test(HttpPostedFileBase file )
{
return "Success";
}
}
2.Here is my view:
@using (Html.BeginForm("Submit"))
{
<div>
<input type="file" name="file" id="uploadFile" />
</div>
}
3.Here is my ajax
$('#uploadFile').on("change", function () {
var formdata = new FormData($('form').get(0));
CallUpload(formdata);
});
function CallUpload(file) {
console.log(file);
$.ajax({
url: '/api/ApiSampleUpload/Test',
type: 'POST',
data: 'file=' + file ,
cache: false,
processData: false,
contentType: 'application/json',
success: function () {
alert('Success');
},
error: function () {
alert('Error occured');
}
});
}
|
|
|
|
|
Two problems:
1) You're missing the enctype on the form:
@using (Html.BeginForm("Test", "ApiSampleUpload", FormMethod.Post, new { enctype = "multipart/form-data" }))
2) You're converting the FormData to a string, so you're submitted data will be file=[object FormData] .
You need to pass the FormData directly to the data parameter instead.
You're also specifying the wrong content type for the upload.
function CallUpload(file) {
console.log(file);
$.ajax({
url: '/api/ApiSampleUpload/Test',
type: 'POST',
data: file,
cache: false,
processData: false,
contentType: false,
success: function () {
alert('Success');
},
error: function () {
alert('Error occured');
}
});
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
1.So should data be like : data: 'file=' + new FormData($('form').get(0))
2.When setting contentType:false I get a 415 (Unsupported Media Type)
|
|
|
|
|
KGr28 wrote: 1.So should data be like : data: 'file=' + new FormData($('form').get(0))
No, it needs to be the FormData object, not a string representation of it:
data: new FormData($('form').get(0)) But in the code you posted, you've already created that FormData object and passed it in as a parameter, so you should just re-use that:
data: file
KGr28 wrote: 2.When setting contentType:false I get a 415 (Unsupported Media Type)
Try explicitly setting it to multipart/form-data then:
contentType: 'multipart/form-data',
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
still get the same error.
|
|
|
|
|
I'm trying to test a C# Web API. I go to a browser and enter "localhost:65078/api/test/test", it fails with "Response status code does not indicate success: 401 (Unauthorized)."
If I use "[http://192.168.51.66:65078/api/test/test](http://192.168.51.66:65078/api/test/test)" then it works. Here's my test code:
private static async Task TestWebAPI(string url)
{
using (var client = new HttpClient())
{
using (var httpResponse = await client.GetAsync(url))
{
try
{
httpResponse.EnsureSuccessStatusCode();
string responsContent = await httpResponse.Content.ReadAsStringAsync();
}
catch (Exception e)
{
_logger.Log(LogLevel.Error, e);
}
}
}
}
There are a lot of responses on Google about this message. Anyone have any insight into what might be wrong?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
httpResponse.EnsureSuccessStatusCode(); This line will always raise an exception is the response is not a success status code—which falls in the range of 200-299 of HTTP status code. Now for your second case, why 401, that means that the server is expecting to read an authentication credential (username/password, bearer token, etc.) which was not passed with the request.
One more thing that I want to highlight here is that, localhost is not 192.168.51.66 . You might be confusing that every request will be forwarded to localhost before being terminated. If a server is listening on, 192.168.51.66, then it will only be listening to requests on that particular IP address. Same goes for port, and protocol (HTTP, FTP, etc.) and I believe that is why you are getting 401.
Solution is either keep using the IP address that you are being provided with, or map the service to listen to HTTP requests on localhost (127.0.0.1) to solve this problem.
HttpResponseMessage.IsSuccessStatusCode Property (System.Net.Http) | Microsoft Docs
HttpResponseMessage.EnsureSuccessStatusCode Method (System.Net.Http) | Microsoft Docs
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
hi,
What is the EigenObjectRecognizer reference in Emgu.CV?
|
|
|
|
|
|
I have an interesting problem
1. Deployed a site to our Dev server.
QA tested the APP
Review passed the APP
2. Deploy for UAT
Now this is where it gets interesting, when you try to call an end point in the API you get a 500 internal server error
What I've tried
1. run dotnet apiDynamicLinkLibraryName.dll - runs / compliles with no isses in the command prompt
2. checked the connection string etc are valid and up to date
3. compared dot net versions that are installed
4. checked what details are in server event log and nothing appears to show there is an issue
5. checked other sites in UAT are working and they do
6. added a simple index1234.html page to the site (as it is an API) so that I can rule out the site not being correctly configured and I get a HTTP 404 not found
6.1 if I remove the site and add just the index1234.html it works
6.2 if I add the site back in the call in 6.1 doesn't work
6.3 but IF I go to site/swagger that works.
Does anyone have anything else that I should check?
Thanks
Simon
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
modified 25-Sep-19 8:45am.
|
|
|
|
|
Have you tried enabling the stdoutLogEnabled setting in web.config and checking the log?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks Rich
worked a treat I was able to resolve the issue
Thanks
Simon
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
button and Align
modified 28-Sep-19 23:54pm.
|
|
|
|
|
I would suggest you ask the question in a wordpress or woocommerce forum.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
I want to change the default image size for a WordPress site.
How I can change it to 250 x 300 pixels?
|
|
|
|
|
I'm wondering if anyone knows what framework(s) Microsoft uses to make its online Office apps (Excel, Word, Outlook, etc.)?
Especially when it comes to Excel, Word, and Powerpoint, I feel like for them to have almost perfectly consistent rendering between the web and desktop versions there must be code sharing going on. However, I believe the desktop apps are developed with .NET and/or C++, so unless they're using some kind of revolutionary WASM framework that isn't available to the public, I don't see how that would be possible. (They're obviously not using Blazor since the Office web apps came well before Blazor was even an experimental project).
Does anyone have any insights?
|
|
|
|
|
|
I'm asking about the WEB version.
|
|
|
|
|
Whichever version, Microsoft are the best people to provide the answer.
|
|
|
|
|
Liquid nitrogen.
And bacon.
".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 loaded up Visio online and the page is Doc.aspx so the main part is c#/asp.net. I'm sure they use JavaScript heavily to keep the page moving and responding well.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
hello...
I found what I believe is a 'glyphicon' button...labeled MAP; & also having the google maps marker icon...it is at this site: https://www.capitalareaofna.org/meetings/
I looked thru the code & couldn't seem to find an image or link of any sort, but would really like to use it as a map link button on my own site.
any ideas?
[OR...does anyone know where I can find a similar button...one that is labeled MAP & also contains a map type icon (I would make my own standard html button, but I really like the one on the above site; & the idea of a map icon on the button in general)]
thanx,
dox
|
|
|
|
|
I need to in the end figure out how to compose PHP code. I've begun with learning HTML as CSS and am interested in what extent other individuals spent learning HTML and CSS before moving onto PHP. Simply searching for some heading and any tips you folks can give.
|
|
|
|