<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Web Forms</title><link>http://forums.asp.net/18.aspx</link><description>All about building ASP.NET Pages - server controls, events, validation, etc.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Disable TextBox from server-side?</title><link>http://forums.asp.net/thread/2589709.aspx</link><pubDate>Fri, 29 Aug 2008 19:21:13 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2589709</guid><dc:creator>RobSil</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2589709.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2589709</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Thanks Major... I tried that (actually had deleted those form the sample code before posting).&amp;nbsp; I did manage to solve it... i swear each time I make a post I find the answer myself soon thereafter.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The issue was that I had the disabled being set in the HTML code also... so I was actually setting it, then unsetting it before the entire page was returned to the client.&amp;nbsp; I removed that auto-populate and now I set/unset properly.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Disable TextBox from server-side?</title><link>http://forums.asp.net/thread/2589592.aspx</link><pubDate>Fri, 29 Aug 2008 18:13:42 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2589592</guid><dc:creator>MajorCats</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2589592.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2589592</wfw:commentRss><description>&lt;p&gt;This is just a long shot...but what is your radiobutton defaulted to?&amp;nbsp; Is it defaulted to &amp;quot;off&amp;quot;?&amp;nbsp; Could it be that when the page builds, it is running your javascript when it sets the default value of the radiobutton.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Put an alert(&amp;#39;Passcode enabled!&amp;#39;); in your function so you can see if your javascript is being executed.&amp;nbsp; If it is, you can try to move your code for settign passcodetb or you could set the radiobutton selection as appropriate instead (which would run the javascript to enable/disable).&lt;/p&gt;</description></item><item><title>Re: Disable TextBox from server-side?</title><link>http://forums.asp.net/thread/2589587.aspx</link><pubDate>Fri, 29 Aug 2008 18:12:37 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2589587</guid><dc:creator>MajorCats</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2589587.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2589587</wfw:commentRss><description>&lt;p&gt;This is just a long shot...but what is your radiobutton defaulted to?&amp;nbsp; Is it defaulted to &amp;quot;off&amp;quot;?&amp;nbsp; Could it be that when the page builds, it is running your javascript when it sets the default value of the radiobutton.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Put an alert(&amp;#39;Passcode enabled!&amp;#39;); in your function so you can see if your javascript is being executed.&amp;nbsp; If it is, you can try to move your code for settign passcodetb or you could set the radiobutton selection as appropriate instead (which would run the javascript to enable/disable).&lt;/p&gt;</description></item><item><title>Disable TextBox from server-side?</title><link>http://forums.asp.net/thread/2589440.aspx</link><pubDate>Fri, 29 Aug 2008 17:00:05 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2589440</guid><dc:creator>RobSil</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2589440.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=2589440</wfw:commentRss><description>&lt;p&gt;Hey all, &lt;br /&gt;&lt;/p&gt;&lt;p&gt;I have a field that contains an &amp;#39;optional&amp;#39; passcode. &amp;nbsp; Above that I have the &amp;quot;On/Off&amp;quot; radio buttons that enable/disable the field.&amp;nbsp; Client-side it&amp;#39;s no problem to have the field be disabled or enabled based upon what the user selects (via javascript below).&amp;nbsp; But now I want to add the ability to &amp;#39;update&amp;#39; the settings.&amp;nbsp; so I load out of the database the users details and am trying to use the code-behind to enable or disable the text field.&amp;nbsp; It does not seem to work as I would assume.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Javascript:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!--&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function setPassCodeEnabled(){ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&amp;quot;&amp;lt;%=passCodeTB.ClientID%&amp;gt;&amp;quot;).disabled = false;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function setPassCodeDisabled(){ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&amp;quot;&amp;lt;%=passCodeTB.ClientID%&amp;gt;&amp;quot;).disabled = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //--&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/script&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;This script is called from the radio buttons and works fine.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Code-Behind:&lt;/p&gt;&lt;p&gt; &amp;nbsp;&amp;nbsp; if (bIsSecure)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; passCodeTB.Enabled = true;&lt;/p&gt;&lt;p&gt;else&amp;nbsp;&amp;nbsp; &lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; passCodeTB.Enabled = false; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I am not sure why that .Enabled approach will not work, but the text box stays disabled despite me verifying that it is indeed being set to true.&amp;nbsp; Can anyone help me sort this out please?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thx,&lt;/p&gt;&lt;p&gt;Rob &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>