| Problem with codebehind control (2 replies) |
| ASPFriends.com 'aspngcontrolscs' list |
| I'm new to web forms usercontrols, and I'm trying to write one from within my ASP.NET web application in VS.NET (beta 2). I'm using the VS.NET standard ascx file with an ascx.cs codebehind, so the ascx file represents a class ("Performance") derived from my class in the ascx.cs ("PerformanceBase"). I have a couple properties and a datagrid, but it's pretty simple. I then want to host this control ... |
|
| DESIGNTIMEDRAGDROP (4 replies) |
| ASPFriends.com 'aspngcontrolscs' list |
| I placed a server control on a web form in Visual Studio .NET. When I moved it in the designer using drag and drop, VS.NET added this property to the control in the .aspx source: ..... DESIGNTIMEDRAGDROP "430" ... I've looked in MSDN and searched the net, but I'm none the wiser as to what this property is as it doesn't appear to be documented. The problem with it is that my custom server control d... |
|
| Setting TagPrefix (5 replies) |
| ASPFriends.com 'aspngcontrolscs' list |
| I have added this line to a control to set the TagPrefix when it is dragged in VS.NET: [assembly: TagPrefix("myNamespace", "myTagPrefix") ] It doesn't seem to have any effect, the tagprefix still appears as 'cc1'. I have tried placing the line in AssemblyInfo.cs with the same result. What could be causing this statement to fail to work? Ollie ollie@cornes.org .NET Books http://www.cornes.org/books... |
|
| JavaScript that runs at onload (2 replies, VIP) |
| ASPFriends.com 'aspngcontrolscs' list |
| I've banged my head against this for a little while and I'm wondering if what I'm trying to do is possible. I want to programatically add some javascript to a page so that when the page is opened in the browser the client code is executed. If I was editing the HTML manually, I would create a javascript function and then add something like onload "myfunction()" to the body tag, but I need to add th... |
|
| Templated server control examples ? (4 replies, VIP) |
| ASPFriends.com 'aspngcontrolscs' list |
| Hi All I've built a composite control (emits static design time html) and now I want to provider user driven design time access the control. I'm assuming that a templated control is the best (and only ?) way to do this. There are examples in the framework help for building databound templated controls (and their designers) but nothing on non databound templated controls. Can anyone point me to som... |
|
| RegisterStartupScript (7 replies) |
| ASPFriends.com 'aspngcontrolscs' list |
| I've squirted JS out before using placeholder controls, but I want to ensure there aren't duplicate scripts so I'm using RegisterStartupScript on the Page class. public class MyControl : Control { protected override void OnPreRender(EventArgs e) { string location HttpContext.Current.Server.MapPath("/mywebapp/"); StreamReader stream File.OpenText(location "clientscript.js"); string script stream.Re... |
|
| nested properties (6 replies) |
| ASPFriends.com 'aspngcontrolscs' list |
| Hi, I'd like to group some properties of a web control to display them together in VS designer (in Properties window). The "Font" property of WebControl is a good example of I mean. Thanks, Kuba |
|
| DataBound Server control within a composite control (3 replies) |
| ASPFriends.com 'aspngcontrolscs' list |
| Can anyone give me a example using a DataBound control within a composite control? I need to be able to set the DataSource from the source page and maintain it on postbacks. I can get it working for the inital load of the page, but on postbacks the DataBound control loses it's DataSource. How do I maintain it's state? Thanks, Ray |
|
| NOT ANSWERED BEFORE: Change Property parsing behavior? (2 replies) |
| ASPFriends.com 'aspngcontrolscs' list |
| maybe I wasn't verbose enough before, here's a rephrasing of the problem. I am writing a new Validator control. It is a FileExtensionValidator, subclassing BaseValidator. It adds as properties a StringCollection of file extensions to check against, and a CompareMode enum which says whether the fore mentioned extensions are "allow" or "deny". When somebody uploads a file with the HtmlInputFile cont... |
|
| Adding a TemplateColumn to a DataGrid (2 replies) |
| ASPFriends.com 'aspngcontrolscs' list |
| I'm creating a control which has a CheckBox in the first column of a DataGrid. Is it possible to add a TemplateColumn to a DataGrid from code with the control? I've tried using the TemplateBuilder class like myTemplateBuilder.InstantiateIn(new CheckBox()); but doesn't render anything but a blank space in the column. Thanks, Ray |
|
| DropDownList in a composite control (3 replies, VIP) |
| ASPFriends.com 'aspngcontrolscs' list |
| I've made a control which contains a Label and a DropDownList. I'm trying to populate the DropDownList from the page that contains the control. I'm able to do this fine on the first load of the page, but when the page posts back, the DropDownList is empty. I also have similar controls for TextBox and CheckBox and they work fine (but I'm not using DataBind() I just setting values). Is there somethi... |
|
| Building Web controls that can be used in VS.NET (4 replies) |
| ASPFriends.com 'aspngcontrolscs' list |
| I am working on some custom Web controls that I'd like to work smoothly w/VS.NET's designer. From the documents I've read online and at http://www.swarren.net/, it appears that this is supposed to be an easy task, but I am having fits with it. First off, it appears that one should be able to specify meta data about the control's properties very simply, by just using the directives like: [ Category... |
|
| Custom control with a timer... (2 replies) |
| ASPFriends.com 'aspngcontrolscs' list |
| Hey all... I would be grateful to anyone who can answer either of the following two questions: 1. Can anyone point me to some documentation or even better a sample illustrating how to add code to the InitializeComponent() method of a page at design time as the component is dragged on to the page ? 2. How do add or modify attributes of the page's body tag ? Thanks in advance Michael www.michaellang... |
|
| Problem with ITemplate (5 replies) |
| ASPFriends.com 'aspngcontrolscs' list |
| Hi! I created a decorated Datagrid, a datagrid which is contained in a frame with a special header and footer. The footer is customizable by using a Template. For some reason, I get the following when I add a FooterTemplate to my control. I was able to reproduce the problem with the code provided bellow. Any idea anyone? Thanks alot! Paul Specified cast is not valid. Description: An unhandled exce... |
|
| Binding in the Designer? (2 replies) |
| ASPFriends.com 'aspngcontrolscs' list |
| Thanks to Ollie, Susan, and others who have helped me thus far with my designer questions. I am making great progress and am working on a TemplatedControlDesigner for a templated Web control. What I'd like the user to be able to do is, when entering the ItemTemplate mode, to be able to enter a string like: Name: %# DataBinder.Eval(Container.DataItem, "Name") % and then, ending the item template ed... |
|
| First Try at a Web Control (2 replies) |
| ASPFriends.com 'aspngcontrolscs' list |
| I an trying to create web control that will display a table of data in ways other that the DataGrid will allow. Specifically I want to be able to display the data horizontally rather than vertically and I haven't found anything else that can do it. So I have the CreateChildControls method overridden on my class and am using this code to try to create the table: protected override void CreateChildC... |
|
| Reading a page Variable (2 replies) |
| ASPFriends.com 'aspngcontrolscs' list |
| I have a control based on the TextBox control. One of my Properties of the control is ViewMode. If ViewMode is set to true, then the control renders just it's value and not within a actual textbox. Lets say I have several of these on a page. Is it possible to have a parameter that sets the ViewMode for all my controls at the same time? Can I access variables defined in the page from the control? C... |
|
| Access QueryString value from user control? (4 replies) |
| ASPFriends.com 'aspngcontrolscs' list |
| I would really like to access the Page object from inside a control. I have the following aspx page that calls a method in a control. Everything compiles and works with no problem until I try and set the return strID as follows: String strID Page.Request.QueryString["ID"]; This Causes the ASPX page to generate a System.NullReferenceException Commenting out the problem line and using something simp... |
|
| Custom Control Collection Property (2 replies) |
| ASPFriends.com 'aspngcontrolscs' list |
| Hi, I am trying to create a control with a property (collection) of sub items. like this: mycontrol mysubitem /mysubitem mysubitem /mysubitem /mycontrol Can someone give me a hint? |
|
| Accessing Controls (3 replies) |
| ASPFriends.com 'aspngcontrolscs' list |
| I have a dropdownlist control in a datalist control how Can I access that dropdownlist control to add data to it. Any articles or sources of reference would be greatly appreciated. Thanks, Dean Santillan Email: webmaster@5dayweek.com |
|