Home » Asp.net

Carousel on ASP.NET MVC page

Looking for tips how to code.

Web page has JQuery based carousel that presents first pages of books. Clicking on a book image is supposed to update book detail fields that are located under carousel section.

What is the best way to refresh book details section? Should I use ajax?

Some links with examples would be appreciated.


1 Answer Found


Answer 1

One option it to use an ajax  call using jquery. I don't know what jquery  carrousel extension you are using or what event you can bind on but assume that the name of the event is called click and that the control is called carrousel and that you have bookscontroller with an action GetDescription, it will all look something like this:

<script type="text/javascript" language="javascript">
    $().ready(function () {

    function onClick() {
        var bookId = /* here you need to get the id of the book  somehow */;
            async: false,
            type: 'POST',
            url: '<%: Url.Action("GetDescription", "BooksController") %>',
            data: 'bookId=' + bookId,
            success: function(data) {
                /* do something with the return book description */

In in the GetDescription action of the BooksController you return a JsonResult. This is more or less roughly what you need to do...


My Html Page
<table id="ritu">
   <tr><td> Name</td> <td><td><td><td></tr>
   <tr><td> Father Name</td> <td><td><td><td></tr>
   <tr><td> Age</td> <td><td>Sex<td><td></tr>

  My Output is
     <asp:lable id="lbl_Name" runat="server/>
    <asp:textbox id="txt_Name runat="Server"/>

   <asp:lable id="lbl_FatherName" runat="server/>
    <asp:textbox id="txt_FatherName" runat="Server"/>

<asp:lable id="lbl_Age" runat="server/>
    <asp:textbox id="txt_Age runat="Server"/>
<asp:lable id="lbl_sex" runat="server/>
    <asp:textbox id="txt_sex runat="Server"/>


I want to create a web page for order entry using ASP.NET MVC- Entity Framework. This page contains Order and Order Entry information. For each Order, I can have multiple Order details. If you know how to do this Master/Detail with ASP.NET MVC-Entity Framework please let me know. The user should be able to enter new order with one or many order detail. this should be on one single page.



I am also very interested to know, when the first service pack of Visual Studio 2010 will be released, because I encountered a serious bug when remote debugging an asp.net or asp.net mvc application.

This bug is reported, see:

Without beeing able to remote debug I cannot develop my next (big) project.
So when there is "no service pack timeline for Visual Studio 2010" I need another way to get this bug fixed as soon as possible, because I simply cannot wait an indefinite time.

What can I do for a solution of this problem?

Horst Seyfried


I wrote a free asp.net mvc paging component (should it be called "control"?) called MvcPager, it supports 3 paging mode:standard url paging,default Ajax paging and jQuery Ajax paging. The paging implementation was inspired by Scottgu's PagedList<T> idea. You can view online demo and download it from http://en.webdiyer.com in case you're interested for this component!


I was tested "Expanding the Range of Allowable URLs" for this ASP.NET 4 new feature.  The maxUrlLength attribute under <httpRuntime> section in the web.config is only apply to ASP.NET 4 Web Form files.  I couldn't use this feature in ASP.NET MVC 2 that run under ASP.NET 4 application pool.  Does anyone know this problem? 


On my employee edit view page i have 3 buttons Save,Cancel,Delete.

Save - saving view page values. calling controller action.

Cancel - Go back to previous view page. (List of employee page. where this page view comes)

Delete - Delete current page employee and go back to List of employee page. where this page view comes.

Save button click by default working for me calling controller.

but when i click cancel and delete button same controller gets call

How to handle this situation on page view.


Can anyone please explain why will anyone go in for asp.net MVC since we can easily implement in asp.net 



I have been developing a quiz application in asp.net mvc. In this quiz user is give a list of topic to take quiz. On click of one of the topic the user is taken to new page. In the get part action of this page i have taken some parameters, generated questions for the quiz, register quiz for the user (save in db)and save the generated questions in db.

Now the problem is:

User see the page, if user hits the "submit" button after selecting the answer than it is ok but If user refresh the page. Then the get action is called again and new set of questions are generated and new quiz is registered to user.

How can i avoid this?

Is there any way to detect that the get action is called the second time or to detect page refresh in as.net mvc.

If you could suggest design changes that it is ok too? i just need to make sure if user refresh the page the question need not be generated again and new quiz should not be registered to user.

Please help.


While I have heard a lot of discussions about the pros and cons of ASP.NET MVC and webforms, and that there are cases where either one will be a good fit, I think this is ambigious and only reflects a dilemma facing technical decision makers: ASP.NET MVC is politically correct architecturally, but it is still too primitive for real world development, webforms 4.0 has kind of eliminating the weakness of previous web forms, but it is still a Page Controller.

So for enterprise environment where we are talking about large scale projects serving tens of thousands of users, should we adopt ASP.NET MVC today? It is kind of disappointing that the so called 2.0 of ASP.NET MVC is still so primitive. I like to seek feedback from Architects on this issue and your decision points, any comment will be deeply appreciated.


Hello Friends,

I am showing Custom Error in my page.. if somehting happend wrong. but if the same error occured in my subview master page I am not able to show the Custom error page on Entire page its showing me that Error page under subview master page. Please I am attching the Screen shot.

Can any body help me out how to show the Error page on entire page if something happend in any where submaster or other page..

Here is the code that I am using in web config file to show custom Error page..


master page I have

all the js files and Css files links

and I have submaster page for mainmaster page.. sub master page have three tabs each tab has grid control.if something went wrong I can able to show the Custom Error page but its showing me in submaster page.. not in main master page.....but if something hapend any where I need to show CustoM Error page in main master page..

Here I know the issue what's going on..

This issue is occurring because i am  using AJAX to partially load the contents of the tabs after the initial page load so the error is occurring AFTER my master page has been loaded.

What I need to do is provide a javascript function to handle the error after the ajax call has returned and redirect to the error page.

How to write this Javascript and where Do I need to write this?



Hi all,

I have an application which has been built in MVC 2.0. I need to upgrade it to MVC 3.0 and that too by using Razor CSHTML engine.

All the information which I got on the net was for MVC 3.0 Webform engine but nothing much for migrating to Razor.

I would be very grateful if somebody shows me the steps or sample walkthrough for the purpose of this migration.

Any help would be greatly appreciated.

Thanks and regards,



I am getting following error in production but the same is not a repro in in local.

> Error executing child request for
> handler
> 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerWrapper'.
> Inner Exception: Exception of type
> 'System.Web.HttpUnhandledException'
> was thrown.

Stack Trace:

    at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
    at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage)
    at System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm)
    at System.Web.Mvc.ViewPage.RenderView(ViewContext viewContext)     
    at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)     
    at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass14.<InvokeActionResultWithFilters>b__11()
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)     
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)   
    at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)\n Inner Exception:
    at System.Web.UI.Page.HandleError(Exception e)
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.ProcessRequest()
    at System.Web.UI.Page.ProcessRequest(HttpContext context)
    at System.Web.Mvc.ViewPage.ProcessRequest(HttpContext context)
    at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass4.<Wrap>b__3()
    at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func)
    at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)

