This is a migrated thread and some comments may be shown as answers.

Assign a value to a textbox on Add New Record of radgrid

3 Answers 89 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Arpita
Top achievements
Rank 1
Arpita asked on 27 Oct 2010, 05:30 PM

We have a variable with a value. Want to assign the value of a variable to the textbox on add new record on button click event?

3 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 27 Oct 2010, 05:59 PM
Hello Arpita Parikh,

We need a little more information before we can assist you.

  1. Where is this variable located? In your JavaScript code? In the test code?
  2. Do you value in the variable read and then put into the text box or the contents of the text box read and put into this variable?
  3. Are you trying to write test code that hooks into the button click event, or trying to use/set the variable after the button click is done?

Sincerely yours,
Cody
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Arpita
Top achievements
Rank 1
answered on 27 Oct 2010, 11:30 PM

Hi Cody,

Thanks for your reply.

  1. The variable is a global variable. No the code in not JavaScript.
  2. I read the value from variable and then assign it to the text box
  3. Yes, I am writing test code on the button click event.


-Arpita

0
Cody
Telerik team
answered on 02 Nov 2010, 11:49 PM
Hello Arpita,

I would like to better understand what it is you're trying to test. I ask because it is very unusual to want to hook into a button click event and act on it. The normal test sequence is to have the test click the button and then verify the correct response was returned by the web application. Would you mind giving me an overview of what it is you're trying to validate in this particular test case please? Once I understand what you're trying to accomplish I might be able to offer a better and easier way to accomplish it.

It is possible to hook into JavaScript events. This is documented here.

To set the text of an input text box you would use code like this:

string text_to_set = "Customer";
HtmlInputText textbox = Find.ById<HtmlInputText>("input_q");
textbox.Text = text_to_set;

Kind regards,
Cody
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Arpita
Top achievements
Rank 1
Answers by
Cody
Telerik team
Arpita
Top achievements
Rank 1
Share this question
or