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

user7480455
7:00 PM
even the scaffolding wizard makes it seem like get it getting data and that post is posting it back
 
the only thing that should be talking to your database is your C# code, you use javascript to call that C# code w/o refreshing the page
 
user7480455
right ajax does not post back
 
user7480455
so confusing...
 
ajax posts, it just doesn't cause the page to reload
the server is getting data, and is returning it
it just isn't causing the page to reload
 
user7480455
so when you go to a url to run a function you are not rally leaving the page?
 
7:02 PM
@007 - This is the underlying feature for ajax. You should read a little bit of this page: developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest
 
user7480455
so if I am on my index page and the script sayis url = blah bla... it just going there to run something?
 
user7480455
thanks for the link
 
user7480455
I will read up on that..
 
user7480455
but you guys get what I asking there...
 
user7480455
why does it have you go to a url
 
7:04 PM
read the link
 
user7480455
to me that seems like you would leave the page you are on
 
that travis just posted
it literally answers your question in the first 2 sentences
 
user7480455
funny let me read again
 
"it provides an easy way to retrieve data from a URL without having to do a full page refresh. "
ajax is about retrieving data
or, changing data on the server
 
user7480455
see I read this t provides an easy way to retrieve data from a URL without having to do a full page refresh
 
user7480455
7:05 PM
what url
 
Any url?
 
return "this is a test";
 
user7480455
yeah I read that
 
you know that action method you made that returned "this is a test";
 
user7480455
yes but I typed in that url
 
7:06 PM
You would get "this is a test" back
 
@007 yes!
 
when you cant find a solution. Create it
0
A: Why does my user return null?

