SEARCH YOUR SOLUTION HERE  

enabled and disabled textbox [Solved by Rock] thx

!!olleh


:D



I have a problem with asp.net, I want enabling and disabling a textbox when the user select the option this are enabled, if not disabled.


my problem is when I select some checkboxs this work wrong :S

my code:


Code:If CheckBoxList1.SelectedIndex = 0 Then
DropDownList1.Enabled = True
TextBox6.Visible = True
TextBox11.Visible = True
' DropDownList6.Visible = True
ElseIf CheckBoxList1.SelectedIndex = 1 Then
CheckBoxList1.Items(0).Selected = True
DropDownList2.Visible = True
TextBox7.Visible = True
TextBox12.Visible = True
' DropDownList7.Enabled = True
ElseIf CheckBoxList1.SelectedIndex = 2 Then
CheckBoxList1.Items(0).Selected = True
CheckBoxList1.Items(1).Selected = True
DropDownList3.Visible = True
TextBox8.Visible = True
TextBox13.Visible = True
'DropDownList8.Enabled = True
ElseIf CheckBoxList1.SelectedIndex = 3 Then
CheckBoxList1.Items(0).Selected = True
CheckBoxList1.Items(1).Selected = True
CheckBoxList1.Items(2).Selected = True
DropDownList4.Visible = True
TextBox9.Visible = True
TextBox14.Visible = True
'DropDownList9.Enabled = True
ElseIf CheckBoxList1.SelectedIndex = 4 Then
CheckBoxList1.Items(0).Selected = True
CheckBoxList1.Items(1).Selected = True
CheckBoxList1.Items(2).Selected = True
CheckBoxList1.Items(3).Selected = True
DropDownList5.Visible = True
TextBox10.Visible = True
TextBox15.Visible = True
' DropDownList10.Enabled = True
End If

when I select the first is ok. when I select the second dont enabled the control.

any ideas

thx
regards,

Posted On: Sunday 11th of November 2012 09:59:16 PM Total Views:  155
View Complete with Replies




Related Messages:

