Numeric updown TextBox not displaying buttons in IE [duplicate] - c#

This question already has answers here:
<input type="number"> not working in IE10
(6 answers)
Closed 4 years ago.
I have an HTML input control
<input id="textBox1" class="form-control" runat="server"/>
I add the following C# code to make it a Numeric updown control:
textBox1.Attributes["type"] = "number";
textBox1.Attributes["min"] = "0";
textBox1.Attributes["max"] = "50";
textBox1.Attributes["step"] = "1";
This is working fine in Chrome but in Internet Explorer the updown buttons are not displaying.
What should I do to display the buttons in IE also?
I know that a similar question has been asked here but I thought adding the Attributes in code behind could overcome this as suggested here in Sachin Gupta's answer.

See https://caniuse.com/#feat=input-number
Comment attached to IE versions is:
UI widget does not include increment/decrement buttons.

Related

How does Selenium get the hiding text from knockout's data-bind like data-bind="textInput: overridePassword, enable: false" [duplicate]

This question already has an answer here:
How can one get the value of a text input using Selenium with C#?
(1 answer)
Closed 3 years ago.
I am creating selenium automation for our UI testing, and I tried to generate a random password for a user. How does selenium 3 WebDriver based on C# get the text of html5 knockout data-bind? I am using selenium 3 framework based on C# and Visual Studio 2019
<input id="txtGeneratedPassword" type="text" class="form-control" data-bind="textInput: overridePassword, enable: false" title="" disabled="">
The following is the part of my code:
IWebElement passwd_text = driver.FindElement(By.Id("txtGeneratedPassword"));
Console.WriteLine(driver.ExecuteJavaScript<String>("return
arguments[0].textContent", passwd_text));
but nothing is displayed
you want to get the value, not the text:
How can one get the value of a text input using Selenium with C#?
passwd_text.GetAttribute("value")

accessing an ASP HiddenField within a .JS file [duplicate]

This question already has answers here:
Get the Value of an asp:HiddenField using jQuery
(8 answers)
Closed 5 years ago.
I assign a value to an ASP hidden field within the page load but can't access that value in my JQuery. I added an alert as a test and it comes up 'undefined'. Am I making a syntactic error?
<asp:HiddenField runat="server" id="hfID"/>
hfID.Value = "Test";
alert($('#hfID').Val());
Asp.Net Webforms mangles the id you give it to make sure it's unique on the page. You can use class as a selector or modify your jQuery selector so that it's looking for an id that ends in hfID.
$("[id$='hfID']")

Add tooltip programmatically on asp.net web page [duplicate]

This question already has answers here:
Tooltips for Button elements
(8 answers)
Closed 7 years ago.
I have this code on my project.
string="my string"
how i show this string on a button as a tool-tip. I want this to do programmatically. I want this to do in my code not the design.
i do my codings in asp.net with c# language
Here's how to add the tooltip programmatically
just get the id of the button
<asp:Button id="button1" Text="Submit" runat="server" />
in your code behind:
//do some code to retrieve data from database and store it to this variable
String tooltip = "some text";
button1.ToolTip = tooltip;

ASP.NET C# target blank is not working on LinkButton [duplicate]

This question already has answers here:
link button property to open in new tab?
(8 answers)
Closed 3 years ago.
I have this linkbutton here...
<asp:LinkButton ID="linkButton" CssClass="Button" runat="server" target="_blank">Button Text</asp:LinkButton>
but the target blank does not work, it does not open the page in a new tab, it opens it in the same tab.
What Am I doing wrong?
There is an href, its gets assigned in the code behind like so
linkButton.PostBackUrl = "http://www.nfl.com";
but still the target blank does not work....
You can try this. Hope it helps:
<asp:LinkButton ID="linkButton" OnClientClick="window.document.forms[0].target='_blank';" runat="server">Button Text</asp:LinkButton>
linkButton.PostBackUrl = "http://www.nfl.com";
Below code works fine:
OnClientClick="window.document.forms[0].target='_blank';
In ASP.NET web forms a button, linkbutton, imagebutton or similar control actually just submits the underlying form. In order to open this in a new window you can modify the target property of the "form" using JavaScript. We also need to undo the modification after the click otherwise further button clicks will unintentionally target the new tab, which we can do using a setTimeout and blanking the target again.
<asp:LinkButton ID="uiNewTabExample" Text="PDF" OnClick="uiNewTabExample_Click" OnClientClick="window.document.forms[0].target = '_blank'; setTimeout(function () { window.document.forms[0].target = '' }, 0);"
runat="server" />

Does the <asp:Textbox> have a onFocusLost event? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Lost Focus method for asp.net textbox?
i want to check the data entered by user on the client side.
it is necessary for me to use control.
is there any way so that i can check after client move on to the next input and i can check the data by javascript ?
<asp:TextBox ClientIDMode="Static" onblur="return userCheck(this.id)" onkeyup="return userCheck(this.id)"
ID="txtUserName" runat="server" Width="180"></asp:TextBox>
here i have used two events but i want to use only one.
You can do that with onblur event using javascript.
f.e something like that:
<asp:TextBox runat="server" onblur="Javascript:alert('1234');" />
For what you want to do, you can set the textbox to have AutoPostBack=True; any time the text in the box is changed and the box loses focus, it will post back to the page; you can use the TextChanged property, as well, if you don't want to post back, which will check to see if the text of the TextBox has been changed between posts.
Finally, you can bind the JavaScript onFocus and onBlur events to the textbox, and handle changes to its contents via JavaScript:
http://support.microsoft.com/default.asp…
Source: http://answers.yahoo.com/question/index?qid=1006040618831

Categories

Resources