when I am getting the value for a texbox in gridview, It's displaying " ".
Give me the solutions.
thank u
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Posted Sep 30, 2013, 3:21 AM EDT
Here is the snippet.
RequiredFieldValidator RequiredFieldValidator1 = new RequiredFieldValidator();
RequiredFieldValidator1.Enabled = true;
RequiredFieldValidator1.ErrorMessage = "First field required";
RequiredFieldValidator1.Display = ValidatorDisplay.Dynamic;
RequiredFieldValidator1.ControlToValidate = txtName.Id;
this.page.Controls.Add(RequiredFieldValidator1);
RequiredFieldValidator1.Validate();
Posted Sep 30, 2013, 12:47 AM EDT
shibasankar behera102 reputationPosted Sep 30, 2013, 12:50 AM EDT
this is a web page...
Posted Sep 30, 2013, 12:52 AM EDT
txtFName.Text = txtFName.Text.Trim();
shibasankar behera102 reputationPosted Sep 30, 2013, 1:00 AM EDT
This is right. But can you tell me, how to get those textbox value in gridview.
}
Its displaying " "...
Posted Sep 30, 2013, 1:03 AM EDT
So, I'm unclear here. Can you please explain bit more?
shibasankar behera102 reputationPosted Sep 30, 2013, 1:09 AM EDT
I am calling the above formula inside a button click event...
Posted Sep 30, 2013, 1:17 AM EDT
You meant to say, still you're getting   in the javascript and gridview ?
shibasankar behera102 reputationPosted Sep 30, 2013, 1:56 AM EDT
still I am getting that
Posted Sep 30, 2013, 2:10 AM EDT
Have you trimmed the value in the databound event before adding it to the controls collection?
Do you have any default text for the textbox control?
shibasankar behera102 reputationPosted Sep 30, 2013, 2:29 AM EDT
I am writing something in that text box, after clicking button, I am not getting that value.
Posted Sep 30, 2013, 2:32 AM EDT
shibasankar behera102 reputationPosted Sep 30, 2013, 2:42 AM EDT
thank u for helping me.
shibasankar behera102 reputationPosted Sep 30, 2013, 3:04 AM EDT
shibasankar behera102 reputationPosted Sep 30, 2013, 3:09 AM EDT
Now plz tell me How to validate text boxes inside Gridview....
shibasankar behera102 reputationPosted Sep 30, 2013, 3:26 AM EDT
I hope We'll make good contact in future.....
shibasankar behera102 reputationPosted Sep 30, 2013, 3:27 AM EDT
In which event or method I have to validate the text boxes in gridview?