Click here to Skip to main content
15,899,679 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionusing sleep function in vb.net Pin
solarthur0110-Dec-07 6:14
solarthur0110-Dec-07 6:14 
GeneralRe: using sleep function in vb.net Pin
Christian Graus10-Dec-07 8:30
protectorChristian Graus10-Dec-07 8:30 
GeneralRe: using sleep function in vb.net Pin
solarthur0110-Dec-07 13:05
solarthur0110-Dec-07 13:05 
GeneralRe: using sleep function in vb.net Pin
Michael Sync10-Dec-07 15:15
Michael Sync10-Dec-07 15:15 
GeneralRe: using sleep function in vb.net Pin
solarthur0110-Dec-07 16:10
solarthur0110-Dec-07 16:10 
GeneralRe: using sleep function in vb.net Pin
Michael Sync10-Dec-07 16:23
Michael Sync10-Dec-07 16:23 
GeneralRe: using sleep function in vb.net Pin
Christian Graus10-Dec-07 17:01
protectorChristian Graus10-Dec-07 17:01 
GeneralViewstate (maybe) issue with dynamic controls. Pin
t7bros10-Dec-07 5:34
t7bros10-Dec-07 5:34 
A bit of background before my problem:

We're doing a security overhaul of our internal applications. We've decided that most pages will have 3 forms of security: read-only, partial input, and full control. The read-only and full controls portions are fairly self-explanatory. The partial input version of the page is controlled by the security roles we setup for the various users. One person may have the ability to edit a particular field, while another doesn't.
We receive complaints about hard to read disabled drop down lists. As of right now we have two solutions: javascript that disables clicking on the control, or a custom control that changes the dropdown to a label when it is disabled.

And now the problem:

I'm working on this second option. I created a class that inherits from the DropDown class and created a new property called ChangeToLabel. Code follows:

<br />
Public Class DropDownDisable<br />
Inherits DropDownList<br />
<br />
Dim lbl As New Label<br />
<br />
Public Property ChangeToLabel() As Boolean<br />
Get<br />
Dim s As Boolean = CBool(ViewState("ChangeToLabel"))<br />
Return s<br />
End Get<br />
Set(ByVal value As Boolean)<br />
<br />
If value = False Then<br />
Me.Visible = True<br />
'Me.Enabled = True<br />
lbl.Visible = False<br />
Else<br />
'lbl.Style.ToString = Me.Style.ToString<br />
lbl.CssClass = Me.CssClass<br />
lbl.Width = Me.Width<br />
lbl.Height = Me.Height<br />
lbl.Visible = True<br />
lbl.Text = MyBase.SelectedItem.Text<br />
lbl.ID = Me.ID & "_disabled"<br />
lbl.BorderColor = Color.FromKnownColor(KnownColor.InactiveBorder)<br />
lbl.CopyBaseAttributes(Me)<br />
lbl.Enabled = True<br />
lbl.TabIndex = -1<br />
Me.Visible = False<br />
Me.Parent.Controls.Add(lbl)<br />
End If<br />
End Set<br />
End Property<br />
<br />
End Class<br />
<br />


The problem occurs when the page containing this control posts back. The newly created labels are getting lost. The even stranger problem is that not every label is disappearing. So far, all of the controls that disappear are in a third-party MultiPage control (we use ComponentArt). We run the security methods on every postback, so I'm assuming the labels are on the page in the appropriate places, and that they're just losing their text values. Thanks for any help you can give me.

Tom
GeneralRe: Viewstate (maybe) issue with dynamic controls. Pin
Christian Graus10-Dec-07 8:36
protectorChristian Graus10-Dec-07 8:36 
GeneralRe: Viewstate (maybe) issue with dynamic controls. Pin
t7bros13-Dec-07 4:15
t7bros13-Dec-07 4:15 
GeneralValidator extender Pin
cisco210310-Dec-07 4:42
cisco210310-Dec-07 4:42 
GeneralThe request timed out before the page could be retrieved Pin
Sasmi10-Dec-07 4:31
Sasmi10-Dec-07 4:31 
QuestionASP.NET Reporting Pin
AndyBrew7010-Dec-07 3:47
AndyBrew7010-Dec-07 3:47 
GeneralRe: ASP.NET Reporting Pin
Michael Sync10-Dec-07 4:00
Michael Sync10-Dec-07 4:00 
GeneralRe: ASP.NET Reporting Pin
AndyBrew7010-Dec-07 4:06
AndyBrew7010-Dec-07 4:06 
GeneralRe: ASP.NET Reporting Pin
Michael Sync10-Dec-07 4:28
Michael Sync10-Dec-07 4:28 
GeneralRe: ASP.NET Reporting Pin
AndyBrew7010-Dec-07 8:06
AndyBrew7010-Dec-07 8:06 
GeneralRe: ASP.NET Reporting Pin
pmarfleet10-Dec-07 10:22
pmarfleet10-Dec-07 10:22 
GeneralRe: ASP.NET Reporting Pin
Michael Sync10-Dec-07 15:02
Michael Sync10-Dec-07 15:02 
Question#If ? Pin
kenexcelon10-Dec-07 2:54
kenexcelon10-Dec-07 2:54 
AnswerRe: #If ? Pin
Michael Sync10-Dec-07 3:37
Michael Sync10-Dec-07 3:37 
AnswerRe: #If ? Pin
N a v a n e e t h10-Dec-07 18:06
N a v a n e e t h10-Dec-07 18:06 
QuestionHelp Regarding to upload any file. Pin
Virendrak10-Dec-07 1:56
Virendrak10-Dec-07 1:56 
GeneralRe: Help Regarding to upload any file. Pin
Paddy Boyd10-Dec-07 2:32
Paddy Boyd10-Dec-07 2:32 
GeneralRe: Help Regarding to upload any file. Pin
Virendrak10-Dec-07 3:59
Virendrak10-Dec-07 3:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.