web-controls

.net dropdownlist align text

扶醉桌前 提交于 2019-12-20 03:34:32
问题 I am trying to align the text in my .net dropdownlist to the right. Using CssClass I am able to align text to the right in Firefox. IE doesn't not align text to the right it aligns to the left. I have read that IE 6 doesn't support this. Is this true? I am using IE7 but most of my users will be in IE 6 so, both need to work. <asp:DropDownList ID="ddlNomination" Width="250px" CssClass="ddlnomination" runat="server" DataSourceID="Azoa" DataTextField="nomination_type" DataValueField="nomination

RepeatDirection Property for CheckedListBox C#

倖福魔咒の 提交于 2019-12-20 01:11:11
问题 so I'm very confused here. I want to make my multilined CheckedListBox to be sorted horizontally. I've done some research and it is all leading to the RepeatDirection property. Example in the MSDN But I don't have a web page and I don't know any XML. Can't I just somehow use this property for the CheckedListBox Control? The MSDN people say it is already a property of that Control as they simply have written: public virtual RepeatDirection RepeatDirection { get; set; } I just can't seem to

How to remove span tag from WebControl when rendered

谁说我不能喝 提交于 2019-12-18 14:16:14
问题 When using an ASP.NET CheckBox (and in out case, inherited from a CheckBox ) it renders a span around the checkbox input control, this span control is affecting jQuery scripts. Is it possible to remove this span when rendering? 回答1: Found this useful tip: In Code Behind, use InputAttributes instead of Attributes. For Example, type this: chk.InputAttributes.Add("onchange", "updateFields()") instead of this: chk.Attributes.Add("onchange", "updateFields()") or instead of inline declarations:

How can I include additional markup within a 'Content' inner property of an ASP.Net WebControl?

烈酒焚心 提交于 2019-12-18 06:56:52
问题 I've searched the site and I cannot find a solution for my problem, so apologies if it's already been answered (I'm sure someone must have asked this before). I have written a jQuery Popup window that I've packaged up as a WebControl and IScriptControl. The last step is to be able to write the markup within the tags of my control. I've used the InnerProperty attribute a few times, but only for including lists of strongly typed classes. Here's my property on the WebControl: [PersistenceMode

ASP.net Null Reference Exception Due to Not Finding Controls

坚强是说给别人听的谎言 提交于 2019-12-13 23:17:21
问题 I am having this exception that I can't figure out why it is happening. I searched this site and others trying to find a solution but none have worked so far. The Problem I have the following two div in my .aspx page. <div ID="success" style="visibility:hidden" runat="server"> // buttons and textfields </div> <div ID="fail" style="visibility:hidden" runat="server"> // buttons and textfields </div> On page load, I want one to become Visible depending on some criterion. But when I try to target

Cant access button in codebehind

亡梦爱人 提交于 2019-12-13 20:50:29
问题 I have this button in my .aspx file and would like to access it in my codeBehind .aspx.cs file. It's in a ListView so I'm assuming that's where the issue is (I have no problem accessing any elements outside of that ListView) - just cant seem to figure it out. Button code (Its in a ListView with ID lvInstructorList): <div class="col-3 checkInBtnDiv" runat="server"> <asp:Button class="checkInBtn" ID="checkInBtn" runat="server" OnClick="CheckInBtn_Click" Text="Check-In"></asp:Button> </div> What

Clickable Webcontrol, ASP.NET

浪尽此生 提交于 2019-12-13 15:22:35
问题 This is question is in relation to my last question in case you want some more background information. My question is: Is it possible to make a cell in an asp.net Table clickable? Or Is it at least possible to make a clickable WebControl (which should be possible to place in a ControlCollection), that is not a Button or a LinkButton, in ASP.NET? And if not, is it possible to multiple lines of information into the button text? I've tried adding other components to the button's

Define a Label Asp.net Coordinates through C#

大兔子大兔子 提交于 2019-12-13 05:05:15
问题 I need to create dinamically a System.Web.UI.WebControls.Label and define its cordinates in the Asp.net Page. I know it absolute position (x,y). But i dont know any way to define it. Here is how i create the label: System.Web.UI.WebControls.Label box3 = new System.Web.UI.WebControls.Label(); box3.Text = entradas.ElementAt(0).text; box3.ID = "box3"; //need to define x and y here The question is how to define its position. Thanks in advance 回答1: The Label control has an Attributes property

asp:label doesn't render children

。_饼干妹妹 提交于 2019-12-12 13:35:16
问题 I have an asp:label with a nested custom control and it simply doesn't render. I tried to register a custom WebControlAdapter for Label type and while debugging I noticed that there is apparently no control in the Controls collection, it seems to be completely ignoring any nested elements. Here's markup <asp:Label ID="lbl13" runat="server" AssociatedControlID="txt13" Text="<%$ Resources:Resources, lbl13 %>"> <asp:ValidationMessage ID="vm13" runat="server" MessageFor="txt13" CssClass="field

limit selections in a listbox in vb.net

做~自己de王妃 提交于 2019-12-12 12:42:47
问题 I am creating a web control in vb.net that contains a list box. I know that I am able to choose a selection mode of Single or Multiple, but I am interested in limiting a Multiple selection to a predetermined size. For example preventing a user from selecting more than 3 items. I have tried adding a Validator to the list box, which might be a way forward, but was wondering if there was a way of changing the selection mode to something a bit different than just the two specified ones. Any ideas