Hello,
Im trying to create a dynamic array of textboxes from an array
returned by a web service. THe web service returns a list of fields
that I need to place on a dynamically created web page. The problem I
am having is when the button event is clicked, the text typed in the
textbox doesn't get saved with the textbox. I might be way off base
with even trying this. If anyone could give me some idea on what is
going wrong or another way to produce the form, I would greatly
appreciate it.
Here is the following code for the page I am producing
Try
If Not Me.IsPostBack Then
Result = FieldList.GetFieldListing(FEID, ClientID, UserName,
Password, Fields, ErrMsg)
If Not Result Is Nothing Then
For j = 0 To UBound(Result)
txtBox = New System.Web.UI.WebControls.TextBox
txtLabels = New System.Web.UI.WebControls.Label
txtLabels.ID = Result(j) & "lbl"
txtBox.ID = j
txtLabels.Enabled = True
txtLabels.EnableViewState = True
txtLabels.Font.Size = txtLabels.Font.Size.XSmall
txtLabels.Style("Position") = "Absolute"
txtLabels.Style("Top") = CStr(4 + k) & "px"
txtLabels.Style("Left") = "0px"
txtLabels.Style("Width") = "50px"
txtLabels.Text = Result(j)
txtBox.Attributes("AutoPostBack") = "True"
'txtBoxes(j).AutoPostBack = True
txtBox.Text = txtBox.ID.ToString
txtBox.ReadOnly = False
txtBox.Enabled = True
txtBox.TextMode = TextBoxMode.SingleLine
txtBox.EnableViewState = True
txtBox.Wrap = True
txtBox.Style("BorderStyle") = "NotSet"
txtBox.Style("Position") = "Absolute"
txtBox.Style("Top") = CStr(k) & "px"
txtBox.Style("Left") = "140px"
txtBox.Style("Width") = "200px"
k = k + 25
PlaceHolder1.Controls.Add(txtBox)
PlaceHolder1.Controls.Add(txtLabels)
Panel1.Controls.Add(txtBox)
Panel1.Controls.Add(txtLabels)
Panel1.Style("Height") = CStr(k) & "px"
Panel1.Style("Width") = "341px"
Panel1.Style("Top") = "5px"
Panel1.Style("Left") = "5px"
btnSearch.Style("Top") = CStr(k + 25) & "px"
btnSearch.Style("Left") = "5px"
'WebForm.Controls.Add(txtBoxes(j))
Next j
k = 0
End If
End If
Catch ErrorMessage As Exception
TextBox1.Text = ErrorMessage.Message() & ErrorMessage.Source
Finally
End Try 2 3584
Hi Eric,
Why not first trying with one very simple textbox without any condition and
then build it up in the complete style you are busy with?
I think with what you doing now is getting every time more way off base.
As a first idea of my, you need of course somewhere to have a postback
situation also or in a button event, a setted click event or in your
loadpage in the IsPostback situation..
Just a thought
Cor Im trying to create a dynamic array of textboxes from an array returned by a web service. THe web service returns a list of fields that I need to place on a dynamically created web page. The problem I am having is when the button event is clicked, the text typed in the textbox doesn't get saved with the textbox. I might be way off base with even trying this. If anyone could give me some idea on what is going wrong or another way to produce the form, I would greatly appreciate it.
Here is the following code for the page I am producing
Try If Not Me.IsPostBack Then Result = FieldList.GetFieldListing(FEID, ClientID, UserName, Password, Fields, ErrMsg) If Not Result Is Nothing Then For j = 0 To UBound(Result) txtBox = New System.Web.UI.WebControls.TextBox txtLabels = New System.Web.UI.WebControls.Label txtLabels.ID = Result(j) & "lbl" txtBox.ID = j txtLabels.Enabled = True txtLabels.EnableViewState = True txtLabels.Font.Size = txtLabels.Font.Size.XSmall
txtLabels.Style("Position") = "Absolute" txtLabels.Style("Top") = CStr(4 + k) & "px" txtLabels.Style("Left") = "0px" txtLabels.Style("Width") = "50px" txtLabels.Text = Result(j) txtBox.Attributes("AutoPostBack") = "True" 'txtBoxes(j).AutoPostBack = True txtBox.Text = txtBox.ID.ToString txtBox.ReadOnly = False txtBox.Enabled = True txtBox.TextMode = TextBoxMode.SingleLine txtBox.EnableViewState = True txtBox.Wrap = True txtBox.Style("BorderStyle") = "NotSet" txtBox.Style("Position") = "Absolute" txtBox.Style("Top") = CStr(k) & "px" txtBox.Style("Left") = "140px" txtBox.Style("Width") = "200px" k = k + 25 PlaceHolder1.Controls.Add(txtBox) PlaceHolder1.Controls.Add(txtLabels) Panel1.Controls.Add(txtBox) Panel1.Controls.Add(txtLabels) Panel1.Style("Height") = CStr(k) & "px" Panel1.Style("Width") = "341px" Panel1.Style("Top") = "5px" Panel1.Style("Left") = "5px" btnSearch.Style("Top") = CStr(k + 25) & "px" btnSearch.Style("Left") = "5px" 'WebForm.Controls.Add(txtBoxes(j)) Next j k = 0 End If End If Catch ErrorMessage As Exception TextBox1.Text = ErrorMessage.Message() & ErrorMessage.Source Finally End Try
Hi Eric,
Why not first trying with one very simple textbox without any condition and
then build it up in the complete style you are busy with?
I think with what you doing now is getting every time more way off base.
As a first idea of my, you need of course somewhere to have a postback
situation also or in a button event, a setted click event or in your
loadpage in the IsPostback situation..
Just a thought
Cor Im trying to create a dynamic array of textboxes from an array returned by a web service. THe web service returns a list of fields that I need to place on a dynamically created web page. The problem I am having is when the button event is clicked, the text typed in the textbox doesn't get saved with the textbox. I might be way off base with even trying this. If anyone could give me some idea on what is going wrong or another way to produce the form, I would greatly appreciate it.
Here is the following code for the page I am producing
Try If Not Me.IsPostBack Then Result = FieldList.GetFieldListing(FEID, ClientID, UserName, Password, Fields, ErrMsg) If Not Result Is Nothing Then For j = 0 To UBound(Result) txtBox = New System.Web.UI.WebControls.TextBox txtLabels = New System.Web.UI.WebControls.Label txtLabels.ID = Result(j) & "lbl" txtBox.ID = j txtLabels.Enabled = True txtLabels.EnableViewState = True txtLabels.Font.Size = txtLabels.Font.Size.XSmall
txtLabels.Style("Position") = "Absolute" txtLabels.Style("Top") = CStr(4 + k) & "px" txtLabels.Style("Left") = "0px" txtLabels.Style("Width") = "50px" txtLabels.Text = Result(j) txtBox.Attributes("AutoPostBack") = "True" 'txtBoxes(j).AutoPostBack = True txtBox.Text = txtBox.ID.ToString txtBox.ReadOnly = False txtBox.Enabled = True txtBox.TextMode = TextBoxMode.SingleLine txtBox.EnableViewState = True txtBox.Wrap = True txtBox.Style("BorderStyle") = "NotSet" txtBox.Style("Position") = "Absolute" txtBox.Style("Top") = CStr(k) & "px" txtBox.Style("Left") = "140px" txtBox.Style("Width") = "200px" k = k + 25 PlaceHolder1.Controls.Add(txtBox) PlaceHolder1.Controls.Add(txtLabels) Panel1.Controls.Add(txtBox) Panel1.Controls.Add(txtLabels) Panel1.Style("Height") = CStr(k) & "px" Panel1.Style("Width") = "341px" Panel1.Style("Top") = "5px" Panel1.Style("Left") = "5px" btnSearch.Style("Top") = CStr(k + 25) & "px" btnSearch.Style("Left") = "5px" 'WebForm.Controls.Add(txtBoxes(j)) Next j k = 0 End If End If Catch ErrorMessage As Exception TextBox1.Text = ErrorMessage.Message() & ErrorMessage.Source Finally End Try This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: charliewest |
last post by:
I need to create textboxes in real-time, the actual number of which is
determine by a result from a database query. I have been able to create the
controls, and then add them to the ASPX page....
|
by: Bhavin |
last post by:
How can I capture user entered values from dynamically created controls in
ASP.NET ?
Thanks,
|
by: Sunil Sabir |
last post by:
Dear All,
Actually I am want to make a function which will take a list of ID numbers
retrieved from the database and diplayed their details on the web page.On
the Web Page I have a textbox and...
|
by: Abraham Luna |
last post by:
how do i stop the dynamic validators from breaking explorer
if i use a dynamic validator and move to a different control it breaks
explorer and i can type in the page when i'm not supposed to....
|
by: Eric Diana |
last post by:
Hello,
Im trying to create a dynamic array of textboxes from an array
returned by a web service. THe web service returns a list of fields
that I need to place on a dynamically created web page....
|
by: Frinavale |
last post by:
Introduction
Sometimes, when developing web applications, we need to be able to dynamically load controls based on user selections. The following article describes a simple scenario where TextBox...
|
by: MaryamSh |
last post by:
Hi,
I am creating a Dynamic Search in my application.
I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove)
By pressing Add button...
|
by: MaryamSh |
last post by:
Create Dynamic Dropdownlist Controls and related event
--------------------------------------------------------------------------------
Hi,
I am creating a Dynamic Search in my application.
I...
|
by: englishman69 |
last post by:
Hello,
I have been banging my head against this one for a while... Searches online have revealed many different proposals for correcting my issue but none that I can follow! My basic situation...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |