Welcome Guest Search | Active Topics | Sign In | Register

Load text field data in dialog control Options
GaryBrowning
Posted: Wednesday, May 22, 2013 5:54:21 PM
Rank: Member
Groups: Member

Joined: 6/1/2011
Posts: 18
I have a dialog control on a page that saves user input, with only one text field. I need to be able to load the existing value in the SQL table that this field is saved to when the user clicks the button to display the dialog. Currently the dialog's ShowButton property is set for the button on the page that the user clicks to display it, so when the dialog shows the text field is blank.

How would I do this?

eo_support
Posted: Wednesday, May 22, 2013 6:00:12 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

You would use something like this to get the TextBox control:

Code: C#
TextBox textBox = (TextBox)dialog1.ContentContainer.FindControl("TextBox1");


The rest would be straight forward.

Thanks!
GaryBrowning
Posted: Wednesday, May 22, 2013 9:29:04 PM
Rank: Member
Groups: Member

Joined: 6/1/2011
Posts: 18
Your code appears to load the value from the text field in the dialog to the text field on the web page. I'be got that working. I need to do the opposite when the user clicks the button to display the dialog.

For example, on the page is a label field containing "hello world". I need the label value "hello world" to appear in the dialog content field text field when displayed.

I'm basically trying to allow the user to edit data that is displayed.
eo_support
Posted: Wednesday, May 22, 2013 9:34:25 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

I am not sure if I understood your question correctly. You seem to be asking how to get the content of a label. If that's the case, then you will need to seek other resources because that would be a generic programming questions that has nothing to do with our product. We only offer tech support to our product.

Thanks!
GaryBrowning
Posted: Wednesday, May 22, 2013 11:34:19 PM
Rank: Member
Groups: Member

Joined: 6/1/2011
Posts: 18
I want to take the content of the label and put the value into a text field in your dialog control, before the dialog control is displayed.

Let me ask this. Is there another method/way to display the dialog control through code-behind code rather than setting the ShowButton property? If there is, I can probably copy the label content to the text field before showing the dialog.
eo_support
Posted: Wednesday, May 22, 2013 11:38:22 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

You can set the dialog's InitialState to Visible to display the dialog.

Thanks!
GaryBrowning
Posted: Thursday, May 23, 2013 9:46:50 AM
Rank: Member
Groups: Member

Joined: 6/1/2011
Posts: 18
Thank you. That does the trick!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.