Search Results

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

Page 134/2160 | < Previous Page | 130 131 132 133 134 135 136 137 138 139 140 141  | Next Page >

  • ASP.NET server side show JS Alert box, doesn't work when using partial post back.

    - by jamone
    I have put the following method in my master page. It works when I call it on a full post back, but when I call it from a updatePanel's asyncPostBack no alert is shown. public void ShowAlertMessage(String message) { string alertScript = String.Format("alert('{0}');", message); Page.ClientScript.RegisterStartupScript(this.GetType(), "Key", alertScript, true); } What do I need to do so it works on partial post backs?

    Read the article

  • Create and Call an ASP.NET Asynchronous Web Service and call it from JavaScript

    - by nickyt
    Environment: ASP.NET web applicaition jQuery, ASP.NET AJAX Currently using ASP.NET Web Services The title says it all. One, how do i create an ASP.NET web service that is asynchronous? I've seen many articles, that show example with IAsyncResult and BeginMyWebServiceMethod and EndMyWebServiceMethod, some using ThreadPool etc. I would just like to know what is the simplest way to make an asynchronous web service method call (ideally without having to implement other classes, if possible). To me it should be as simple as adding an attribute to the method (but I think that is wishful thinking), e.g. public SomeWebService : WebService { [Asynchronous] public static bool SomeCheck() { // code } } I'm open to using WCF if that makes it easier (we converted to ASP.NET 3.5 around Christmas time). Once I have the asynchronous web service created, what is the best way to call it from client-side script? Via jQuery's $ajax or ASP.NET's auto generated class for a web service that is script method?

    Read the article

  • How do I get Asp.net MVC BeginForm to add closing tag correctly?

    - by Matt
    I seem to be missing something obvious here, but cannot see what it is. My problem is that the closing form tag for BeginForm is not being added to my markup. I am looping through a collection and creating a form for each item, but the forms arent closing properly. Any suggestions please? Thanks <% foreach (var item in Model) { %> <% using (Html.BeginForm("EditUser","Users")) { %> <tr> <td> <input id="contactID" type="hidden" value="<%= item.ContactID %>" /> <%=item.Email %> </td> <td> <%=item.Market.MarketName%> </td> <td> <%=item.ContactType.ContactTypeName%> </td> <td> <input type="submit" value="Edit" /> </td> </tr> <%} %> <% } %>

    Read the article

  • Count word occurrences in a text field with LINQ

    - by Yoann. B
    How can i get the occurrences count of a Word in a database text field With LINQ ? Keyword token sample : ASP.NET EDIT 4 : Database Records : Record 1 : [TextField] = "Blah blah blah ASP.NET bli bli bli ASP.NET blu ASP.NET yop yop ASP.NET" Record 2 : [TextField] = "Blah blah blah bli bli bli blu ASP.NET yop yop ASP.NET" Record 3 : [TextField] = "Blah ASP.NET blah ASP.NET blah ASP.NET bli ASP.NET bli bli ASP.NET blu ASP.NET yop yop ASP.NET" So Record 1 Contains 4 occurrence of "ASP.NET" keyword Record 2 Contains 2 occurrence of "ASP.NET" keyword Record 3 Contains 7 occurrence of "ASP.NET" keyword Collection Extraction IList < RecordModel (ordered by word count descending) Record 3 Record 1 Record 2 LinqToSQL should be the best, but LinqToObject too :) NB : No issue about the "." of ASP.NET keyword (this is not the goal if this question)

    Read the article

  • Multi-threaded library calls in ASP.NET page request.

    - by ProfK
    I have an ASP.NET app, very basic, but right now too much code to post if we're lucky and I don't have to. We have a class called ReportGenerator. On a button click, method GenerateReports is called. It makes an async call to InternalGenerateReports using ThreadPool.QueueUserWorkItem and returns, ending the ASP.NET response. It doesn't provide any completion callback or anything. InternalGenerateReports creates and maintains five threads in the threadpool, one report per thread, also using QueueUserWorkItem, by 'creating' five threads, also with and waiting until calls on all of them complete, in a loop. Each thread uses an ASP.NET ReportViewer control to render a report to HTML. That is, for 200 reports, InternalGenerateReports should create 5 threads 40 times. As threads complete, report data is queued, and when all five have completed, report data is flushed to disk. My biggest problems are that after running for just one report, the aspnet process is 'hung', and also that at around 200 reports, the app just hangs. I just simplified this code to run in a single thread, and this works fine. Before we get into details like my code, is there anything obvious in the above scendario that might be wrong?

    Read the article

  • How to manupilate data in VIew using Asp.Net Mvc RC 2?

    - by Picflight
    I have a table [Users] with the following columns: INT SmallDateTime Bit Bit [UserId], [BirthDate], [Gender], [Active] Gender and Active are Bit that hold either 0 or 1. I am displaying this data in a table on my View. For the Gender I want to display 'Male' or 'Female', how and where do I manipulate the 1's and 0's? Is it done in the repository where I fetch the data or in the View? For the Active column I want to show a checkBox that will AutoPostBack on selection change and update the Active filed in the Database. How is this done without Ajax or jQuery?

    Read the article

  • ASP.NET mvc 2 Validation always shows errors on initial page load.

    - by gt124
    I've searched around a lot, and honed this problem down to this case: I'm using the PRG pattern, pragmatically I'm using the same DTO for my post/get actions. It looks like when I have the dto with the data annotation attributes in the get action parameter list, the validation is always displaying errors, every time on initial page load. In some cases this could be desired behavior if you put asterisks in the error message, but how do I get rid of it? Thanks in advance.

    Read the article

  • Oracle XE + ODP.NET ANNOYING VIEW ERROR

    - by Alex
    Sup guys, heres my view: CREATE OR REPLACE VIEW SISTEMA.VWTELA AS SELECT TEL_DLTELA AS Tela, TEL_DLDESCRICAO As Descricao, TEL_DLTABELA As Tabela, CASE WHEN to_char(TEL_STATIVO) = to_char(1) THEN to_char('Yes') ELSE to_char('No') END as Ativo, TEL_IDTELA AS IDTEL FROM SISTEMA.TEL_TELA; When i do a SELECT * FROM SISTEMA.VWTELA it works fine from PL/SQL Developer but when i launch the query from my VB.NET application it throws me a super annoying error ORA-01722. Any ideas? The Application code works perfecty with any query so its not application code error but prolly some "super cool feature" from ODP.NET. Already tried to_number, to_whatever and same error always happens.

    Read the article

  • asp.net membership db. Adding branches to a user

    - by diver-d
    Hi everyone, I am playing around with the membership database and have a question. Lets say I have a company called company ABC. There are 10 branches that belong to comapany ABC. IS there anyway to create a relationship within the database using company ABC as the parent and having the 10 branches as childs? I hope that makes sense :)

    Read the article

  • How to binding to bit datatype in SQL to Booleans/CheckBoxes in ASP.NET MVC 2 with DataAnnotations

    - by nvtthang
    I've got problem with binding data type boolean to checkbox in MVC 2 data annotations Here's my code sample: label> Is Hot </label> <%=Html.CheckBoxFor(model => model.isHot, new {@class="input" })%> It always raise this error message below at (model=model.isHot). Cannot convert lambda expression to delegate type 'System.Func<Framework.Models.customer,bool>' because some of the return types in the block are not implicitly convertible to the delegate return type Cannot implicitly convert type 'bool?' to 'bool'. An explicit conversion exists (are you missing a cast?) Please suggest me how can I solve this problem? Thanks in advance.

    Read the article

  • How to pass content in response from Exception filter in Asp.net WebAPI?

    - by jaffa
    Consider following code: My problem is: 1) I can't seem to cast the errors to HttpContent 2) I can't use the CreateContent extension method as this doesn't exist on the context.Response.Content.CreateContent public class ServiceLayerExceptionFilter : ExceptionFilterAttribute { public override void OnException(HttpActionExecutedContext context) { if (context.Response == null) { var exception = context.Exception as ModelValidationException; if ( exception != null ) { var modelState = new ModelStateDictionary(); modelState.AddModelError(exception.Key, exception.Description); var errors = modelState.SelectMany(x => x.Value.Errors).Select(x => x.ErrorMessage); // Cannot cast errors to HttpContent?? // var resp = new HttpResponseMessage(HttpStatusCode.BadRequest) {Content = errors}; // throw new HttpResponseException(resp); // Cannot create response from extension method?? //context.Response.Content.CreateContent } else { context.Response = new HttpResponseMessage(context.Exception.ConvertToHttpStatus()); } } base.OnException(context); } }

    Read the article

  • asp.net dropdown iniside datagrid

    - by harold-sota
    I'm inserting a dropdwon list in datagrid on row editing. When i run the project the datasource is not rekognized. The asp.net part is there: <asp:TemplateField HeaderText="Lookup 1"> <EditItemTemplate> <asp:DropDownList ID="Loocup1DropDownList" Width="100%" runat="server" DataSource ="<%GetValueForDropDownCombinationContent()%>" DataValueField="LOOKUP_ID" DataTextField="lookup_name" > </asp:DropDownList> </EditItemTemplate> <ItemTemplate> <asp:Label ID="LOOKUP1_NAME" runat="server" Text='<%# Bind("LOOKUP1_NAME") %>'></asp:Label> </ItemTemplate> This is the vb.net function: Protected Function GetValueForDropDownCombinationContent() As DataSet Dim dsProductLookups As New DataSet dsProductLookups = DocumentManager.Data.DataRepository.Provider.ExecuteDataSet("sp_GetCombinationsLookups", productCombo.SelectedValue) Return dsProductLookups End Function any ideas???

    Read the article

  • Progressively stream the output of an ASP.NET page - or render a page outside of an HTTP request

    - by Evgeny
    I have an ASP.NET 2.0 page with many repeating blocks, including a third-party server-side control (so it's not just plain HTML). Each is quite expensive to generate, in terms of both CPU and RAM. I'm currently using a standard Repeater control for this. There are two problems with this simple approach: The entire page must be rendered before any of it is returned to the client, so the user must wait a long time before they see any data. (I write progress messages using Response.Write, so there is feedback, but no actual results.) The ASP.NET worker process must hold everything in memory at the same time. There is no inherent needs for this: once one block is processed it won't be changed, so it could be returned to the client and the memory could be freed. I would like to somehow return these blocks to the client one at a time, as each is generated. I'm thinking of extracting the stuff inside the Repeater into a separate page and getting it repeatedly using AJAX, but there are some complications involved in that and I wonder if there is some simper approach. Ideally I'd like to keep it as one page (from the client's point of view), but return it incrementally. Another way would be to do something similar, but on the server: still create a separate page, but have the server access it and then Response.Write() the HTML it gets to the response stream for the real client request. Is there a way to avoid an HTTP request here, though? Is there some ASP.NET method that would render a UserControl or a Page outside of an HTTP request and simply return the HTML to me as a string? I'm open to other ideas on how to do this as well.

    Read the article

  • How to adjust asp.net URL routing based on domain/host?

    - by DrewF
    What's the best way to adjust the path destination for a routing table created in the global.asax Application_Start event based on the domain/sub domain/host? The following worked in IIS6, but with IIS7 the request object is decoupled from the Application_Start event and therefore does not work anymore: Dim strHost As String = Context.Request.Url.Host Dim strDir As String = "" If strHost.Contains("domain1.com") Then strDir = "area1/" Else strDir = "area2/" End If routes.MapPageRoute("Search", "Search", "~/" & strDir & "search.aspx")

    Read the article

  • Control button Post Back when click it in ASP.NET with VB.NET

    - by Lefteris Gkinis
    In my Default.aspx web page i use the following code in order to save some Attributes to an xml file <asp:Button ID="Button1" Text="Save Attributes" CssClass="Button01" runat="server" OnClientClick="SaveAttributesButton_Click(); return, false;" > </asp:Button> when i Click on the button that starts to make postback all the code right from the page load I have already use the HTML Button but this need a java script which is run when the page load And sub without my command Please is there anybody which can assist me on this issue?

    Read the article

  • Which is the "best" data access framework/approach for C# and .NET?

    - by Frans
    (EDIT: I made it a community wiki as it is more suited to a collaborative format.) There are a plethora of ways to access SQL Server and other databases from .NET. All have their pros and cons and it will never be a simple question of which is "best" - the answer will always be "it depends". However, I am looking for a comparison at a high level of the different approaches and frameworks in the context of different levels of systems. For example, I would imagine that for a quick-and-dirty Web 2.0 application the answer would be very different from an in-house Enterprise-level CRUD application. I am aware that there are numerous questions on Stack Overflow dealing with subsets of this question, but I think it would be useful to try to build a summary comparison. I will endeavour to update the question with corrections and clarifications as we go. So far, this is my understanding at a high level - but I am sure it is wrong... I am primarily focusing on the Microsoft approaches to keep this focused. ADO.NET Entity Framework Database agnostic Good because it allows swapping backends in and out Bad because it can hit performance and database vendors are not too happy about it Seems to be MS's preferred route for the future Complicated to learn (though, see 267357) It is accessed through LINQ to Entities so provides ORM, thus allowing abstraction in your code LINQ to SQL Uncertain future (see Is LINQ to SQL truly dead?) Easy to learn (?) Only works with MS SQL Server See also Pros and cons of LINQ "Standard" ADO.NET No ORM No abstraction so you are back to "roll your own" and play with dynamically generated SQL Direct access, allows potentially better performance This ties in to the age-old debate of whether to focus on objects or relational data, to which the answer of course is "it depends on where the bulk of the work is" and since that is an unanswerable question hopefully we don't have to go in to that too much. IMHO, if your application is primarily manipulating large amounts of data, it does not make sense to abstract it too much into objects in the front-end code, you are better off using stored procedures and dynamic SQL to do as much of the work as possible on the back-end. Whereas, if you primarily have user interaction which causes database interaction at the level of tens or hundreds of rows then ORM makes complete sense. So, I guess my argument for good old-fashioned ADO.NET would be in the case where you manipulate and modify large datasets, in which case you will benefit from the direct access to the backend. Another case, of course, is where you have to access a legacy database that is already guarded by stored procedures. ASP.NET Data Source Controls Are these something altogether different or just a layer over standard ADO.NET? - Would you really use these if you had a DAL or if you implemented LINQ or Entities? NHibernate Seems to be a very powerful and powerful ORM? Open source Some other relevant links; NHibernate or LINQ to SQL Entity Framework vs LINQ to SQL

    Read the article

< Previous Page | 130 131 132 133 134 135 136 137 138 139 140 141  | Next Page >