last day (1779 days later) » 
11:00 - 21:0021:00 - 00:00

11:25 AM
room topic changed to ASP.NET MVC: Discussions relating to ASP.NET MVC and Razor, etc. etc. [asp.net-mvc] [asp.net-mvc-4] [razor]
 
lurk
 
room topic changed to ASP.NET MVC: Discussions relating to ASP.NET MVC and Razor, etc. etc. [asp.net-mvc] [asp.net-mvc-4] [c#] [razor]
lurky lurk
Everyone I want here is here apart from @AndréSilva who should be here! Grrrrr
 
put VB in there, can't exclude the VB people
 
c# ? you mean vb.net guys aren't welcome? :)
 
They make me sad, but fiiiine
room topic changed to ASP.NET MVC: Discussions relating to ASP.NET MVC and Razor, etc. etc. [asp.net-mvc-4] [c#] [razor] [vb.net] [vb.net]
 
11:26 AM
lol no i'd rather drop language tags completely
you're not really bothered about their language are you?
 
they're not really needed are they?
 
Argh
 
though, admittedly its in wpf too
and i kinda gave the same argument there
 
Somehow I ended up with two 's
 
i'm not sure why we didn't drop the language
 
11:27 AM
remove one of them and leave it at that
 
seems like you wrote it twice?
 
room topic changed to ASP.NET MVC: Discussions relating to ASP.NET MVC and Razor, etc. etc. [asp.net-mvc] [asp.net-mvc-4] [razor]
 
I dunno
there that'll do
 
yea
 
done, leave it
 
11:27 AM
language agnositc
right - i know NOTHING about asp/asp.net
 
but I'm an atheist
 
so i'm just gonna lurk and perhaps learn something :)
 
Yay my rep is rounded to 7k in chat ^_^
 
one line
two line
 
@Sean you don't believe in language?
 
11:28 AM
DAMNIT
one line
two line
three line
four line
awwwwwwww yeah
 
oh! i can flag!
 
"Sean
1337"
 
Maybe we need at least 1 line in here related to ASP.NET MVC
 
first room flag! :)
yes go ahead
 
flag?!
 
11:29 AM
@ViewBag.Title
^
 
@Sean spammer!
 
sorry, was trying to get my 1337 to show up
 
Ok, ok I am here..
 
Now you can ask all sorts of questions and I can leech of the answers
boom
 
11:35 AM
My question is: How can you guys not get lost with all those weird stuff that mvc does ?
 
My counter-question is: What weird stuff does MVC do?
 
There is a file that holds the Title that gets imported in the page but the page can hold a Title that is written in the page...
Too much pinging though different files without any need actually ._.
At least it was my first impression..
 
Nothing "holds" the title
The Title (ie. ViewBag.Title) is defined in HomeController.IndexAction()
Since that is the first thing executed in the whole pipeline, it's available to anything underneath it
Index.cshtml is next, if that were to change ViewBag.Title again, it would be changed for anything underneath it
_Layout.cshtml is loaded as the layout by Index.cshtml, so the ViewBag.Title available to that, is whatever it was throughout the context of Index.cshtml
 
So you mean that, before loading the actual title, it reads about 3 different files ?
 
11:39 AM
HomeController, _Layout and Index..
 
HomeController is compiled, it's code
 
And _Layout and Index ?
Just interpreted by the compiler right ?
 
and the "actual title" doesn't mean anything, you don't need it at all. It's just used in the sample file so you can change the title in the layout per Action
They're compiled/cached at runtime
 
How can you not find that confusing ?
 
What is confusing about it
 
11:41 AM
We just discussed about the hierarchy of a damn title load..
 
A request comes in - The routing layer goes oh, what controller is this? Home, and what Action? Index
No we discussed the whole MVC architecture; It's that simple.
 
Just to substitute to <title>Actual Title</title>
 
But you don't need to use it
 
But wtf
 
You could put <title>My big hairy head</title>
 
11:42 AM
ViewBag can contain anything
 
And leave the ViewBag out
 
Using <title>@ViewBag.Title</title> is merely using ViewBag so you can set .Title in the action
 
Say you wanted to change the title per user, that kind of thing
 
Yea, ViewBag.Username = User.Identity.Name; - in view: Hello, @ViewBag.Username!
 
It's only the same as setting Page.Title except that ASP.Net pages let you set it through the <title> tag if your <head> has the runat="server" attribute
You don't have to use it at all =]
(omg I understand it)
 
11:46 AM
Damn, I really need to finish my site and get those tutorials I wrote on there
SO MANY THINGS TO DO
 
Time, the most precious resource of all
You know what's horrible? When you see csc.exe and vbc.exe going nuts next to each other
 
:D
From Ke$ha to Lang Lang in 0.8 seconds.
 
12:16 PM
hi all,anybody has idea on web plus x6
 
hello there
:D
 
@steve The web design package?
Hey @E.LDunn
 
howdy mr rudi
 
How you?
 
@RudiVisser I have created buttons in this package and I want to use this buttons in my asp.net mvc application
 
12:20 PM
room topic changed to ASP.NET MVC: Discussions relating to ASP.NET MVC and Razor, etc. etc. [asp.net-mvc] [asp.net-mvc-4] [html5] [razor] [xhtml]
@steve You should be able to copy over the generated HTML/resources (images etc) into your view(s) just fine. What's the actual problem?
 
Is there any additional resources required to display this?
 
If your button is an image, then yes of course
Or if there are custom styles in a stylesheet somewhere being applied to your button
 
@RudiVisser actually I have created a button and in the page source code,I have copied the meta tags and stylings,I have included in my view page but it is not displaying as it is
 
@steve Do you have a screenshot of what it's meant to look like and what it does look like?
 
@RudiVisser yah,I will send it,jst a moment
@RudiVisser 1 st one created in web plus ,after including styling in my view it is displaying like this
 
12:35 PM
Okay when you say you've "included styling", what exactly have you copied?
Surely the WebPlus thing generates HTML/CSS/Images, they are all needed to achieve the same effect when copied over
 
its taking default styling you need to override it
 
body{margin:0;padding:0;}
.Button1,.Button1:link,.Button1:visited{background-image:url('wpimages/wpba23ff89_06.png');background-position:0px 0px;text-decoration:none;display:block;position:absolute;}
.Button1:focus{outline-style:none;}
.Button1:hover{background-position:0px -162px;}
.Button1:active{background-position:0px -81px;}
.Button1 span,.Button1:link span,.Button1:visited span{color:#ffffff;font-family:"Trebuchet MS",sans-serif;font-weight:normal;text-decoration:none;text-align:center;text-transform:none;font-style:normal;left:17px;top:24px;width:81px;height:17px;font-size:11px;displ
and button defined like <a href="javascript:;" __AddCode="ToHyperlink" id="btn_1" class="Button1" style="position:absolute;left:361px;top:243px;width:119px;height:81px;"><span>Bu‌​tton</span></a>
 
you need your background image
background-image:url('wpimages/wpba23ff89_06.png')
 
Okay and is wpimages/wpba23ff89_06.png actually in the folder off from where your CSS is?
So you have for example:
/Content/Site.css
/Content/wpimages/wpba23ff89_06.png
 
can i include any resources to my application?
 
12:38 PM
Images etc? Of course
But paths in CSS are relative to the CSS file itself, so if that CSS is in /Content/Site.css, your images must be in /Content/wpimages/..
 
can u tell me where we can get this images?In my installation folder i have checked but i didn't get any images
 
They will be in the path where your style is for your site in Web Plus, probably
 
@RudiVisser thank u
 
No problem
 
I will check it
 
1:27 PM
Any luck @steve?
 
@RudiVisser no
I think I have to download the images package separately
 
But can't you preview your site from Web Plus 6 and it works fine?
 
I don't want to create my site in web plus,I just want to use the web plus tools in my application
 
Yes I understand, but if you preview it in Web Plus, it will put the files on disk somewhere; Those are the ones you need
 
ok @RudiVisser
I am leaving bye
 
1:33 PM
Bye!
 
2:26 PM
woof
 
MEOW
 
moooo
 
 
1 hour later…
3:54 PM
Oink.
 
4:16 PM
moo
 
 
2 hours later…
6:26 PM
@RudiVisser you're name is in italics!
 
6:37 PM
So this is where EL hangs now
@JohanLarsson He created the room.. automatically makes him a mod.
 
@LewsTherin and in Wpf room
We should all start lurking here imo
 
Yeah I will be here as I am working with MVC extensively
Any of the "experts" in here?
 
Here's a question: When I serialize an MvcHtmlString, it's turning up empty when I try to access it on the view. I'm guessing it's because it's wrapped in {}, and the serializer just blasts it out or something. Any idears?
Note that I'm returning a json object, running JSON.parse() on it, and all the other stuff is dandy but the MvcHtmlString just shows up as{}
 
Sample string & code?
 
Sure...
            // Here's the MvcHtmlString.
            content.ContentTextBlobRaw = MvcHtmlString.Create(content.ContentTextBlob);
later...
        JavaScriptSerializer serializer = new JavaScriptSerializer();
        string contentPiece = serializer.Serialize(result);
        return Json(contentPiece);
 
6:45 PM
Good day
 
Hey Rudi
 
How're you @LewsTherin ^_^
 
the "result" is a series of objects that contain objects with fields, one of which is ContentTextBlobRaw
 
Hey @JohanLarsson!
 
Tired of C# at this web dev at this stage ;) You?
 
6:46 PM
And some javascript:
 
@RudiVisser How is it accessed in your View?
 
@RudiVisser You see the question right? My estimate is that you are 7x better than I am, you on it?
 
@JohanLarsson Check FB if you have a min :)
 
CKEDITOR.instances.myEditor.setData(data.ContentTextBlobRaw); // That guy's empty, other properties are fine.
 
Yeah, one sec and I'll take a look, just got a overflowing pan
@LewsTherin I'm alright, just tired, looooooooong day at work
 
6:49 PM
The string itself: <p> Welcome to the home page which is used for demo purposes and so forth.<img alt="mail" height="20" src="/ckeditor/plugins/smiley/images/envelope.gif" title="mail" width="20" /><img alt="smiley" height="20" src="http://localhost:4556/dcms/ckeditor/plugins/smiley/images/regular_smile.gif" title="smiley" width="20" />&copy;</p> <p> &nbsp;</p>
nothing too exciting there.
 
@MrBoJangles On debug what is contentPiece?
 
A question.. how would I handle an ajax post? if the user clicks the button twice it is screwed.. So do I disable the button and on success clear the fields?
 
it's a string
kind of a big one
 
@LewsTherin You can use @Html.AntiForgeryToken, sec
 
Antiforgerytoken?
 
6:52 PM
ya
I believe that will still validate on an action that returns Json
Could be wrong though, if I am you can always do something similar to that
 
Shortened with ellipses...\t\u0026nbsp;\u003c/p\u003e ","ContentTextBlobRaw":{},"ContentBlobSummary":null, ...
 
@RudiVisser Ok I will have a read thanks..
 
(shortened by me, not by the code)
 
@MrBoJangles alright and whilst debugging if you take a look at result and check where content is, is the MvcHtmlString in there?
Because I'm wondering if it's just failing to encode the MvcHtmlString class as JSON, so converting it to a plain old string before putting it in the object might work
 
That, according to this link, is exactly the problem: patridgedev.com/2012/07/05/…
I just switched it to a string. Should be in fat city now.
Thanks for the second witness, so to speak.
 
7:10 PM
No problem :)
 
