TextBox does not have KeyDown or KeyPress events - vb.net

I have a visual basic web application and i placed a textbox on the form. When I look at the actions available for that textbox, the only actions available are DataBinding, Disposed, Init, Load, PreRender, TextChanged, and Unload. Why is KeyDown not available? Is it because this is a web application as opposed to a windows application? Is it possible to build an event handler that will fire the when a key is pressed? Maybe I have to convert my project to a windows application?

Yes, that is the reason. Remember that, in a web application, functionality is split between server and client. If you want to react to keystrokes then you need to do that on the client side, which means using JavaScript.

You are using Asp.Net Web Forms application. The very reason it exists is to help developers who previously worked on WinForms applications to move towards Web Development. This is why there are some similarities, e.g. WinControls <-> WebControls. But don't forget, you are in the WEB now. Your Button_onClick event works completely differently. If on WinForms this is invoked directly by button press; on the WebForms, your form is translated into HTML page with <form> and <input . . .> tags. And it builds javascript automatically, so when you press the button, there is a POST call to a server. Then, your server receives request, and directs execution to Button_onClick during so-called "page cycle".
Once you decide that your app needs to be a web app, you should probably forget doing it using Web Forms because this system is not true web development. A true web-centric development would be Javascript-based UI, may be using some framework like Vue or Angular with Asp.net Web Api as server app. May be you should start with Asp.net MVC. This will make you concentrate on single application, because server and client components are developed together when you use MVC.
Going back to main question - yes, 2 different systems, do not expect compatibility. And even when something seem similar, they might behave differently.

Why do you want to capture the keystroke?
You can control that the TextBox is entered by code, for example, that only numbers are entered;
asp:TextBox ID="TextBox3" runat="server" Width="50px"
AutoComplete="off" MaxLength="20" type="number" step="any"
TabIndex="9">

Related

Problem of Jmeter/Webdriver with testing a webapp searching data form which has Knockout installed

I am facing problem of testing jmeter/Webdriver for a webapp which has Knockout framework installed. I fill all the form fields OK but when run click search button it displays the error that required fields need not to be empty. I checked all web element value are not empty. As my understand Knockout is not activated to bind Web elements with DataModel from Knockout. I used wait WDS.browser.manage().timeouts().implicitlyWait for webpage fully loaded/ajax calling or event being fired but without any success. I Do you have any experiencing and solution for testing this kinds of webapp?
thanks
It might be the case you need to trigger a certain JavaScript event in order to "tell" the web application that you finish the input, i.e. onkeyup or onblur which is not being automatically called by Selenium's sendKeys() function
You can use i.e. WDS.browser.executeScript() function to send the event(s) which indicate that you filled in the form(s). Check out The WebDriver Sampler: Your Top 10 Questions Answered article to learn how to call scripts, use Waits, etc.

Create a non legacy Event

When I use the legacy API call to create an event all works as expected except it is displayed in the Web UI with a 'View Diagrams' and 'View Guest Lists' buttons.
After creating an event using the web app it just displays a 'View Event' button and postfixes the description with '[V2]' The display url is of the form: https://app.socialtables.com/?event=435008 which seems to be using the legacy_id of the event.
I need to be able to create an event that matches the behavior of the Web App.
How can this be accomplished?
The legacy API is intended to create Legacy Events, so that is working as it should. We are in transition from our legacy to 4.0 apis so the following will solution will work today with minimal changes to your code: setting venue_mapper_version as 3 in the legacy API call.
{
...
"venue_mapper_version": 3
}
To ensure future-proof functionality you should also consider using our /4.0/events routes as they will be the answer going forward. https://developer.socialtables.com/api-console#/Events

Browser Contron With Javascript Detection and DOM Read

I have a website designed for adaptive content, and need to make a "Desktop App", my idea is to insert the Website in a Windows Form, using a "browser" control, preferably chrome-like (The Website is in HTML5/CSS3).
My "problem" is that I need to handle "javascript events", I need to launch an event from the website, and the App would need to catch it and do something.
In another side, I need to read some DOM components via Class or ID, and read the attributes in the Windows App (like div content, or data-* attributes)
Does a free control exist for VB.NET with these capabilities?

Make Web Browser control communicate with VB.NET Program

What I am looking for here is a way to possibly click a button inside a web browser control and have it call a sub from inside the program or have the program react to something on the page.
I am trying to make a HTML5 GUI for my application. I don't really want use any 3rd party API's to handle commands from a HTML5 interface but if I can find another alternative that would be good. But if there is no other way I would be content with using a 3rd party API.
The way I have done this in the past is to specify a special protocol for my app.
yourapp:somefunction/someparameter
Handle the Navigating event, and in your code for when that event is fired, check to see if the URL has your protocol on the front of it. If it is, set e.Cancel = true to cancel navigation, and add code to handle the URL parameters yoruself.

how to load html in SL4 Child window?

in this case , without using third party controls, load Html content in silverlight child window.(SL-4 InBrowser Application)
There is no built-in way in Silverlight 4 to do this in browser. The only way to do this in browser is to use javascript interop. You have to run the Silverlight app in Windowless mode, and create a div on the web page that is placed on top of the Silverlight application. You then have to move that div around based on the current coordinates of the Silverlight windows using javascript interop. This is not entirely trivial. Good luck.