Search Results

Search found 59301 results on 2373 pages for 'asp net ajax'.

Page 88/2373 | < Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >

  • MVC Site - Ensuring the default entry view is always correct

    - by Klaptrap
    I have a MVC site with AD authorization. This is all working fine. I publish the site to the webserver and call the site directly (http://intranet). If I have not logged in for a while (I have an authorised cookie with a 30 minute TTL), I am prompted to log-in and if successful I am redirected to the homeController's index view. This is great and as expected. If I keep the session open (browser open) and browse away from the site, if I then browse back to http://intranet, I am not challenged as I have recently authenticated but the default page is from a different controller and not the home page view. How can I stop this from happening? It cannot be a session setting as this is not a new session and the routes appear correct - they are not beng called at this point anyhow. Please MVC guru's advise....!

    Read the article

  • VS 2010 MVC Formatting

    - by Brian
    Hello, MVC is formatting my code horribly, and I was wondering if you can turn it off? I feel the answer is no, but I was hoping VS 2010 had built in a setting... Here's what its formatting as: <% if (org.UserKey.HasValue) { %> <%= org.Reference(i => i.UserReference).Email%> <% } else { %> <%= org.UserEmail%> <% } %> I want the beginning brackets on the same line as the if and the else... Thanks.

    Read the article

  • jPlayer widget created with static error as result

    - by goldengel
    I've created a widged with Orchard. Unfortunately I've used the same "Title" for a jPlayer widget twice. Now I receive an error: Server Error in '/wgk' Application. Sequence contains more than one element Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: Sequence contains more than one element Source Error: Line 2: <fieldset> Line 3: <div>@Html.LabelFor(o => o.MediaGalleryName, @T("Media gallery"))</div> Line 4: @if(!Model.HasAvailableGalleries) { Line 5: <div>@T("You need first to create an media gallery on Media Gallery menu")</div> Line 6: } Source File: x:\Intepub\wgk\Modules\Orchard.jPlayer\Views\EditorTemplates\Parts\MediaGallery.cshtml Line: 4 Stack Trace: [InvalidOperationException: Sequence contains more than one element] System.Linq.Enumerable.SingleOrDefault(IEnumerable`1 source) +4206966 NHibernate.Linq.Visitors.ImmediateResultsVisitor`1.HandleSingleOrDefaultCall(MethodCallExpression call) +51 NHibernate.Linq.Visitors.ImmediateResultsVisitor`1.VisitMethodCall(MethodCallExpression call) +411 NHibernate.Linq.Visitors.ExpressionVisitor.Visit(Expression exp) +371 In MediaGallery.cshtml (found in error description above) is written: @model Orchard.jPlayer.Models.MediaGalleryPart <fieldset> <div>@Html.LabelFor(o => o.MediaGalleryName, @T("Media gallery"))</div> @if(!Model.HasAvailableGalleries) { <div>@T("You need first to create an media gallery on Media Gallery menu")</div> } else { <div>@Html.DropDownListFor(o => o.SelectedGallery, Model.AvailableGalleries)</div> <div>@Html.LabelFor(o => o.SelectedType, @T("Media gallery type"))</div> <div>@Html.DropDownListFor(o => o.SelectedType, Model.AvailableTypes)</div> <div>@Html.LabelFor(o => o.AutoPlay, @T("Auto play"))</div> <div>@Html.CheckBoxFor(o => o.AutoPlay)</div> } </fieldset> My problem is now, I cannot find or edit the widget with double used name. I would love to replace it to another name. But I do not know where to do this. Please advice.

    Read the article

  • jqgrid retrieving empty rows using webapi (REST)

    - by polonskyg
    I'm using jqgrid in an ASPNET MVC4 project with WebApi (REST), Entity Framework 5 using Unit Of Work and Repository patterns. My problem is that I see the data flowing as json to the browser and I see three rows in the grid, but those rows are empty, and the data is not shown (three empty rows in the grid). This is method to get the data in the WebApi controller: public dynamic GetGridData(int rows, int page, string sidx, string sord) { var pageSize = rows; var index = sidx; var order = sord; var categories = Uow.Categories.GetAll().OrderBy(t => (string.IsNullOrEmpty(index) ? "Id" : index) + " " + (order ?? "desc")); var pageIndex = Convert.ToInt32(page) - 1; var totalRecords = categories.Count(); var totalPages = (int)Math.Ceiling((float) totalRecords / (float) pageSize); var categoriesPage = categories.Skip(pageIndex * pageSize).Take(pageSize).ToList(); return new { total = totalPages, page = page, records = totalRecords, rows = (from category in categoriesPage select new { id = category.Id.ToString(), cell = new string[] { category.Id.ToString(), category.Name, category.Description } }).ToArray() }; } This is the json received in the browser { "total": 1, "page": 1, "records": 3, "rows": [{ "id": "1", "cell": ["1", "Category 1", null] }, { "id": "3", "cell": ["3", "Category 3", "asAS"] }, { "id": "4", "cell": ["4", "Category 4", null] }] } This is the .js file with jqgrid jQuery("#ajaxGrid").jqGrid({ url: $("#ServiceUrl").val(), datatype: "json", jsonReader: { repeatitems: false, id: "Id" }, colNames: ['Id', 'Name', 'Description'], colModel: [ { name: 'id', editable: true, sortable: true, hidden: true, align: 'left' }, { name: 'name', editable: true, sortable: true, hidden: false, align: 'left' }, { name: 'description', editable: true, sortable: true, hidden: false, align: 'left' } ], mtype: 'GET', rowNum: 15, pager: '#ajaxGridPager', rowList: [10, 20, 50, 100], caption: 'List of Categories', imgpath: $("#ServiceImagesUrl").val(), altRows: true, shrinkToFit: true, viewrecords: true, autowidth: true, height: 'auto', error: function(x, e) { alert(x.readyState + " "+ x.status +" "+ e.msg); } }); function updateDialog(action) { return { url: $("#ServiceUrl").val(), closeAfterAdd: true, closeAfterEdit: true, afterShowForm: function (formId) { }, modal: true, onclickSubmit: function (params) { var list = $("#ajaxGrid"); var selectedRow = list.getGridParam("selrow"); params.url += "/" + list.getRowData(selectedRow).Id; params.mtype = action; }, width: "300", ajaxEditOptions: { contentType: "application/json" }, serializeEditData: function (data) { delete data.oper; return JSON.stringify(data); } }; } jQuery("#ajaxGrid").jqGrid( 'navGrid', '#ajaxGridPager', { add: true, edit: true, del: true, search: false, refresh: false }, updateDialog('PUT'), updateDialog('POST'), updateDialog('DELETE') ); BTW, If I want to return jqGridData instead the dynamic, How should I do it? Did is showing empty rows as well: public class jqGridData<T> where T : class { public int page { get; set; } public int records { get; set; } public IEnumerable<T> rows { get; set; } public decimal total { get; set; } } public jqGridData<Category> GetGridData(int rows, int page, string sidx, string sord) { var pageSize = rows; var index = sidx; var order = sord; var categories = Uow.Categories.GetAll().OrderBy(t => (string.IsNullOrEmpty(index) ? "Id" : index) + " " + (order ?? "desc")); var pageIndex = Convert.ToInt32(page) - 1; var totalRecords = categories.Count(); var totalPages = (int)Math.Ceiling((float)totalRecords / (float)pageSize); var categoriesPage = categories.Skip(pageIndex * pageSize).Take(pageSize); return new jqGridData<Category> { page = page, records = totalRecords, total = totalPages, rows = categoriesPage }; }

    Read the article

  • Need an ASP.NET MVC long running process with user feedback

    - by Jason
    I've been trying to create a controller in my project for delivering what could turn out to be quite complex reports. As a result they can take a relatively long time and a progress bar would certainly help users to know that things are progressing. The report will be kicked off via an AJAX request, with the idea being that periodic JSON requests will get the status and update the progress bar. I've been experimenting with the AsyncController as that seems to be a nice way of running long processes without tying up resources, but it doesn't appear to give me any way of checking on the progress (and seems to block further JSON requests and I haven't discovered why yet). After that I've tried resorting to storing progress in a static variable on the controller and reading the status from that - but to be honest that all seems a bit hacky! All suggestions gratefully accepted!

    Read the article

  • problems with a jquery plugin

    - by CoffeeCode
    I'm using AJAX_POSTUP. When i make a request it sends a file to a bowser [offers to download] (the files content are params of the action methods). Does anyone know whats going on and how i can avoid this problem??? i'm not aware of other plugins such as AJAX_POSTUP

    Read the article

  • What is the web.debug.config and web.release.config file for?

    - by chobo
    Hi, I just upgraded to VS 2010 and MVC 2.0 and I noticed the web.config has two additional files attached to it? Are thee files used to specify debug and release specific settings, so you don't clutter up the main web.config? Does it even make sense to place a connection string in the root web.config file if I have have a local and remote one in the debug and release web.configs respectively. Thanks!

    Read the article

  • How to refresh parent and ancestor windows after closing the child windows?

    - by truthseeker
    Hi, I have three windows: 1st - main window 2nd - child window - it's opened using window.showModalDialog from 1st widnow. 3rd - window - is an ancestor of 1st window and is's opened from 2nd window using window.showModalDialog. And now what I need to achieve is to open 1, 2 and 3 window. Next after closing the 3rd one, refresh the 2nd one. And after closing the 2nd one, refresh the 1st one. But there is one more assumption, I don't want to have any post-back during this process. Dose anybody have any idea how to make it?

    Read the article

  • UrlHelper and ViewContext inside an Authorization Attribute

    - by DM
    I have a scenario that I haven't been able to solve: I'm toying around with creating my own custom authorization attribute for mvc. The main bit of functionality I would like to add is to have the ability to change where the user gets redirected if they are not in a certain role. I don't mind that the system sends them back to the login page if they're not authenticated, but I would like to choose where to send them if they are authenticated but not allowed to access that action method. Here's is what I would like to do: public class CustomAuthorizeAttribute : AuthorizeAttribute { public string Action; public string Controller; protected override bool AuthorizeCore(System.Web.HttpContextBase httpContext) { // if User is authenticated but not in the correct role string url = Url.Action(this.Action, this.Controller); httpContext.Response.Redirect(url); } } And as an added bonus I would like to have access to ViewContext and TempData before I do the redirect. Any thoughts on how I could get instantiate a UrlHelper and ViewContext in the attribute?

    Read the article

  • asp.net form validation. Server-side or client-side

    - by Jeroen
    Here's (i think) an interesting question. With AJAX more and more common i feel more and more like doing all form validation server-side. Picture a registration form pre-AJAX. You have all your validation client-side using the common asp validation controls and validation summery...except...checking username availability, check emailadress availability, captcha and what not. So you end up with 2 kinds of validation and so presenting the user with 2 different UI's at 2 different moments. 2 words come to my mind. Ugly. Inconsistent. So here's the question. Why not do all the validation server-side (using AJAX or not). (I'm not using JQuery yet, should i?)

    Read the article

  • AJAX URL request doesn't work from desktop

    - by Aaron
    Running this simple AJAX with WAMP localhost I can pull JSON from a web address. $(document).ready(function(){ $.ajax({ url: 'http://time.jsontest.com/', dataType: 'jsonp', success: function(json) { console.log(json); } }); }); However I cannot connect if I try running normally through a browser, why is that? Google CDN: <src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js">

    Read the article

  • Best placement for javascript in Asp.net MVC app that heavily uses partial views

    - by KallDrexx
    What is the best place for javascript that is specific to a partial view? For example, if I have a partial view (loaded via ajax call) with some divs and I want to turn those divs into an accordian, would it be better put the $("#section").accordion() in script tags inside of the partial view, or in a .js file in the function that retrieves that partial view and inserts it into the DOM? Obviously, common methods I will be keeping in a .js file, however I am more talking about javascript very specific to the partial view itself. Most things I find on the net seem to say to put all javascript into a separate .js but nothing addresses the idea of partial views.

    Read the article

  • IIS 6/.Net 2:How can user A get the user cookie for unrelated user B who is in a different session a

    - by jon.ediger
    1) user A goes to the site, creates an account, and logs in 2) user b goes to the site. Rather than having to log in, user b enters as though user b is user a. User b gets access to all of user a's data and can brows the site as user a. Note: user b does not log in. User b just hits the site, and the site returns as if user b is already logged in as user a. Note 2: user a and user b are on distinct computers. Also, static variables are not involved in the code. Setup: IIS 6 .Net 2.0 OutputCache off for the pages in the site

    Read the article

  • Rendering PDFs from a database inside MVC views?

    - by Mohammad Sepahvand
    I was wondering if it's possible to do this without using 3rd party compnents in MVC 3. (I am open to free components though.) There are a couple of links out there but they seem to be mostly concerned with reporting and other code samples that do claim to do this sort of thing don't seem to compile. I'm not having any trouble saving and retrieving the PDFs to and from my database, but when I return the PDF as a File or a FileStreamResult the user is prompted with a download. A more desirable approach would be to actually render the PDFs inside the browser. I've had a look at iTextSHarp, it does the job to an extent, but it's not a complete solution. For example it will display the PDF inside the view if and only if the client has Adobe Reader installed, otherwise it prompts for a download. So technically, I'm mostly looking for a PDF viewer. Any ideas?

    Read the article

  • ASP.NET Repeater datasource bound to a function. Would it call the function twice?

    - by Frenchie
    In the code behind I have a function that returns a List(Of SomeClass): rptRepeater.DataSource = SomeFunction(SomeVariable) rptRepeater.DataBind() In the html I have a basic repeater layout and am using the below code to get the Properties of each object returned. <%#Databinder.Eval(Container.DataItem, "Parameter1")% My question is, would there ever be a case that it would execute the Function more than once?

    Read the article

  • How do you update the aspnetdb membership IsApproved value?

    - by Matt
    I need to update existing users IsApproved status in the aspnet_Membership table. I have the code below that does not seem to be working. The user.IsApproved property is updated but it is not saving it to the database table. Are there any additional calls I need to make? Any suggestions? Thanks. /// <summary> /// Updates a users approval status to the specified value /// </summary> /// <param name="userName">The user to update</param> /// <param name="isApproved">The updated approval status</param> public static void UpdateApprovalStatus(string userName, bool isApproved) { MembershipUser user = Membership.GetUser(userName); if (user != null) user.IsApproved = isApproved; }

    Read the article

  • Is there an "extended" UIHint attribute to apply CSS styles for DisplayFor - EditorFor templates?

    - by AJ
    Intro: After reading Brad Wilson Metadata series and searching unsuccesfully on google, I was wondering: Question: Has any OS project / code been created that allows you to tag CSS styles in the Meta information, for example in my (buddy) Model, I want to be able to decorate a property with multiple CSS styles (a single style you can fake with UIHint, I want to set many possible styles - and be able to "cross-utilise") eg. public class MyModel { [DisplayCssHint("h5")] [DisplayCssHint("color:#777;")] [EditorCssHint(".myCoolTextClass")] [EditorCssHint(".myOtherCoolTextClass")] public string Title{ get;set; } [DisplayCssHint(".normaltext")] [EditorCssHint(".myCoolTextClass")] [EditorCssHint(".myOtherCoolTextClass")] public string Message {get;set;} } Thoughts: I know that this does not seem like a logical place to put styling information, however as it is metadata and is discriptive... besides it would be nice to do this while prototyping - (especially being able to apply class styles and extending it further - to generate .Less files would really be cool! more to the point I would hate to write it, if its already been done ;). Any links/pointers/idea's would be appreciated. Thanks,

    Read the article

  • CustomProfile is not saving?

    - by Xaisoft
    I created a class that extends ProfileBase: public class CustomerProfile : ProfileBase { public int CustomerID { get; set; } public string CustomerName { get; set; } public static CustomerProfile GetProfile() { return Create(Membership.GetUser().UserName) as CustomerProfile; } public static CustomerProfile GetProfile(string userName) { return Create(userName) as CustomerProfile; } } If I do: CustomerProfile p = CustomerProfile.GetProfile(); p.CustomerID = 1; p.Save(); The next time I try to access the value for the current user, it is not 1, it is 0, so it appears it is not saving it in the database. In my web.config file I have the following snippet: <profile inherits="PortalBLL.CustomerProfile"> <providers> <add name="CustomerProfile" type="System.Web.Profile.SqlProfileProvider" applicationName="/" connectionStringName="LocalSqlServer"/> </providers> </profile> I tried the following and it worked, I am curious why it doesn't save it using the automatic properties. [SettingsAllowAnonymous(false)] public int CustomerID { get { return (int)base.GetPropertyValue("CustomerID");} set { base.SetPropertyValue("CustomerID",value);} }

    Read the article

  • MVC MapPageRoute and ActionLink

    - by Dismissile
    I have created a page route so I can integrate my MVC application with a few WebForms pages that exist in my project: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); // register the report routes routes.MapPageRoute("ReportTest", "reports/test", "~/WebForms/Test.aspx" ); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); } This has created a problem whenever I use Html.ActionLink in my Views: <%: Html.ActionLink("Home", "Index", "Home") %> When I load the page in the browser the link appears like: http://localhost:12345/reports/test?action=Index&controller=Home Has anyone run into this before? How can I fix this?

    Read the article

  • LINQ to SQL repository - caching data

    - by creativeincode
    I have built my first MVC solution and used the repository pattern for retrieving/inserting/updating my database. I am now in the process of refactoring and I've noticed that a lot of (in fact all) the methods within my repository are hitting the database everytime. This seems overkill and what I'd ideally like is to do is 'cache' the main data object e.g. 'GetAllAdverts' from the database and to then query against this cached object for things like 'FindAdvert(id), AddAdvert(), DeleteAdvert() etc..' I'd also need to consider updating/deleting/adding records to this cache object and the database. What is the best apporoach for something like this? My knowledge of this type of things is minimal and really looking for advice/guidance/tutorial to point me in the right direction. Thanks in advance.

    Read the article

  • How to refresh parent and ancestor windows afret colsing the child windows?

    - by truthseeker
    Hi, I have three windows: 1st - main window 2nd - child window - it's opened using window.showModalDialog from 1st widnow. 3rd - window - is an ancestor of 1st widnow and is's opened from 2nd widnow using window.showModalDialog. And now what I need to achivie is to open 1, 2 and 3 window. Next after closing the 3rd one, refrest the 2nd one. And after closing the 2nd one, refresh the 1st one. But there is one more assumption, I don't want to have any postback during this proces. Dose anybody have any idea how to make it?

    Read the article

< Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >