Search Results

Search found 53991 results on 2160 pages for 'asp net 3 5'.

Page 105/2160 | < Previous Page | 101 102 103 104 105 106 107 108 109 110 111 112  | Next Page >

  • C# 4.0 in a Nutshell, Fourth Edition

    - by outcoldman
    Just became a lucky owner of this book C# IN A NUTSHELL 4th edition. This is a fourth edition of this book’s series. I saw previous third edition of this book, we presented it on one of our events at Yaroslavl State University, but that book was a Russian translated version and published in Russia, this is was bad side of that book – all books at Russia printed on really bad paper. I should say that I didn’t read this book by end, but already I was surprised. Why? Why I heard a lot about Richter CLR via C# (English version of 3rd edition of this book I already have, and this book are waiting my attention), and just a few words about C# IN A NUTSHELL, at least in my sphere. I just listen once about this book at one of the podcast of Alt.Net group, and this words was Richter it is really good book, and C# IN A NUTSHELL it is a good handbook. My opinion is - you should read Richter if you want to develop with .NET. But if you want to develop on .NET with C# you should read C# IN A NUTSHELL too. Read more...

    Read the article

  • DevDays ‘00 The Netherlands day #2

    - by erwin21
    Day 2 of DevDays 2010 and again 5 interesting sessions at the World Forum in The Hague. The first session of the today in the big world forum theater was from Scott Hanselman, he gives a lap around .NET 4.0. In his way of presenting he talked about all kind of new features of .NET 4.0 like MEF, threading, parallel processing, changes and additions to the CLR and DLR, WPF and all new language features of .NET 4.0. After a small break it was ready for session 2 from Scott Allen about Tips, Tricks and Optimizations of LINQ. He talked about lazy and deferred executions, the difference between IQueryable and IEnumerable and the two flavors of LINQ syntax. The lunch was again very good prepared and delicious, but after that it was time for session 3 Web Vulnerabilities and Exploits from Alex Thissen. This was no normal session but more like a workshop, we decided what kind of subjects we discussed, the subjects where OWASP, XSS and other injections, validation, encoding. He gave some handy tips and tricks how to prevent such attacks. Session 4 was about the new features of C# 4.0 from Alex van Beek. He talked about Optional- en Named Parameters, Generic Co- en Contra Variance, Dynamic keyword and COM Interop features. He showed how to use them but also when not to use them. The last session of today and also the last session of DevDays 2010 was about WCF Best Practices from Gerben van Loon. He talked about 7 best practices that you must know when you are going to use WCF. With some quick demos he showed the problem and the solution for some common issues. It where two interesting days and next year i sure will be attending again.

    Read the article

  • DropDownList and SelectListItem Array Item Updates in MVC

    - by Rick Strahl
    So I ran into an interesting behavior today as I deployed my first MVC 4 app tonight. I have a list form that has a filter drop down that allows selection of categories. This list is static and rarely changes so rather than loading these items from the database each time I load the items once and then cache the actual SelectListItem[] array in a static property. However, when we put the site online tonight we immediately noticed that the drop down list was coming up with pre-set values that randomly changed. Didn't take me long to trace this back to the cached list of SelectListItem[]. Clearly the list was getting updated - apparently through the model binding process in the selection postback. To clarify the scenario here's the drop down list definition in the Razor View:@Html.DropDownListFor(mod => mod.QueryParameters.Category, Model.CategoryList, "All Categories") where Model.CategoryList gets set with:[HttpPost] [CompressContent] public ActionResult List(MessageListViewModel model) { InitializeViewModel(model); busEntry entryBus = new busEntry(); var entries = entryBus.GetEntryList(model.QueryParameters); model.Entries = entries; model.DisplayMode = ApplicationDisplayModes.Standard; model.CategoryList = AppUtils.GetCachedCategoryList(); return View(model); } The AppUtils.GetCachedCategoryList() method gets the cached list or loads the list on the first access. The code to load up the list is housed in a Web utility class. The method looks like this:/// <summary> /// Returns a static category list that is cached /// </summary> /// <returns></returns> public static SelectListItem[] GetCachedCategoryList() { if (_CategoryList != null) return _CategoryList; lock (_SyncLock) { if (_CategoryList != null) return _CategoryList; var catBus = new busCategory(); var categories = catBus.GetCategories().ToList(); // Turn list into a SelectItem list var catList= categories .Select(cat => new SelectListItem() { Text = cat.Name, Value = cat.Id.ToString() }) .ToList(); catList.Insert(0, new SelectListItem() { Value = ((int)SpecialCategories.AllCategoriesButRealEstate).ToString(), Text = "All Categories except Real Estate" }); catList.Insert(1, new SelectListItem() { Value = "-1", Text = "--------------------------------" }); _CategoryList = catList.ToArray(); } return _CategoryList; } private static SelectListItem[] _CategoryList ; This seemed normal enough to me - I've been doing stuff like this forever caching smallish lists in memory to avoid an extra trip to the database. This list is used in various places throughout the application - for the list display and also when adding new items and setting up for notifications etc.. Watch that ModelBinder! However, it turns out that this code is clearly causing a problem. It appears that the model binder on the [HttpPost] method is actually updating the list that's bound to and changing the actual entry item in the list and setting its selected value. If you look at the code above I'm not setting the SelectListItem.Selected value anywhere - the only place this value can get set is through ModelBinding. Sure enough when stepping through the code I see that when an item is selected the actual model - model.CategoryList[x].Selected - reflects that. This is bad on several levels: First it's obviously affecting the application behavior - nobody wants to see their drop down list values jump all over the place randomly. But it's also a problem because the array is getting updated by multiple ASP.NET threads which likely would lead to odd crashes from time to time. Not good! In retrospect the modelbinding behavior makes perfect sense. The actual items and the Selected property is the ModelBinder's way of keeping track of one or more selected values. So while I assumed the list to be read-only, the ModelBinder is actually updating it on a post back producing the rather surprising results. Totally missed this during testing and is another one of those little - "Did you know?" moments. So, is there a way around this? Yes but it's maybe not quite obvious. I can't change the behavior of the ModelBinder, but I can certainly change the way that the list is generated. Rather than returning the cached list, I can return a brand new cloned list from the cached items like this:/// <summary> /// Returns a static category list that is cached /// </summary> /// <returns></returns> public static SelectListItem[] GetCachedCategoryList() { if (_CategoryList != null) { // Have to create new instances via projection // to avoid ModelBinding updates to affect this // globally return _CategoryList .Select(cat => new SelectListItem() { Value = cat.Value, Text = cat.Text }) .ToArray(); } …}  The key is that newly created instances of SelectListItems are returned not just filtered instances of the original list. The key here is 'new instances' so that the ModelBinding updates do not update the actual static instance. The code above uses LINQ and a projection into new SelectListItem instances to create this array of fresh instances. And this code works correctly - no more cross-talk between users. Unfortunately this code is also less efficient - it has to reselect the items and uses extra memory for the new array. Knowing what I know now I probably would have not cached the list and just take the hit to read from the database. If there is even a possibility of thread clashes I'm very wary of creating code like this. But since the method already exists and handles this load in one place this fix was easy enough to put in. Live and learn. It's little things like this that can cause some interesting head scratchers sometimes…© Rick Strahl, West Wind Technologies, 2005-2012Posted in MVC  ASP.NET  .NET   Tweet !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs"); (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })();

    Read the article

  • How do I tell the cases when it's worth to use LINQ?

    - by Lijo
    Many things in LINQ can be accomplished without the library. But for some scenarios, LINQ is most appropriate. Examples are: SELECT - http://stackoverflow.com/questions/11883262/wrapping-list-items-inside-div-in-a-repeater SelectMany, Contains - http://stackoverflow.com/questions/11778979/better-code-pattern-for-checking-existence-of-value Enumerable.Range - http://stackoverflow.com/questions/11780128/scalable-c-sharp-code-for-creating-array-from-config-file WHERE http://stackoverflow.com/questions/13171850/trim-string-if-a-string-ends-with-a-specific-word What factors to take into account when deciding between LINQ and regular .Net language elements?

    Read the article

  • ASP.NET Export to Excel and Word using VB.NET and C#

    In most ASP.NET web applications there is a need to export data. This is particularly useful if the information will be used for further analysis and archiving purposes offline. This tutorial will illustrate how you can export your data from your ASP.NET webpage example if it is coming from a MSSQL database to one of the most common file export formats in Windows MS Excel and MS Word.... DNS Configured Correctly? Test Your Internal DNS With Our Free DNS Advisor Tool From Infoblox.

    Read the article

  • Who are good suppliers of .NET 4 Hosted Virtual Private Servers ? (May 2010)

    - by Nick Haslam
    I'm looking for a supplier for hosting a Virtual server, running Windows Server 2008 (R2 ideally) and .NET 4 to run an internet facing ASP.NET web application. I'd also like to be able to remote desktop onto it, and install other apps as necessary, including other websites as and when. I'm based in the UK, so a UK based supplier would be great. I was looking at Fasthosts, but having researched them a bit more, they look like a bad idea.

    Read the article

  • Mvc4 installer is incompatible with .net 4.5 but .net 4.5 is not installed

    - by jstell
    I'm getting the classic 'mvc4 installer is incompatible with .net 4.5' that many others have gotten except I do not have .Net 4.5 installed on this machine. MVC3 projects getting created just fine. I get this error when running the Web Installer for MVC4 Beta. System setup is VS2010 SP1, Windows 7 64-bit, Resharper is installed as well I am at a loss here and now seem to be just wasting time trying to fix this.

    Read the article

  • Gridview inside a ModalPopUpExtender causes ModalPopUpExtender to close

    - by harold-sota
    I have a gridview inside a ModalPopUpExtender, the grid view have the button add delete and edit when i clic one of the button of the gridview the popup is closed. I wont to close the popup when the close button is clicked. This is the asp.net part: < cc1: ModalPopupExtender ID="NamePopup" runat="server" PopupControlID="OptionPanel" TargetControlID="btnD" BackgroundCssClass="mpBg" DropShadow="true" OkControlID="btnSavePopup" CancelControlID="btnPostCancel" < / cc1:ModalPopupExtender Any ideas??

    Read the article

  • Using Server.CreateObject("ADODB.Stream") in IE7

    - by Daud
    I have a asp.net 1.1 application that uses the following code to write out a file in the response: Dim objStream As Object objStream = Server.CreateObject("ADODB.Stream") objStream.open() objStream.type = 1 objStream.loadfromfile(localfile) Response.BinaryWrite(objStream.read) This code is called by a pop up window that displays this file or gives a open/save dialog in Internet explorer. The problem is, that it seems to work fine in IE6 but in IE7 the pop up opens and then closes without displaying the file. Any one know whats wrong?

    Read the article

  • Application framework building

    - by Muhammad Umar Siddique
    Hi I was looking to build a Data Access Layer for my new web based application, I'm using ASP.NET. I'm want to build a framework not only for this application but also want to utilize it for my future projects. Actually my main aim is to make a framework, from DAC, DAL, BL to GUI. I want suggestions from you guys that what should i adopt, what give me flexibility, which suits for both small and large size applications. Thanks in advance.

    Read the article

  • How to break this string and sort on version number

    - by Sean P
    I have an ASP app that has a string array as such (there are much more than this): 7.5.0.17 Date: 05_03_10 7.5.0.18 Date: 05_03_10 7.5.0.19 Date: 05_04_10 7.5.0.2 Date: 02_19_10 7.5.0.20 Date: 05_06_10 7.5.0.3 Date: 02_26_10 7.5.0.4 Date: 03_02_10 7.5.0.5 Date: 03_08_10 7.5.0.6 Date: 03_12_10 7.5.0.7 Date: 03_19_10 7.5.0.8 Date: 03_25_10 7.5.0.9 Date: 03_26_10 7.5.1.0 Date: 05_06_10 How do I go about sorting these string by version descending?

    Read the article

  • Exposing business logic as WCF service

    - by Oren Schwartz
    I'm working on a middle-tier project which encapsulates the business logic (uses a DAL layer, and serves a web application server [ASP.net]) of a product deployed in a LAN. The BL serves as a bunch of services and data objects that are invoked upon user action. At present times, the DAL acts as a separate application whereas the BL uses it, but is consumed by the web application as a DLL. Both the DAL and the web application are deployed on different servers inside organization, and since the BL DLL is consumed by the web application, it resides in the same server. The worst thing about exposing the BL as a DLL is that we lost track with what we expose. Deployment is not such a big issue since mostly, product versions are deployed together. Would you recommend migrating from DLL to WCF service? If so, why? Do you know anyone who had a similar experience?

    Read the article

  • .Net search engine architecture and technology choice

    - by shrivb
    I am in the process of designing a search engine for an asp.net site. The site currently uses Microsoft Indexing Server to index and search content which range from simple text files to MS documents to PDFs. MIS is also used to crawl File servers. MIS in tandem with Index Server Companion crawls for content from external sites. I intend to replace MIS with the indexer/crawler I am trying to build. Since my platform is completely on the Microsoft stack, I cant afford to have a Java application server. Thus, Solr, and effectively, SolrNet is ruled out. With this being the context, I have couple of questions. 1.Technology choice I had done my initial investigation and looked at Lucene.Net. There seemed to be 2 issues in using Lucene.Net. First being, it cant crawl external content. There doesn't seem to be a direct port of Nutch in .Net. Second, since it is just an indexer, it cant parse various document types. The parsing is left to the developer. So, what would be best technology choice on the .Net platform to achieve indexing & crawling? Are there any .Net open source libraries available for document parsing? 2.Architectural pattern Is there any general architectural pattern or best practice that needs to be followed in designing such a search engine? Thanks in advance.

    Read the article

  • How do I explain to HR that my work experience is relevant even if it doesn't match the keywords in the job description?

    - by Dmitri
    I am looking at a job with a great company and in a field that I really want to be in. Unfortunalty, what they want is someone with "experience with ASP (VB), T-SQL in a production environment." But I've never done anything except with FOSS tools: C, Ruby(straight and RoR), Perl, MySQL, et c. I'm thinking that I could probably pick up VB without much trouble (I took a class that used it on college, was impressed at how easy it was to construct Windows UIs, but I've never needed it) Is there any way that I can demonstrate that my experience is similar? What would equivalent experience be in the FOSS world?

    Read the article

  • Why should I use List<T> over IEnumerable<T>?

    - by Rowan Freeman
    In my ASP.net MVC4 web application I use IEnumerables, trying to follow the mantra to program to the interface, not the implementation. Return IEnumerable(Of Student) vs Return New List(Of Student) People are telling me to use List and not IEnumerable, because lists force the query to be executed and IEumerable does not. Is this really best practice? Is there any alternative? I feel strange using concrete objects where an interface could be used. Is my strange feeling justified?

    Read the article

  • Display post data !

    - by Comii
    I am trying to post data from vb.net application to web service asmx that is located on server! For posting data from vb.net application I am using this code: Public Function Post(ByVal url As String, ByVal data As String) As String Dim vystup As String = Nothing Try 'Our postvars Dim buffer As Byte() = Encoding.ASCII.GetBytes(data) 'Initialisation, we use localhost, change if appliable Dim WebReq As HttpWebRequest = DirectCast(WebRequest.Create(url), HttpWebRequest) 'Our method is post, otherwise the buffer (postvars) would be useless WebReq.Method = "POST" 'We use form contentType, for the postvars. WebReq.ContentType = "application/x-www-form-urlencoded" 'The length of the buffer (postvars) is used as contentlength. WebReq.ContentLength = buffer.Length 'We open a stream for writing the postvars Dim PostData As Stream = WebReq.GetRequestStream() 'Now we write, and afterwards, we close. Closing is always important! PostData.Write(buffer, 0, buffer.Length) PostData.Close() 'Get the response handle, we have no true response yet! Dim WebResp As HttpWebResponse = DirectCast(WebReq.GetResponse(), HttpWebResponse) 'Let's show some information about the response Console.WriteLine(WebResp.StatusCode) Console.WriteLine(WebResp.Server) 'Now, we read the response (the string), and output it. Dim Answer As Stream = WebResp.GetResponseStream() Dim _Answer As New StreamReader(Answer) 'Congratulations, you just requested your first POST page, you 'can now start logging into most login forms, with your application 'Or other examples. vystup = _Answer.ReadToEnd() Catch ex As Exception MessageBox.Show(ex.Message) End Try Return vystup.Trim() & vbLf End Function Now how i can retrieve this data in asmx service?

    Read the article

  • ASP.NET MVC: shortcut for Response.Write and String.Format

    - by pcampbell
    I've found a pattern in my Views like this: <% if (someCondition) { Response.Write(string.Format("Hello {0}, Visitor {1} on {2}.", userName, someCounter, someDate)); } else { Response.Write(string.Format("Foo is {0}.", bar)); } %> The question here is around DRY and Response.Write(string.Format()). Are there better, or more concise ways to . Consider that HTML encoding would be a nice feature to include, perhaps as a boolean to a method call of some kind (extension method on Html?. Is there an obvious extension method that I'm missing? Do you have an extension method that you rely on to achieve this functionality?

    Read the article

  • asp.net MVC RC1 RenderPartial ViewDataDictionary

    - by Mark79
    I'm trying to pass a ViewData object from a master page to a view user control using the ViewDataDictionary. The problem is the ViewDataDictionary is not returning any values in the view user control whichever way i try it. The sample code below is using an anonymous object just for demonstration although neither this method or passing a ViewData object works. Following is the RenderPartial helper method i'm trying to use: <% Html.RenderPartial("/Views/Project/Projects.ascx", ViewData.Eval("Projects"), new ViewDataDictionary(new { Test = "Mark" })); %> and in my view user control i do the following: <%= Html.Encode(ViewData["Test"]) %> Why does this not return anything? Thanks for your help. EDIT: I'm able to pass and access the stronlgy typed model without any problems. it's the ViewDataDictionary which i'm trying to use to pass say just a single value outside of the model..

    Read the article

  • Adding custom options in binded dropdown in asp.net

    - by MarceloRamires
    I have a bound dropdown list populated with a table of names through a select, and databinding. it shoots selectedindexchanged that (through a postback) updates a certain gridview. What happens is, since it runs from changing the index, the one that always comes selected (alexander) can only me chosen if you choose another one, then choose alexander. poor alexander. What I want is to put a blanc option at the beginning (default) and (if possible) a option as second. I can't add this option manually, since the binding wipes whatever was in the dropdown list and puts the content of the datasource.

    Read the article

  • Urlrewriting.net pages are not causing postbacks

    - by Nick
    I'm using webforms with UrlRewriting.Net to rewrite pages, e.g. http://www.example.com/stuff.aspx?c=30 becomes http://www.example.com/stuff/30-this-stuff.aspx. It works in so far as the correct content is loading; however, none of the postbacks are working (mostly buttons on the page). If I set up a breakpoint on Page_Load, I see that IsPostBack is always false. Any ideas on how to fix this? Right now I'm just on Visual Studio 2008. EDIT: I have since switched to UrlRewriter.Net, which worked after a few tweaks (see Scott Gu's article). Besides here, I have posted my original problem to the developer's forum: if I ever get an answer, I'll post it here (unless else posts it here first).

    Read the article

  • .NET Usercontrols telerik devexpress infragistics ComponentOne: who's best?

    - by petebob796
    I am considering the purchase of some .NET user controls with interest in both WinForms and asp.net. I have trialed in the past devexpress when I needed a hierarchical data grid for a personal project which I was impressed with. Rather than just jump for them I am interested in peoples experience of different products such as: TelerikDev ExpressInfragistics ComponentOne Any Others? I would like peoples opinions on: - Features Set and Number of Controls - Installation and Upgrade - Ease of use - Documentation - Price - License - Development (Updates to controls their side) Also if anyone has any links to review (hopefully side by side) please post them

    Read the article

  • Downloading file from server (asp.net) to IE8 Content-Disposition problem with file name

    - by David
    I am downloading a file from the server/database via aspx page. When using the content-disposition inline the document opens in correct application but the file name is the same as the web page. I want the document to open in say MS Word but with the correct file name. Here is the code that I am using Response.Buffer = true; Response.ClearContent(); Response.ClearHeaders(); Response.Clear(); Response.ContentType = MimeType(fileName); //function to return the correct MIME TYPE Response.AddHeader("Content-Disposition", @"inline;filename=" + fileName); Response.AddHeader("Content-Length", image.Length.ToString()); Response.BinaryWrite(image); Response.Flush(); Response.Close(); So again, I want the file to open in MS Word with the correct document file name so that the user can properly save/view. Ideas? thanks

    Read the article

  • MVC.NET project won't start under IIS 5.1 on Windows XP SP3

    - by mrjoltcola
    I've a MVC.NET 2 project that runs fine under Windows 7 and will start on Windows XP if I use the Visual Studio Development Server, however, starting under IIS generates an error: Unable to start debugging on the web server With the message The specified procedure could not be found No errors in the system event viewer. If I start without debugging I get an "HTTP 500 Internal Server Error" The reason I run it under IIS is the project also includes some WCF wsHttp web services that use certificates, so the VS Development Server is not adequate for hosting those. I have already seen the links on SO that talk about adding the wildcard mapping. I've already done that, just as I've done on Windows Server 2003 where I successfully host MVC.NET RC2 for quite a while.

    Read the article

< Previous Page | 101 102 103 104 105 106 107 108 109 110 111 112  | Next Page >