Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Controls that contain code: Code Blocks Not Supported

Reply
Thread Tools

Controls that contain code: Code Blocks Not Supported

 
 
Microsoft
Guest
Posts: n/a
 
      12-14-2005
How can I develop a custom control that can then be used to display
dynamically generated data?
I have created a simple custom control which I use to reproduce the same
style box in my website repeatedly. The content for the box is placed
between the tags of the control in the aspx file.
However if I want to inject some dynamic text I get the error "code blocks
are not supported in this context", how can I get around this?

This is the HTML code that I am using to create an instance of my control.
Everything works correctly as long as the HTML code within the control tags
is vanilla HTML. I am using .NET 2 and I've enabled the ParseChildren(false)
tag to my control so as to be able to access the vanilla HTML.

===============================
<Box:ShadedBox Width="90%" BoxTitle="Registration" runat="server">
<%="hi" %>
</Box:ShadedBox>


===============================

Any help would be appreciated, I am new to this ASP.NET development having
only ever worked with ASP or PHP before now where code was permitted to be
inserted anywhere.
Regards,
Anthony Williams


 
Reply With Quote
 
 
 
 
Anthony Williams
Guest
Posts: n/a
 
      12-14-2005
Thats interesting, why is my name Microsoft!? Should be fixed now...


"Microsoft" <> wrote in message
news:u93O8%...
> How can I develop a custom control that can then be used to display
> dynamically generated data?
> I have created a simple custom control which I use to reproduce the same
> style box in my website repeatedly. The content for the box is placed
> between the tags of the control in the aspx file.
> However if I want to inject some dynamic text I get the error "code blocks
> are not supported in this context", how can I get around this?
>
> This is the HTML code that I am using to create an instance of my control.
> Everything works correctly as long as the HTML code within the control
> tags is vanilla HTML. I am using .NET 2 and I've enabled the
> ParseChildren(false) tag to my control so as to be able to access the
> vanilla HTML.
>
> ===============================
> <Box:ShadedBox Width="90%" BoxTitle="Registration" runat="server">
> <%="hi" %>
> </Box:ShadedBox>
>
>
> ===============================
>
> Any help would be appreciated, I am new to this ASP.NET development having
> only ever worked with ASP or PHP before now where code was permitted to be
> inserted anywhere.
> Regards,
> Anthony Williams
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
Code blocks are not supported in this context John Cantley ASP .Net 2 12-14-2005 02:19 PM
why do i recieve the error 'the avi is invalid or does not contain a format supported by microsoft video for windows ' Paul Butt Computer Support 6 09-05-2005 10:00 PM
procs/blocks - blocks with procs, blocks with blocks? matt Ruby 1 08-06-2004 01:33 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57