Search Results

Search found 615 results on 25 pages for 'razor storm'.

Page 4/25 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How do I post to a webservice and display the returned Response in MVC3 Razor Application?

    - by DavieDave
    I have need to call a webservice from an HTML helper extension I created (combinbation of Action and Image) and placed in the view as follows @Html.ActionImage("CallService", new { number = ViewBag.number, code = ViewBag.code, account = ViewBag.account, amount = ViewBag.amount }, "~/Content/sb_200x61.png", "Start the Process") I am making the action call and it calls the service and returns a string of the html response, but it doesn't look right. I am using the typical HttpWebRequest to do the POST Action in C# code. Here is the controller action code: public MvcHtmlString CallService(string number, string code, string account, decimal? amount) { string response = MyService.ServiceLayer.ClassName.callService(number, code, account, Convert.ToDecimal(amount); MvcHtmlString mstring = new MvcHtmlString(response); return mstring; } When it returns the string back it's looking like the all styling and js is removed. It that due to MvcHtmlString? Is there a better way to do this? Redirect somehow ?

    Read the article

  • How to build MVC Views that work with polymorphic domain model design?

    - by Johann de Swardt
    This is more of a "how would you do it" type of question. The application I'm working on is an ASP.NET MVC4 app using Razor syntax. I've got a nice domain model which has a few polymorphic classes, awesome to work with in the code, but I have a few questions regarding the MVC front-end. Views are easy to build for normal classes, but when it comes to the polymorphic ones I'm stuck on deciding how to implement them. The one (ugly) option is to build a page which handles the base type (eg. IContract) and has a bunch of if statements to check if we passed in a IServiceContract or ISupplyContract instance. Not pretty and very nasty to maintain. The other option is to build a view for each of these IContract child classes, breaking DRY principles completely. Don't like doing this for obvious reasons. Another option (also not great) is to split the view into chunks with partials and build partial views for each of the child types that are loaded into the main view for the base type, then deciding to show or hide the partial in a single if statement in the partial. Also messy. I've also been thinking about building a master page with sections for the fields that only occur in subclasses and to build views for each subclass referencing the master page. This looks like the least problematic solution? It will allow for fairly simple maintenance and it doesn't involve code duplication. What are your thoughts? Am I missing something obvious that will make our lives easier? Suggestions?

    Read the article

  • Is an ACPI GPE storm normal in an Ubuntu session?

    - by Tinellus
    In a previous question (What is a an ACPI GPE storm?), I asked about ACPI GPE storm. Looking closer to my kern.log file in /var/log/, I notice that in every session at some point (usually withing 20' after startup) a GPE storm is triggered. When I open kern.log immediately after startup, I see that the 'GPE-storm' can be triggered by anything (a copy-action, the opening of an app like Firefox or Thunderbird, etc...). This worries me. Looking for other ACPI related events in kern.log, I find these error messages. I hope someone can give some advice: Jun 10 16:33:20 Guy-VAIO kernel: [ 0.724505] ACPI FADT declares the system doesn't support PCIe ASPM, so disable it Jun 10 16:33:20 Guy-VAIO kernel: [ 0.795205] [Firmware Bug]: ACPI: BIOS _OSI(Linux) query ignored Jun 10 16:33:20 Guy-VAIO kernel: [ 1.024009] ACPI: Deprecated procfs I/F for battery is loaded, please retry with CONFIG_ACPI_PROCFS_POWER cleared Jun 10 16:33:20 Guy-VAIO kernel: [ 23.140259] [Firmware Bug]: ACPI(VGA) defines _DOD but not _DOS There's also a video driver message that worries me, don't know if it's related though: Jun 10 16:33:20 Guy-VAIO kernel: [ 23.162154] fglrx: module license 'Proprietary. (C) 2002 - ATI Technologies, Starnberg, GERMANY' taints kernel. Jun 10 16:33:20 Guy-VAIO kernel: [ 23.162158] Disabling lock debugging due to kernel taint As mentioned in my previous question, I'm experiencing frequent (several times /d) application crashes, that seem random, with apport messages being sent, and less frequent (once a week or so) complete system freezes where the system becomes unresponsive to keyboard, mouse or touchpad input and the only solution is a hard reboot (press start button) My questions: what about the Firmware Bugs in ACPI? how and where do I have to 'clear CONFIG_ACPI_PROCFS_POWER'? what does it mean when fglrx 'taints the kernel', is it serious and what could I do about it? Ubuntu 12.04, 64-bit, 3.2.0-25-generic Kernel, Intel® Core™ i5-2430M CPU @ 2.40GHz × 4 Thanks

    Read the article

  • Temporary boot problem after thunder storm - likely causes?

    - by alastairs
    The village where I live was sat under a thunder cloud for most of Friday, and we suffered a few power fluctuations (specifically, what seemed to be split-second outages). When I got back home from work, I found that my PCs had shut down during one of these outages. When I went to boot one of them back up, I couldn't get anything to display on screen, nor did the boot seem to complete correctly. I tried a number of things - unplugging different bits of hardware, swapping graphics adaptors, etc. - to no avail. I thought I was looking at a fried motherboard or CPU. Power seemed to be distributed correctly to the peripherals (the drives all appeared to be working) so I figured it couldn't be the PSU. Eventually I unplugged it from the mains and left it overnight (approx 12hrs unplugged). I tried it again this morning, and it booted up correctly. Woo-hoo! I have all my equipment protected by surge-protected power strips, so I don't think a spike caused these problems. Obviously it has something to do with the power fluctuations, and maybe the PSU in the problem machine got itself confused somehow. The questions are, for future reference and to help people with similar problems: What are the likely causes of the boot failure I experienced? Is a UPS a simple and cost-effective solution, or might other things help prevent this happening in future? What UPS can you recommend (my budget is limited)?

    Read the article

  • Updated MVC 4 to 5.2.0 via Nuget Site compiles but wont run

    - by hjavaher
    I had the bright idea of updating my perfectly working ASP.Net MVC 4 application to the MVC 5 via nuget, Everything compiles just fine but when I try to run the application I get the following yellow screen of death. Has anyone gotten this or know how to solve it? I've searched for it and couldn't find any solutions. Please let me know if there is any farther information that would help you that I can give you. Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed. 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.MethodAccessException: Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [MethodAccessException: Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed.] WebMatrix.WebData.PreApplicationStartCode.Start() +112 [InvalidOperationException: The pre-application start initialization method Start on type WebMatrix.WebData.PreApplicationStartCode threw an exception with the following error message: Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed..] System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +556 System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +132 System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +102 System.Web.Compilation.BuildManager.ExecutePreAppStart() +153 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516 [HttpException (0x80004005): The pre-application start initialization method Start on type WebMatrix.WebData.PreApplicationStartCode threw an exception with the following error message: Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed..] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9885060 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

    Read the article

  • Consuming all touchEvents not preventing scrolling on the blackberry storm

    - by Some guy with a headache
    Hello, I am trying to make a custom control for the BlackBerry Storm using SDK v5.0. This control needs to disable scrolling while the user is dragging elements within a field. The problem is that even if I my control consumes every single touch event send to it, when the user lifts their finger off the screen it still flings up or down as if its finishing a scroll action. Does anyone know of a way to prevent this from happening or what I might be doing wrong ? Thank you.

    Read the article

  • servicestack Razor view with request and response DTO

    - by user7398
    I'm having a go with the razor functionality in service stack. I have a razor cshtml view working for one of my response DTO's. I need to access some values from the request DTO in the razor view that have been filled in from some fields from the REST route, so i can construct a url to put into the response html page and also label some form labels. Is there anyway of doing this? I don't want to duplicate the property from the request DTO into the response DTO just for this html view. Because i'm trying to emulate an existing REST service of another product, i do not want to emit extra data just for the html view. eg http://localhost/rest/{Name}/details/{Id} eg @inherits ViewPage<DetailsResponse> @{ ViewBag.Title = "todo title"; Layout = "HtmlReport"; } this needs to come from the request dto NOT @Model <a href="/rest/@Model.Name">link to user</a> <a href="/rest/@Model.Name/details/@Model.Id">link to user details</a>

    Read the article

  • Customize the SimpleMembership in ASP.NET MVC 4.0

    - by thangchung
    As we know, .NET 4.5 have come up to us, and come along with a lot of new interesting features as well. Visual Studio 2012 was also introduced some days ago. They made us feel very happy with cool improvement along with us. Performance when loading code editor is very good at the moment (immediate after click on the solution). I explore some of cool features at these days. Some of them like Json.NET integrated in ASP.NET MVC 4.0, improvement on asynchronous action, new lightweight theme on Visual Studio, supporting very good on mobile development, improvement on authentication… I reviewed them, and found out that in this version of .NET Microsoft was not only developed new feature that suggest from community but also focused on improvement performance of existing features or components. Besides that, they also opened source more projects, like Entity Framework, Reactive Extensions, ASP.NET Web Stack… At the moment, I feel Microsoft want to open source more and more their projects. Today, I am going to dive in deep on new SimpleMembership model. It is really good because in this security model, Microsoft actually focus on development needs. As we know, in the past, they introduce some of provider supplied for coding security like MembershipProvider, RoleProvider… I don’t need to talk but everyone that have ever used it know that they were actually hard to use, and not easy to maintain and unit testing. Why? Because every time you inherit it, you need to override all methods inside it. Some people try to abstract it by introduce more method with virtual keyword, and try to implement basic behavior, so in the subclass we only need to override the method that need for their business. But to me, it’s only the way to work around. ASP.NET team and Web Matrix knew about it, so they built the new features based on existing components on .NET framework. And one of component that comes to us is SimpleMembership and SimpleRole. They implemented the Façade pattern on the top of those, and called it is WebSecurity. In the web, we can call WebSecurity anywhere we want, and make a call to inside wrapper of it. I read a lot of them on web blog, on technical news, on MSDN as well. Matthew Osborn had an excellent article about it at his blog. Jon Galloway had an article like this at here. He analyzed why old membership provider not fixed well to ASP.NET MVC and how to get over it. Those are very good to me. It introduced to me about how to doing SimpleMembership on it, how to doing it on new ASP.NET MVC web application. But one thing, those didn’t tell me was how to doing it on existing security model (that mean we already had Users and Roles on legacy system, and how we can integrate it to this system), that’s a reason I will introduce it today. I have spent couples of hours to see what’s inside this, and try to make one example to clarify my concern. And it’s lucky that I can make it working well.The first thing, we need to create new ASP.NET MVC application on Visual Studio 2012. We need to choose Internet type for this web application. ASP.NET MVC actually creates all needs components for the basic membership and basic role. The cool feature is DoNetOpenAuth come along with it that means we can log-in using facebook, twitter or Windows Live if you want. But it’s only for LocalDb, so we need to change it to fix with existing database model on SQL Server. The next step we have to make SimpleMembership can understand which database we use and show it which column need to point to for the ID and UserName. I really like this feature because SimpleMembership on need to know about the ID and UserName, and they don’t care about rest of it. I assume that we have an existing database model like So we will point it in code like The codes for it, we put on InitializeSimpleMembershipAttribute like [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]     public sealed class InitializeSimpleMembershipAttribute : ActionFilterAttribute     {         private static SimpleMembershipInitializer _initializer;         private static object _initializerLock = new object();         private static bool _isInitialized;         public override void OnActionExecuting(ActionExecutingContext filterContext)         {             // Ensure ASP.NET Simple Membership is initialized only once per app start             LazyInitializer.EnsureInitialized(ref _initializer, ref _isInitialized, ref _initializerLock);         }         private class SimpleMembershipInitializer         {             public SimpleMembershipInitializer()             {                 try                 {                     WebSecurity.InitializeDatabaseConnection("DefaultDb", "User", "Id", "UserName", autoCreateTables: true);                 }                 catch (Exception ex)                 {                     throw new InvalidOperationException("The ASP.NET Simple Membership database could not be initialized. For more information, please see http://go.microsoft.com/fwlink/?LinkId=256588", ex);                 }             }         }     }And decorating it in the AccountController as below [Authorize]     [InitializeSimpleMembership]     public class AccountController : ControllerIn this case, assuming that we need to override the ValidateUser to point this to existing User database table, and validate it. We have to add one more class like public class CustomAdminMembershipProvider : SimpleMembershipProvider     {         // TODO: will do a better way         private const string SELECT_ALL_USER_SCRIPT = "select * from [dbo].[User]private where UserName = '{0}'";         private readonly IEncrypting _encryptor;         private readonly SimpleSecurityContext _simpleSecurityContext;         public CustomAdminMembershipProvider(SimpleSecurityContext simpleSecurityContext)             : this(new Encryptor(), new SimpleSecurityContext("DefaultDb"))         {         }         public CustomAdminMembershipProvider(IEncrypting encryptor, SimpleSecurityContext simpleSecurityContext)         {             _encryptor = encryptor;             _simpleSecurityContext = simpleSecurityContext;         }         public override bool ValidateUser(string username, string password)         {             if (string.IsNullOrEmpty(username))             {                 throw new ArgumentException("Argument cannot be null or empty", "username");             }             if (string.IsNullOrEmpty(password))             {                 throw new ArgumentException("Argument cannot be null or empty", "password");             }             var hash = _encryptor.Encode(password);             using (_simpleSecurityContext)             {                 var users =                     _simpleSecurityContext.Users.SqlQuery(                         string.Format(SELECT_ALL_USER_SCRIPT, username));                 if (users == null && !users.Any())                 {                     return false;                 }                 return users.FirstOrDefault().Password == hash;             }         }     }SimpleSecurityDataContext at here public class SimpleSecurityContext : DbContext     {         public DbSet<User> Users { get; set; }         public SimpleSecurityContext(string connStringName) :             base(connStringName)         {             this.Configuration.LazyLoadingEnabled = true;             this.Configuration.ProxyCreationEnabled = false;         }         protected override void OnModelCreating(DbModelBuilder modelBuilder)         {             base.OnModelCreating(modelBuilder);                          modelBuilder.Configurations.Add(new UserMapping());         }     }And Mapping for User as below public class UserMapping : EntityMappingBase<User>     {         public UserMapping()         {             this.Property(x => x.UserName);             this.Property(x => x.DisplayName);             this.Property(x => x.Password);             this.Property(x => x.Email);             this.ToTable("User");         }     }One important thing, you need to modify the web.config to point to our customize SimpleMembership <membership defaultProvider="AdminMemberProvider" userIsOnlineTimeWindow="15">       <providers>         <clear/>         <add name="AdminMemberProvider" type="CIK.News.Web.Infras.Security.CustomAdminMembershipProvider, CIK.News.Web.Infras" />       </providers>     </membership>     <roleManager enabled="false">       <providers>         <clear />         <add name="AdminRoleProvider" type="CIK.News.Web.Infras.Security.AdminRoleProvider, CIK.News.Web.Infras" />       </providers>     </roleManager>The good thing at here is we don’t need to modify the code on AccountController. We only need to modify on SimpleMembership and Simple Role (if need). Now build all solutions, run it. We should see a screen like thisIf I login to Twitter button at the bottom of this page, we will be transfer to twitter authentication pageYou have to waiting for a moment Afterwards it will transfer you back to your admin screenYou can find all source codes at my MSDN code. I will really happy if you guys feel free to put some comments as below. It will be helpful to improvement my code in the future. Thank for all your readings. 

    Read the article

  • A Custom View Engine with Dynamic View Location

    - by imran_ku07
        Introduction:          One of the nice feature of ASP.NET MVC framework is its pluggability. This means you can completely replace the default view engine(s) with a custom one. One of the reason for using a custom view engine is to change the default views location and sometimes you need to change the views location at run-time. For doing this, you can extend the default view engine(s) and then change the default views location variables at run-time.  But, you cannot directly change the default views location variables at run-time because they are static and shared among all requests. In this article, I will show you how you can dynamically change the views location without changing the default views location variables at run-time.       Description:           Let's say you need to synchronize the views location with controller name and controller namespace. So, instead of searching to the default views location(Views/ControllerName/ViewName) to locate views, this(these) custom view engine(s) will search in the Views/ControllerNameSpace/ControllerName/ViewName folder to locate views.           First of all create a sample ASP.NET MVC 3 application and then add these custom view engines to your application,   public class MyRazorViewEngine : RazorViewEngine { public MyRazorViewEngine() : base() { AreaViewLocationFormats = new[] { "~/Areas/{2}/Views/%1/{1}/{0}.cshtml", "~/Areas/{2}/Views/%1/{1}/{0}.vbhtml", "~/Areas/{2}/Views/%1/Shared/{0}.cshtml", "~/Areas/{2}/Views/%1/Shared/{0}.vbhtml" }; AreaMasterLocationFormats = new[] { "~/Areas/{2}/Views/%1/{1}/{0}.cshtml", "~/Areas/{2}/Views/%1/{1}/{0}.vbhtml", "~/Areas/{2}/Views/%1/Shared/{0}.cshtml", "~/Areas/{2}/Views/%1/Shared/{0}.vbhtml" }; AreaPartialViewLocationFormats = new[] { "~/Areas/{2}/Views/%1/{1}/{0}.cshtml", "~/Areas/{2}/Views/%1/{1}/{0}.vbhtml", "~/Areas/{2}/Views/%1/Shared/{0}.cshtml", "~/Areas/{2}/Views/%1/Shared/{0}.vbhtml" }; ViewLocationFormats = new[] { "~/Views/%1/{1}/{0}.cshtml", "~/Views/%1/{1}/{0}.vbhtml", "~/Views/%1/Shared/{0}.cshtml", "~/Views/%1/Shared/{0}.vbhtml" }; MasterLocationFormats = new[] { "~/Views/%1/{1}/{0}.cshtml", "~/Views/%1/{1}/{0}.vbhtml", "~/Views/%1/Shared/{0}.cshtml", "~/Views/%1/Shared/{0}.vbhtml" }; PartialViewLocationFormats = new[] { "~/Views/%1/{1}/{0}.cshtml", "~/Views/%1/{1}/{0}.vbhtml", "~/Views/%1/Shared/{0}.cshtml", "~/Views/%1/Shared/{0}.vbhtml" }; } protected override IView CreatePartialView(ControllerContext controllerContext, string partialPath) { var nameSpace = controllerContext.Controller.GetType().Namespace; return base.CreatePartialView(controllerContext, partialPath.Replace("%1", nameSpace)); } protected override IView CreateView(ControllerContext controllerContext, string viewPath, string masterPath) { var nameSpace = controllerContext.Controller.GetType().Namespace; return base.CreateView(controllerContext, viewPath.Replace("%1", nameSpace), masterPath.Replace("%1", nameSpace)); } protected override bool FileExists(ControllerContext controllerContext, string virtualPath) { var nameSpace = controllerContext.Controller.GetType().Namespace; return base.FileExists(controllerContext, virtualPath.Replace("%1", nameSpace)); } } public class MyWebFormViewEngine : WebFormViewEngine { public MyWebFormViewEngine() : base() { MasterLocationFormats = new[] { "~/Views/%1/{1}/{0}.master", "~/Views/%1/Shared/{0}.master" }; AreaMasterLocationFormats = new[] { "~/Areas/{2}/Views/%1/{1}/{0}.master", "~/Areas/{2}/Views/%1/Shared/{0}.master", }; ViewLocationFormats = new[] { "~/Views/%1/{1}/{0}.aspx", "~/Views/%1/{1}/{0}.ascx", "~/Views/%1/Shared/{0}.aspx", "~/Views/%1/Shared/{0}.ascx" }; AreaViewLocationFormats = new[] { "~/Areas/{2}/Views/%1/{1}/{0}.aspx", "~/Areas/{2}/Views/%1/{1}/{0}.ascx", "~/Areas/{2}/Views/%1/Shared/{0}.aspx", "~/Areas/{2}/Views/%1/Shared/{0}.ascx", }; PartialViewLocationFormats = ViewLocationFormats; AreaPartialViewLocationFormats = AreaViewLocationFormats; } protected override IView CreatePartialView(ControllerContext controllerContext, string partialPath) { var nameSpace = controllerContext.Controller.GetType().Namespace; return base.CreatePartialView(controllerContext, partialPath.Replace("%1", nameSpace)); } protected override IView CreateView(ControllerContext controllerContext, string viewPath, string masterPath) { var nameSpace = controllerContext.Controller.GetType().Namespace; return base.CreateView(controllerContext, viewPath.Replace("%1", nameSpace), masterPath.Replace("%1", nameSpace)); } protected override bool FileExists(ControllerContext controllerContext, string virtualPath) { var nameSpace = controllerContext.Controller.GetType().Namespace; return base.FileExists(controllerContext, virtualPath.Replace("%1", nameSpace)); } }             Here, I am extending the RazorViewEngine and WebFormViewEngine class and then appending /%1 in each views location variable, so that we can replace /%1 at run-time. I am also overriding the FileExists, CreateView and CreatePartialView methods. In each of these method implementation, I am replacing /%1 with controller namespace. Now, just register these view engines in Application_Start method in Global.asax.cs file,   protected void Application_Start() { ViewEngines.Engines.Clear(); ViewEngines.Engines.Add(new MyRazorViewEngine()); ViewEngines.Engines.Add(new MyWebFormViewEngine()); ................................................ ................................................ }             Now just create a controller and put this controller's view inside Views/ControllerNameSpace/ControllerName folder and then run this application. You will find that everything works just fine.       Summary:          ASP.NET MVC uses convention over configuration to locate views. For many applications this convention to locate views is acceptable. But sometimes you may need to locate views at run-time. In this article, I showed you how you can dynamically locate your views by using a custom view engine. I am also attaching a sample application. Hopefully you will enjoy this article too. SyntaxHighlighter.all()  

    Read the article

  • Microsoft releases Visual Studio 2010 SP1

    - by brian_ritchie
    Microsoft has been beta testing SP1 since December of last year.  Today, it was released to MSDN subscribers and will be available for public download on March 10, 2011.The service pack includes a slew of fixes, and a number of new features: Silverlight 4 supportBasic Unit Testing support for the .NET Framework 3.5Performance Wizard for SilverlightIntelliTrace for 64-bit and SharePointIIS Express supportSQL CE 4 supportRazor supportHTML5 and CSS3 support (IntelliSense and validation)WCF RIA Services V1 SP1 includedVisual Basic Runtime embeddingALM Improvements Of all the improvements, IIS Express probably has the largest impact on web developer productivity.  According to Scott Gu, it provides the following:It’s lightweight and easy to install (less than 10Mb download and a super quick install)It does not require an administrator account to run/debug applications from Visual Studio It enables a full web-server feature set – including SSL, URL Rewrite, Media Support, and all other IIS 7.x modules It supports and enables the same extensibility model and web.config file settings that IIS 7.x support It can be installed side-by-side with the full IIS web server as well as the ASP.NET Development Server (they do not conflict at all) It works on Windows XP and higher operating systems – giving you a full IIS 7.x developer feature-set on all OS platforms IIS Express (like the ASP.NET Development Server) can be quickly launched to run a site from a directory on disk.  It does not require any registration/configuration steps. This makes it really easy to launch and run for development scenarios.Good stuff indeed.  This will make our lives much easier.  Thanks Microsoft...we're feeling the love!  

    Read the article

  • Does RazorEngine require MVC3 to be installed?

    - by tkha007
    I am working on a web project that uses MVC2. I decided to try out RazorEngine to do some e-mail templating. This appeared to work fine when I was protyping using an MVC2 project so I assumed that RazorEngine will work fine for my e-mail templating solution. What I had forgotten at the time was that I actually had MVC3 installed on my local development machine. After deploying the project on a pre-test server I get the following error in the logs when the application attempts to do anything with RazorEngine: Could not load file or assembly 'System.Web.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. File name: 'System.Web.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' at RazorEngine.Compilation.DefaultCompilerServiceFactory.CreateCompilerService(Language language) at RazorEngine.Templating.TemplateService.CreateTemplateType(String razorTemplate, Type modelType) at RazorEngine.Templating.TemplateService.CreateTemplate[T](String razorTemplate, T model) at RazorEngine.Templating.TemplateService.Parse[T](String razorTemplate, T model) at RazorEngine.Razor.Parse[T](String razorTemplate, T model) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at Persistence.Utility.RazorEngineHelper.Parse(String templateName, Object model) in The fact that it can't find 'System.Web.Razor' means that this DLL does not exist on the deployed server. The only difference I can think of between the deployment server and my local dev machine is that the deployment server does not have MVC3 installed but I may be mistaken because the deployment server is not something I normally control and as such I don't have a lot of information about it. It is meant to host this particular application so there have been previous deployments of this application to this server. This is the first time I'm making a deployment with RazorEngine as a dependency.

    Read the article

  • Blackberry storm 9530 tracing touch events while scrolling

    - by SWATI
    hey in my screen there is a an edit field and 2 custom button fields as "OK" and "CANCEL" Below buttonfield there are some more focussable label fields when i write a name in edit field and press enter then focus comes to "OK" button but how to set focus on "CANCEL" button. Moreover while scrolling the focus does not automatically move ahead??? what to do may be i m confused with touch events and their handling!!! Kindly help!!!!!!!!!!!! Code: txt_Name = new EditField(TextField.NO_NEWLINE) { public void paint(net.rim.device.api.ui.Graphics g) { g.setColor(Color.MAROON); super.paint(g); } }; txt_Name.setFont(font); v1 = new VerticalFieldManager(); v1.add(txt_Name ); ButtonField btn1 = new ButtonField("OK",ButtonField.CONSUME_CLICK); ButtonField btn2 = new ButtonField("CANCEL",ButtonField.CONSUME_CLICK); v2 = new VerticalFieldManager(); v2.add(btn1); v2.add(btn2); LabelField l1 = new LabelField("Hello Moon ",Field.Focussable); LabelField l2 = new LabelField("Hello Citizen",Field.Focussable); LabelField l3 = new LabelField("Hello People",Field.Focussable); LabelField l4 = new LabelField("Hello world",Field.Focussable); v3 = new VerticalFieldManager(); v3.add(l1); v3.add(l2); v3.add(l3); v3.add(l4); add(v1); add(v2); add(v3); } protected boolean navigationClick(int status, int time) { if(OK.isFocus()) { //execute some code return true; } if(CANCEL.isFocus()) { //execute some code return true; } }

    Read the article

  • Disable Razors default .cshtml handler in a ASP.NET Web Application

    - by mythz
    Does anyone know how to disable the .cshtml extension completely from an ASP.NET Web Application? In essence I want to hijack the .cshtml extension and provide my own implementation based on a RazorEngine host, although when I try to access the page.cshtml directly it appears to be running under an existing WebPages razor host that I'm trying to disable. Note: it looks like its executing .cshtml pages under the System.Web.WebPages.Razor context as the Microsoft.Data Database is initialized. I don't even have any Mvc or WebPages dlls referenced, just System.Web.dll and a local copy of System.Web.Razor with RazorEngine.dll I've created a new ASP.NET Web .NET 4.0 Application and have tried to clear all buildProviders and handlers as seen below: <system.web> <httpModules> <clear/> </httpModules> <compilation debug="true" targetFramework="4.0"> <buildProviders> <clear/> </buildProviders> </compilation> <httpHandlers> <clear/> <add path="*" type="MyHandler" verb="*"/> </httpHandlers> </system.web> <system.webServer> <modules runAllManagedModulesForAllRequests="true"> <clear/> </modules> <handlers> <clear/> <add path="*" name="MyHandler" type="MyHandler" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" /> </handlers> </system.webServer> Although even with this, when I visit any page.cshtml page it still bypasses My wildcard handler and tries to execute the page itself. Basically I want to remove all traces of .cshtml handlers/buildProviders/preprocessing so I can serve the .cshtml pages myself, anyone know how I can do this?

    Read the article

  • Disabling Submit Button in ASP.NET 3.5 Application with JavaScript breaks BlackBerry submission

    - by ahsteele
    The following code is being used to disable a Submit button once it has been clicked. This works great on desktop browsers and most BlackBerry mobile browsers. Submit.Attributes.Add("onclick", "javascript:this.disabled=true;" + ClientScript.GetPostBackEventReference(Submit, null)); Unfortunately, when using a BlackBerry Storm clicking the submit button causes the device to just reload the page. If I remove this code the Storm browser submits the page just fine. I need to disable the button when the browser is capable of doing so but do not want to affect browsers that are not JavaScript capable. I realize I could add the jQuery framework and only attach the event client side, but am trying to look for the simplest fix (read least intrusive) as this is a legacy application. Any suggestions?

    Read the article

  • MVC3 Custom view engine

    - by eth0
    I have a custom View Engine that derives from WebFormViewEngine. There's a lot of stuff going on in here, mostly caching. I want to be able to use WebFormViewEngine AND RazorViewEngine at the same time, is this possible? Ideally I'd like to do; ViewEngines.Add(new MyViewEngine<WebFormsViewEngine>()); ViewEngines.Add(new MyViewEngine<RazorViewEngine>()); if a .ascx/.aspx/.master file exists then use WebForms, otherwise use Razor is a .cshtml file exists. EDIT: I should of worded my question better. As my custom view engine derives from WebFormViewEngine it obviously uses WebForms, I can't derive from two classes. I can derive from RazorViewEngine but then I'll loose WebForms. I can duplicate my code entirely, derive from RazorViewEngine and edit the views file extensions, etc. but as I said I've got a lot of custom code in my view engine and would be duplicating hundreds of lines. WebFormViewEngine and RazorViewEngine derive from BuildManagerViewEngine which in turn implements IViewEngine. The problem with that is I have to implement methods CreatePartialView() and CreateView() but how would I know what to return (WebForms/Razor?) using generics?

    Read the article

  • ASP.NET MVC, Web API, Razor : Microsoft prendra en compte les contributions externes pour ces produits open source

    ASP.NET MVC, Web API, Razor : Microsoft prendra en compte les contributions externes pour ces produits open source Microsoft vient d'annoncer qu'il allait publier sous licence open source Apache 2.0 le code source de Web Pages et ASP.NET Web API. Web Pages est la plateforme sur laquelle repose le nouveau moteur de vue Razor, la première version avait été publiée avec WebMatrix 1 et ASP.NET MVC 3. Web Pages est actuellement disponible en version 2 beta. ASP.NET Web API, quant à elle, permet aux développeurs d'exposer leurs applications, données et services sur le web directement à travers HTTP. La technologie avait été introduite avec ASP.NET MVC 4 beta. Le passage à l'op...

    Read the article

  • Issue with TagBuilder.MergeAttribute for parameter null

    - by The Yur
    I would like to use Razor's feature not to produce attribute output inside a tag in case when attribute's value is null. So when Razor meets <div class="@var" where @var is null, the output will be mere <div. I've created some Html extension method to write text inside tag. The method takes header text, level (h1..h6), and html attributes as simple object. The code is: public static MvcHtmlString WriteHeader(this HtmlHelper html, string s, int? hLevel = 1, object htmlAttributes = null) { if ((hLevel == null) || (hLevel < 1 || hLevel > 4) || (s.IsNullOrWhiteSpace())) return new MvcHtmlString(""); string cssClass = null, cssId = null, cssStyle = null; if (htmlAttributes != null) { var T = htmlAttributes.GetType(); var propInfo = T.GetProperty("class"); var o = propInfo.GetValue(htmlAttributes); cssClass = o.ToString().IsNullOrWhiteSpace() ? null : o.ToString(); propInfo = T.GetProperty("id"); o = propInfo.GetValue(htmlAttributes); cssId = o.ToString().IsNullOrWhiteSpace() ? null : o.ToString(); propInfo = T.GetProperty("style"); o = propInfo.GetValue(htmlAttributes); cssStyle = o.ToString().IsNullOrWhiteSpace() ? null : o.ToString(); } var hTag = new TagBuilder("h" + hLevel); hTag.MergeAttribute("id", cssId); hTag.MergeAttribute("class", cssClass); hTag.MergeAttribute("style", cssStyle); hTag.InnerHtml = s; return new MvcHtmlString(hTag.ToString()); } I found that in spite of null values for "class" and "style" attributes TagBuilder still puts them as empty strings, like <h1 class="" style="" But for id attribute it surprisingly works, so when id's value is null, there is no id attribute in tag. My question - is such behavior something that should actually happen? How can I achieve absent attributes with null values using TagBuilder? I tried this in VS2013, MVC 5.

    Read the article

  • ServiceStack razor default page

    - by Tom
    Say I have 2 pages /NotADefault.cshtml /Views/Default.cshtml Question 1. Now I run it, page A always gets called implicitly as start-up default page no matter what I name it. Page B will only be called when I explicitly call localhost/View/Default. How do I make page B (the one in View folder) my default page? Question 2. I also have NotADefaultService.cs and DefaultService.cs. I give each page a Service class at the back. However, when page A is called NotADefaultService.cs never gets called. Only DefaultService.cs gets called when page B is called... My observation is that only the pages in the View folder will get their back-end service class working. Outside of View folder it doesn't work. Combining Q1 and Q2. How do I: Option 1. get the backend service class working under / root outside "View" folder? OR Option 2. appoint /View/Default.schtml as my default at start-up where the service class can be hit?

    Read the article

  • how to pass parameter to partial view in MVC4 razor

    - by user2139492
    In my asp.net mvc 4 application i want to pass a parameter to partial view,however the parameter we want to pass is coming from javascript code Below is the code <script> var TestId; $(document).ready(function () { // Send an AJAX request $.getJSON("/api//GetFun?Id="[email protected], function (data) { TestId= data.Id //i am getting the id here which i need to pass in partial view } 1)........... }); </script> html code: <div id="tab1" > 2).... @{ Html.RenderAction("MyPartialView", "MyController", new { id = TestId });} </div> So let me know how can i pass the test id to my partial view :in HTML(2) code or in javascript (1)

    Read the article

  • Why doesn't Request.IsAjaxRequest() work in ASP.NET MVC 3?

    - by Rob Ellis
    I'm creating a new project, asp.net mvc3 with Razor, and wanting to turn the LogOn into an ajax request. HTML @using (Ajax.BeginForm("LogOn", "Account", new AjaxOptions { HttpMethod="post", OnSuccess="LoginSubmitted"})) { } Controller if (Request.IsAjaxRequest()) { return Json(new { ResultMessage = "Username or password provided is incorrect"}); } else { ModelState.AddModelError("", "The user name or password provided is incorrect."); } Everything else remains the same. First, looking at the the http response with Fiddler, I notice there is no x-requested-with header. So I add <input type="hidden" name="X-Requested-With" value="XMLHttpRequest" /> That seems to work, but now what I receive back is a Json object, which isn't being parsed and instead Google Chrome is just rendering the Json to screen. Whats happening?

    Read the article

  • Waiting for a background operation to complete

    - by JohnHenry
    I have been suffering from the all too common 'Waiting for a background operation to complete...' message in Visual Studio 2012 (Professional) for a while now but it has been fairly sporadic. Lately though, I am really struggling to use Visual Studio as pretty much whenever i try and do anything with any Razor views (mostly clicking to move the cursor) visual studio hangs and the above message appears for about a minute at a time. (If when its finished doing stuff i then click in the view again, the process repeats, and repeats, and repeats.....) I have searched high and low, and read loads of articles regarding this and peoples suggestions and tried changing indentation settings, resetting settings, etc but none have worked. Has anyone come across something else that may work as this is seriously impeding my ability to use visual studio and sadly provoking much cursing.

    Read the article

  • ASP.NET MVC4: How to convert an IEnumerable to a string for ViewBag

    - by sehummel
    This is what I'm trying to do, but it doesn't work: HardwareType hwt = new HardwareType { HType = "PC" }; IEnumerable<Hardware> Pcs = db.Hardware.Where(h => h.HardwareType.Contains(hwt)); ViewBag.Pcs = Pcs.ToString(); So how do I convert my IEnumerable to a string (or other primitive data type) so the compiler won't give me an error when I try to use it in my Razor? @foreach (var item in ViewBag.Pcs) { <li><a href="#" class="btn"><i class="icon-hdd"></i> @item.HType</a></li> }

    Read the article

  • How to make a general profile for PHPUnit testing in WebIDE?

    - by Ondrej Slinták
    I'm playing a bit with beta version of PHP Storm (PHP version of WebIDE) and its integration of PHPUnit. I know how to set a profile to run tests in particular file, directory or class. Problem is, I'd like to create some profile where Run button would run tests in currently opened file. Any idea if there's a way to do it? Or perhaps it isn't implemented in beta version yet?

    Read the article

  • How could i get selected value from dropdownlist in kendo ui grid in mvc

    - by Karthik Bammidi
    I am working on Kendo UI with asp.net mvc razor. I am trying to bind database table data with kendo grid that supports CRUD operations. Here i need to populate a dropdownlist for one of my table field. I have used the following code View: @model IEnumerable<MvcApplication1.PriceOption> @(Html.Kendo().Grid(Model) .Name("Grid") .Columns(columns => { //columns.Bound(p => p.ProductTitle).ClientTemplate("<input type='checkbox' disabled='disabled'name='Discontinued' <#= Discontinued? checked='checked' : '' #> />"); columns.Bound(p => p.ProductTitle).EditorTemplateName("OptionalEmail"); columns.Bound(p => p.OptionTitle); columns.Bound(p => p.Price); columns.Bound(p => p.Frequency); columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200); }) .ToolBar(toolbar => toolbar.Create()) .Editable(editable => editable.Mode(Kendo.Mvc.UI.GridEditMode.InLine)) .Pageable() .Sortable() .Scrollable() .DataSource(dataSource => dataSource .Ajax() .Events(events => events.Error("error_handler")) .Model(model => model.Id(p => p.ProductID)) .Create(create => create.Action("CreateOption", "ZiceAdmin")) .Read(read => read.Action("Read", "ZiceAdmin")) .Update(update => update.Action("UpdateOption", "ZiceAdmin")) .Destroy(update => update.Action("DeleteOption", "ZiceAdmin")) ) ) OptionalEmail.cshtml @model string @(Html.Kendo().DropDownList() .Name("ProductTitle") .Value(Model) .SelectedIndex(0) .BindTo(new SelectList(ViewBag.ProductTitle)) ) Here i need to store the selected item from the dropdownlist. But it always shows null. How could i get the selected value from dropdownlist.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >