.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> ASP.Net >> Post New Question Subscribe to Interview Questions

How can I add the result of an ASP.NET MVC controller action to a Bundle?

Posted By :Jack Smith     Posted Date :November 09, 2012    Points :40   Category :ASP.Net 


I have a controller action that returns Javascript file. I can reference this file from my view and it works fine. I'd like to put it in a System.Web.Optimization.Bundle with the other JS files.

I'm trying to do this, essentially:

new Bundle().Include("~/DynamicScript/UrlDictionary");

The other files in my Bundle get rendered just fine, but this one is ignored. Seeing this behavior, my assumption is that bundling gets handled before the application is able to resolve URL's through the routing infrastructure, or maybe that the bundling component doesn't request files in a manner that would allow that resolution to happen.

If someone could confirm that for me and/or point me in a good direction here, it would be much appreciated.


You can also find related Interview Question to How can I add the result of an ASP.NET MVC controller action to a Bundle?  below: 

Mention some of the return types of a controller action method ?

  
An action method is used to return an instance of any class which is derived from ActionResult class.
Some of the return types of a controller action method are:
i) ViewResult : It is used to return a webpage from an action method
ii) PartialViewResult : It is used to send a section of a view to be rendered inside another view.
iii) JavaScriptResult : It is used to return JavaScript code which will be executed in the user's browser.
iv) RedirectResult : Based on a URL, It is used to redirect to another controller and action method.
v) ContentResult : It is an HTTP content type may be of text/plain. It is used to return a custom content type as a result of the action method.
vi) JsonResult : It is used to return a message which is formatted as JSON.
vii) FileResult : It is used to send binary output as the response.
viii) EmptyResult : It returns nothing as the result.
(More...)

What is the result of below given line of code in Java Script? 5+4+'7'

  
The answer is 97.

As 5 and 4 are integer so total becomes 9 and it's add '7' to it as string so it becomes 97.
(More...)

How to get the number after decimal point in .net?
If the no is 2.36
Result should be 36?

  
string result=number.Substring(number.inderOf('.')+1);

It will first get the index of '.' and then add 1 to get the index of next charater then with the help of substring method we will get the no after the decimal point to the last (More...)

What will be the result of the following statement?


SELECT STR(938.56, 6, 1)


A. 938.56
B. 938.5
C. 938.6
D. 0938.5
E. 0938.6
F. 00938.5
G. 00938.6

  
Correct Answer : C
Explanation:
-----------
The STR function returns character data converted from numeric data. The second parameter of the STR function is for the total length of the output, including the decimal point, sign, digits and spaces. The output is rounded to the number of decimal places specified in the third parameter.
(More...)

What is Action in C# 3.5?

  
Action is a built-in delegate which returns void.

There are 5 versions of Action

Action
Action
Action
Action
Action
(More...)

How do you create a Custom action for an item in a list ?

  

Ans. This can be done by adding a new feature into SharePoint. You would need to use customaction tag in your elements.xml file and will have to set various properties like imageurl or UrlAction for your customaction. You can later add this feature into sharepoint using stsadm install feature command. (More...)

What is Custom action?

  
Represents a link, toolbar button, menu item, or any control that can be added to a toolbar or menu that appears in the sharepoint ribbon UI. For e.g. "New Link" button in your List is a custom action Items in List Tools is a custom action. (More...)

How do you create a Custom action for an item in a list ?

  
This can be done by adding a new feature into SharePoint. You would need to use customaction tag in your elements.xml file and will have to set various properties like imageurl or UrlAction for your customaction. You can later add this feature into sharepoint using stsadm install feature command. (More...)

What is the use of a controller in an MVC application ?

  
A controller will decide what to do and what to display in the view. It works as follows:

i) A request will be received by the controller
ii) Basing on the request parameters, it will decide the requested activities
iii) Basing on the request parameters, it will delegates the tasks to be performed
iv) Then it will delegate the next view to be shown
(More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend