Phoenix_uy

0

votes
1

answer
26

views

How to call an implemented interface method with different return types? [duplicate]

This question already has an answer here: Does C# support return type covariance? 9 answers I've an interface that has one method with an Interface return type. Is there a way to implement that method in different classes with different return types (derived from the interface return type)? This is...
Phoenix_uy
1

votes
1

answer
160

views

SCSS compilation is throwing a syntax error isn't a valid CSS value

I've a color palette scss file with a couple of functions, one to get a color and another to get the color but with an opacity. The compilation of that file doesn't throw any error but when I'm going to use the funtion for the opacity, I got an error ('dark': 0.1, 'light': 0.8) isn't a valid CSS val...
Phoenix_uy
1

votes
1

answer
327

views

Assign a custom object id to a Membership User from ASP.NET

i have this question about Membership Provider (MySQL) from .NET MVC 3. I have a custom object called CustomObj with the structure: IdCustomObj Name I want to Associate this CustomObj to any new MembershipUser that is created. Is this possible? If so, How? Thanks!
Phoenix_uy
1

votes
1

answer
3.2k

views

HashBytes works on sql server 2000?

i have a client that runs a windows application on a sql server 2000 database, and i am trying to run a query that works fine on sql server 2005, with the HashBytes function like this: SUBSTRING(master.dbo.fn_varbintohexstr(HashBytes('MD5','some text'), 3, 32) AS MD5 but i don't know if this functio...
Phoenix_uy
1

votes
1

answer
540

views

Fill second select with onchange of first one on MVC3 without javascript

i have a project on MVC3 and Razor. I'm doing on my project everything without javascript first and then in the future when everything works without JS, then i will add the JS functionallity. The thing is that i have a razor page, that i fill from the Model a select and what i need is that when the...
Phoenix_uy
1

votes
1

answer
222

views

JQuery autocomplete disable some results

i have a jquery autocomplete with ajax in my view with this code: $('#QuickSearchProduct').autocomplete({ source: function (request, response) { var term = request.term; var url = url ? url : $(this.element).attr('data-autocomplete-url'); cache[url] = cache[url] || {}; if (term in cache[url]) { res...
Phoenix_uy
1

votes
2

answer
956

views

Best way to insert 15.000 records on sql server 2012?

What's the best way to insert 15.000 records or more in sql server 2012? Store procedure? Pure inserts? I'm using a .NET application in C# by the way.
Phoenix_uy
1

votes
1

answer
934

views

css class has-error not being added to div when radiobutton has validation

I have a MVC razor view page with a form and some fields with data annotations like this: Fecha de nacimiento @Html.DropDownListFor(m => m.BirthDay, Model.Days, 'Día', new { @class = 'form-control' }) @Html.ValidationMessageFor(m => m.BirthDay) @Html.DropDownListFor(m => m.BirthMonth, Model.Months,...
Phoenix_uy
1

votes
2

answer
1.3k

views

ASP.NET MVC: Why Range Data Annotation is not working on checkbox in client side?

I have a form with some fields with the Required Data Annotation and then i have a 'Accept Terms and Conditions' checkbox with the Data Annotation [Range(typeof(bool), 'true', 'true', ErrorMessage='You must accept Terms And Conditions to proceed')] Everything works fine but the thing that is annoyin...
Phoenix_uy
1

votes
3

answer
0

views

Getting HtmlString value from form post in mvc3

i have a form in a razor view in my aspnet mvc3 project. The form, submits to a controller action that receives a Custom object that one of the properties is of type HtmlString. That property comes with null from the form submit and if the property is of type string, the value is the one the user...
Phoenix_uy
1

votes
1

answer
1.4k

views

C# Show dialog over another dialog in winforms?

I have a winforms application (C#) and in one of my forms, i have a dialog that adds some entity to a datagrid in the main form. In this dialog, i have validations that if they are invalid, those errors are showed in a new dialog.. my problem is that this error dialog shows on the back of the first...
Phoenix_uy
1

votes
1

answer
1.7k

views

Get real primary screen in c# with a multi monitor setup?

I have a c# windows application that work with multimonitors. The application has a main form that must be showed in the primary display and a full screen form that needs to be displayed on the second screen (this second form is showed in a 3d goggles). This is my way to assign the screens: Screen...
Phoenix_uy
1

votes
2

answer
69

views

Conditional wrapper on ul in ng-repeat

I have a ng-repeat with ul list inside and i want to create a ul every 8 elements but i can't find the way. I have to use $index % 8 == 0 to show the ul conditionally but i don't know how. This is my code so far: {{v}} The output result would be something like this: ... content... .... content......
Phoenix_uy
0

votes
0

answer
8

views

Access object array from form-data request in java

I've a form-data request that sends kind of an object to my servlet in java and I don't know a propper way to get that information. This is my scenario: The form send the data in a way that the result will be a JSON object like this: { prop1 : value1, prop2 : value2, list : [ { objectProperty1 : val...
Phoenix_uy
1

votes
4

answer
1.4k

views

Prevent submit form twice with change event

i hava a form with a hidden submit button and one text input. In the text input, with jQuery i attached to it a change event that submits the form. The thing is that if i hit enter on the input, then the form submits twice. I think is because the enter submits the form and the input detects a change...
Phoenix_uy
1

votes
2

answer
2k

views

Get only common objects from a list of arrays in javascript

i have a couple arrays in my javascript code (i'm using knockout js too) and i want to get a single array that contains only the common objects of all the arrays. My code is something like this: Array1 = [{a: 1, b: 'something'}, {a: 2, b: 'something1'},{a: 3, b: 'something3'}]; Array2 = [{a: 3, b: '...
Phoenix_uy
17

votes
8

answer
11.9k

views

Add List<int> to a mysql parameter

I have this question about the MySqlParameter from the .NET connector. I have this query: SELECT * FROM table WHERE id IN (@parameter) And the MySqlParameter is: intArray = new List(){1,2,3,4}; ...connection.Command.Parameters.AddWithValue('parameter', intArray); This is possible? Is possible to pas...
Phoenix_uy
1

votes
3

answer
100

views

Creating a JavaScript object with 3 methods throws Object has no method

i'm trying to create a JavaScript object named human with three methods walk, eat and talk, and i want to call it like this (no method should print any values): human.talk('hello').walk('home').eat('pizza'). I have this code: var human = { talk : function talk(t){ }, walk : function walk(w){ }, eat...
Phoenix_uy
2

votes
2

answer
6.2k

views

Create folder inside debug or release con console application

i have a console application in vs2010 (C#) and in the project, i have a Folder added by me (right click on project.. add->folder) and i want that when i compile the application (debug or release), then the folder will be created (if not exists) in the debug or release directory. Is that possible? T...
Phoenix_uy
6

votes
1

answer
4.5k

views

Skip item in foreach knockout js array?

i have this question about a foreach in knockout js and the first item. I want to skip the first one and iterate over the next items. The main issue is that i wanna do something like this:
Phoenix_uy
4

votes
1

answer
838

views

Any visual studio 2010 extension for auto concatenation on new line?

i have this question about visual studio 2010... in mono develop, when i have a string like this: string s = 'hello, how are you'; and if i press enter key on the beginning of the 'how...', the code changes automatically to this: string s = 'hello, ' + 'how are you?'; Is some extension in visual st...
Phoenix_uy
2

votes
1

answer
1.3k

views

Loading a project in vs2013 with IIS setting fails

I have a solution in Visual Studio 2013 that have 8 projects. The web project for that solution have the IIS setting with the path http://localhost/www.myproject.com but every time i open the solution this project gives a 'load failed' and if i try to reload the project appears a message that says:...
Phoenix_uy
1

votes
1

answer
373

views

It's possible to pre save the knockoutjs view model to prevent refresh and data lost?

i have a MVC3 project with KnockoutJS and in my view. The form that the user fills, has information already loaded from the server and the user is filling and selecting from this data so then, the user saves the data selected. So... sometimes, the user, in the middle of the form, realize that some d...
Phoenix_uy
2

votes
2

answer
295

views

DisplayFor in razor with nullable decimal changes format

I have a property on my model like: [DisplayFormat(DataFormatString = '{0:P0}')] public decimal ? Rate { get; set; } In my razor view i have: - @Html.DisplayFor(x => x.Rate) The problem is this: the number i need to show is 28.71 (decimal?) if the DisplayFor is with x => x.Rate then the view shows...
Phoenix_uy
1

votes
5

answer
589

views

Place button next to input text even if the input is hidden?

I have a search form that I need that the input text begins hidden and with a button named search, the input appears and when the input is being shown, the button named search is converted to a close button to hide again the input text. My problem is that when the input text is hidden, the button mo...
Phoenix_uy
23

votes
1

answer
55.5k

views

Dynamic select2 not firing change event

I have a form with a couple of selects inside. I'm applying the select2 jquery plugin over those selects like this: $('select.company_select, select.positions_select').select2(); The select's work fine, but I have this code to autosubmit my form (I have the autosubmit class on the form tag). var cur...
Phoenix_uy
2

votes
1

answer
3.4k

views

Join function in knockout js observableArray?

Is there a way to perform the javascript join function in a observableArray? In javascript i can do the following: var a = ['1', '2', '3']; var p = a.join(','); and p would be '1,2,3' but with knockout i cant found a way to do this action?
Phoenix_uy
12

votes
4

answer
11.2k

views

How to reverse a generic list without changing the same list?

I have a generic list that is being used inside a method that's being called 4 times. This method writes a table in a PDF with the values of this generic list. My problem is that I need to reverse this generic list inside the method, but I'm calling the method 4 times so the list is being reversed e...
Phoenix_uy
6

votes
2

answer
3.7k

views

How can i bind jquery select2 to new added selects?

i have a razor-mvc web and a couple of select's on a form. I bind this selects with the select2 plugin in jquery like this: $('select.company_select, select.positions_select').select2(); And my form is an ajax form (ajax by javascript, not by Ajax.BeginForm). The thing is that when i submit the form...
Phoenix_uy
1

votes
3

answer
1.7k

views

Perform a not true checked binding on knockout js?

i have an input type checkbox in knockout js and i whant to perform the 'not true' action when this checkbox is checked. Something like this: But this is not working. I know that i can call IsHidden and set the common checked binding, but i have a special situation in witch i need this behavior.
Phoenix_uy
3

votes
0

answer
314

views

VisualStudio 2010 Post-Build event to refresh chrome tab?

i have a question about post-build events in visual studio 2010. I have an MVC3 project and i want a post-build event that make a refresh on the current chrome tab. It's that possible? What i have is a vb file with this code: set WshShell = WScript.CreateObject('WScript.Shell') WshShell.AppActivate...
Phoenix_uy
2

votes
3

answer
2.3k

views

Trigger function after <li> element is added with jQuery?

I have an html ul list and a button add that creates new li elements. What i need is to call a function after the new li element is created but i'm facing the problem that the click event (or what ever it does) of the button with the function to add the new li element is unaccessible to me, so the o...
Phoenix_uy
6

votes
7

answer
5.5k

views

Prevent open downloads window in chrome with barcode reader

i have this problem with my website (MVC3, C#) and a barcode reader. In my form i have something like this: And the input is filled with a barcode reader and automatically submits the form that with ajax, fills the div with the id = list. My problem is that with chrome and ie, after the text is subm...
Phoenix_uy
1

votes
4

answer
73

views

Make methods with name in english but call them in spanish in c# project?

I am making a C# project for a client and my class have methods with is signature in english, something like Connect, Disconnect, Rebuild, etc. But my client, in his application manage everything in spanish. Can my library project maintain the method names in English but allowing my client to call t...
Phoenix_uy
6

votes
5

answer
14.2k

views

jQuery Show not working if css class has display:none

I have a class called loading like this: .loading { display: none; vertical-align: top; margin: 0; padding: 0; background: url('../images/shared/loading_16x16.gif') center center no-repeat; width: 16px; height: 16px; } with following html snippet: and my jQuery code (on document ready): $.ajaxS...
Phoenix_uy
3

votes
3

answer
3.2k

views

Create or replace node in an XML without root in C#

I have an XML file like this: .... .... ... And this XML file has not a root element (i know that this is a wrong XML format). I need to create or replace if already exists a node in this XML but i cant work with XDocument or XmlDocument because they need a root element to work and i cant add a root...
Phoenix_uy
3

votes
1

answer
978

views

Align currency to the right on format string

I have a DisplayFormat in my C# code like this: [DisplayFormat(DataFormatString = '{0:C0}')] And the ouput is like: USD 50 But how can i change this display format to show: 50 USD? with the currency symbol on the right?
Phoenix_uy
1

votes
2

answer
577

views

Performance in linq to entity queries between linq and lambda?

I have a doubt in a query that it's a little bit slow and i want to know what's best for performance. Let's present this first example: var result = from tableA in context.TableA join tableB in context.TableB on tableA.id equals tableB.id where *some conditions* select new { tableA.id, tableA.name,...
Phoenix_uy
2

votes
2

answer
3.8k

views

Concat and/or merge objects in two generic lists

i need help with this problem... I have two lists of same objects 'SearchResult', this object has an id attribute and a score attribute. In both list can exist the same id, but with different score, so i need to create a new List that combines same id's but the score must be the sum of both scores a...
Phoenix_uy
3

votes
1

answer
901

views

Disable select2 dropdown with knockout binding?

I have an MVC Razor project and in my view i have one Html.TextBoxFor with data-bind='disable: setRoot'. This input is used by Select2 jquery plugin. My problem is that the disable binding is not working properly. This is my code: Category root @Html.TextBoxFor(m => m.Create.IdCategory, new { id = '...
Phoenix_uy

View additional