{"id":2072,"date":"2012-08-05T10:58:55","date_gmt":"2012-08-05T14:58:55","guid":{"rendered":"http:\/\/www.iowawebnet.com\/ein\/?p=2072"},"modified":"2012-08-09T11:12:14","modified_gmt":"2012-08-09T15:12:14","slug":"form-control-state-and-css-properies-in-code-behind","status":"publish","type":"post","link":"https:\/\/www.iowawebnet.com\/ein\/2012\/08\/form-control-state-and-css-properies-in-code-behind\/","title":{"rendered":"Form control state in code behind"},"content":{"rendered":"<pre>\r\nOn page load event we define button css properties\r\n<code>\r\nProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)\r\n                        Handles Me.Load\r\n  \r\n'define control css\r\n   ValidatUser.Attributes.Add(\"class\", \"btnSubmit\")\r\n   vUsername.Attributes.Add(\"class\", \"txtBox\")\r\n\r\n'on post back page we change the state of control        \r\n   If Page.IsPostBack Then\r\n     'hide validate button\r\n     ValidateUser.Visible = False\r\n     'disable textbox\r\n      vUsername.Enabled = False\r\n   End If\r\nEnd Sub\r\n<\/code>\r\nI hope you get the idea.\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>On page load event we define button css properties Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load &#8216;define control css ValidatUser.Attributes.Add(&#8220;class&#8221;, &#8220;btnSubmit&#8221;) vUsername.Attributes.Add(&#8220;class&#8221;, &#8220;txtBox&#8221;) &#8216;on post back page we change the state of control If Page.IsPostBack Then &#8216;hide validate button ValidateUser.Visible = False &#8216;disable textbox vUsername.Enabled = False End If End [&hellip;]<\/p>\n","protected":false},"author":35,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[85,17,16,52,84],"tags":[19,144],"class_list":["post-2072","post","type-post","status-publish","format-standard","hentry","category-net-4-0","category-applications","category-net","category-controls","category-vs2010","tag-asp-net","tag-controls"],"_links":{"self":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/2072"}],"collection":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/comments?post=2072"}],"version-history":[{"count":7,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/2072\/revisions"}],"predecessor-version":[{"id":2078,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/2072\/revisions\/2078"}],"wp:attachment":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/media?parent=2072"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/categories?post=2072"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/tags?post=2072"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}