Search Results

Search found 58341 results on 2334 pages for 'learning net'.

Page 48/2334 | < Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >

  • How to disable an ASP.NET linkbutton when clicked

    - by Jeff Widmer
    Scenario: User clicks a LinkButton in your ASP.NET page and you want to disable it immediately using javascript so that the user cannot accidentally click it again.  I wrote about disabling a regular submit button here: How to disable an ASP.NET button when clicked.  But the method described in the other blog post does not work for disabling a LinkButton.  This is because the Post Back Event Reference is called using a snippet of javascript from within the href of the anchor tag: <a id="MyContrl_MyButton" href="javascript:__doPostBack('MyContrl$MyButton','')">My Button</a> If you try to add an onclick event to disable the button, even though the button will become disabled, the href will still be allowed to be clicked multiple times (causing duplicate form submissions).  To get around this, in addition to disabling the button in the onclick javascript, you can set the href to “#” to prevent it from doing anything on the page.  You can add this to the LinkButton from your code behind like this: MyButton.Attributes.Add("onclick", "this.href='#';this.disabled=true;" + Page.ClientScript.GetPostBackEventReference(MyButton, "").ToString()); This code adds javascript to set the href to “#” and then disable the button in the onclick event of the LinkButton by appending to the Attributes collection of the ASP.NET LinkButton control.  Then the Post Back Event Reference for the button is called right after disabling the button.  Make sure you add the Post Back Event Reference to the onclick because now that you are changing the anchor href, the button still needs to perform the original postback. With the code above now the button onclick event will look something like this: onclick="this.href='#';this.disabled=true;__doPostBack('MyContrl$MyButton','');" The anchor href is set to “#”, the linkbutton is disabled, AND then the button post back method is called. Technorati Tags: ASP.NET LinkButton

    Read the article

  • Creating vCard action result

    - by DigiMortal
    I added support for vCards to one of my ASP.NET MVC applications. I worked vCard support out as very simple and intelligent solution that fits perfectly to ASP.NET MVC applications. In this posting I will show you how to send vCards out as response to ASP.NET MVC request. We need three things: some vCard class, vCard action result, controller method to test vCard action result. Everything is very simple, let’s get hands on. vCard class As first thing we need vCard class. Last year I introduced vCard class that supports also images. Let’s take this class because it is easy to use and some dirty work is already done for us. NB! Take a look at ASP.NET example in the blog posting referred above. We need it later when we close the topic. Now think about how useful blogging and information sharing with others can be. With this class available at public I saved pretty much time now. :) vCardResult As we have vCard it is now time to write action result that we can use in our controllers. Here’s the code. public class vCardResult : ActionResult {     private vCard _card;       protected vCardResult() { }       public vCardResult(vCard card)     {         _card = card;     }       public override void ExecuteResult(ControllerContext context)     {         var response = context.HttpContext.Response;         response.ContentType = "text/vcard";         response.AddHeader("Content-Disposition", "attachment; fileName=" + _card.FirstName + " " + _card.LastName + ".vcf");           var cardString = _card.ToString();         var inputEncoding = Encoding.Default;         var outputEncoding = Encoding.GetEncoding("windows-1257");         var cardBytes = inputEncoding.GetBytes(cardString);           var outputBytes = Encoding.Convert(inputEncoding,                                 outputEncoding, cardBytes);           response.OutputStream.Write(outputBytes, 0, outputBytes.Length);     } } And we are done. Some notes: vCard is sent to browser as downloadable file (user can save or open it with Outlook or any other e-mail client that supports vCards), File name is made of first and last name of contact. Encoding is important because Outlook may not understand vCards otherwise (don’t know if this problem is solved in Outlook 2010). Using vCardResult in controller Now let’s tale a look at simple controller method that accepts person ID and returns vCardResult. public class ContactsController : Controller {       // ... other controller methods ...       public vCardResult vCard(int id)     {         var person = _partyRepository.GetPersonById(id);         var card = new vCard                 {                     FirstName=person.FirstName,                     LastName = person.LastName,                     StreetAddress = person.StreetAddress,                     City = person.City,                     CountryName = person.Country.Name,                       Mobile = person.Mobile,                     Phone = person.Phone,                     Email = person.Email,                 };           return new vCardResult(card);     } } Now you can run Visual Studio and check out how your vCard is moving from your web application to your e-mail client. Conclusion We took old code that worked well with ASP.NET Forms and we divided it into action result and controller method that uses vCard as bridge between our controller and action result. All functionality is located where it should be and we did nothing complex. We wrote only couple of lines of very easy code to achieve our goal. Do you understand now why I love ASP.NET MVC? :)

    Read the article

  • Enhancing performance in Entity Framework applications by precompiling LINQ to Entities queries

    - by nikolaosk
    This is going to be the tenth post of a series of posts regarding ASP.Net and the Entity Framework and how we can use Entity Framework to access our datastore. You can find the first one here , the second one here , the third one here , the fourth one here , the fifth one here ,the sixth one here ,the seventh one here ,the eighth one here and the ninth one here . I have a post regarding ASP.Net and EntityDataSource . You can read it here .I have 3 more posts on Profiling Entity Framework applications...(read more)

    Read the article

  • Upcoming DotNetNuke Training for January 2011

    - by Chris Hammond
    With the New Year, why not resolve to learn more about DotNetNuke ? DotNetNuke is the most successful and widely adopted open source project on the Microsoft Stack. Its been around for eight years and isn’t going away anytime soon. While the software itself is written in VB.Net you are not limited to VB.Net when developing custom extensions for the platform, in fact, when I do my module development I do it primarily in C# out of preference. If you’re a developer out there who shuns learning a framework...(read more)

    Read the article

  • HTTP Error 403.18 - Forbidden - asp.net mvc web api

    - by CoffeeCode
    I have deployed the default asp.net mvc 4 web api project to my windows server 2008 RC and am experiensing some issues with calling the web api actions. I'm quite new in the server/iis configuration part. I can open the home page, but the API part doesnt work. I'm getting such an error: HTTP Error 403.18 - Forbidden The specified request cannot be processed in the application pool that is configured for this resource on the Web server Module IIS Web Core Notification BeginRequest Handler StaticFile Error Code 0x00000000 Requested URL http://server.com:80/index.php?p=MvcApplication2_deploy/api/values/ Physical Path C:\Inetpub\vhosts\server.com\Webservice\index.php Logon Method Not yet determined Logon User Not yet determined I have checked Url Rewrite it is empty, have disabled WebDAV and also checked the Handler Mappings every thing seems to be ok there. Could any one give me some hints what could be wrong? Thanks!!!

    Read the article

  • ASP.NET MVC app on IIS7 with WebForms content is throwing NTLM authenticate box

    - by Jon
    I have an ASP.NET MVC app that also contains some WebForms content (for SSRS ReportViewer). This is deployed to IIS7 and the MVC pages of the app work fine, but when I try to browse to the aspx page I am prompted with the NTLM auth box. I do not have NTLM enabled, I only have Anonymous auth enabled. I have this deployed and fully working on an IIS6 box, the only other difference is that the IIS6 box is in our company domain, but the IIS7 box is not (I fail to see how this could be the issue as the MVC stuff is working fine). Any thoughts? Thanks.

    Read the article

  • Can't install .NET framework 4.0 on Windows XP professional version 2002 SP3 (OS bug?)

    - by that guy
    .NET framework 4.0 install fails on Windows XP professional version 2002 SP3: I tried to run setup using "run as..." to make sure the admin rights are used ("protect my computer..." tick was deselected of course). I tried everything: installing using online/offline setup, windows update. install goes a little and then "rolls back" and says: Installation did not succeed .NET Framework 4 has not been installed because: Fatal error during installation. for more information about this problem, see the log file. the full log: http://pastebay.net/1433771 Any ideas? EDIT1: I have found this in the log: "BlockIf: You must install the 32-bit Windows Imaging Component (WIC) before you run Setup. Please visit the Microsoft Download Center to install WIC, and then rerun Setup...." So I found it, and launched "wic_x86_enu.exe" - but it said: WIC Setup error Newer version of update is already on the system. I have already installed: .NET framewrok 2.0 SP2 .NET framewrok 3.0 SP2 .NET framewrok 3.5 SP1 but I need 4.0 . EDIT2: another attempt and it's log. (this time better copy of log file): http://pastebin.com/gmGfbM9a (copy to notepad and save as .htm and open with internet browser). I have tried all the solutions I could find - and nothing helped. I have found something weird: when I formatted the hard drive and installed windows xp again - the .NET framework 4.0 installed ok, but when I plugged my 100Mbit internet cable - the operating system kind off "locked itself" and the bug returned - I could no longer install .NET framework 4.0 again. There was no reason for that to happen, for example I have windows server 2003 in local network, but I don't have active directory enabled on it or anything like that - the server just has some folders shared and thats all (all server's "features" are default). I had the second pc with the same problem - with XP on it too. This seems like the bug of Operating System to me. I couldn't find what was causing the problem. After many days I gave up: backuped everything, formatted HDD and installed Windows 7 professional 64bit. .NET framework 4.0 installed with no problem on it.

    Read the article

  • MS Chart with ASP.NET chart type "column" not showing axis x label if there are more than 9 bar in t

    - by Bayonian
    Hi, I'm having problem with MS Chart chart type column. If there are only 9 bar in the chart like the following picture, then the axis-x label show up properly. However, there are more than 9 bars bar the chart, the axis-x label wont show up properly, some of them just dissappear. Here's my mark-up for the chart: <asp:Chart ID="chtNBAChampionships" runat="server"> <Series> <asp:Series Name="Championships" YValueType="Int32" Palette="Berry" ChartType="Column" ChartArea="MainChartArea" IsValueShownAsLabel="true"> <Points> <asp:DataPoint AxisLabel="Celtics" YValues="17" /> <asp:DataPoint AxisLabel="Lakers" YValues="15" /> <asp:DataPoint AxisLabel="Bulls" YValues="6" /> <asp:DataPoint AxisLabel="Spurs" YValues="4" /> <asp:DataPoint AxisLabel="76ers" YValues="3" /> <asp:DataPoint AxisLabel="Pistons" YValues="3" /> <asp:DataPoint AxisLabel="Warriors" YValues="3" /> <asp:DataPoint AxisLabel="Mara" YValues="4" /> <asp:DataPoint AxisLabel="Saza" YValues="9" /> <asp:DataPoint AxisLabel="Buha" YValues="6" /> </Points> </asp:Series> </Series> <ChartAreas> <asp:ChartArea Name="MainChartArea"> </asp:ChartArea> </ChartAreas> </asp:Chart> I don't know it works with only 9 bars? Is there any way to make the chart work properly? Also, if possible, how to make each bar have different color. Thank you.

    Read the article

  • controller path not found for static images? asp.net mvc routing issue?

    - by rksprst
    I have an image folder stored at ~/Content/Images/ I am loading these images via <img src="/Content/Images/Image.png" /> Recently, the images aren't loading and I am getting the following errors in my error log. What's weird is that some images load fine, while others do not load. Anyone have any idea what is wrong with my routes? Am I missing an ignore route for the /Content/ folder? I am also getting the same error for favicon.ico and a bunch of other image files... <Fatal> -- 3/25/2010 2:32:38 AM -- System.Web.HttpException: The controller for path '/Content/Images/box_bottom.png' could not be found or it does not implement IController. at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(Type controllerType) at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) at System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) at System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) at System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) My current routes look like this: routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults ); routes.MapRoute( "ControllerDefault", // Route name "{controller}/project/{projectid}/{action}/{searchid}", // URL with parameters new { controller = "Listen", action = "Index", searchid = "" } // Parameter defaults ); Thanks!

    Read the article

  • What are some good resources for learning C beyond K&R

    - by Roland
    Hi, I'm currently reaching the end of working through the K&R book "The C Programming Language", and I'm looking for things to read next. Any recommendations of: blogs more detailed / advanced books (I've already stuck Advanced Programming in a Unix Environment on my Safari bookshelf) open source code (beginner-friendly and with good C idioms or style) to read up on next would be gratefully appreciated. To be specific, I'm most interested in things relevant to a *nix environment rather than Windows. Cheers, Roland

    Read the article

  • Is it worth learning Perl 6?

    - by Andres
    I have the opportunity to take a two day class on Perl 6 with the Rakudo Compiler. I don't want to start a religious war, but is it worth my time? Is there any reason to believe that Perl 6 will be practical in the real world within the next two years? Does anyone currently use it effectively? Update I took the class and learned a lot. However, after day 1, my mind was a bit overwhelmed. There are tons of cool ideas in perl 6, and it will be neat to see what filters up to other languages. Overall the experience was a positive use of my time, though I wasn't able to absorb as much on the second day. If it were a three day class it would have been unproductive just because there is a limit to how much you can process in a short amount of time.

    Read the article

  • .Net reflection to get description of class / property etc?

    - by ClarkeyBoy
    Hi, I know its unlikely but I was wondering if there is any way to get the comments (i.e. the bits after the ''') of a class or property..? I have managed to get a list of properties of a class using the PropertyInfo class but I cant find a way to get the comments / description.. I need it for a guide I am writing for the administrators of my site - it would be great if it could automatically update if new properties are added, so there is no need to worry about updating it in the future too much. Anyone know how to do this? Thanks in advance. Regards, Richard

    Read the article

  • How to change id value when using Html.DropDownListFor helper in asp.net mvc 2.0?

    - by chobo2
    Hi I have a partial view that has something like this <%= Html.DropDownListFor(m => m.SelectedProductName, Model.ProductList, "Select a Product") %> Now you can create a new product and edit a existing product. Both editing and creating use the same form. The create is on the main page on load up. Edit popus up in a jquery u.i model dialog and renders a new partial view. So as far as the page is concerned is that I have 2 dropdown boxes with the same "id" which is bad since they should be unique. So how do I change the id? So when the edit loads it might have a id of "editSelectedProductName"? I tried to do this in the view model public string SelectedProductName{ get; set; } ViewModelConstructor() { SelectedProductName = "EditSelectedProductName"; } But it seems to not care and keeps using "SelectedProductName" as the product name. Thanks

    Read the article

  • .Net reflection to get developers comments about class / property etc?

    - by ClarkeyBoy
    Hi, I know its unlikely but I was wondering if there is any way to get the comments (i.e. the bits after the ''') of a class or property..? I have managed to get a list of properties of a class using the PropertyInfo class but I cant find a way to get the comments / description.. I need it for a guide I am writing for the administrators of my site - it would be great if it could automatically update if new properties are added, so there is no need to worry about updating it in the future too much. Anyone know how to do this? Thanks in advance. Regards, Richard

    Read the article

  • Tips for learning faster

    - by Helper Method
    When I start to learn something new, a new tool, programming language, etc. it often takes me sooo much time to learn it. In the end, I have a deep understanding (well, most of the time ;-)), but lacking the time for other things also important. Do you know any tips to learn faster without sacrificing too much depth?

    Read the article

  • How to know what you don't know?

    - by Ivo Danihelka
    Is there a way how to recognize that you don't know something? For example, I had some hard realizations: I didn't know that criticism isn't a good way to teach your friends. I realized that after reading How to Win Friends & Influence People. I didn't know about the fundamental needed for an indutive bias in machine learning. If I have read Mitchell's Machine Learning book early, I would know it. I haven't found it mentioned in other books and papers. Sorry if the question is too generic. The question could also mean: How to know that you are missing something important about your programming language?

    Read the article

  • Asp.Net 1 -> Asp.Net 2 upgrade - Machine.Config - unrecognized parameter

    - by Chris
    Hi All, I am working on upgrading a web app to asp.net 2 from 1. VS 2008 did its conversion things, and everything is building successfully and has been converted to a web application via the appropriate menu item in VS 2008. On launching the site using the Asp.net development server I am receiving a configuration error on the appsettings line in the machine config of Unrecognized attribute 'restartOnExternalChanges'. The app targets asp.net 2 in the projects properties in VS, and the error page indicates similar : Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 The error message seems to indicate I am trying to run this in an asp.net 1 environment, but surely that isnt the case, and if so how do I rectify this. Any help would be appreciated Thanks,

    Read the article

< Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >