Search Results

Search found 53463 results on 2139 pages for 'net generics'.

Page 72/2139 | < Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >

  • How to declare a Generics Action in struts2.xml file ?

    - by Rasatavohary
    Hi everyone, My problems is in a Struts2 action, where I have a class : public class MyAction<T> extends ActionSupport with a private member like this : private T myData; And I would like to declare this aciton in the struts.xml file, how can i manage to do so ? Thanks for the answer. Ps : I've tried without declaration of T, but it did not work

    Read the article

  • migrate method Rand(int) Visual Fox Pro to C#.net

    - by ch2o
    I'm migrating a Visual Fox Pro code to C #. NET What makes the Visual Fox Pro: generates a string of 5 digits ("48963") based on a text string (captured in a textbox), if you always enter the same text string will get that string always 5 digits (no reverse), my code in C #. NET should generate the same string. I want to migrate the following code (Visual Fox Pro 6 to C#) gnLower = 1000 gnUpper = 100000 vcad = 1 For y=gnLower to gnUpper step 52 genClave = **Rand(vcad)** * y vRound = allt(str(int(genclave))) IF Len(vRound) = 3 vDec = Right(allt(str(genClave,10,2)), 2) finClave = vRound+vDec Thisform.txtPass.value = Rand(971); Exit Endif Next y outputs: vcad = 1 return: 99905 vcad = 2 return: 10077 vcad = thanks return: 17200 thks!

    Read the article

  • .NET Framework 3.5, Assembly Binding Logging

    - by Achilles
    I am getting the following error: Could not load file or assembly 'System.Web.DynamicData, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. I've researched the problem and some of the solutions are pointing to Turning on Assembly Binding Logging. I'm confused as to what this error is. So my question: *What does this error mean and how do I resolve it? I am not hosting the site in a shared hosting scenario, it is on a single server running .NET Framework 3.5.0 using IIS 6.0 Edit .Net Framework 3.5 SP 1 isn't installed on the server. The missing assemblies are apart of that Service Pack.

    Read the article

  • What should i do to test EasyMock objects when using Generics ? EasyMock

    - by Arthur Ronald F D Garcia
    See code just bellow Our generic interface public interface Repository<INSTANCE_CLASS, INSTANCE_ID_CLASS> { void add(INSTANCE_CLASS instance); INSTANCE_CLASS getById(INSTANCE_ID_CLASS id); } And a single class public class Order { private Integer id; private Integer orderNumber; // getter's and setter's public void equals(Object o) { if(o == null) return false; if(!(o instanceof Order)) return false; // business key if(getOrderNumber() == null) return false; final Order other = (Order) o; if(!(getOrderNumber().equals(other.getOrderNumber()))) return false; return true; } // hashcode } And when i do the following test private Repository<Order, Integer> repository; @Before public void setUp { repository = EasyMock.createMock(Repository.class); Order order = new Order(); order.setOrderNumber(new Integer(1)); repository.add(order); EasyMock.expectLasCall().once(); EasyMock.replay(repository); } @Test public void addOrder() { Order order = new Order(); order.setOrderNumber(new Integer(1)); repository.add(order); EasyMock.verify(repository) } I get Unexpected method call add(br.com.smac.model.domain.Order@ac66b62): add(br.com.smac.model.domain.Order@ac66b62): expected: 1, actual: 0 Why does it not work as expected ??? What should i do to pass the test ???

    Read the article

  • Adding an attachment to a .NET Email

    - by Velika
    How do I attach a file with a very unfriendly name (like a file with a session Id number in it) but have it attached as another name?The file has the session ID in it to avoid clashes name on the web server nut when I attach it to the file, a friendlier name is preferable. Is there a way to attach the file with teh unfriendly name as anotehr name so that when the user gets the email he can tell from the name what the content of the file is? I'd hate to have to create a unique folder just to put a common file name in it for the purpose of simply attaching it to an email. Dim mailMessage As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage() mailMessage.Attachments.Add("unfriendlyname.txt", ????)

    Read the article

  • ASP.NET MVC Authentication Cookie Not Being Retrieved

    - by Jamie Wright
    I am having a hard time implementing "Remember Me" functionality in an MVC application with a custom principal. I have boiled it down to ASP.NET not retrieving the authentication cookie for me. I have included a snaphot below from Google Chrome. Shows the results of Request.Cookies that is set within the controller action and placed in ViewData for the view to read. Notice that it is missing the .ASPXAUTH cookie Shows the results from the Chrome developer tools. You can see that .ASPXAUTH is included here. Does anyone know what the issue may be here? Why does ASP.NET not read this value from the cookie collection?

    Read the article

  • set label value in vb.net

    - by julio
    Hi-- I'm usually a PHP guy but got stuck doing a project in vb.net. I have a query (sqldatasource) that returns a single value (the last update date). I want to use a label to say something like "Last updated: " < Label = (returned value) In PHP this would be simple. In vb.net, all I can find are endless badly written code behinds showing how you'd execute the query onLoad then bind it to the label. Is this really the only way to do this? It seems like a ridiculously simple problem to have such a long solution. I have used a datagrid control to just bind the query result directly, but it prints the column name as well as the date, so it's not ideal. Any ideas?

    Read the article

  • .Net friendly, local, key-value pair, replicatable datastore

    - by Brad Mathews
    I am looking for a key/value type datastore with very specific requirements. Anyone know anything that will work? Needs to be a component of some sort. No additional installation needed. The datastore needs to be on the local hard drive. I am using VB.Net for a desktop app running Windows XP through 7 so it needs to callable by that environment. It needs to replicatable. If I have four copies of my app running on the network, each local copy of the datastore needs to replicate with the others. As close to real time as possible. The first three are easy, I can do that with ADO.Net out of the box. The last one, replication, is the one I do not have answer to. Does such an animal exist? Thanks, Brad

    Read the article

  • ASP.net VB Timers

    - by Tom Gullen
    I would like to be able to time a page load time in ASP.net (VBscript). Adding Trace="true" to the page directive is nice, but I need to actually time an event and store it in a variable. In ASP it was easy with the Timer object, but in .net I can't find anything on Google. I need something along the lines of: Dim startTime Dim endTime startTime = now() doBigFunction() endTime = now() response.write("That took " & endTime - startTime & " milliseconds") Cheers!

    Read the article

  • How to make safe cast using generics in C#?

    - by TN
    I want to implement a generic method on a generic class which would allow to cast safely, see example: public class Foo<T> : IEnumerable<T> { ... public IEnumerable<R> SafeCast<R>() where T : R { return this.Select(item => (R)item); } } However, the compiler tells me that Foo<T>.SafeCast<R>() does not define parameter 'T'. I understand this message that I cannot specify a constraint on T in the method since it is not defined in the method. But how can I specify an inverse constraint?

    Read the article

  • VB.NET function that takes other functions as a parameter, and executes them

    - by rob
    Hello, Is there a way in vb.net to create a sub/function that will take as an argument some kind of pointer to another function, and allow this new sub/function to execute the passed function? What I have are 10-12 xml-rpc functions I am calling against a remote server. Each of these functions has different argument lists (one takes 1 string, another might take 3 strings and one int, etc). All of them return an object. As I am calling these, it seems like it should be able to be factored better. For instance, everytime I call any of these functions, I want to test the return value for a session drop, and do something to try and reconnect to the remote system, etc. Using .net 3.5 Thanks! -R

    Read the article

  • Generics: How to derive from one of two classes?

    - by Yaron Naveh
    I have the following c# classes: class A : Object { foo() {} } class B : Object { foo() {} } I want to write a generic method that applies to both: void bar<T>(T t) { t.foo(); } this does not compile complaining the foo() is not a member of T. I can add a constraint for T to derive from one of the classes: void bar<T>(T t) where T : A but how can I have it for both?

    Read the article

  • .NET /asp.net 4: Changes with automatic NAMES of controls?

    - by mark smith
    Hi there, I just updated an app from .net 2.0 to .net 4.0 and i have noticed the following... For example i have the following control.. <input type="hidden" name="ctl00$cphMain$hfdFueraHorarioOficinaConfirmado" id="cphMain_hfdFueraHorarioOficinaConfirmado" value="False" /> and then in javascript i did this before.. var hfdFueraHorarioOficinaConfirmado=document.getElementById('ctl00_cphMain_hfdFueraHorarioOficinaConfirmado'); but after checking the Id within the html source once it renders and also doing some debugging with firebug etc.... it has changed from ctl00_cphMain_hfdFueraHorarioOficinaConfirmado to cphMain_hfdFueraHorarioOficinaConfirmado can anyone explain why? .... so should i basically do a search and replace and remove the ctl00?????? A little confused Obviosuly the javascript line with the the ctl00_ infront return NULL because it doesn't exist, but removing this returns the object.. Any help or ideas really appreciated Thanks

    Read the article

  • problem running system.net.webclient and process.start off a control event

    - by Rob
    The following code causes my vs 2008 wpf project to hang, I'm not sure why. Both Part 1 and Part 2 work perfectly fine independently, but when I run them together on an control event (click a button for example) the program hangs. I've also tried shell execute for part 2 - same results. However, this code when run within the form loaded event works fine. Any insights would be truly appreciated. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click 'Part 1 Dim myWebClient As System.Net.WebClient = New System.Net.WebClient Dim CurrentDataFileContents As String = myWebClient.DownloadString("http://www.xyz.com") myWebClient.Dispose() 'Part 2 System.Diagnostics.Process.Start("http://www.test.com") End Sub

    Read the article

  • Problem running ASP.NET MVC 2 website on IIS7

    - by Charlie
    I'm trying to deploy my ASP.NET MVC 2 website from VS2010 beta 2 to IIS7. The publish works fine but none of the routes work, so when I go to the URL http://localhost/myapp/Home/Index I get the error: HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable. I'm deploying to a virtual directory which is using an app pool configured for the .NET 4 framework with managed pipeline mode set to integrated. Also, if I go Basic Settings-Test Connection, both tests pass. From what I understand, it should just work? I don't have any problems deploying Nerd Dinner from VS2008, that works fine.

    Read the article

  • Java generics: What is the compiler's issue here? ("no unique maximal instance")

    - by Epaga
    I have the following methods: public <T> T fromJson( Reader jsonData, Class<T> clazz ) { return fromJson( jsonData, (Type)clazz ); } public <T> T fromJson( Reader jsonData, Type clazz ) { ... } The compiler is saying about the first method: type parameters of <T>T cannot be determined; no unique maximal instance exists for type variable T with upper bounds T,java.lang.Object return fromJson( jsonData, (Type)clazz ); ^ What is the problem?

    Read the article

  • I would like to convert Joomla CMS to ASP.net as there is no CMS like Joomla in .net. Would that

    - by SIA
    Hello friends I have this idea boggling my head since a long time. As a developer, I get a lot from the community and feel like giving back something to the community. And after knowing and working on Joomla i found Joomla CMS as the most flexible, easy and user friendly cms. As a developer, I like most of the features of it. Now, i want to have a asp.net version of joomla, available free to the community. I wanted to start it from scratch and it would be a copy/same as joomla. Would that be a good idea to go with it? Are there any CMS (same as Joomla) available in asp.net? I would like to have suggestions and advice from my community developers. Critics are welcomed ;) SIA

    Read the article

  • How to implement ASP.NET membership provider in my domain model

    - by Kjensen
    In a website, I need to integrate membership and authentication. So I want to use the functionality of ASP.NET Membership, but I have other custom stuff, that a "user" has to do. So I am sitting here with my pencil and paper, drawing lines for my domain model... And how can I best utilize the ASP.Net membership, but extend it to fill my needs? Should I create a class that inherits from a MembershipUser and extend it with my own properties and methods (and save this in a seperate table). Or should I let the MembershipUser be a property on my custom User/Client object? What would be a good solid way to do this?

    Read the article

  • Date javascript object from IE cannot be automatically bound to Datetime in ASP.NET MVC

    - by Sergio
    Hi There, I have a site that uses a jquery calendar to display events. I have noticed than when using the system from within IE (all versions) ASP.NET MVC will fail to bind the datetime to the action that send back the correct events. The sequence of events goes as follows. Calendar posts to server to get events Server ActionMethod accepts start and end date, automatically bound to datetime objects In every browser other than IE the start and end date come through as: Mon, 10 Jan 2011 00:00:00 GMT When IE posts the date, it comes through as Mon, 10 Jan 2011 00:00:00 UTC ASP.NET MVC 2 will then fail to automatically bind this to the action method parameter. Is there a reason why this is happening? The code that posts to the server is as follows: data: function (start, end, callback) { $.post('/tracker/GetTrackerEvents', { start: start.toUTCString(), end: end.toUTCString() }, function (result) { callback(result); }); },

    Read the article

< Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >