Click here to Skip to main content
15,895,011 members
Home / Discussions / C#
   

C#

 
QuestionHow Know if an control has added an event Pin
machocr10-May-04 10:12
machocr10-May-04 10:12 
AnswerRe: How Know if an control has added an event Pin
Heath Stewart10-May-04 10:41
protectorHeath Stewart10-May-04 10:41 
GeneralSending data over POST Pin
CWIZO10-May-04 9:21
CWIZO10-May-04 9:21 
GeneralRe: Sending data over POST Pin
Heath Stewart10-May-04 9:45
protectorHeath Stewart10-May-04 9:45 
GeneralRe: Sending data over POST Pin
CWIZO10-May-04 10:24
CWIZO10-May-04 10:24 
GeneralRe: Sending data over POST Pin
Heath Stewart10-May-04 10:46
protectorHeath Stewart10-May-04 10:46 
GeneralDropDownList - Behavioral Question. Pin
stan2810-May-04 7:43
stan2810-May-04 7:43 
GeneralRe: DropDownList - Behavioral Question. Pin
Heath Stewart10-May-04 9:03
protectorHeath Stewart10-May-04 9:03 
First of all, this belongs in the ASP.NET forum, but I'll award bad behavior anyway since it at least relates to .NET and possibly even C# (unlike the SQL question posted after this one).

EVERYTHING in ASP.NET comes down to a class or member. The <asp:DropDownList> control is just the System.Web.UI.WebControls.DropDownList class. So you can set its Enabled property to false, except it's not a string - it's a boolean property so drop the quotes. In-line with the ASP.NET page as HTML, the attribute is a string by the TypeConverter for that property is able to convert strings to boolean values and vice versa. So, in your SelectedIndexChanged event handler, you can set ddl1.Enabled to false so long as you have a reference to it. In ASP.NET 1.x, your .aspx page inherits from your code-behind .cs source file. So, create two protected members like so:
protected DropDownList ddl1;
protected DropDownList ddl2;
When they're instantiated in the .aspx page, these members in your base class will not be null. VS.NET does this by default when you create new pages in an ASP.NET Web project.

Just make sure that in most cases when you're modifying properties that correspond to attributes or child elements that are output to the HTML document sent to the client that you enable the ViewState property. This isn't always the case, but reading and discovering how to effectively use the ViewState (which is enabled by default) will help.

 

Microsoft MVP, Visual C#
My Articles
Generaltoolbar icon Pin
elena1234510-May-04 6:16
elena1234510-May-04 6:16 
GeneralRe: toolbar icon Pin
Heath Stewart10-May-04 6:49
protectorHeath Stewart10-May-04 6:49 
GeneralRe: toolbar icon Pin
elena1234510-May-04 10:08
elena1234510-May-04 10:08 
GeneralRe: toolbar icon Pin
Heath Stewart10-May-04 10:44
protectorHeath Stewart10-May-04 10:44 
GeneralDatabase Wrapper Pin
JohnMess10-May-04 5:25
sussJohnMess10-May-04 5:25 
GeneralRe: Database Wrapper Pin
Heath Stewart10-May-04 5:40
protectorHeath Stewart10-May-04 5:40 
GeneralRe: Database Wrapper Pin
johnmess10-May-04 6:31
sussjohnmess10-May-04 6:31 
QuestionImage retrieval from ImageList is slow? Pin
Judah Gabriel Himango10-May-04 4:39
sponsorJudah Gabriel Himango10-May-04 4:39 
AnswerRe: Image retrieval from ImageList is slow? Pin
Heath Stewart10-May-04 4:47
protectorHeath Stewart10-May-04 4:47 
GeneralRe: Image retrieval from ImageList is slow? Pin
Judah Gabriel Himango10-May-04 4:53
sponsorJudah Gabriel Himango10-May-04 4:53 
GeneralRe: Image retrieval from ImageList is slow? Pin
Judah Gabriel Himango10-May-04 6:19
sponsorJudah Gabriel Himango10-May-04 6:19 
GeneralRe: Image retrieval from ImageList is slow? Pin
leppie10-May-04 11:55
leppie10-May-04 11:55 
Generaljumping from one form to another Pin
michael.wikstrom10-May-04 3:29
michael.wikstrom10-May-04 3:29 
GeneralRe: jumping from one form to another Pin
Heath Stewart10-May-04 3:35
protectorHeath Stewart10-May-04 3:35 
GeneralSending binary data with webservices Pin
Edgar R. C.10-May-04 3:01
Edgar R. C.10-May-04 3:01 
GeneralRe: Sending binary data with webservices Pin
Heath Stewart10-May-04 3:09
protectorHeath Stewart10-May-04 3:09 
GeneralRe: Sending binary data with webservices Pin
Edgar R. C.10-May-04 3:57
Edgar R. C.10-May-04 3:57 

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.