uh oh
 
Sup
 
7:40 PM
hej @TravisJ
 
what is all this nonsense about? honestly, which one of you is writing mvc in vb?
@Johan - Hello :)
 
If you ever get bored with talking about boobs in C# this room might be an option
 
Well, we do have all the talent in here.
But I must be going back to being productive at the moment.
 
but you will lurk right?
 
Agh, stuff keeps getting appended to the url in an ajax request..
 
7:45 PM
I will lurk. And I accidentally answered a question just now.
 
For example "Cart/ShoppingList" will prepend "Home/Cart/ShoppingList".. I think I know why.. but how to stop that?
 
PRO DU ct ivit y in here.
 
@TravisJ :O
 
Are you using a razor helper to generate the url?
 
Nope
 
7:47 PM
Is the view located in an area?
 
area? wut..
No Views\ViewFolder\.cshtml
And the script is in a .js file
 
Hey @TravisJ, no VB :P
 
@Lews - what is the signature for your action method?
@Rudi :P
 
@LewsTherin What's your code to make the ajax request? I mean are you setting Controller explicitly or just letting it use default?
 
ActionResult ShoppingList(int id1,int id2)
@RudiVisser url: "Cart/ShoppingList"
A property in the ajax object.
 
7:52 PM
That's not going to work is it
 