SkullomaniaThere is no material online on how to create a password token with UserManager. For anyone having this issue in the future this is how it is resolved. 1.) Create a new folder called MyClasses and create and add the following class public class GmailEmailService:SmtpClient { // Gmail user-na...

 
now, if you want to call it from javascript, you type it in the javascript ajax call
 
Boom!
 
user7480455
man I need to go back to english school as I am not doing a good job asking questions
 
user7480455
7:07 PM
let me try again
 
javascript will "go to that url" without refreshing the page, will grab that string "this is a test"; and will return it to your page, all without refreshing the page
 
user7480455
you have to but on your basic hat here just work with me
 
user7480455
When I start my app lets say I am on the create view
 
user7480455
it is localhostnumber/controller/create/schtml
 
user7480455
ok you had me type in controller/test
 
user7480455
7:08 PM
and it returned data
 
user7480455
but I wantthat data on the create page
 
user7480455
I don;t want to go to another url
 
user7480455
my drop down is on the create page
 
user7480455
get what I am saying
 
user7480455
I get that if I goto the url it will do what I want
 
7:09 PM
@007 - Did you click test on the example I gave earlier at dotnetfiddle?
 
user7480455
but I want a simple function to run on an exiting page
 
user7480455
yeah that was pretty sweet by the way!
 
user7480455
I need to study that more to see how I can push that into my app
 
The alert was the server value, you could easily place it in a select <option> on the page
 
user7480455
I appreicate that if you missed my thank you to you!! I own you your fav food or something!
 
7:11 PM
no one owns my food.
 
user7480455
same to use steve and any one that helped my non programming ass!
 
lol j/k don't worry about it
 
user7480455
I owe
 
But really, you can return a whole set of data as well
 
var test;

$.ajax({
    url: "controller/test",
    type: 'POST',
    data: $("#yourForm").serialize(),
    success: function (result) {
        test = result;
    }
});
@007
 
7:11 PM
Do you know what JSON is?
 
user7480455
I don
 
user7480455
t
 
so, you went to your "controller/test" url, through javascript
no new page
 
user7480455
I don't know any of the scripting stuff
 
JSON is how you pass back a set of data instead of one value
It is basically just a string structure that is easy to parse.
 
7:12 PM
@TravisJ he doesn't understand passing back 1 value
 
user7480455
well I have that
 
I just keep flooding until something clicks :P
 
user7480455
I have this contentType: "application/json; charset=utf-8",
dataType: "json",
data: JSON.stringify(data),
 
lol
var test;
$.ajax({
        url: "controller/test",
        type: 'POST',
        data: $("#yourForm").serialize(),
        success: function (result) {
            test = result;
        }
    });
 
user7480455
but you know I just got that from another post on a site a bout a week ago
 
7:13 PM
look at that 007, stop typing
 
user7480455
I have that
 
user7480455
I have a ajax call
 
user7480455
that's what I was saying last week
 
you asked "how do i go to that url, i want it on my main mvc view"
 
user7480455
let me post what I have
 
7:14 PM
5 mins ago, by 007
but I wantthat data on the create page
 
user7480455
maybe you will see what
 
1 min ago, by Steve G
var test;
$.ajax({
        url: "controller/test",
        type: 'POST',
        data: $("#yourForm").serialize(),
        success: function (result) {
            test = result;
        }
    });
now, the javascript variable "test" has the value returned from "controller/test" url
 
user7480455
I have something that looks like your stuff
 
user7480455
ok I am pressing control K
 
stop playing with your complex example
 
user7480455
7:15 PM
$('#RES_VEH_ID').focus(function () {


// TODO: Validate input


var data = {
StartDate: $('#RES_START_DATE').val().trim(),
EndDate: $('#RES_THRU_DATE').val().trim(),
StartTime: $('#RES_START_TIME').val().trim(),
EndTime: $('#RES_END_TIME').val().trim()
};
debugger;
$.ajax({

url: '@Url.Action("UpdateAvailVehicles", "VRS_REQUEST")',
//url: "http://localhost:50061/checkin/app/login",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: JSON.stringify(data),
success: function () {alert('Success');
 
play with a simple example to understand the concept
 
user7480455
why does it not format??
 
press the up key twice. hold the control key. press the k key. press enter
 
user7480455
oh he say control K last week no wonder it does not format
 
@007 - Your setup is incorrect
 
user7480455
7:17 PM
yeah... it just wont goto the break point
 
user7480455
I have tired about 10 iterations and it will not goto the controller break point
 
url: '@(Url.Action("UpdateAvailVehicles", "VRS_REQUEST"))',
contentType: 'application/json',
traditional: true,
data: JSON.stringify(data),
success: function(serverResponse){
 
what does traditional do?
 
anyone used HtmlAgilityPack ? how to get ALL the classes that include 1 class name ?

for Example i got Class="Important NotImportant" and Class="Important UnImportant" i want to SelectNode both of them that got Important !
 
@SteveG - traditional allows for arrays and nested objects I believe
 
7:18 PM
ah
 
@TravisJ Isn't he missing type = 'POST'?
 
yes, that too
 
Using :
foreach (HtmlNode link in doc.DocumentNode.SelectNodes("//div[@class='Important']"))

only show me the one with ONLY important class name
 
user7480455
I took that out today
 
user7480455
so put that back
 
7:18 PM
I've sent objects and arrays without tradional before
default = true?
 
i'm not sure, i know i have too, but maybe he means the root is an array or something?
 
If you don't use that your arrays look like this
"a[]=1&a[]=2&a[]=3" but MVC wants
"a=1&a=2&a=3"
 
From jQuery: If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below).
 
user7480455
ok edit
 
pressing up switches you between your messages
press up right now, and you can edit your last message
now, press up and hold control and hit k
then press enter (save changes)
 
user7480455
7:21 PM
$('#RES_VEH_ID').focus(function () {


// TODO: Validate input


var data = {
StartDate: $('#RES_START_DATE').val().trim(),
EndDate: $('#RES_THRU_DATE').val().trim(),
StartTime: $('#RES_START_TIME').val().trim(),
EndTime: $('#RES_END_TIME').val().trim()
};
debugger;
$.ajax({
type: "POST",

url: '@(Url.Action("UpdateAvailVehicles", "VRS_REQUEST"))',
contentType: 'application/json',
traditional: true,
data: JSON.stringify(data),
success: function (serverResponse) {

},
error: function (xhr, textStatus, errorThrown) {
 
user7480455
lol
 
user7480455
jjhc
 
does your code not have any spaces in it?
 
user7480455
still no go
 
user7480455
i don;t know man.,..
 
7:22 PM
Does your updateavailvehicles actionresult have [HttpPost] on it?
 
user7480455
I am out of my element
 
user7480455
I took that off too
 
Also, keep in mind, if the model does not properly bind precisely, then it will think the route is wrong
it needs the [HttpPost] on there
Don't forget, you have to run the project in order for the server side change to update
 
Yeah, that was the next place I was going.
I am guessing you haven't messed with the default routing yet...
 
Yeah, it would help if you showed the model that is being accepted in the actionresult
 
user7480455
7:23 PM
ok I have added the post pack to it
 
user7480455
back
 
okay, can you should the parameters of that actionresult as well?
 
Have we really fallen so low that we need to specify that you need to actually run your project in order to see changes?
 
Because using json.stringify expects just one parameter to be a class with the properties named exactly the same as what you are sending
 
user7480455
let me post the action methof
 
user7480455
7:24 PM
d
 
control k, while the text is still in your edit window, not after you send
 
user7480455
sorry I have to create this code so I can post..
 
@mikeTheLiar - In vs if you make c# changes to the cshtml view it will change without rerunning the project
 
@007 wut
 
user7480455
as this does notcome for the actual application
 
7:25 PM
Did you not write the controller code yet?
 
he wants to sanitize it for the public
 
user7480455
edit
 
user7480455
[HttpPost]
//[Route("VRS_REQUEST/UpdateAvailVehicles/{StartDate},{EndDate},{StartTime},{EndTime}")]
//SEE:http://stackoverflow.com/questions/19663762/mvc-ajax-post-to-controller-action-method
public ActionResult UpdateAvailVehicles(string StartDate, string EndDate, string StartTime, string EndTime)
{

ViewBag.VehList = new SelectList(GetAvailVehicles(Convert.ToDateTime(StartDate), Convert.ToDateTime(EndDate), TimeSpan.Parse(StartTime), TimeSpan.Parse(EndTime)));

return Json(ViewBag.VehList, JsonRequestBehavior.AllowGet);
 
user7480455
christ
 
7:25 PM
stop, don't type anything else
up once, hold control, press k, press enter
 
user7480455
ok
 
4 buttons
god dammit
i give up
 
lol
 
hahahaha
 
user7480455
yes that what I have been doing except for the up arrow
 
7:26 PM
Failure is always an option.
 
user7480455
hey man good be the firewall or somethign
 
user7480455
thing
 
user7480455
you seem doing it
 
user7480455
- m
 
So the problem is that using stringify you send one string
 
7:27 PM
I have never seen the route attribute before...
 
and your actionresult has 4 parameters
So the route misses
and you never hit your breakpoint
 
user7480455
I'm not all that bright but Do have muscle memory
 
user7480455
Ahhhh ok
 
??
ugh
 
What transport protocol does WebRequest use?
 
7:28 PM
http
 
Can't find it on msdn...
 
oh transport
uh
 
yeah....
that's application
 
user7480455
ok so what would be a better option over the string option
 
public class DataHolder
{
 public string StartDate { get; set; }
 public string EndDate { get; set; }
 public string StartTime { get; set; }
 public string EndTime { get; set; }
}
public ActionResult UpdateAvailVehicles(DataHolder dataModel)
 
user7480455
7:29 PM
just wondering
 
@Nathvi tcp
 
how did you find that out?
@SteveG
 
i googled "does http use tcp or udp"
 
Yeah, it's not going to the route. To do it your way the URL string would need to be
 
gotcha
 
user7480455
7:31 PM
ok so does the above go into the controller?
 
user7480455
under the httppost
 
"The OSI model allows higher layer protocols to run over any underlying protocol providing the correct services. HTTPS is HTTP using SSL/TLS security. SSL/TLS typically runs on top of TCP, but there is nothing to stop you from running it on UDP, SCTP or any other transport layer protocol."

Wrong?
27
Q: Does HTTPS use TCP or UDP?

StevenDoes HTTPS use TCP or UDP?

 
user7480455
also is there a way to save this awesome fiddle thing?
 
no
yes
maybe
 
@Nathvi it says it normally runs on tcp, i would assume to get it to run on something else would be non-trivial so for all intents and purposes, http runs on tcp
 
7:34 PM
You would have to do it this way with your current route.

url = $"~/VRS_REQUEST/UpdateAvailVehicles/{data.StartDate},{data.EndDate},{data.StartTime},{data.EndTime}",
//rest of ajax
@007
which, to put lightly, is error prone
 
user7480455
Ahh thanks Tyler.... That's ok . At this point two weeks dealing with this... I have no Fuks left to give and no power ups or level ups.... I'm spent mate!
 
user7480455
hmm it's not liking that format
 
Your browser might not support javascript string interpolation
 
user7480455
its visual studio that is blowing up
 
user7480455
oh it's just warnings
 
7:40 PM
Okay, what is the error?
oh
Was about to say, javascript shouldn't blow up VS.
 
user7480455
it's giving me a long red line...
 
Flat or squiggly?
 
user7480455
I think that's what I find so odd about the script stuff... one way shows the Url:
 
user7480455
then the line you gave me is url =
 
user7480455
is there any standard?
 
user7480455
7:42 PM
squigs
 
sorry, it should be url:
 
user7480455
and then all the other : have red squigs
 
It's object notation
 
user7480455
is there a way to post a screenshot?
 
Hold on...
$.ajax({
url:  $"~/VRS_REQUEST/UpdateAvailVehicles/{data.StartDate},{data.EndDate},{data.StartTime},{data.EndTime}",
//the rest of the object...
 
user7480455
7:45 PM
ok I put him in...
 
user7480455
what about the type: "POST",
 
yes
put that in too
Still, you should be using the other one from Travis...
 
user7480455
I am bit it does not like
 
user7480455
gonna try to paste a screenie
 
user7480455
nope cant paste a screen shot
 
user7480455
7:47 PM
I guess you have to be a higher level to share images?
 
Use imgur
 
user7480455
it's blocked for me
 
user7480455
hmm
 
just upload with the button to the right of the text box
 
user7480455
I only have send
 
user7480455
7:50 PM
no upload on my screen sadly
 
........
 
user7480455
I'm telling you I have the Kids Table Stack Exchange
 
user7480455
or overflow
 
.............
............
........
....
 
user7480455
maybe I need to download firefox
 
7:52 PM
..
.
 
user7480455
it could be the google browser?
 
...
 
user7480455
are typing dots?
 
.....
 
user7480455
or are my 82 year old eyes calling it quites
 
user7480455
7:53 PM
quits
 
...
 
user7480455
gonna exit and come back
 
Hello!
 
hai!
 
user7480455
ok
 
7:55 PM
so 007 fixed his code problem that he had last week?
 
user7480455
yeah still not upload button
 
nope
 
OMG
 
still trying to teach him how to press 2 keys, control and k
 
user7480455
hey easy
 
7:56 PM
:p
i kid i kid
 
user7480455
as you can see I don't have all the features
 
im playin
 
user7480455
but I think I am close.. these guys have really gone above and beyond...
 
:D
 
user7480455
at 82 years it hard to grasp new things
 
7:57 PM
ha ha
 
user7480455
now I am trying to post a screen shot
 
82 years old, no hands, blind and... what else?
 
at 82 it hard to press keys
 
user7480455
3 fingers I have hands
 
oh thats right
 
user7480455
7:57 PM
I lost them in Fulham in a factory mishap
 
sounds like you need some snagit in your life
 
:D
 
user7480455
how do you guys no about all these neat sites!! ???
 
user7480455
cool
 
user7480455
posted! Thanks Mr .N
 
you dont escape the string
 
user7480455
hmmm
 
user7480455
I hate to ask but what is that?
 
actually idk what is going in this asp.net...
 
user7480455
8:02 PM
idk?
 
i dont know...
 
user7480455
oh damn LOL
 
user7480455
ok
 
user7480455
sorry
 
user7480455
Tyler asked me to put that guy in because I need to pass my date infp
 
user7480455
8:03 PM
info
 
user7480455
seems like it was the $ (the us dollar sign)
 
user7480455
url: "~/VRS_REQUEST/UpdateAvailVehicles/{data.StartDate},{data.EndDate},{data.StartTi‌​me},{data.EndTime}",
 
user7480455
no squigs with the above
 
user7480455
hmm still getting a 404 page
 
user7480455
"http://localhost:50296/VRS_REQUEST/~/VRS_REQUEST/UpdateAvailVehicles/%7Bdata.St‌​artDate%7D,%7Bdata.EndDate%7D,%7Bdata.StartTime%7D,%7Bdata.EndTime%7D"
 
user7480455
8:16 PM
not sending over date values
 
user7480455
8:53 PM
hi steve are you on?
 

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