conversion ajax enabled asp.net 2.0 to asp 3.5 web site   (157 Views)
I've asp.net 2.0 ajax enabled web site in which I used Ajax update panels in pages. Now I want to convert it into asp.net 3.5 but it gives errors for Ajax tool kit and script manager and update panel used in pages. I don't want to remove ajax functionality from my site, so is there a way to convert them without removing ajax update panels from pages. On my PC I've installed both VS2005 and VS2008. Any suggestions is appreciated.
Re: logon only if enabled   (82 Views)
hi there, my login was working fine with only using the 2 fileds user name and password my login page uses my companydb.aspx code file to process the logins basically i want to upgrade the login if you like before it was username password correct then come on in if not correct stay out now i want if username password and comp_enabled = 1 then come on in CompanyDB code VB Code: Public Shared Function ValidateUser(ByVal UserName As String, ByVal Password As String, [COLOR=RoyalBlue]ByVal enabled As String[/COLOR]) _ As Boolean Dim sSelect As String sSelect = "SELECT COUNT(*) FROM tb_comp_detail " _ & "WHERE c_companycode = '" & UserName _ & "' AND c_password = '" & Password & "'" _ [COLOR=RoyalBlue]& "' AND c_comp_enabled = '" & enabled & "'"[/COLOR] Dim cmdSelect As New SqlCommand(sSelect, Connection) Dim iCount As Integer cmdSelect.Connection.Open() iCount = cmdSelect.ExecuteScalar() cmdSelect.Connection.Close() my login page VB Code: Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click If companyDB.ValidateUser(txtUsername.Text, txtPassword.Text, [COLOR=RoyalBlue]lblOn.Text[/COLOR]) Then FormsAuthentication.RedirectFromLoginPage(txtUsername.Text, chkAutomatic.Checked) Else changes i made above are in blue the lblon is just a label text 1 in it the error i get is incorrect syntax near 1
Re: [2005] Application pool sharepoint enabled   (144 Views)
Im creating a simple web application (using http during creating project) which contain one textbox and a button. No code behind.If Im changing the app pool to sharepoint enabled web page display server application unavaible but im sure that this app pool is running because it can run a project created from .net 1.1. I try to change the app pool to sharepoint not enabled the from the ISS it display the page well. Any suggestion I attached a picture for more info about the error.
set tabpanel child controls enabled   (83 Views)
Hi Guys, I have 3 tabpanels. When I'm creating a new record I hide the 2nd and 3rd tab panel. Code: Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender If Me.hdnFileID.Value = -1 Then Me.tabInvoices.Enabled = False Me.timesheetTab.Enabled = False End If End Sub then I have a pagemethod that saves the data. Once that is done I do this in javascript to enable the tabs so users can work on them. Code: //TSTab is the clientid of the tabcontainer FileTab = $find(TSTab); var tab1 = FileTab.get_tabs()[1]; tab1.set_enabled(true); var tab2 = FileTab.get_tabs()[2]; tab2.set_enabled(true); this works but the child controls in the tab are disabled please help me with some to to enable them.
set tabpanel child controls enabled   (105 Views)
Hi Guys, I have 3 tabpanels. When I'm creating a new record I hide the 2nd and 3rd tab panel. Code: Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender If Me.hdnFileID.Value = -1 Then Me.tabInvoices.Enabled = False Me.timesheetTab.Enabled = False End If End Sub then I have a pagemethod that saves the data. Once that is done I do this in javascript to enable the tabs so users can work on them. Code: //TSTab is the clientid of the tabcontainer FileTab = $find(TSTab); var tab1 = FileTab.get_tabs()[1]; tab1.set_enabled(true); var tab2 = FileTab.get_tabs()[2]; tab2.set_enabled(true); this works but the child controls in the tab are disabled please help me with some to to enable them.
Re: ASP.NET 4.0 Web extension is not enabled on the Web server Error   (82 Views)
We have installed the .net 4.0 framework and registered asp.net 4.0 to IIS using aspnet_regiis, but we keep getting this error when we try to create a new (or upgrade an existing) project on our development box. "The ASP.NET 4.0 Web extension is not enabled on the Web server. is targeting ASP.NET 4.0. Do you want to enable ASP.NET on the Web Server" When we hit "Yes", it pulls up another message of: "ASP.NET 4.0 has not been registered on the Web server. You need to manually configure your Web server for ASP.NET 4.0 in order for your site to run correctly, Press F1 for more details." Any ideas That particular message pulls up nothing in a Google search...
Problem in checkbox in ajax enabled appn   (96 Views)
I have an asp .net checkbox in an ajax enabled application. The checkbox is disabled or enabled in the client side (javascript) based on the data in the page load itself. After the page gets succesfully loaded, i am unable to change the state of the checkbox (disable/enable) thru the client side code. The checkbox state remains same as it was set in the page load. What is the reason for this problem and how to solve it
[URGENT] textbox enabled=false; can't request   (125 Views)
I have a textbox on an asp webpage that I have created dynamically (using only the codebehind page) I have populated that textbox with some textual data. I have a button on the form (along with other textboxes). When I press the button code executes to gather the information in all the textboxes on the form. I can get all the values in the various textboxes EXCEPT when a textbox's enabled property is set to false. When it's set to false the code "Request("TextBoxID")" returns nothing.Any thoughts, parshu Pune, India Since 10/8/2002 Posts 1,964 Reputation 17,980 Reply parshuram naregal (parshu) replied on 3/22/2006 10:23 PM rated by 0 users Just wondering can't u simply use, TextBox1.Text to retrieve the value , pdan2993 Fayetteville, GA Since 8/19/2003 Posts 371 Reputation 2,800 Reply Patrick Daniel (pdan2993) replied on 3/23/2006 7:08 AM rated by 0 users By design, a textbox that is set to enabled=false will never postback it's value. In asp.net 2.0 they have added a property to the form object that allows you to post disabled controls. I believe it tells the client to run a script that transparently enables all the controls or something. Not sure the specifics, but this is a known issue.There are articles out there that show you how to make a textbox appear disabled.Check out this article on how to make a "faux" disabled textbox:http://aspnet.4fromrolla.com/articles/012506-1.aspxI implemented something similar and it works perfectly. You just have to run an initialization function in javascript when the page loads to ensure fields are properly enabled/disabled.
Setting a button's enabled propery having no affect   (108 Views)
I have two buttons, when one is clicked, both must be disabled before the processing takes place. But I can not disable the buttons. I think it's because of the way asp.net flows I don't really know the order. HTML: Just a regular table, with two buttons. The user should not be able to click either button while the processing takes place (a few minutes)Code:When you click on the Export button this code runs:Code: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then ' Some code... Else cmdPrevious.Enabled = False cmdExport.Enabled = False End If End SubAlong with the button code:Code:Protected Sub cmdExport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdExport.Click Dim strCaseName As String strCaseName = Request.Cookies("FalconCurrentEmployer").Value Call ExportAndSubmit() ' Big function lblExportSuccess.Text = "Case """ & strCaseName & """ has been exported and submitted for approval" pnlExport.Visible = False pnlExportSuccess.Visible = True End SubExportAndSubmit() is a big function, does a lot of file copying and database manipulation.Where can I put the code to disable the buttons prior to ExportAndSubmit() being called I tried putting the Enabled calls in the cmdExport_Click as well, but it still doesn't take.This is actually a problem is several spots in my code. I have things to hide or disable prior to the action selected by the user.
Datalist.Item.enabled = false ??   (94 Views)
I am trying to disable all controls in specific DatalistItem.I was wondering if it was possible to disable an entire DatalistItem without having to disable each individual control within the datalistitem. I tried something like this but it doesnt have any affect.Code:Datalist.items(itemIndex).Enabled = False'ItemIndex represents some index integerI can disable them by looping through the DatalistItems and finding each individual control within the item and then disable them, but I would like to do this more efficiently. Does anyone have any suggestions
Test to see if Cookies are enabled   (58 Views)
How do I do that in ASP.Net using VB.Ne
ViewState enabled=false no affect?   (179 Views)
I have a Gridview that has some controls above you can use to select how much data the Gridview displays - a week's worth, a month's worth, a year's worth etc. And, as it's a view only grid, I thought 'I'll keep the page size down by doing this:
Re: Change textbox enabled by databind   (201 Views)
Hi! I ahve a very annoying problem. I have a datacolumn that either return 1 or 0 and I need to set a textbox control to enabled=true if its 1 and enabled=false if its 0. This may seem very easy, but I keep getting cast errors. I have tried: Enabled='' Enabled=''
Re: hyperlink not enabled when sent from Intranet web site in outlook 2007   (108 Views)
, I am using xp_sendmail (ASP.NET/SQL Server) to send hyperlinked emails from the companys Intranet web site. The user can access web pages by clicking on the link in the email. The link is highlighted (and underlined) and can be accessed by clicking on it in outlook 2003 but the link is not highlighted and underlined and cannot be accessed in outlook 2007.
Re: [02/03] How do I write my application so it is plug-in-enabled   (216 Views)
Yes, I realize this is a huge question and that is kind of vague, but my knowledge in that department is kind of limited. How do I write an application that has these basic properties: - Can load in a DLL or similar written by someone else upon demand at run time - ow that DLL access to data and functions native to my application - Display data based on that DLL - Run functions within that DLL - - For such functions, run them without knowing what they are called at the time I wrote my application I can kind of answer the last point myself in the following: If I can get to where I can run functions in a loaded-in DLL, I can force all those DLLs to have an access control function where I just tell the DLL to run its own function and it runs its own functions from within that "wrapper" function. I hope you all understand what I am going for here. This is crucial to the future of humanity! (Now, you should be scared. Very scared)
enabled validators   (83 Views)
Ink have a link to another page but i cant redirect there because a have validators.. that require a field.. how can i solve this problem..
form focus when .enabled=false   (136 Views)
hello , I have a forum that is loading in data that I dont want the user to be able to modify, so I have set all the textfields to enabled=false this works but I get a wee error triangle at the bottom of internet explorer and when I click it it says that form focus cannot work when fields are not enabled. Is there anyway of manually stopping the form trying to focus on the first item so that this error will not occur
Anyone seen an AJAX enabled poll for asp.net 1.0?   (121 Views)
We're looking for a poll we can put on our intranet. We thought it would be nice if it was AJAX so we wouldn't have to refresh the page, but can't seem to find anything out there.Anyone seen one of these out there
Still trying to test for javascript enabled   (311 Views)
I have the folowing code, but if I disable Javascript on my PC it still shows the message 'You do have javascript enabled'Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here If Not IsPostBack Then Try ShowMessage("You do have javascript enabled") Catch ex As Exception Me.label1.text = "You do not have javascript enabled" End Try End If End Sub Private Sub ShowMessage(ByVal strMessage As String) Dim strScript As String = "" strScript += "alert(""" & strMessage & """);" strScript += "" If Not (Page.IsStartupScriptRegistered("clientScript")) Then Page.RegisterStartupScript("clientScript", strScript) End If End Sub
Function for text box being enabled   (134 Views)
So i have a check box and a text box. When check box checked, I want the text box to be enabled. Here is what I have so far. I am knew to ASP, so any help is appreciated in understanding what I am doing wrong. Then of course the script: Function termChecked() As Boolean If cbTerm.Checked = True Then txtTerm.Enabled=True Else txtTerm.Enabled=False End If End Function