Posts by CesarMiguel • 4,800 points
128 posts
-
1
votes3
answers121
viewsA: Problem with the C
Your mistake is in this if: if (VF/VS)<=5 Tries: if ((VF/VS)<=5)
canswered CesarMiguel 4,800 -
2
votes2
answers107
viewsA: Simple calculation between string and integer
You can always check if the variable is an integer number before dividing. I leave here a Jsfiddle with the example: Jsfiddle What I’m doing is: 1-I have a regular expression that defines integers…
-
1
votes3
answers542
viewsA: Receive a Model per parameter in a function
Eventually I came up with a solution that maybe not the most effective is working well. What I am doing is: I call a javascript function; I will fetch the value of the filters; I call the function…
-
1
votes3
answers542
viewsQ: Receive a Model per parameter in a function
I’m trying to get one Model in a function, which is a step view (although I don’t know if it’s possible) to then generate a list and generate a PDF. My View: @model…
-
6
votes2
answers1506
viewsQ: Compare date time with a timespan
On Asp mvc 4, I’m doing a query where I find the data where the hours are lower or equal than those entered by the user. That is, I have a dateTime and check with the user input variable (a…
-
2
votes2
answers437
viewsA: Associate a controller to an existing view
Just change the return of your function, and to name the view that you want: public ActionResult NomeFuncao() { // código return PartialView("_NomeViewPartial"); }…
asp.net-mvc-5answered CesarMiguel 4,800 -
7
votes7
answers3980
viewsA: How to check if there are numbers inside an input with Javascript?
The best you can do is get a regular expression and compare the input with the expression. Regular expression: var verifyInt = /\d+/g; And now you take the input and you use the match if the input…
javascriptanswered CesarMiguel 4,800 -
2
votes3
answers1220
viewsQ: Remove key pressed in an input text
I have the following scenario: A input text which comes with a certain bd value/text but which the user should not be able to edit. To do this, pressing a key in the input will delete that same…
-
2
votes2
answers428
viewsA: Float:left, div falling by the width of the div
It seems to me you want to put the div fixed on the line. You were missing the property overflow: hidden; who does just that. Fiddle edited…
-
4
votes3
answers2237
viewsQ: Construct string with special characters
I am building PDF’s, and I need to print a string with special characters. I am constructing the string as follows (using iTextSharp): PdfPCell teste = new PdfPCell(new Phrase("<O meu texto>…
-
3
votes1
answer1806
viewsA: Cell width Pdfptable iTextShar MVC 4
Problem solved. I saw several solutions on the net where they said to define the table as follows: PdfPTable table = new PdfPTable(10); table.HorizontalAlignment = 0; table.TotalWidth = 500f;…
-
2
votes1
answer1806
viewsQ: Cell width Pdfptable iTextShar MVC 4
I’m using the iTextSharp to create PDF’s in my application. However I have to recreate a table, where I have to set the size for a column rather reduced. Follow the image that shows the size with…
-
2
votes2
answers1033
viewsQ: Change a detachable PDF field
I’m working on MVC 4 and installed the iTextSharp to create PDF’s, until everything well. But what I am doing is replicating a PDF that already exists, to fill the respective fields required in this…
-
3
votes2
answers189
viewsQ: Data overwrite to cycle for
I have the following table: This table is dynamic and works like form, IE, the user when clicking Novo a new row is created with the dynamic fields. By clicking Salvar Dados all user-created lines…
-
1
votes8
answers5526
viewsA: How to make a DIV fill all available width
If you want the div's change the size depending on how you handle the screen, you have to put all the measurements in %. That is, this 250px you have to pass to %. Otherwise it will always assume…
-
4
votes6
answers11946
viewsA: Converting a string to int?
It is possible that there are several ways to do it. I use the TryParse to convert string for int. Example: var varStringConvert = "123"; int varInt; if ((int.TryParse(varStringConvert.ToString(),…
-
8
votes3
answers2494
viewsQ: Table css type excel
I am creating a table for insertion/query of data that is the closest to the format of an excel sheet. My table: Problem: As the image above shows, when placing a input in a td, it does not occupy…
-
5
votes4
answers6021
viewsA: Exchange text by clicking on it to display/hide an element
You can use the function .text() (English) jquery. I made a Jsfiddle to see how it works, where I am changing the text of the HTML element with the id="see": if ($("#see").text() == "See more...") {…
-
4
votes2
answers144
viewsQ: Compare Dayofweek in an ASP MVC query
I’m trying to make a query where I check if the day week is chosen to create a list of data that loads in a Viewmodel. Query: var plan = db.Servicos.Where(s => (TecnicoResp.HasValue ?…
-
1
votes1
answer352
viewsA: Problem generating list in Viewmodel
I’ve already found the problem: In every cycle of foreach I have to put resultFiltro pointing to a new element. Staying: foreach (var item in forn) { resultFiltro = new…
-
1
votes1
answer352
viewsQ: Problem generating list in Viewmodel
I’m working on ASP.Net with MVC 4, and when doing a search/use filters I will present a list of resulting data. To better manipulate this result I created a ViewModel where I put information from…
-
5
votes3
answers54
viewsQ: Remove margin with jquery
On a given page, when opening, I need to remove the margin class content to stay as I intend. CSS: .three-columns .content { margin: 20px 250px 0 250px; } .content { margin: 20px 0 0 250px; } I’m…
-
9
votes1
answer2336
viewsA: Type of relations 1:1
The difference in dashes has to do with the use of primary keys from one table to another. In case you use --- you will retrieve the primary key from the table with which you are making the…
-
11
votes5
answers2480
viewsQ: Check if day exists in month
I need to verify/validate if a (numerical) day exists in a given month. For example, I have the day 31, and as it does not exist in the month of February the condition will fail. I think a simple if…
-
0
votes6
answers5869
viewsA: How to know the number of a week in each month
I ended up finding a solution, perhaps not the most effective. I built from the @Raulalmeira answer. var listaDatas = new List<DateTime>(); //Lista que vai receber as datas 1º- I created a…
-
7
votes6
answers5869
viewsQ: How to know the number of a week in each month
I am working on ASP MVC4, and would like to know the number of weeks in a given month to generate a list of dates. For example, the user inserts a week, and in that week of each month I will…
-
7
votes3
answers3924
viewsQ: How to know the week of a given month?
I am working on ASP.NET MVC 4, and I intend to know what is the week of a given month. For example, the user wants to set a frequency of occurrences, and as such says: The occurrence will happen…
-
15
votes2
answers2432
viewsQ: How to create a Date list with a specific day
I am working on ASP with MVC 4, and I hold create a list of dates from the data entered by the user. For example, the user inserts the day of the month in which a certain occurrence will be made. It…