.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 31st, 2003, 08:23 AM
calinberindea calinberindea is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 18 calinberindea User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy webform update problem

Hi, I have the following problem:

On a webform I have some textboxes and combo boxes and a button. All of them are web controls. Some of them are disabled. When I click the submit button, I update in the database the modified fields, and I show the same page with the updated fields and a message. I update only the enabled fields, I don't touch the disabled fields. After the update is made, the disabled fields are empty. I assume is because the .Net can't take the disabled field's value (like in HTML).
I can use ReadOnly instead of Enabled, but is not ok for combos.

Has anybody a solution? I would need a solution asap.
Thanks in advance

Reply With Quote
  #2  
Old August 2nd, 2003, 04:09 PM
Andrew Andrew is offline
dotNetBB Forums Developer
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 265 Andrew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to Andrew Send a message via AIM to Andrew Send a message via Yahoo to Andrew
While not necessarily the "best" option, you could always loop thru the posted collection like this also :
Code:
Dim arr1() As String
Dim arr2() As String
Dim l1 As Integer = 0
Dim l2 As Integer = 0
Dim aCount As Integer = 0
Dim coll As System.Collections.Specialized.NameValueCollection  
coll = HttpContext.Current.Request.Form
arr1 = coll.AllKeys
For l1 = 0 To arr1.GetUpperBound(0)
  arr2 = coll.GetValues(l1)
  For l2 = 0 To arr2.GetUpperBound(0)
    If Not arr2(l2) Is Nothing Then
      If arr2(l2) <> String.Empty Then
        Context.Current.Response.Write("<br />Name : " + arr1(l1) + " -- Value : " + arr2(l2))
      End If
    End If
  Next
Next
__________________
Building a better community one post at a time.
dotNetBB Forums

Reply With Quote
  #3  
Old August 4th, 2003, 02:33 AM
calinberindea calinberindea is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 18 calinberindea User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Still not working

Running this code I got only the enabled controls with thei values.

Reply With Quote
  #4  
Old August 4th, 2003, 02:55 AM
Andrew Andrew is offline
dotNetBB Forums Developer
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 265 Andrew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to Andrew Send a message via AIM to Andrew Send a message via Yahoo to Andrew
You will always only get the enabled controls. There is no getting around that.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > webform update problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT