asp.net-customcontrol

Buttons on click event, inside an update panel, rendered through a custom server control not firing

泪湿孤枕 提交于 2019-12-25 02:55:31
问题 I am developing a custom control which renders (a) textbox (es), in its textchange event I want to asynchronously send the value to the control where it would search and make the data available in an exposed property to be fetched later on page load . But my problem is, HOW TO ASYNCHRONOUSLY CALL A METHOD CODED INSIDE MY CONTROL to do the search functionality. For now, the textbox textchange and the buttons click events are not firing, the button click loads the page and writing in the

How to register custom server control on ASP.NET page

你。 提交于 2019-12-18 12:54:06
问题 I have a project and I am trying to register a custom server control (there is no .ascx file) on the page. I am currently using Class Declaration namespace MyApp.Controls{ public class CustomControl: WebControl{ public string Text { get { String s = (String)ViewState["Text"]; return ((s == null) ? String.Empty : s); } set { ViewState["Text"] = value; } } protected override void RenderContents(HtmlTextWriter output) { output.Write(Text); } } } On my page, <%@ Register TagPrefix="myControls"

Possible to have a inner control on a custom server control?

一世执手 提交于 2019-12-11 07:49:40
问题 I would like to be able to do something like: <ui:Tab Title="A nice title"> <TabTemplate> <asp:Literal runat="server" ID="SetMe">With Text or Something</asp:Literal> </TabTemplate> </ui:Tab> but also be able to do: <ui:Tab Title="A nice title"> <TabTemplate> <asp:DataList runat="server" ID="BindMe"></asp:DataList> </TabTemplate> </ui:Tab> Answer code I eventually came up with: [ParseChildren(true)] public class Node : SiteMapNodeBaseControl, INamingContainer { private ITemplate tabTemplate;

ASP .NET web application memory leaks - profiler shows a lot of strings

纵饮孤独 提交于 2019-12-11 01:46:33
问题 My web application constantly hits the IIS limitation set on the virtual memory allocated to the application pool. This causes IIS to stop the application. I've been trying to identify possible memory leaks in my app using .NET memory profiler and so far the largest amount of memory retained after GC seems to be in strings. Even for accessing one page the memory usage grows quite a lot. When I look into the strings stored I find duplicated strings like SQL queries used in SqlDataSource