Why not?
 
The relative path from there is /Home/Cart/ShoppingList
Use /Cart/ShoppingList
Or even better, url: "@Url.Action("Cart", "ShoppingList")"
 
Would razor work in a .js file?
 
yes, use the url.action helper
no, it wont
 
7:53 PM
sad but true.
 
Dang.. so I have to move my script over to the cshtml file.. bumm.
 
No no no
There are a couple ways to stop you from moving the whole script, just move the target URL
Stick it in a a) normal element's data-# attribute b) hidden input or c) Make your request thing a class, include the <script> tag and then use MyAjaxHelper.CartUrl = "@Url.Action()"
 
I've seen this data attribute in some source code.. what is it for?
 
Thanks!
 
7:58 PM
No problemo
 
@Lews - data attributes are teh bomb!
 
This room is going to such a great lurking experience!
Until I try to start doing things and asking questions, then it is going to be all crickets :)
 
@Lews - Basically what it allows you to do is store data inside directly on your element. All you do is
element.setAttribute("data-WHATEVERNAME","data goes here");
and then to get it later you do
var mydata = element.getAttribute("data-WHATEVERNAME");
 
So I can store id's in there?
 
yup
data-myid="56"
element.getAttribute("data-myid");
 
8:01 PM
What if the browser doesn't use html5 isn't it screwed?
 
