|
I suspect the generated HTML will have an <input type="number"> for both number fields.
Unless otherwise specified, the default step for both fields will be 1 , meaning that you can only enter integers:
HTML attribute: step - HTML: HyperText Markup Language | MDN[^]
Try specifying the step for both fields:
<input asp-for="Glycemie" class="form-control" step="0.01" />
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
thanks, I'll look into that.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
Message Removed
modified 26-Mar-23 15:27pm.
|
|
|
|
|
Need to Integrate Swipe Machine in my C# Application for billing
|
|
|
|
|
Well, go ahead; you have our permission to do that.
Feel free to come back if you have an actual question to ask. But bear in mind that the only people who can support your "swipe machine" are the people who supplied it.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Credit card?
And you said C# but this is ASP.NET.
In C#
- You define, in general, how this processing will plugin to your application. You need to learn in general how credit cards work. That will include transactions and batching. You probably also need to look at debit cards.
- You must first have a processor (service that processes credit card transactions.) However in practice you probably need two for a real business since one is a backup. A processor is going to end up needing a bank account to which the company has access. That can limit choices (both bank and processor.)
- You get their specs which includes process for verifying your service.
- You implement to the specs.
- You integrate that code into your application.
- You must figure out a viable way to test the code. Basically you need some credit cards (plural) which can be used as actual cards. Usually with a $0.01 transaction. Obviously whoever has these must be trusted but also there are hard and very low limits on the cards.
- You certify with the processor.
Besides the above it is very important that you understand how error handling works. Both errors that the processor specs might document and those that they do not.
There are services out there besides processors which act as a gateway (and usually called that) which, by their claims, make much of the above easier. Sometimes that is true and sometime perhaps not. But with those you are limited to which processors that they support.
|
|
|
|
|
Silly me - I meant WebForms, of course, not WinForms...
My (admittedly limited) understanding of this class, is that it allows you to override the default HTML rendering code for an ASP.NET web control. It shouldn't, AFAIU, affect any of the properties ro events otherwise asociated with the control - only the HTML markup .NET uses to render it on teh page.
OK - so I've tried this for a the radio button adn checkbox controls. It all seems to work, and the controls render with the markup I want. If I set the AutoPostBack property, the HTML includes the usual
onclick="javascript:setTimeout('__doPostBack('[ctrl ID here]','')', 0)" that we all know and love in such controls... and indeed, the controls will post the page back when clicked/changed, and the "correct" changed state of is shown on the posted back page.
BUT... the control's CheckedChanged server-side event is not being fired. Am I operating unders ome basic misunderstanding of this class?
|
|
|
|
|
I have the following code that is sist make the firs leter of a token uppercase, do not know if this is the correct way to do it.
I only run thos on my local machine
The value of slug is the token name on coinmarketcup
At the moment when I open the page it show me the name of the token that I have click on, but they are all lowercase, so I want it to show the first letter in uppercase.
If i using the code that i have giving it shows CoinDetails (it is my page name)
thiss is the code that is not working
<pre>
<?php
$slug = basename(parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH));
$slug = preg_replace('/\\.[^.\\s]{3,4}$/', '', $slug);
$slug = ucfirst(strtolower($slug));
?>
Try to use this with this code
<pre><div class="card-header" >
<h5 class="card-title mb-0" ><?php echo $slug; ?></h5>
</div>
|
|
|
|
|
Fix the problem self with this code
<pre><?php echo ucfirst($slug);?>
|
|
|
|
|
how to auto print label in vb to be in the database
|
|
|
|
|
By writing some code.
If you want a better answer, then ask a better question.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I know that in OData, we need to provide an API that gets OData queries as url string. Considering I'm working on Blazor Server App, can I use OData without providing an another API app on the server?
modified 18-Feb-23 3:40am.
|
|
|
|
|
I'm using the following controller to get data from database using EF Core:
public class EquipmentsController : ODataController
{
private readonly SqlServerContext _sqlServerContext;
public EquipmentsController(SqlServerContext sqlServerContext)
{
_sqlServerContext = sqlServerContext;
}
[HttpGet]
[EnableQuery]
public ActionResult<IQueryable<Equipment>> Get()
{
IQueryable<Equipment> eqList = _sqlServerContext.Equipments.AsQueryable()
.Include(x => x.CostCenter)
.Include(x => x.EquipmentCategory)
.Include(x => x.equipmentType);
return Ok(eqList);
}
}
My problem is that I cannot get nested result in the final json while I have included CostCenter, EquipmentCategory, and equipmentType entities. I'm using ASP.NET Core 6 API and OData 8.0.12
My ED model is as follows:
static IEdmModel GetEdmModel()
{
ODataConventionModelBuilder builder = new();
builder.EntitySet<Equipment>("Equipments");
return builder.GetEdmModel();
}
How can I fix that?
|
|
|
|
|
Have you included the relevant $expand options in your query?
OData Expand - OData | Microsoft Learn[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
Greetings again experts.
Could you please help me out on this one.
I have a very long markup page that is used for various activities.
There is a section that allows users to enter a value into a search box and click the search button.
If there is a hit, a page is populated with the values from the search hit.
This works.
If however, the search turns up nothing, then we would like to popup a section of the page with several form controls which allows user to enter the values that did not turn up during search and submit to the database.
I tried using hide/show panel control but nothing is showing up.
I tried hide and show div but no luck.
I would truly appreciate any assistance with this. I am pasting only the section of the code that needs to be displayed in a popup, perhaps in the middle of the page.
Many thanks in advance.
<ajax:ModalPopupExtender ID="installAddress_MPE" runat="server" TargetControlID="label2" PopupControlID="div5" BackgroundCssClass="modalBackground" />
<div id="div5" runat="server">
<asp:Table ID="Table1" Style="background-color:White; font-size:12pt; color:Black;" runat="server">
<asp:TableRow>
<asp:TableCell ID="TableCell3" Style="background-color:Blue; font-size:14pt; color:White;" runat="server" ColumnSpan="6">
<asp:Label ID="installAddressHeader" runat="server" Text="New Installation Address Entry" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
<div id="divRebatable" class="popupdiv">
<asp:TextBox ID="txt_toiletsizes" placeholder="Enter new Toiltet GPF" Width="150px" runat="server"></asp:TextBox>
<asp:TextBox ID="txt_newAmount" placeholder="Enter amount" Width="100px" runat="server"></asp:TextBox>
<asp:Button ID="btn_add" runat="server" Text="Add It" onclick="btn_add_Click"
Width="100px" />
<asp:Table ID="rebatableTable" Width="100%" runat="server">
<asp:TableRow CssClass="divHeader"><asp:TableHeaderCell ColumnSpan="4">Add Rebatable Toilets</asp:TableHeaderCell></asp:TableRow>
<asp:TableRow ID="allToilets" runat="server">
<asp:TableHeaderCell>How many toilets?</asp:TableHeaderCell>
<asp:TableCell>
<asp:DropDownList ID="ddlNumber" runat="server" OnSelectedIndexChanged="ddlNumber_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Text="--Select--" Value=""></asp:ListItem>
<asp:ListItem Text="1" Value="1"></asp:ListItem>
<asp:ListItem Text="2" Value="2"></asp:ListItem>
<asp:ListItem Text="3" Value="3"></asp:ListItem>
</asp:DropDownList>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
<div>
<asp:Repeater ID="DynamicRepeater" runat="server" onitemdatabound="DynamicRepeater_ItemDataBound">
<HeaderTemplate>
<table border="1">
<tr>
<td>Toilet Size</td>
<td>Model #</td>
<td>Date Upgraded</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:DropDownList ID="ddlToiletGPF" AutoPostBack="true" runat="server">
</asp:DropDownList>
</td>
<td>
<asp:TextBox ID="ModelNumber" runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="DateUpgraded" runat="server"></asp:TextBox>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater><br />
<asp:Label ID="lblSuccess" style="font-weight:bold;" runat="server" Text=""></asp:Label>
</div>
</div>
<asp:Label ID="lblMsg" runat="server" Text="" /><br />
Protected Sub Submit(sender As Object, e As EventArgs)
Dim address As String = Request.Form(txtSearch.UniqueID)
Dim speakerId As String = Request.Form(hfAutoId.UniqueID)
'get the results and fill in the datagrid
Dim sqlStatement As String = "Select o.PrimaryFirst, o.PrimaryLast, ap.applicant, FORMAT(ap.DateReceived, 'd','us') as DateReceived,o.SecondaryFirst,o.SecondaryLast,ad.InstallAddress,ad.InstallCity, ad.InstallState, ad.InstallZip, ad.WaterAcctNo from Applications ap "
sqlStatement += "inner Join Addresses ad on ap.WaterAccountNo = ad.WaterAcctNo inner join Owner o on ap.OwnerCode = o.OwnerID Where ad.InstallAddress Like '%" & address.Replace("'", "''").Trim() & "%'"
Dim sqlCmd2 As SqlCommand = New SqlCommand(sqlStatement, myConnection)
Dim reader As SqlDataReader = sqlCmd2.ExecuteReader()
If reader.HasRows Then
While reader.Read()
div1.Visible = False
installationAddress.Text = reader("InstallAddress").ToString() & " " & reader("InstallCity").ToString() & ", " & reader("InstallState").ToString() & " " & reader("InstallZip").ToString()
waterAccountNumber.Text = reader("WaterAcctNo").ToString()
ownerInformation.Text = reader("PrimaryFirst").ToString() & " " & reader("PrimaryLast").ToString()
dateReceived.Text = reader("dateReceived").ToString()
applicantName.Text = reader("applicant").ToString()
End While
Else
div1.Visible = True
End If
reader.Close()
sqlCmd2.Dispose()
myConnection.Close()
End Sub
modified 17-Jan-23 12:21pm.
|
|
|
|
|
samflex wrote:
Dim sqlStatement As String = "Select o.PrimaryFirst, o.PrimaryLast, ap.applicant, FORMAT(ap.DateReceived, 'd','us') as DateReceived,o.SecondaryFirst,o.SecondaryLast,ad.InstallAddress,ad.InstallCity, ad.InstallState, ad.InstallZip, ad.WaterAcctNo from Applications ap "
sqlStatement += "inner Join Addresses ad on ap.WaterAccountNo = ad.WaterAcctNo inner join Owner o on ap.OwnerCode = o.OwnerID Where ad.InstallAddress Like '%" & address.Replace("'", "''").Trim() & "%'" Your code is almost certainly vulnerable to SQL Injection[^]. NEVER use string concatenation/interpolation to build a SQL query. ALWAYS use a parameterized query.
Const sqlStatement As String = "Select o.PrimaryFirst, o.PrimaryLast, ap.applicant, FORMAT(ap.DateReceived, 'd','us') as DateReceived, o.SecondaryFirst, o.SecondaryLast, ad.InstallAddress, ad.InstallCity, ad.InstallState, ad.InstallZip, ad.WaterAcctNo from Applications ap inner Join Addresses ad on ap.WaterAccountNo = ad.WaterAcctNo inner join Owner o on ap.OwnerCode = o.OwnerID Where ad.InstallAddress Like @query"
Using sqlCmd2 As New SqlCommand(sqlStatement, myConnection)
sqlCmd2.Parameters.AddWithValue("@query", address.Trim())
Using reader As SqlDataReader = sqlCmd2.ExecuteReader()
If reader.HasRows Then
div1.Visible = False
While reader.Read()
installationAddress.Text = String.Format("{0} {1}, {2} {3}", reader("InstallAddress"), reader("InstallCity"), reader("InstallState"), reader("InstallZip"))
waterAccountNumber.Text = reader("WaterAcctNo").ToString()
ownerInformation.Text = String.Format("{0} {1}", reader("PrimaryFirst"), reader("PrimaryLast"))
dateReceived.Text = reader("dateReceived").ToString()
applicantName.Text = reader("applicant").ToString()
End While
Else
div1.Visible = True
End If
End Using
End Using
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
Hi, I need little help with starting the web API because I am not familiar with web development. My goal is to set up REST API for just one endpoint and some webhook or something to receive callback POST notification. I need to send every day request to subscribe for next day and receive notifications from it.
I created new project c# ASP.NET Core Web App (NET 7) and installed Swashbuckle.AspNetCore package, build it and run. It loads the page locally with no problems but when I publish it and upload to my (paid) hosting server it show me 404 error. In my output I have webroot folder and app.dll app.exe and couple .js files but no index.js or index.php to show startup page, I think it must be something to start. How can I execute or start my app on web page? I created index.php or .html whith "hello world" and after upload it in root folder shows page instantly. Can anyone help me or guide me how to solve this?
|
|
|
|
|
I got information now that my hosting server is not for asp.net, it's for linux not windows. Dummy question: is there any way to bridge it?
|
|
|
|
|
|
Hello,
i use ajax, HtmlEditorExtender to let users writing their own description
i store in database, and in my database i can see properly data store in table like this :
'🔸🖤 DANCE SQUARE 🖤🔸\n📝 LA TRILOGIE :\n3 dates à ne surtout pas manquer\n.\n🟧◾️ 29 Octobre - LA'
but when i read data by sql, in string variable, i lose all the specials characters like hearts in my example, all specials characters are replace by ?
what should i do to keep specials characters ? (correctly store in database.)
i read like this :
if (!res.IsDBNull(i))
ss {
return res.GetString(i);
}
else
{
return string.Empty;
}
|
|
|
|
|
Even money's on this (NOUS VOYON (sp?)):
CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
A blind man could probably use GOOGLE to find this but ... I haven't got a blind man's machine so this is a conjecture on my part.
(Un aveugle pourrait probablement utiliser GOOGLE pour trouver cela mais ... je n'ai pas de machine pour aveugle, donc c'est une conjecture de ma part.)
|
|
|
|
|
Yes, but an intelligent man could understand that I have already found and applied this, but it is not enough
|
|
|
|
|
Probably your data is Unicode or UTF-8. I am not an expert on such things but you should ensure the data is being processed approriately.
One possibility is the font being used. The data might be just fine but if you are not using a font that supports Unicode or UTF-8 (whatever is relevant) then you won't see it correctly.
However the "\n" implies it is something else. That character is the carriage return, such as the Enter key in the keyboard.
Note that Rich Text is not the same as HTML. The formats are very different.
|
|
|
|
|