104
votes
16answers
42k views

Embedding JavaScript engine into .NET (C#)

just wondering if anyone has ever tried embedding and actually integrating any js engine into the .net environment. I could find and actually use (after a LOT of pain and effort, since it's pretty ...
85
votes
4answers
13k views

Bundler not including .min files

I have a weird issue with the mvc4 bundler not including files with extension .min.js In my BundleConfig class, I declare public static void RegisterBundles(BundleCollection bundles) { ...
72
votes
3answers
91k views

how to use Dictionary or Hashtable in Javascript? [duplicate]

Possible Duplicate: Can anyone recommend a good Hashtable implementation in Javascript? Hello everyone, I want to calculate/store some statistics information using JavaScript, the equivalent ...
60
votes
14answers
123k views

Call ASP.NET Function From Javascript?

I'm writing a web page in ASP.NET. I have some Javascript, and I have a submit button with an onClick event. Is it possible to call a method I created in ASP with Javascript's onClick event?
51
votes
4answers
53k views

How to post an array of complex objects with JSON, jQuery to ASP.NET MVC Controller?

My current code looks like the following. How can I pass my array to the controller and what kind of parameters must my controller action accept? function getplaceholders() { var placeholders = ...
41
votes
2answers
38k views

Difference between RegisterStartupScript and RegisterClientScriptBlock?

Is the only difference between the RegisterStartupScript and the RegisterClientScriptBlock is that RegisterStartupScript puts the javascript before the closing tag of the page and ...
40
votes
8answers
13k views

Concatenate and minify JavaScript on the fly OR at build time - ASP.NET MVC

As an extension to this question here Linking JavaScript Libraries in User Controls I was after some examples of how people are concatenating and minifying JavaScript on the fly OR at build time. I ...
36
votes
6answers
10k views

Google Angular Framework - Worth the risk?

I have been asked to build a small web application for one of our clients and think it might be a good opportunity to try out a different framework for building web applications. Most of the ...
36
votes
10answers
40k views

How do I add an additional window.onload event in Javascript

In my asp.net User Control I'm adding some script to the window.onload event like so: if (!Page.ClientScript.IsStartupScriptRegistered(this.GetType(), onloadScriptName)) ...
36
votes
10answers
7k views

How to flatten an ExpandoObject returned via JsonResult in asp.net mvc?

I really like the ExpandoObject while compiling a server-side dynamic object at runtime, but I am having trouble flattening this thing out during JSON serialization. First, I instantiate the object: ...
33
votes
13answers
54k views

How to inject Javascript in WebBrowser control?

I've tried this: string newScript = textBox1.Text; HtmlElement head = browserCtrl.Document.GetElementsByTagName("head")[0]; HtmlElement scriptEl = browserCtrl.Document.CreateElement("script"); ...
33
votes
2answers
1k views

Can't set IHTMLEventObj2::fromElement

I'm trying to generate synthetic Javascript events in an Internet Explorer extension, and I'm having trouble getting the fromElement property to stick. Here's an excerpt of my code: ...
26
votes
5answers
2k views

Difference between the implementation of var in Javascript and C#

I would like to ask a theoretical question. If I have, for example, the following C# code in Page_load: cars = new carsModel.carsEntities(); var mftQuery = from mft in cars.Manufacturers ...
26
votes
2answers
57k views

How to use __doPostBack()

I'm trying to create an asyncrhonous postback in asp.net using __doPostBack(), but I have no idea how to do it. I want to use vanilla javascript. Something simple like a button click can cause the ...
25
votes
22answers
4k views

Why not put all braces inline in C++, C#, Java, javascript, etc.?

Of all the conventions out there for positioning braces in C++, C#, Java, etc., I don't think I've ever seen anyone try to propose something like this: public void SomeMethod(int someInput, string ...

1 2 3 4 5 462
15 30 50 per page