Can anybody tell me what is causing this issue?


hiya folks,

I'm upgrading a classic asp app that contains include files as a kind of masterPage, eg  topMenu.asp etc.

I want to plug and aspx child page into the app with as little alteration as possible...Simply including the asp pages in the aspx page doesn't work, as asp.net 2.0 obviously tries to "handle" the classic asp page, and it errors.

<<CS1010: Newline in constant>>  .. i believe because c# is trying to interpret the VB server side code.

So, how can I plug the classic asp stuff in as easily as possible?

many thanks,


Hi Am new to this tool. but i want to know if i CAT.Net can check Asp.net MVC 2 code for vulnarabilties & check agains Xss etc..

Today I installed the new Azure SDK (1.2) tools.  I cannot run any ASP.Net MVC applications in an Azure Web Role if they target .Net 4.0, in that no controller actions are ever called so the browser just comes up blank.  Any other combination of .Net Framework/ASP seems to work fine:

- Azure/3.5/MVC - works

- Azure/4.0/traditional ASP app - works

- No Azure/4.0/MVC - works

These are all just creating a new Cloud or ASP project in VS2010 and running it (though existing applications behave the same).  I am running on Win 7 x64.

Any suggestions?


I'm trying to figure out how to use SSL for only certain pages on my website.  It's an ecommerce site, and I don't want the whole site to use SSL, only the checkout areas.  I'm not sure what's needed to set this up, is it all IIS, web.config file, etc.

I'm hosting with Discount ASP.Net, and will purcase an SSL cert through them for my site.

Thank you,



The challenge: I have a number of pages in asp classic that need to be moved 

to an ASP.NET 4.0 site. These pages will be somewhat removed from the rest of the

site, which will be making use of Web Forms. The 4.0 Site will not be using MVC.

I need an extremely high degree of control over the form and input elements, so even though

4.0 web forms look better than the old web forms, I don't want to be using server controls - period. 

Rather, I'm looking for the type of control you can have when playing with multiple recordsets

coming from a proc. Spaghetti code? Yes, mabye, but that's kind of what MVC allows.

Is there a way to do this sort of thing in ASP.NET? 

Any suggestions/guidance/resource would be much appreciated.  


We have recently migrated one of our legacy websites (classic ASP) to ASP.Net 4.0. I have already created a RegisterRoutes() in Global.asax (as per http://weblogs.asp.net/scottgu/archive/2010/01/05/asp-net-4-seo-improvements-vs-2010-and-net-4-0-series.aspx). I am concerned about SEO rankings and link breakages with external sites linking to old site.

 Ideally, I will like to:

 Load all the routes from an XML file within RegisterRoutes() --> As there are 100's of pages with no naming convention followed. We have already created mappings within an excel spread sheet which can easily be exported to XML.Action Permanent redirects from within RegisterRoutes() --> to avoid having landing page(s) performing Redirects like Response.RedirectPermanent() and Response.RedirectToRoutePermanent.

Has anyone run into a similar situation? Is there a better way of handling this situation?

Your help is much appreciated.

Kind regards,



I have a mix of asp.net and asp classic pages in the same application. Could any tell how do I do a response.redirect to the asp classic pages? I get a error using the normal way. 


How can I move my asp pages to asp.net pages?



<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure