« first day (2355 days earlier)      last day (2588 days later) » 

user7480455
4:00 PM
but this issue has stumped me
 
user7480455
in webforms I think I would be able to update this drop list with a simple user control type thing
 
  <!-- Honestly, no. -->
  <!--
    <table border="0" width="100%">
      <tr>
        <td align="center">No.</td>
      </tr>
    </table>
  -->
  <!-- Fact: Chuck Norris hates layout tables! -->
 
user7480455
here you have to ajax and java all over the place... so I am learning as I go
 
@mikeTheLiar hehe source code easter egg
 
@007 the web is complicated, thats what you're struggling w/
 
user7480455
4:01 PM
no doubt
 
user7480455
I am out of my element
 
user7480455
I wont be doing it again
 
mvc is not that complicated, but you think it is because you're new to web in general
 
user7480455
no beg to differ with you on that
 
user7480455
I have read many reports for programmers that have a time with it
 
4:02 PM
Julia Silge on March 28, 2017

Computer programmers, IT specialists, and hackers are often depicted in popular works of fiction, from books, movies, to TV shows. On the 2017 Developer Survey, we asked respondents about depictions of what it’s really like to be a programmer. This was one of my favorite questions on the survey this year, and analyzing these results has been quite the glimpse into the opinions of our community.

There were 10,983 respondents who answered this question on the survey about fictional characters, and respondents answered one of four possible versions of this question: …

 
@007 the shit you're learning now can get you $100k+/year
 
user7480455
and I'm not even a programmer I have no business with dealing with it
 
user7480455
money is not important to me
 
me either tbh
 
user7480455
my real job I make good money
 
4:03 PM
but, that doesn't mean it has 0 value to me
 
user7480455
and it's most rewarding
 
what is your real job?
 
I'm batman
 
user7480455
well I don't over share
 
user7480455
but anyway
 
4:04 PM
@007 your field isn't oversharing
 
user7480455
to me it is
 
@milleniumbug i laughed at this btw
 
user7480455
but you were giving me some insight on this last week
 
user7480455
why would the ajax call not find the controller action
 
user7480455
I have it typed in
 
user7480455
4:05 PM
at the very least you would think it would goto it
 
have you been able to get your controller action to work independently of js? have you used rest console or the browser to hit that action and verify it does what you want, and how to call it?
 
user7480455
I tried asking the javascript boys but I think they are PHC centric over there.. and had no clue what I was on about lol
 
user7480455
it does not go to the controller that is what I was sayingto you last week
 
@007 thats because you don't describe things well, and if you'd upload the project to github we'd be able to just to look at the code
 
@007 out of curiosity what are you trying to do with your ajax thing?
 
4:07 PM
but we're basically playing 20 questions because you're not good at describing things and won't show us anything
 
like post a form or get data
I've had an issue similar to this in the past
 
he's trying to get data with a post call currently
or was the last time we spoke
 
nope
use get
 
user7480455
Hi Kieran
 
hallo
 
4:07 PM
yep, i tried telling him that
 
use HttpGet instead of Post
That right there is your issue
 
user7480455
I am trying to get a drop list to update
 
Right
 
he wants the parameters to be in a json body instead of the url
 
user7480455
so I have a controller funtion that runs and gets data from the data base
 
user7480455
4:08 PM
I am using the on focus of the drop list to trigger the update of the data
 
ok
 
user7480455
so someone here said use ajax
 
and he isn't testing his endpoint and js code separately, so when he tests, shit breaks and he doesn't know whats going on
 
Right
Post only works for forms
 
user7480455
I found an example that was similar to what I was doing but it is not finding the controller action
 
user7480455
4:09 PM
steve what do you mean I am not testing
 
@Kieran nah you can post json and stuff to endpoints, completely irrelevant of forms
 
@007 if your not using a form to post to your actionresult method, don't use HttpPost.
 
user7480455
when you can to my office the other day,,,,
 
user7480455
I guess you say that I was not trying everthing this lil brain has to make it work
 
Take [HttpPost] & [HttpGet] off
See if it works then
 
user7480455
4:10 PM
I have a form where I am entering the paramerters
 
ok
 
user7480455
so I need to remove the post
 
user7480455
i mean the get
 
Just take the tag off and see if it works
 
user7480455
ok let me try
 