all browsers support it back to like ie5
 
.getAttribute is all there
 
Oh this is wonderful.. I've been using shit hidden fields.
 
you can add arbitrary attributes to HTML elements, doesn't mean the browser will do anything with them, but it won't touch them either
 
lol
^^
 
8:02 PM
SharePoint makes extensive use of them and it does my head in xD
 
It's nice to be in a room where I don't have to run my NSFW script
 
ms-screwYourDayUp="true"
 
What if the user manipulates the ids in the data fields?
Wouldn't that screw shit up as well?
 
yeah
 
That's the idea @TravisJ! I'm thinking Kendall won't be liking "yet another dupe c# room", so we don't have the tag :D
 
8:03 PM
screw stuff up, indeed it would
 
lol, that is pretty intrusive though, don't use it for anything that must be secure.
 
@LewsTherin It's not like you're storing sensitive data in there
 
@Rudi :D
 
@RudiVisser Yeah, but id's lead to sensitive data?
 
Server side scrubbing is important.
 
8:04 PM
@LewsTherin If they can get it out of your HTML attributes, they can get it out of hidden fields
 
@RudiVisser what does it matter what anybody thinks really? I counted five Android rooms this morning
 
@Sean Oh I know.. which sucks as well
@TravisJ ?
 
@Lews - Don't trust what the user posts if you are worried about them.
 
@JohanLarsson Nope, just funny at the WPF rant :D
Yay, 7k!
 
gratz
 
8:06 PM
@RudiVisser congorats!
 
@TravisJ Unless I store the id in the session variable or another info.. and compare.
@RudiVisser Hey nice! :P
@TravisJ I see you reached 10k as well :P
 
@RudiVisser I missed the wpf rant
 
@Lews - :D
 
still sitting here at 1337 rep, loathed to be useful atm xD
 
