469,077 Members | 1,457 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,077 developers. It's quick & easy.

Asp.net User Control or Custom control Property doesnt accept inline asp.net constrac

Hi , I have got problem with passing my inline based value to y user
control (or custom control, no matter which one I use, I have tried
both to make sure it doesnt matter) .
So say I have property called ImagePath and i want to pass my value
through asp.net specific inline cunstruction:
<uc:MyControl runat=server id="someId" ImagePath="<%=
Request.ApplicationPath %>/App_Themes/<%= Page.Theme %>/Images/
ball_.png" />,

problem that in my property I get value exactly word for word:<%=
Request.ApplicationPath %>/App_Themes/<%= Page.Theme %>/Images/
ball_.png , but i Should get it like:

For example if I use simple img html tag i works:
<img src="<%= Request.ApplicationPath %>/App_Themes/<%= Page.Theme %>/
Images/ball_.png" />
But if i add runat=server it brokes and i dont see any image coz the
path of image already messy string with <%= and so on.

I tried a lot of attributes to my ImagePath that found in web posts to
let it work (i.e.: [Bindable(true)],[Category("Data")],
[Browsable(true)] and many more) but no result.

Please let me know if you can resolve this interesting trick somehow?
Aug 25 '08 #1
1 2798
3,406 Expert 2GB
I think you might be mixing ASP and ASP.NET. The two are incompatible. runat designates ASP.NET. <%=%> is a standard ASP response.write shorthand. Some ASP syntax works in .NET, but not all, and it is easier to use strictly one or the other from a troubleshooting standpoint. What is your IDE? Are you just coding in notepad?

Aug 25 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Jonathan Wood | last post: by
11 posts views Thread by John J. Hughes II | last post: by
5 posts views Thread by John Kotuby | last post: by
5 posts views Thread by =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post: by
4 posts views Thread by =?Utf-8?B?UmljaEI=?= | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.