lamy Posted October 9, 2006 Posted October 9, 2006 (edited) i have sets of tags that i wanted to write in my html (specifying where it should be) but i couldnt find the right approach for this atm i made a web control which serves as a place holder, then on my page i find (if its on a master page) the control and assign the content (in a property) while the control (placeholder) overides Render so it gets written to where i placed it any other way to do this? all i wanted to do is write some custom tags like these <html> <form ...> ... </form> <mycustomtag value="set" target="something"/> <mycustomtag value="invoke" target="something_else"/> <mycustomtag value="invoke" target="another"/> <mycustomtag value="terminate" target="true"/> </html> it has no order or whatsoever, itll depend on the conditions that i made. if youre wondering why i needed this its because this page is being read by my winforms application which actually handles the interface (its for a kiosk, the ui for keypads and all those are done in windows control which i invoke if i see those tags) response.write wont do since i cant tell it where to write it, thats why i made that placeholder so i know where i put it, anyone? heres what i have atm my tag writer control <ToolboxData("<{0}:TagWriter runat=""server""></{0}:TagWriter>")> _ Partial Class TagWriter Inherits System.Web.UI.UserControl Private _Content As String = String.Empty <Personalizable()> _ Public Property Content() As String Get Return _Content End Get Set(ByVal value As String) _Content = value End Set End Property Protected Overrides Sub Render(ByVal writer As HtmlTextWriter) writer.Write(_Content) End Sub End Class at code-behind i generate those tags using a class (function returning a string) and assign it to content from my page (load) TagWriter1.Content = "something here" if its on a master page Dim tag As TagWriter = CType(Page.Master.FindControl("tagWriter"), TagWriter) tag.Content = "something here" Edited October 9, 2006 by lamy Quote slow down when you need to hurry, stop when you need to move on, look back when you need to forget, or you might slip and leave sanity
Gill Bates Posted October 9, 2006 Posted October 9, 2006 Try subclassing System.Web.UI.WebControls.WebControl instead. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.