8:06 PM
@JohanLarsson Nothing important, just Kendall ranting on that the c# room had and that the WPF room was a "dupe" so he wouldn't join it
 
@Lews - If you foresee a situation where the integrity of your data can be compromised, then it needs to be handled. These situations can depend on the context of the amount of data and ability exposed to the user.
 
@TravisJ you did notice @Pheonixblade9 is present right?
 
@TravisJ Eh.. I will worry about that for later.. :P at least get it working rofl.
 
:)
@Johan - Yeah I saw @Pheonixblade9, why?
;)
 
@TravisJ is he SFW?
 
8:13 PM
Yes.
 
Phoenix is the one that's slept with all our mothers, right?
Or is he the one in the place with the cool name that doesn't really like me
 
the mothers
I think that is just an endearment thing though.
 
@RudiVisser I would be surprised, two fine gentlemen should get along imo
 
Is there a way to create a partialview without the layouts interfering?
For some reason the partialview still uses the layout.. despite explicitly saying without layouts..
Oh fuck.. I know why. It has to be in the Shared folders.. :S
 
8:31 PM
oh damn you know why
 
Agh, here is another crap... I'm having a lot of crap going on.
I'm using jquery dialog box. So a div acts as a "dialog"..
 
@LewsTherin something like FancyBox?
 
When the script opens a dialog, I make an ajax call, onsuccess the dialog/div gets filled with the data.
@Sean Yeah, I was using that originally then I switched to the default one.
 
ok probably not relevant, carry on
 
For some reason after the callback.. the script doesn't work.. the buttons won't submit, or after closing the dialog box nothing works. The way I got around that was call the init function when ajax#onsuccess executes..
Surely there is a better way?
Because right now.. feck all works.
The hack used to work.. now pfft
 
8:38 PM
How do you mean it doesn't work after the callback? Can you put an alert in the callback and have that pop up?
 
function ShowDialogData(evt) {
     $("#dialog").dialog("open");
    $("#dialog").html("Loading..");
    $.ajax({
        type: "GET",
        url: $("#shoppingcarturl").val(),
        data: {
            userid: id[1],
            cartid: id[2],

        },
        success: function (data) {
            $("#dialog").html(data);
        }
    });
}
When the success executes.. it displays the data in the dialog and the dialog collapses
But stuff in the script doesn't execute any longer.. so if I close the dialog and try to open it again.. I get the finger
 
so it's auto-collapsing as if someone had clicked the close button?
 
Yup, but the dialog is still there.. just empty
 
Ok so maybe move the code into another function and call it on the open event of the dialog?
Will write an example
 
Shouldn't make a diff.. and btw I was wrong about the partial view.. it still uses the layout
Oh! It's working!
The damn partial view was the fuck up
@{
    Layout = Request.IsAjaxRequest() ? null : "~/Views/Shared/_Layout.cshtml";
}
35
Q: MVC 3: How to render a view without its layout page?

Alex FordI am learning about Progressive Enhancement and I have a question about AJAXifying views. In my MVC 3 project I have a layout page, a viewstart page, and two plain views. The viewstart page is in the root of the Views folder and thus applies to all views. It specifies that all views should use _...

 
8:45 PM
function ShowDialogData(evt) {
	$("#dialog").dialog({
		open: GetDialogData
	});
    $("#dialog").dialog("open");
    $("#dialog").html("Loading..");
}

function GetDialogData(event, ui)
{
    $.ajax({
        type: "GET",
        url: $("#shoppingcarturl").val(),
        data: {
            userid: id[1],
            cartid: id[2],

        },
        success: function (data) {
            $("#dialog").html(data);
        }
    });
}
Oh so fixing the partial view fixed your JS @LewsTherin?
 
Yep, just that one liner.. let me check if it opens again
Yep opens and closes again.
Did I mention I hate web dev?
 
@LewsTherin Haha, it's joyous!
 
Nah, it makes me think too much :(
 
You need to show your brain some lovin, it wants to think!
 
Hehe.. I've taught it to be lazy
:P
 
11:00 - 21:0021:00 - 00:00

  last day (1779 days later) »