4:10 PM
hi
 
o/
 
@007 i tried telling you 10000x to test them independently.... you aren't giving us enough info to help you, so all we can do is to try to teach it how to fix it yourself, but you don't take our advice, so how are we supposed to help?
 
user7480455
        $.ajax({
            type: "POST",
 
user7480455
should I remove that?
 
return this.collectableTypes[id] ?? null; <- Is this utterly pointless?
 
4:11 PM
yes
 
I want to add a Created column to a table so that every new record will have a default created date. And any existing rows will have a null vlaue. My thinking is this will suffice:
 
I don't ever use that & i have no issues
 
ALTER TABLE [dbo].[Escalations]
ADD
Created DATETIME2(3)
CONSTRAINT DF_Escalations_Created DEFAULT (SYSDATETIME())
 
he can't just remove the post because he needs to send a json body, he needs to update his routes to take two dates for the endpoint
 
@BrianJ getdate() will work
instead of sysdatetime()
 
user7480455
4:12 PM
what is an endpoint steve... you are using words I don;t know the meaning sir
 
your actionresult @007
 
user7480455
in the controller?
 
user7480455
ok
 
...
 
@Kieran ok and what about existing records it will allow nulls? I don't see it specifed
 
user7480455
4:13 PM
so its still not going to the controller action
 
uhhhh
I don't think so...
 
have the controller action return static text "this is a test", and then go to the URL that corresponds to the action
 
user7480455
and I get this error: Failed to load resource: the server responded with a status of 500 (Internal Server Error)
 
user7480455
on the googles
 
@BrianJ are you using MSSQL?
 
user7480455
4:14 PM
how would I do that steve?
 
return "this is a test";
 
And/or are you able to do it via the SSMS ui
 
user7480455
sorry but I don;t know how to do all of the trouble shooting
 
localhost:port/api/controller/action
 
@Kieran yep, so I want it to set the default Created for any new inserted records, not updated. And to allow null value for the existing rows without a Created value
 
4:15 PM
Ok
 
user7480455
but it has parameters
 
and yes it's mssql
 
the parameters should bein the url
not in json for a get call
 
The way that i would do it, would be via the gui
add the extra col onto the table
 
user7480455
man... sorry but you have lost me
 
user7480455
4:15 PM
well I get what you are saying
 
change your stored procedure/sql to include your date stuff
 
user7480455
I just don;t know hoe to go about it
 
user7480455
how
 
however at the same time, I'd take a backup before you do anything c:
 
so, you have a post call, and the reason you had a post call is because you need to send 2 dates in json, correct?
 
4:16 PM
hmm ok
 
user7480455
I guess...
 
user7480455
remember I don't know why I am using jason
 
okay, screw everything you've done, make a new action method on your controller
 
@BrianJ the only problem with doing it via gui though is that it has to drop and re-create the table
 
user7480455
it was just suggested to use ajax
 
4:16 PM
so
theres that
 
user7480455
ok
 
@Kieran well it's a new field so shouldn't need to drop?
 
You'd think that
 
public string Test()
{
return "this is a test";
}
 
But that would be too easy
 
4:17 PM
now, in your browser, go to yourcontroller/test
 
user7480455
would I need to make it a public actionresult?
 
nope
exactly what i have
 
thinking it should be:
ALTER TABLE [dbo].[Escalations]
ADD
Created DATETIME2(3) null
CONSTRAINT DF_Escalations_Created DEFAULT (getdate())
 
user7480455
ahh ok that worked
 
user7480455
neat!
 
4:19 PM
now, if you were to go to that url from javascript
you could store "this is a test" in a javascript variable
and if you wanted to, you could create a drop down, and append "this is a test" to it
 
user7480455
ahh ok
 
user7480455
let me chew on that then
 
user7480455
I just wonder why the other example show all that complicated stuff
 
okay, just think about it, it doesn't solve all your issues, but it'll help you understand whats happening
 
user7480455
sure
 
4:20 PM
now
if you did this:
 
user7480455
I am so out of me league lol
 
user7480455
this is sad
 
no you're not
stop beating yourself up
 
user7480455
lol
 
now if you do this:
var list = new List<string>();
list.Add("this is test 1");
list.Add("this is test 2");

return list;
instead of: return "this is a test"
now see what you get
 
user7480455
4:22 PM
ok let me add
 
(change the return type for the action to List<string>)
 
user7480455
hm do I need to re declare list getting a comple error
 
user7480455
saying its not valid in the context
 
public List<string> Test()
{
    var list = new List<string>();
    list.Add("this is test 1");
    list.Add("this is test 2");

    return list;
}
 
user7480455
ok
 
4:25 PM
go to the url again, what is returned?
 
user7480455
System.Collections.Generic.List`1[System.String]
 
user7480455
that's pretty cool
 
oh, well, im apparently retarded because thats not what i thought would be returned
one sec
 
change return list; to return Json( list, JsonRequestBehaviour.AllowGet);
You should see a list then
 
I'm getting a weird exception when I call Response.Redirect("default.cshtml")
ex: "Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack."

Anyone understand this?
 
4:26 PM
of sorts at least anyway
 
Hello, is somebody here familiar with consuming web services using a wsdl file as well as xsd files?

So my problem is the following. I received a wsdl file that uses xsd files from somebody and I need to consume the webservice. I add a service reference, fill in the path to the wsdl file and then I can name the Service. I also see the available Service as well as the assigned Methods that I need.

But when I click create, the generated code does not contain any of those methods. Instead there are some classes (which I need as well) but it looks like the main service class that I should use
 
Response.AddHeader("REFRESH", "0;URL=default.cshtml");
orks perfectly fine though
 
@Kieran oh yeah good call
 
user7480455
he the fact is that this is just a simple function.. all of the tutorials show a bunch a complex stuff this is straight forward
 
@007 instead of "return list" do "return Json(list, JsonRequestBehavior.AllowGet);
public List<string> Test()
{
    var list = new List<string>();
    list.Add("this is test 1");
    list.Add("this is test 2");

    return Json( list, JsonRequestBehaviour.AllowGet);
}
 
user7480455
4:28 PM
I get an error about coverting
 
let me open up visual studio so i can test before i send 1 sec
 
user7480455
Cannot implicitly convert type 'System.Web.Mvc.JsonResult' to 'System.Collections.Generic.List<string>'
 
well fuck
 
oh how about this
 
I found my solution: http://stackoverflow.com/questions/2041482/unable-to-evaluate-expression-because-the-code-is-optimized-or-a-native-frame-is

I have to use the overload Response.Redirect("string", false");
anyone know why response.redirect is doing this to me though?
 
4:29 PM
Thought that would work
nope
wont work
keep it as action result
 
bummer
 
I think i know what that issue is
return Json(new { result = list }, JsonRequestBehaviour.AllowGet);
Try the above @007
 
nah
 
humour me
 
ok
 
user7480455
4:30 PM
my original attempt was the json result in my code.. interesting so I was on the right track yes?
 
@007
return Json(new { result = list }, JsonRequestBehaviour.AllowGet);
 
@007 don't worry about your other problem, just understand the concepts, then the problem you're facing will become more clear
 
user7480455
The name 'JsonRequestBehaviour' does not exist in the current context
 
user7480455
maybe i missed a step
 
uh
sec
remove the u from Behavior
!!kieran
 
4:32 PM
Feb 27 at 16:02, by Kieran
Thank you for confirming im an idiot c:
 
i did a stupid
@007 return Json(new { result = list }, JsonRequestBehavior.AllowGet);
 
user7480455
this give the conversion eror
 
user7480455
error
 
hm
strange
 
user7480455
do I need a using stament
 
4:33 PM
@007 i just tested this and it works
public JsonResult Test()
      {
         var list = new List<string>();
         list.Add( "this is test 1" );
         list.Add( "this is test 2" );

         return Json( list, JsonRequestBehavior.AllowGet );
      }
 
lol what
it worked as a JsonResult?
 
JsonResult is probably a child of actionresult
 
Last time i tried to use that it didnt work
wierd
 
user7480455
hey ok no errors let me test
 
yep, go to the url
 
4:34 PM
in JavaScript, 29 mins ago, by Kendall Frey
user image
you guys deserve to be jealous too
 
what is it?
zig zag?
 
is that drugs?
 
a 3d printed Kanada flag
 
user7480455
["this is test 1","this is test 2"]
 
i think kendall is on the drugs
@007 aha! you see what it did there!
 
4:35 PM
i thought canada flag had red on it
 
it's not painted
 
user7480455
let me study it
 
so your saying its not done yet
 
and it's a Kanada flag, not a Canada flag
 
the leaf doesn't look similar
 
4:35 PM
@007 it converted your C# list, into json, json is javascript, you converted your C# list into a javascript array
 
@peterpep it's done printing
 
im just being difficult :D
 
user7480455
ahh ok
 
that's better than being hard
 
user7480455
gotcha steve
 
4:36 PM
@KendallFrey but theres no leaf
 
It's not a Canada flag
 
ok
TF is Kanada
 
...is that a ksp flag
 
4:37 PM
@007 now, if you were to go to that url with ajax (javascript), it would return an array, a javascript array, that you could use to.... for instance, inject each array element into an html drop down
 
user7480455
hmmm
 
user7480455
but I think what I am not conveying all that well is that my attempts can;t seem to find the urll
 
so, write up some javascript that goes to that url, and then console.log() it
@007 the url issue is the least of your worries
 
user7480455
hmmm
 
write up a test javascript page, that goes to that action method that you just wrote
 
user7480455
4:38 PM
ok let me ask this
 
ignore your current project
 
user7480455
is java the only way to trigger this type of update?
 
> java
 
you can go to a url in any language
 
user7480455
is there any pure c3 way
 
4:39 PM
java, or javascript, or php, or C#, or vb6
 
user7480455
C#
 
you're going to it from javascript
 
user7480455
ok so if I wanted to update a drop list with out javascript what would be the best way
 
so make a new page, do your whole $.ajax({..}) thing, point to the url that returns
5 mins ago, by 007
["this is test 1","this is test 2"]
 
user7480455
man this apple is to big from my mouth... :(
 
user7480455
4:41 PM
too
 
you already have the ajax code, yes?
just copy and paste it, change it to GET, and change the URL
 
user7480455
I know by sadly I still don;t understand it all that well
 
user7480455
but
 
well, try it, and come back with the errors you get, just like when we were working through the action method that returns a static list
 
user7480455
Like I said... I'm not a programmer so I think I am just over matched in this..
 
user7480455
4:42 PM
yeah I will.. but again is there any other way
 
shut up and do it or i'll gut you like a fish
2
@007 lol no
well, mvc might have something
i'm not too read up on mvc
 
user7480455
come on now be serious... I have been delayed almost 2 weeks tryingto get a drop list updated
 
59 secs ago, by Steve G
shut up and do it or i'll gut you like a fish
 
user7480455
the orginal ist gets it data via a view bag
 
write some js to call your new action method
we just tested the action method, call it w/ js
 
4:44 PM
what is his ajax call?
 
i have no idea, some post call
that doesn't work
 
user7480455
well it's been a lot of things
 
can you paste your ajax call in?
 
user7480455
I have tried every othion I could find in the book
 
user7480455
just not having any success with it
 
4:45 PM
@peterpep he doesn't understand the fundamentals of what he's trying to do, i'm just trying to get him to understand the fundamentals in a project outside of the one he's struggling in
 
gotchya
 
user7480455
in past apps updating a drop list was so simple..
 
user7480455
this thing is a brain killer
 
he can't post code, he can't describe well what his issues are, the only thing left for me to try is to teach him how it works in a project thats not his
@007 in the past it was exactly the same thing as it is now
 
user7480455
and don;t think I don;t appriciate the help!
 
4:46 PM
I do think you don;t have an apostrophe key
 
let me know when you run into issues getting your ajax to work w/ that new method call
@KendallFrey it's sad that I don't even see that anymore
 
user7480455
yeah...
 
@SteveG cataracts?
 
something
 
user7480455
let me ask this...
 
user7480455
4:52 PM
I have a $(function () {$('#RES_E').focus(function () {GetRoute();});});
 
user7480455
The GetRoute function I do something generic like this
 
user7480455
that runs a function without having to go a url
 
user7480455
I think that's what is blowing mind.. is that I don;t want to navigate away from the page I am on
 
user7480455
I just want to run a function that is in the controller and say on the page I'm on
 
user7480455
maybe that's what I have not been explaining well
 
4:57 PM
write an ajax call to call that endpoint
that you just created
have the ajax happen when you push a button
 

« first day (2355 days earlier)      last day (2588 days later) »