ラベル textboxes の投稿を表示しています。 すべての投稿を表示
ラベル textboxes の投稿を表示しています。 すべての投稿を表示

2012年3月28日水曜日

Resize Accordion Pane

I have a few textboxes and requiredfieldvalidator s with a validationsummary inside an Accordion pane. When I click the submit button and the validationsummary shows its messages (at the top of the pane) it pushes the other controls down and some end up outside the pane. This is a Pain and was wondering if there is a way to make the accordion pane resize. Anybody have some Javascript or something that will help with this?

Awsome Thanks!

Sorry, posted before I read enough of the forum. SeemsThis isissue 1560 and their hoping to get it fixed by the next release. I did a slight workaround anyway: The other accordion pane I had was taller so I just added enough breaklines inside the offending pane which allowed for enough space for my validation summary to appear and just clip the breaklines out of the pane.

Although any ideas for a better solution would be greatly appreciated

Awsome Thanks!!

2012年3月26日月曜日

Retrieve value from a dynamically created control inside an UpadetPanel

I would like to dynamically create some controls - tablecells, textboxes, and dropdownlists inside an AJAX UpdatePanel.
How would I retrieve the values that user enters into these controls in my vb.net code behind?
Can you please provide vb.net sample code ??

Here is my code:

'creates the textboxes - works fine

For i = 1 To intUnseatedGuestCount
Dim txtFirstName As New TextBox
txtFirstName.ID = "txtFirstName" + i.ToString
Me.tdNewSeatingCards.Controls.Add(txtFirstName)
Next

'code to retreive the values - produces an error message

Object reference not set to an instance of an object

For i = 1 To Me.hidNewSeatingCardCount.value
strTXTName = "txtFirstName" + i.ToString
Dim myTXT As TextBox = CType(Me.tdNewSeatingCards.FindControl("txtFirstName" + i.ToString), TextBox)
strTest += myTXT.Text + "<br>"
Next

Thank you for your help

You are creating controls dynamically, So on every postback (even in asynchronous postbacks ) you have to create it


OK Here is my code to recreate the controls:

For i = 1 To Me.hidNewSeatingCardCount.Value
Dim txtFirstName As TextBox = CType(Me.tdNewSeatingCards.FindControl("txtFirstName" + i.ToString), TextBox)
txtFirstName.ID = "txtFirstName" + i.ToString
Me.tdNewSeatingCards.Controls.Add(txtFirstName)
strTest += CType(Me.tdNewSeatingCards.FindControl("txtFirstName" + i.ToString), TextBox).Text
Next

There are no error messages, but I am not getting the values that the user enters into the textbox.

Thank you


Hi,

Thank you for your post!

You should place your recreate code in the init event.

The cause of the issue is viewstate process is finished before you recreate your controls!

If you have further questions,let me know!

Best Regards,

retrieve value from a dynamically created control

I would like dynamically create some controls - tablecells, textboxes, and dropdownlists inside an AJAX UpdatePanel.

How would I retrieve the values that user enters into these controls in my vb.net code behind?

Can you please provide vb.net sample code ??

Thank you for your help

http://forums.devx.com/showthread.php?t=16770

http://mail.123aspx.com/ArticleFrame.aspx?res=31558


here is a nice tutorial with example / code on how to create Dynamic controls and how to retrieve values from these dynamic controls.. [Page_Init() event is used here...]

SingingEels : Dynamically Created Controls in ASP.NET

hope it helps./.