Home » Posts tagged "Controls" (Page 2)

Archive for the 'Controls' Tag

Form control state in code behind

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 ‘define control css ValidatUser.Attributes.Add(“class”, “btnSubmit”) vUsername.Attributes.Add(“class”, “txtBox”) ‘on post back page we change the state of control If Page.IsPostBack Then ‘hide validate button ValidateUser.Visible = False ‘disable textbox vUsername.Enabled = False End If End […]

DefaultValue of parameter – alternative method of setting parameter’s value

Set update parameter default value in code behind: Formview …. Meeting Time: <asp:textbox ID=”TimeTextBox” runat=”server” Text=’< %# Bind("Time") %>‘ /> … <updateparameters> <asp:parameter Name=”Time” Type=”String” /> <asp:parameter Name=”Rid” Type=”Int32″ /> </updateparameters> </asp:textbox> Code behind Protected Sub MemberDetailFV_ItemUpdating(ByVal sender As Object, ByVal_ e As System.Web.UI.WebControls.FormViewUpdateEventArgs)_ Handles MemberDetailFV.ItemUpdating_ MemberDetailDS.UpdateParameters(“Time”).DefaultValue = Now() End Sub

Monthly Event Calendar – Control parameter query

Description: ASP.NET Toolbox calendar control which use control parameter to query db records and display event(s) on calander item selection change. This is suitable for deisplaying events on PostBack call on the same page. Elements: Events.mdb / or MS SQL Web.config Month-2.aspx Month-2.aspx.vb Dtgrid.css Method: Create table Events (Id [primary key – AutoNumber], Event [Text], […]