Showing posts with label image. Show all posts
Showing posts with label image. Show all posts

Wednesday, March 28, 2012

They LIED!

I have designed a custom control and have been trying to set the TagPrefix and ToolBoxBitmap image to the control, but none of it is working!

Adding the TagPrefix to the control

To set the TagPrefix it's says to do this

'Within the AssemblyInfo.vb file add this
Imports System.Web.UI

'<Assembly: TagPrefix("Namespace Name", "TagPrefix")>
<Assembly: TagPrefix("JHAControls", "JHA")>

When I add my control to the page it shows up as this in the HTML

<%@dotnet.itags.org. Register TagPrefix="cc1" Namespace="JHACustomControls.JHAControls" Assembly="JHACustomControls" %>

the TagPrefix should be "JHA", not "cc1", which is the default.

Why doesn't this doesn't work!?

Adding an icon to the custom control
To add an icon to the custom control, it says to do this.
Assuming the icon is the same name as your class, which it is (JHATextBox class, and JHATextBox.bmp icon)

1) Create a 16x16 pixel bmp icon. which I did.
2) Add the icon to the project, which I did.
3) Set the icons build action to "Embedded Resource", which I did
4) Rebuild the project and the icon will display in the toolbox when the control is added.

This doesn't work either, I still get the default "gears" icon.

I can get the icon to work, but only if I specify the absolute path to the file (C:\MyFolder\MyFile.bmp). But then the control (.dll file) doesn't work on another computer unless the image exists in the same location on that computer.

Anyone know why these aren't working??I finally got the first part (TagPrefix) working...It isnt' only the namespace name that is needed...it is the SolutionName.Namespace name.

So instead of

<Assembly: TagPrefix("JHAControls", "JHA")>

it had to be

<Assembly: TagPrefix("JHACustomControls.JHAControls", "JHA")>

Where JHACustomControls is the name of the solution or project, then the namespace.

I still haven't figured out the icon part though.
I got it all fixed.
I removed the namespace from my class and the icon displayed just fine.
Thanks for the help!
What Help ?

I should be thanking you as you are miles ahead of me in .net.
I am finding it very difficult. Especially ADO.net.
I was being sarcastic, as it doesn't appear that anyone here has done, what I was trying to do.

.NET is pretty straight forward once you understand the basics.
If you need help just ask.
I have. I just haven't been around for a week. I have an entire toolbox tab full of controls with pretty icons. That tagPrefix is jumpy though it'll get lost and you'll have to mess with and force a full rebuild instead of the partial that is done default to fix it. And as best as I can tell you can only have one tagPrefix two even though the namespace is diffrent won't work.

Have you looked at designers yet. they are interesting to say the least.

Monday, March 26, 2012

This Image Generating thing...

Hey!

I wrote a message yersterday and got some good answers and have now managed
to generate a nice image. The problem is that it's all generated in an
Images.Aspx file and I don't really want that. I am writing a WebControl
Library and I want to generate everything from there...

In the Render Sub of the Control I output some HTML and there I need to
reference to a file in the <img> element, is there anyway to NOT have to
point to a aspx file (that generated the picture) there and instead point to
a more local way that I can include in my WebControl Library?

I guess it's possible to render the image as a file and put on the
serverdisk and then point to it but that would be a security risk I guess
and can't really asume, that people that would use this control, like to set
permissions on the server to make it work.

How do I do this?

best regards/
Lars NetzelIf I am correct, you want to create a WebControl that creates an image AND
includes the <img=>... tags when rendered, correct?

You COULD put the binary image inline, but I would not recomend that.

From a browser's point of view an img tag creates another request to the
server to grab the image. So you would need 2 controls/pages:
1) The image creation page, which it looks like you aready have
(images.aspx)
2) The web control which renders the <img> tag.

The webcontrol will render something like "<img
src="/images.aspx?parameters" height=x width=x/>"
When the browser then gets this HTML, it will call up /images.aspx to grab
the actual image.

That's the most straight forward way of doing it that I can think of off
hand.

Steve

"Lars Netzel" <troligt@.apa.se> wrote in message
news:uNUt7i78EHA.2112@.TK2MSFTNGP14.phx.gbl...
> Hey!
> I wrote a message yersterday and got some good answers and have now
managed
> to generate a nice image. The problem is that it's all generated in an
> Images.Aspx file and I don't really want that. I am writing a WebControl
> Library and I want to generate everything from there...
> In the Render Sub of the Control I output some HTML and there I need to
> reference to a file in the <img> element, is there anyway to NOT have to
> point to a aspx file (that generated the picture) there and instead point
to
> a more local way that I can include in my WebControl Library?
> I guess it's possible to render the image as a file and put on the
> serverdisk and then point to it but that would be a security risk I guess
> and can't really asume, that people that would use this control, like to
set
> permissions on the server to make it work.
> How do I do this?
> best regards/
> Lars Netzel
Okay! Thanx, I was afraid of that that was the only way. The thign is I've
seen really cool Chart Controls for the web that renders 3d illustrations
using GDI+ and since they cost a lot I asume they have protected the code
for the image rendering and if it is like you say.. that you can only render
the image from an aspx file.. the code is pretty much open to all... and
also a bit harder to distribute, the user will need to add the aspx file to
his projects.. I wanted to see if it's possible to make a ONE dll solution
for the solution that would incluse all the pictures and just work.

What's your thoughts on this?

/Lars

"Steve Lutz" <slutz@.nospam.comcast.net> skrev i meddelandet
news:uq6Spt%238EHA.1204@.TK2MSFTNGP10.phx.gbl...
> If I am correct, you want to create a WebControl that creates an image AND
> includes the <img=>... tags when rendered, correct?
> You COULD put the binary image inline, but I would not recomend that.
> From a browser's point of view an img tag creates another request to the
> server to grab the image. So you would need 2 controls/pages:
> 1) The image creation page, which it looks like you aready have
> (images.aspx)
> 2) The web control which renders the <img> tag.
> The webcontrol will render something like "<img
> src="http://pics.10026.com/?src=/images.aspx?parameters" height=x width=x/>"
> When the browser then gets this HTML, it will call up /images.aspx to grab
> the actual image.
> That's the most straight forward way of doing it that I can think of off
> hand.
> Steve
>
> "Lars Netzel" <troligt@.apa.se> wrote in message
> news:uNUt7i78EHA.2112@.TK2MSFTNGP14.phx.gbl...
>> Hey!
>>
>> I wrote a message yersterday and got some good answers and have now
> managed
>> to generate a nice image. The problem is that it's all generated in an
>> Images.Aspx file and I don't really want that. I am writing a WebControl
>> Library and I want to generate everything from there...
>>
>> In the Render Sub of the Control I output some HTML and there I need to
>> reference to a file in the <img> element, is there anyway to NOT have to
>> point to a aspx file (that generated the picture) there and instead point
> to
>> a more local way that I can include in my WebControl Library?
>>
>> I guess it's possible to render the image as a file and put on the
>> serverdisk and then point to it but that would be a security risk I guess
>> and can't really asume, that people that would use this control, like to
> set
>> permissions on the server to make it work.
>>
>> How do I do this?
>>
>> best regards/
>> Lars Netzel
>>
>>
Hi Lars,

First, if your ASP.Net code is pretty much open to all, you have a SERIOUS
security hole on your web server!

Second, you must understand that in a web page, an image is requested via a
URL. Now, you could always write a custom HTTP handler that handles the
image request, but you will still have to have a URL that the HTTP handler
can respond to. It is actually much simpler (and just as secure) to do it
the easy way, and write an ASPX page that serves up the image.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Lars Netzel" <troligt@.apa.se> wrote in message
news:O67b7c$8EHA.824@.TK2MSFTNGP11.phx.gbl...
> Okay! Thanx, I was afraid of that that was the only way. The thign is I've
> seen really cool Chart Controls for the web that renders 3d illustrations
> using GDI+ and since they cost a lot I asume they have protected the code
> for the image rendering and if it is like you say.. that you can only
> render the image from an aspx file.. the code is pretty much open to
> all... and also a bit harder to distribute, the user will need to add the
> aspx file to his projects.. I wanted to see if it's possible to make a ONE
> dll solution for the solution that would incluse all the pictures and just
> work.
> What's your thoughts on this?
> /Lars
>
> "Steve Lutz" <slutz@.nospam.comcast.net> skrev i meddelandet
> news:uq6Spt%238EHA.1204@.TK2MSFTNGP10.phx.gbl...
>> If I am correct, you want to create a WebControl that creates an image
>> AND
>> includes the <img=>... tags when rendered, correct?
>>
>> You COULD put the binary image inline, but I would not recomend that.
>>
>> From a browser's point of view an img tag creates another request to the
>> server to grab the image. So you would need 2 controls/pages:
>> 1) The image creation page, which it looks like you aready have
>> (images.aspx)
>> 2) The web control which renders the <img> tag.
>>
>> The webcontrol will render something like "<img
>> src="http://pics.10026.com/?src=/images.aspx?parameters" height=x width=x/>"
>> When the browser then gets this HTML, it will call up /images.aspx to
>> grab
>> the actual image.
>>
>> That's the most straight forward way of doing it that I can think of off
>> hand.
>>
>> Steve
>>
>>
>>
>> "Lars Netzel" <troligt@.apa.se> wrote in message
>> news:uNUt7i78EHA.2112@.TK2MSFTNGP14.phx.gbl...
>>> Hey!
>>>
>>> I wrote a message yersterday and got some good answers and have now
>> managed
>>> to generate a nice image. The problem is that it's all generated in an
>>> Images.Aspx file and I don't really want that. I am writing a WebControl
>>> Library and I want to generate everything from there...
>>>
>>> In the Render Sub of the Control I output some HTML and there I need to
>>> reference to a file in the <img> element, is there anyway to NOT have to
>>> point to a aspx file (that generated the picture) there and instead
>>> point
>> to
>>> a more local way that I can include in my WebControl Library?
>>>
>>> I guess it's possible to render the image as a file and put on the
>>> serverdisk and then point to it but that would be a security risk I
>>> guess
>>> and can't really asume, that people that would use this control, like to
>> set
>>> permissions on the server to make it work.
>>>
>>> How do I do this?
>>>
>>> best regards/
>>> Lars Netzel
>>>
>>>
>>
>>
So how does the big guys do this then, check this demosite out... It's a
picture that I guess has do be dynamically rendered... and there's no aspx
reference in the SRC of IMG element

http://demo.xceedsoft.com/XceedChartExplorer/

/Lars Netzel

"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> skrev i meddelandet
news:OBZXio$8EHA.2568@.TK2MSFTNGP10.phx.gbl...
> Hi Lars,
> First, if your ASP.Net code is pretty much open to all, you have a SERIOUS
> security hole on your web server!
> Second, you must understand that in a web page, an image is requested via
> a URL. Now, you could always write a custom HTTP handler that handles the
> image request, but you will still have to have a URL that the HTTP handler
> can respond to. It is actually much simpler (and just as secure) to do it
> the easy way, and write an ASPX page that serves up the image.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> Neither a follower nor a lender be.
> "Lars Netzel" <troligt@.apa.se> wrote in message
> news:O67b7c$8EHA.824@.TK2MSFTNGP11.phx.gbl...
>> Okay! Thanx, I was afraid of that that was the only way. The thign is
>> I've seen really cool Chart Controls for the web that renders 3d
>> illustrations using GDI+ and since they cost a lot I asume they have
>> protected the code for the image rendering and if it is like you say..
>> that you can only render the image from an aspx file.. the code is pretty
>> much open to all... and also a bit harder to distribute, the user will
>> need to add the aspx file to his projects.. I wanted to see if it's
>> possible to make a ONE dll solution for the solution that would incluse
>> all the pictures and just work.
>>
>> What's your thoughts on this?
>>
>> /Lars
>>
>>
>>
>> "Steve Lutz" <slutz@.nospam.comcast.net> skrev i meddelandet
>> news:uq6Spt%238EHA.1204@.TK2MSFTNGP10.phx.gbl...
>>> If I am correct, you want to create a WebControl that creates an image
>>> AND
>>> includes the <img=>... tags when rendered, correct?
>>>
>>> You COULD put the binary image inline, but I would not recomend that.
>>>
>>> From a browser's point of view an img tag creates another request to the
>>> server to grab the image. So you would need 2 controls/pages:
>>> 1) The image creation page, which it looks like you aready have
>>> (images.aspx)
>>> 2) The web control which renders the <img> tag.
>>>
>>> The webcontrol will render something like "<img
>>> src="http://pics.10026.com/?src=/images.aspx?parameters" height=x width=x/>"
>>> When the browser then gets this HTML, it will call up /images.aspx to
>>> grab
>>> the actual image.
>>>
>>> That's the most straight forward way of doing it that I can think of off
>>> hand.
>>>
>>> Steve
>>>
>>>
>>>
>>> "Lars Netzel" <troligt@.apa.se> wrote in message
>>> news:uNUt7i78EHA.2112@.TK2MSFTNGP14.phx.gbl...
>>>> Hey!
>>>>
>>>> I wrote a message yersterday and got some good answers and have now
>>> managed
>>>> to generate a nice image. The problem is that it's all generated in an
>>>> Images.Aspx file and I don't really want that. I am writing a
>>>> WebControl
>>>> Library and I want to generate everything from there...
>>>>
>>>> In the Render Sub of the Control I output some HTML and there I need to
>>>> reference to a file in the <img> element, is there anyway to NOT have
>>>> to
>>>> point to a aspx file (that generated the picture) there and instead
>>>> point
>>> to
>>>> a more local way that I can include in my WebControl Library?
>>>>
>>>> I guess it's possible to render the image as a file and put on the
>>>> serverdisk and then point to it but that would be a security risk I
>>>> guess
>>>> and can't really asume, that people that would use this control, like
>>>> to
>>> set
>>>> permissions on the server to make it work.
>>>>
>>>> How do I do this?
>>>>
>>>> best regards/
>>>> Lars Netzel
>>>>
>>>>
>>>
>>>
>>
>>
they are mapping the requested images to an image generating service on the
server ( ie. rewriting xxx.png as ImageGen.aspx?xxx )

"Lars Netzel" <troligt@.apa.se> wrote in message
news:%23X4ee$B9EHA.3820@.TK2MSFTNGP11.phx.gbl...
> So how does the big guys do this then, check this demosite out... It's a
> picture that I guess has do be dynamically rendered... and there's no aspx
> reference in the SRC of IMG element
> http://demo.xceedsoft.com/XceedChartExplorer/
>
> /Lars Netzel
>
> "Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> skrev i meddelandet
> news:OBZXio$8EHA.2568@.TK2MSFTNGP10.phx.gbl...
> > Hi Lars,
> > First, if your ASP.Net code is pretty much open to all, you have a
SERIOUS
> > security hole on your web server!
> > Second, you must understand that in a web page, an image is requested
via
> > a URL. Now, you could always write a custom HTTP handler that handles
the
> > image request, but you will still have to have a URL that the HTTP
handler
> > can respond to. It is actually much simpler (and just as secure) to do
it
> > the easy way, and write an ASPX page that serves up the image.
> > --
> > HTH,
> > Kevin Spencer
> > Microsoft MVP
> > .Net Developer
> > Neither a follower nor a lender be.
> > "Lars Netzel" <troligt@.apa.se> wrote in message
> > news:O67b7c$8EHA.824@.TK2MSFTNGP11.phx.gbl...
> >> Okay! Thanx, I was afraid of that that was the only way. The thign is
> >> I've seen really cool Chart Controls for the web that renders 3d
> >> illustrations using GDI+ and since they cost a lot I asume they have
> >> protected the code for the image rendering and if it is like you say..
> >> that you can only render the image from an aspx file.. the code is
pretty
> >> much open to all... and also a bit harder to distribute, the user will
> >> need to add the aspx file to his projects.. I wanted to see if it's
> >> possible to make a ONE dll solution for the solution that would incluse
> >> all the pictures and just work.
> >>
> >> What's your thoughts on this?
> >>
> >> /Lars
> >>
> >>
> >>
> >> "Steve Lutz" <slutz@.nospam.comcast.net> skrev i meddelandet
> >> news:uq6Spt%238EHA.1204@.TK2MSFTNGP10.phx.gbl...
> >>> If I am correct, you want to create a WebControl that creates an image
> >>> AND
> >>> includes the <img=>... tags when rendered, correct?
> >>>
> >>> You COULD put the binary image inline, but I would not recomend that.
> >>>
> >>> From a browser's point of view an img tag creates another request to
the
> >>> server to grab the image. So you would need 2 controls/pages:
> >>> 1) The image creation page, which it looks like you aready have
> >>> (images.aspx)
> >>> 2) The web control which renders the <img> tag.
> >>>
> >>> The webcontrol will render something like "<img
> >>> src="http://pics.10026.com/?src=/images.aspx?parameters" height=x width=x/>"
> >>> When the browser then gets this HTML, it will call up /images.aspx to
> >>> grab
> >>> the actual image.
> >>>
> >>> That's the most straight forward way of doing it that I can think of
off
> >>> hand.
> >>>
> >>> Steve
> >>>
> >>>
> >>>
> >>> "Lars Netzel" <troligt@.apa.se> wrote in message
> >>> news:uNUt7i78EHA.2112@.TK2MSFTNGP14.phx.gbl...
> >>>> Hey!
> >>>>
> >>>> I wrote a message yersterday and got some good answers and have now
> >>> managed
> >>>> to generate a nice image. The problem is that it's all generated in
an
> >>>> Images.Aspx file and I don't really want that. I am writing a
> >>>> WebControl
> >>>> Library and I want to generate everything from there...
> >>>>
> >>>> In the Render Sub of the Control I output some HTML and there I need
to
> >>>> reference to a file in the <img> element, is there anyway to NOT have
> >>>> to
> >>>> point to a aspx file (that generated the picture) there and instead
> >>>> point
> >>> to
> >>>> a more local way that I can include in my WebControl Library?
> >>>>
> >>>> I guess it's possible to render the image as a file and put on the
> >>>> serverdisk and then point to it but that would be a security risk I
> >>>> guess
> >>>> and can't really asume, that people that would use this control, like
> >>>> to
> >>> set
> >>>> permissions on the server to make it work.
> >>>>
> >>>> How do I do this?
> >>>>
> >>>> best regards/
> >>>> Lars Netzel
> >>>>
> >>>>
> >>>
> >>>
> >>
> >>
I've given you the basics. There are several ways to achieve this, one of
which I mentioned: a custom HTTP Handler. With a custom HTTP Handler, you
could use any file extension you like. However, as I said, that isn't
necessary in your case, and would probably be much more difficult for you to
implement, or you wouldn't have to ask.

If I was steering you wrong, believe me, somebody would have told you by
now! ;-)

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Lars Netzel" <troligt@.apa.se> wrote in message
news:%23X4ee$B9EHA.3820@.TK2MSFTNGP11.phx.gbl...
> So how does the big guys do this then, check this demosite out... It's a
> picture that I guess has do be dynamically rendered... and there's no aspx
> reference in the SRC of IMG element
> http://demo.xceedsoft.com/XceedChartExplorer/
>
> /Lars Netzel
>
> "Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> skrev i meddelandet
> news:OBZXio$8EHA.2568@.TK2MSFTNGP10.phx.gbl...
>> Hi Lars,
>>
>> First, if your ASP.Net code is pretty much open to all, you have a
>> SERIOUS security hole on your web server!
>>
>> Second, you must understand that in a web page, an image is requested via
>> a URL. Now, you could always write a custom HTTP handler that handles the
>> image request, but you will still have to have a URL that the HTTP
>> handler can respond to. It is actually much simpler (and just as secure)
>> to do it the easy way, and write an ASPX page that serves up the image.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> .Net Developer
>> Neither a follower nor a lender be.
>>
>> "Lars Netzel" <troligt@.apa.se> wrote in message
>> news:O67b7c$8EHA.824@.TK2MSFTNGP11.phx.gbl...
>>> Okay! Thanx, I was afraid of that that was the only way. The thign is
>>> I've seen really cool Chart Controls for the web that renders 3d
>>> illustrations using GDI+ and since they cost a lot I asume they have
>>> protected the code for the image rendering and if it is like you say..
>>> that you can only render the image from an aspx file.. the code is
>>> pretty much open to all... and also a bit harder to distribute, the user
>>> will need to add the aspx file to his projects.. I wanted to see if it's
>>> possible to make a ONE dll solution for the solution that would incluse
>>> all the pictures and just work.
>>>
>>> What's your thoughts on this?
>>>
>>> /Lars
>>>
>>>
>>>
>>> "Steve Lutz" <slutz@.nospam.comcast.net> skrev i meddelandet
>>> news:uq6Spt%238EHA.1204@.TK2MSFTNGP10.phx.gbl...
>>>> If I am correct, you want to create a WebControl that creates an image
>>>> AND
>>>> includes the <img=>... tags when rendered, correct?
>>>>
>>>> You COULD put the binary image inline, but I would not recomend that.
>>>>
>>>> From a browser's point of view an img tag creates another request to
>>>> the
>>>> server to grab the image. So you would need 2 controls/pages:
>>>> 1) The image creation page, which it looks like you aready have
>>>> (images.aspx)
>>>> 2) The web control which renders the <img> tag.
>>>>
>>>> The webcontrol will render something like "<img
>>>> src="http://pics.10026.com/?src=/images.aspx?parameters" height=x width=x/>"
>>>> When the browser then gets this HTML, it will call up /images.aspx to
>>>> grab
>>>> the actual image.
>>>>
>>>> That's the most straight forward way of doing it that I can think of
>>>> off
>>>> hand.
>>>>
>>>> Steve
>>>>
>>>>
>>>>
>>>> "Lars Netzel" <troligt@.apa.se> wrote in message
>>>> news:uNUt7i78EHA.2112@.TK2MSFTNGP14.phx.gbl...
>>>>> Hey!
>>>>>
>>>>> I wrote a message yersterday and got some good answers and have now
>>>> managed
>>>>> to generate a nice image. The problem is that it's all generated in an
>>>>> Images.Aspx file and I don't really want that. I am writing a
>>>>> WebControl
>>>>> Library and I want to generate everything from there...
>>>>>
>>>>> In the Render Sub of the Control I output some HTML and there I need
>>>>> to
>>>>> reference to a file in the <img> element, is there anyway to NOT have
>>>>> to
>>>>> point to a aspx file (that generated the picture) there and instead
>>>>> point
>>>> to
>>>>> a more local way that I can include in my WebControl Library?
>>>>>
>>>>> I guess it's possible to render the image as a file and put on the
>>>>> serverdisk and then point to it but that would be a security risk I
>>>>> guess
>>>>> and can't really asume, that people that would use this control, like
>>>>> to
>>>> set
>>>>> permissions on the server to make it work.
>>>>>
>>>>> How do I do this?
>>>>>
>>>>> best regards/
>>>>> Lars Netzel
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
I appriciate you answers and your time spent on this thread. I just wanted
to see if there were other options than using an aspx file as image source.

I guess we'll wait until asp.net 2.0 and see what the DynamicImage control
can achieve!

/Lars

"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> skrev i meddelandet
news:Ofx27kC9EHA.2608@.TK2MSFTNGP10.phx.gbl...
> I've given you the basics. There are several ways to achieve this, one of
> which I mentioned: a custom HTTP Handler. With a custom HTTP Handler, you
> could use any file extension you like. However, as I said, that isn't
> necessary in your case, and would probably be much more difficult for you
> to implement, or you wouldn't have to ask.
> If I was steering you wrong, believe me, somebody would have told you by
> now! ;-)
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> Neither a follower nor a lender be.
> "Lars Netzel" <troligt@.apa.se> wrote in message
> news:%23X4ee$B9EHA.3820@.TK2MSFTNGP11.phx.gbl...
>> So how does the big guys do this then, check this demosite out... It's a
>> picture that I guess has do be dynamically rendered... and there's no
>> aspx reference in the SRC of IMG element
>>
>> http://demo.xceedsoft.com/XceedChartExplorer/
>>
>>
>> /Lars Netzel
>>
>>
>> "Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> skrev i meddelandet
>> news:OBZXio$8EHA.2568@.TK2MSFTNGP10.phx.gbl...
>>> Hi Lars,
>>>
>>> First, if your ASP.Net code is pretty much open to all, you have a
>>> SERIOUS security hole on your web server!
>>>
>>> Second, you must understand that in a web page, an image is requested
>>> via a URL. Now, you could always write a custom HTTP handler that
>>> handles the image request, but you will still have to have a URL that
>>> the HTTP handler can respond to. It is actually much simpler (and just
>>> as secure) to do it the easy way, and write an ASPX page that serves up
>>> the image.
>>>
>>> --
>>> HTH,
>>>
>>> Kevin Spencer
>>> Microsoft MVP
>>> .Net Developer
>>> Neither a follower nor a lender be.
>>>
>>> "Lars Netzel" <troligt@.apa.se> wrote in message
>>> news:O67b7c$8EHA.824@.TK2MSFTNGP11.phx.gbl...
>>>> Okay! Thanx, I was afraid of that that was the only way. The thign is
>>>> I've seen really cool Chart Controls for the web that renders 3d
>>>> illustrations using GDI+ and since they cost a lot I asume they have
>>>> protected the code for the image rendering and if it is like you say..
>>>> that you can only render the image from an aspx file.. the code is
>>>> pretty much open to all... and also a bit harder to distribute, the
>>>> user will need to add the aspx file to his projects.. I wanted to see
>>>> if it's possible to make a ONE dll solution for the solution that would
>>>> incluse all the pictures and just work.
>>>>
>>>> What's your thoughts on this?
>>>>
>>>> /Lars
>>>>
>>>>
>>>>
>>>> "Steve Lutz" <slutz@.nospam.comcast.net> skrev i meddelandet
>>>> news:uq6Spt%238EHA.1204@.TK2MSFTNGP10.phx.gbl...
>>>>> If I am correct, you want to create a WebControl that creates an image
>>>>> AND
>>>>> includes the <img=>... tags when rendered, correct?
>>>>>
>>>>> You COULD put the binary image inline, but I would not recomend that.
>>>>>
>>>>> From a browser's point of view an img tag creates another request to
>>>>> the
>>>>> server to grab the image. So you would need 2 controls/pages:
>>>>> 1) The image creation page, which it looks like you aready have
>>>>> (images.aspx)
>>>>> 2) The web control which renders the <img> tag.
>>>>>
>>>>> The webcontrol will render something like "<img
>>>>> src="http://pics.10026.com/?src=/images.aspx?parameters" height=x width=x/>"
>>>>> When the browser then gets this HTML, it will call up /images.aspx to
>>>>> grab
>>>>> the actual image.
>>>>>
>>>>> That's the most straight forward way of doing it that I can think of
>>>>> off
>>>>> hand.
>>>>>
>>>>> Steve
>>>>>
>>>>>
>>>>>
>>>>> "Lars Netzel" <troligt@.apa.se> wrote in message
>>>>> news:uNUt7i78EHA.2112@.TK2MSFTNGP14.phx.gbl...
>>>>>> Hey!
>>>>>>
>>>>>> I wrote a message yersterday and got some good answers and have now
>>>>> managed
>>>>>> to generate a nice image. The problem is that it's all generated in
>>>>>> an
>>>>>> Images.Aspx file and I don't really want that. I am writing a
>>>>>> WebControl
>>>>>> Library and I want to generate everything from there...
>>>>>>
>>>>>> In the Render Sub of the Control I output some HTML and there I need
>>>>>> to
>>>>>> reference to a file in the <img> element, is there anyway to NOT have
>>>>>> to
>>>>>> point to a aspx file (that generated the picture) there and instead
>>>>>> point
>>>>> to
>>>>>> a more local way that I can include in my WebControl Library?
>>>>>>
>>>>>> I guess it's possible to render the image as a file and put on the
>>>>>> serverdisk and then point to it but that would be a security risk I
>>>>>> guess
>>>>>> and can't really asume, that people that would use this control, like
>>>>>> to
>>>>> set
>>>>>> permissions on the server to make it work.
>>>>>>
>>>>>> How do I do this?
>>>>>>
>>>>>> best regards/
>>>>>> Lars Netzel
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
okey, thanx, so they are also in need of an "online" service for the
picture, might not be a local "kick ass" solution that I thought.

/Lars

"gerry" <germ@.hotmail.com> skrev i meddelandet
news:e15WrOC9EHA.3336@.TK2MSFTNGP11.phx.gbl...
> they are mapping the requested images to an image generating service on
> the
> server ( ie. rewriting xxx.png as ImageGen.aspx?xxx )
>
> "Lars Netzel" <troligt@.apa.se> wrote in message
> news:%23X4ee$B9EHA.3820@.TK2MSFTNGP11.phx.gbl...
>> So how does the big guys do this then, check this demosite out... It's a
>> picture that I guess has do be dynamically rendered... and there's no
>> aspx
>> reference in the SRC of IMG element
>>
>> http://demo.xceedsoft.com/XceedChartExplorer/
>>
>>
>> /Lars Netzel
>>
>>
>> "Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> skrev i meddelandet
>> news:OBZXio$8EHA.2568@.TK2MSFTNGP10.phx.gbl...
>> > Hi Lars,
>>> > First, if your ASP.Net code is pretty much open to all, you have a
> SERIOUS
>> > security hole on your web server!
>>> > Second, you must understand that in a web page, an image is requested
> via
>> > a URL. Now, you could always write a custom HTTP handler that handles
> the
>> > image request, but you will still have to have a URL that the HTTP
> handler
>> > can respond to. It is actually much simpler (and just as secure) to do
> it
>> > the easy way, and write an ASPX page that serves up the image.
>>> > --
>> > HTH,
>>> > Kevin Spencer
>> > Microsoft MVP
>> > .Net Developer
>> > Neither a follower nor a lender be.
>>> > "Lars Netzel" <troligt@.apa.se> wrote in message
>> > news:O67b7c$8EHA.824@.TK2MSFTNGP11.phx.gbl...
>> >> Okay! Thanx, I was afraid of that that was the only way. The thign is
>> >> I've seen really cool Chart Controls for the web that renders 3d
>> >> illustrations using GDI+ and since they cost a lot I asume they have
>> >> protected the code for the image rendering and if it is like you say..
>> >> that you can only render the image from an aspx file.. the code is
> pretty
>> >> much open to all... and also a bit harder to distribute, the user will
>> >> need to add the aspx file to his projects.. I wanted to see if it's
>> >> possible to make a ONE dll solution for the solution that would
>> >> incluse
>> >> all the pictures and just work.
>> >>
>> >> What's your thoughts on this?
>> >>
>> >> /Lars
>> >>
>> >>
>> >>
>> >> "Steve Lutz" <slutz@.nospam.comcast.net> skrev i meddelandet
>> >> news:uq6Spt%238EHA.1204@.TK2MSFTNGP10.phx.gbl...
>> >>> If I am correct, you want to create a WebControl that creates an
>> >>> image
>> >>> AND
>> >>> includes the <img=>... tags when rendered, correct?
>> >>>
>> >>> You COULD put the binary image inline, but I would not recomend that.
>> >>>
>> >>> From a browser's point of view an img tag creates another request to
> the
>> >>> server to grab the image. So you would need 2 controls/pages:
>> >>> 1) The image creation page, which it looks like you aready have
>> >>> (images.aspx)
>> >>> 2) The web control which renders the <img> tag.
>> >>>
>> >>> The webcontrol will render something like "<img
>> >>> src="http://pics.10026.com/?src=/images.aspx?parameters" height=x width=x/>"
>> >>> When the browser then gets this HTML, it will call up /images.aspx to
>> >>> grab
>> >>> the actual image.
>> >>>
>> >>> That's the most straight forward way of doing it that I can think of
> off
>> >>> hand.
>> >>>
>> >>> Steve
>> >>>
>> >>>
>> >>>
>> >>> "Lars Netzel" <troligt@.apa.se> wrote in message
>> >>> news:uNUt7i78EHA.2112@.TK2MSFTNGP14.phx.gbl...
>> >>>> Hey!
>> >>>>
>> >>>> I wrote a message yersterday and got some good answers and have now
>> >>> managed
>> >>>> to generate a nice image. The problem is that it's all generated in
> an
>> >>>> Images.Aspx file and I don't really want that. I am writing a
>> >>>> WebControl
>> >>>> Library and I want to generate everything from there...
>> >>>>
>> >>>> In the Render Sub of the Control I output some HTML and there I need
> to
>> >>>> reference to a file in the <img> element, is there anyway to NOT
>> >>>> have
>> >>>> to
>> >>>> point to a aspx file (that generated the picture) there and instead
>> >>>> point
>> >>> to
>> >>>> a more local way that I can include in my WebControl Library?
>> >>>>
>> >>>> I guess it's possible to render the image as a file and put on the
>> >>>> serverdisk and then point to it but that would be a security risk I
>> >>>> guess
>> >>>> and can't really asume, that people that would use this control,
>> >>>> like
>> >>>> to
>> >>> set
>> >>>> permissions on the server to make it work.
>> >>>>
>> >>>> How do I do this?
>> >>>>
>> >>>> best regards/
>> >>>> Lars Netzel
>> >>>>
>> >>>>
>> >>>
>> >>>
>> >>
>> >>
>>>>
>>

This Image Generating thing...

Hey!
I wrote a message yersterday and got some good answers and have now managed
to generate a nice image. The problem is that it's all generated in an
Images.Aspx file and I don't really want that. I am writing a WebControl
Library and I want to generate everything from there...
In the Render Sub of the Control I output some HTML and there I need to
reference to a file in the <img> element, is there anyway to NOT have to
point to a aspx file (that generated the picture) there and instead point to
a more local way that I can include in my WebControl Library?
I guess it's possible to render the image as a file and put on the
serverdisk and then point to it but that would be a security risk I guess
and can't really asume, that people that would use this control, like to set
permissions on the server to make it work.
How do I do this?
best regards/
Lars NetzelIf I am correct, you want to create a WebControl that creates an image AND
includes the <img=>... tags when rendered, correct?
You COULD put the binary image inline, but I would not recomend that.
From a browser's point of view an img tag creates another request to the
server to grab the image. So you would need 2 controls/pages:
1) The image creation page, which it looks like you aready have
(images.aspx)
2) The web control which renders the <img> tag.
The webcontrol will render something like "<img
src="/images.aspx?parameters" height=x width=x/>"
When the browser then gets this HTML, it will call up /images.aspx to grab
the actual image.
That's the most straight forward way of doing it that I can think of off
hand.
Steve
"Lars Netzel" <troligt@.apa.se> wrote in message
news:uNUt7i78EHA.2112@.TK2MSFTNGP14.phx.gbl...
> Hey!
> I wrote a message yersterday and got some good answers and have now
managed
> to generate a nice image. The problem is that it's all generated in an
> Images.Aspx file and I don't really want that. I am writing a WebControl
> Library and I want to generate everything from there...
> In the Render Sub of the Control I output some HTML and there I need to
> reference to a file in the <img> element, is there anyway to NOT have to
> point to a aspx file (that generated the picture) there and instead point
to
> a more local way that I can include in my WebControl Library?
> I guess it's possible to render the image as a file and put on the
> serverdisk and then point to it but that would be a security risk I guess
> and can't really asume, that people that would use this control, like to
set
> permissions on the server to make it work.
> How do I do this?
> best regards/
> Lars Netzel
>
Okay! Thanx, I was afraid of that that was the only way. The thign is I've
seen really Chart Controls for the web that renders 3d illustrations
using GDI+ and since they cost a lot I asume they have protected the code
for the image rendering and if it is like you say.. that you can only render
the image from an aspx file.. the code is pretty much open to all... and
also a bit harder to distribute, the user will need to add the aspx file to
his projects.. I wanted to see if it's possible to make a ONE dll solution
for the solution that would incluse all the pictures and just work.
What's your thoughts on this?
/Lars
"Steve Lutz" <slutz@.nospam.comcast.net> skrev i meddelandet
news:uq6Spt%238EHA.1204@.TK2MSFTNGP10.phx.gbl...
> If I am correct, you want to create a WebControl that creates an image AND
> includes the <img=>... tags when rendered, correct?
> You COULD put the binary image inline, but I would not recomend that.
> From a browser's point of view an img tag creates another request to the
> server to grab the image. So you would need 2 controls/pages:
> 1) The image creation page, which it looks like you aready have
> (images.aspx)
> 2) The web control which renders the <img> tag.
> The webcontrol will render something like "<img
> src="http://pics.10026.com/?src=/images.aspx?parameters" height=x width=x/>"
> When the browser then gets this HTML, it will call up /images.aspx to grab
> the actual image.
> That's the most straight forward way of doing it that I can think of off
> hand.
> Steve
>
> "Lars Netzel" <troligt@.apa.se> wrote in message
> news:uNUt7i78EHA.2112@.TK2MSFTNGP14.phx.gbl...
> managed
> to
> set
>
Hi Lars,
First, if your ASP.Net code is pretty much open to all, you have a SERIOUS
security hole on your web server!
Second, you must understand that in a web page, an image is requested via a
URL. Now, you could always write a custom HTTP handler that handles the
image request, but you will still have to have a URL that the HTTP handler
can respond to. It is actually much simpler (and just as secure) to do it
the easy way, and write an ASPX page that serves up the image.
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.
"Lars Netzel" <troligt@.apa.se> wrote in message
news:O67b7c$8EHA.824@.TK2MSFTNGP11.phx.gbl...
> Okay! Thanx, I was afraid of that that was the only way. The thign is I've
> seen really Chart Controls for the web that renders 3d illustrations
> using GDI+ and since they cost a lot I asume they have protected the code
> for the image rendering and if it is like you say.. that you can only
> render the image from an aspx file.. the code is pretty much open to
> all... and also a bit harder to distribute, the user will need to add the
> aspx file to his projects.. I wanted to see if it's possible to make a ONE
> dll solution for the solution that would incluse all the pictures and just
> work.
> What's your thoughts on this?
> /Lars
>
> "Steve Lutz" <slutz@.nospam.comcast.net> skrev i meddelandet
> news:uq6Spt%238EHA.1204@.TK2MSFTNGP10.phx.gbl...
>
So how does the big guys do this then, check this demosite out... It's a
picture that I guess has do be dynamically rendered... and there's no aspx
reference in the SRC of IMG element
http://demo.xceedsoft.com/XceedChartExplorer/
/Lars Netzel
"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> skrev i meddelandet
news:OBZXio$8EHA.2568@.TK2MSFTNGP10.phx.gbl...
> Hi Lars,
> First, if your ASP.Net code is pretty much open to all, you have a SERIOUS
> security hole on your web server!
> Second, you must understand that in a web page, an image is requested via
> a URL. Now, you could always write a custom HTTP handler that handles the
> image request, but you will still have to have a URL that the HTTP handler
> can respond to. It is actually much simpler (and just as secure) to do it
> the easy way, and write an ASPX page that serves up the image.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> Neither a follower nor a lender be.
> "Lars Netzel" <troligt@.apa.se> wrote in message
> news:O67b7c$8EHA.824@.TK2MSFTNGP11.phx.gbl...
>
they are mapping the requested images to an image generating service on the
server ( ie. rewriting xxx.png as ImageGen.aspx?xxx )
"Lars Netzel" <troligt@.apa.se> wrote in message
news:%23X4ee$B9EHA.3820@.TK2MSFTNGP11.phx.gbl...
> So how does the big guys do this then, check this demosite out... It's a
> picture that I guess has do be dynamically rendered... and there's no aspx
> reference in the SRC of IMG element
> http://demo.xceedsoft.com/XceedChartExplorer/
>
> /Lars Netzel
>
> "Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> skrev i meddelandet
> news:OBZXio$8EHA.2568@.TK2MSFTNGP10.phx.gbl...
SERIOUS
via
the
handler
it
pretty
the
off
an
to
>
I've given you the basics. There are several ways to achieve this, one of
which I mentioned: a custom HTTP Handler. With a custom HTTP Handler, you
could use any file extension you like. However, as I said, that isn't
necessary in your case, and would probably be much more difficult for you to
implement, or you wouldn't have to ask.
If I was steering you wrong, believe me, somebody would have told you by
now! ;-)
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.
"Lars Netzel" <troligt@.apa.se> wrote in message
news:%23X4ee$B9EHA.3820@.TK2MSFTNGP11.phx.gbl...
> So how does the big guys do this then, check this demosite out... It's a
> picture that I guess has do be dynamically rendered... and there's no aspx
> reference in the SRC of IMG element
> http://demo.xceedsoft.com/XceedChartExplorer/
>
> /Lars Netzel
>
> "Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> skrev i meddelandet
> news:OBZXio$8EHA.2568@.TK2MSFTNGP10.phx.gbl...
>
I appriciate you answers and your time spent on this thread. I just wanted
to see if there were other options than using an aspx file as image source.
I guess we'll wait until asp.net 2.0 and see what the DynamicImage control
can achieve!
/Lars
"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> skrev i meddelandet
news:Ofx27kC9EHA.2608@.TK2MSFTNGP10.phx.gbl...
> I've given you the basics. There are several ways to achieve this, one of
> which I mentioned: a custom HTTP Handler. With a custom HTTP Handler, you
> could use any file extension you like. However, as I said, that isn't
> necessary in your case, and would probably be much more difficult for you
> to implement, or you wouldn't have to ask.
> If I was steering you wrong, believe me, somebody would have told you by
> now! ;-)
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> Neither a follower nor a lender be.
> "Lars Netzel" <troligt@.apa.se> wrote in message
> news:%23X4ee$B9EHA.3820@.TK2MSFTNGP11.phx.gbl...
>
okey, thanx, so they are also in need of an "online" service for the
picture, might not be a local "kick ass" solution that I thought.
/Lars
"gerry" <germ@.hotmail.com> skrev i meddelandet
news:e15WrOC9EHA.3336@.TK2MSFTNGP11.phx.gbl...
> they are mapping the requested images to an image generating service on
> the
> server ( ie. rewriting xxx.png as ImageGen.aspx?xxx )
>
> "Lars Netzel" <troligt@.apa.se> wrote in message
> news:%23X4ee$B9EHA.3820@.TK2MSFTNGP11.phx.gbl...
> SERIOUS
> via
> the
> handler
> it
> pretty
> the
> off
> an
> to
>

this is strange....

Hey

asp.net 2.0

My problem is that the image web server control (see below) won't display
the image if web.config have this setting:
<authorization>
<deny users="?" />
</authorization>

<asp:Image ID="logo" runat="server" ImageUrl="~/logo.png" />

Any ideas what I should do to solve this so the image is displayed if
web.config have
<authorization>
<deny users="?" />
</authorization>

Best Regards!

JeffThis web page uses a theme

and it looks like the page can't use the theme either if
<authorization>
<deny users="?" />
</authorization>

<pages theme="Standard" maintainScrollPositionOnPostBack="true"></pages>

any suggestions?

"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:OFg7n$w4GHA.1460@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

Hey
>
asp.net 2.0
>
My problem is that the image web server control (see below) won't display
the image if web.config have this setting:
<authorization>
<deny users="?" />
</authorization>
>
<asp:Image ID="logo" runat="server" ImageUrl="~/logo.png" />
>
Any ideas what I should do to solve this so the image is displayed if
web.config have
<authorization>
<deny users="?" />
</authorization>
>
>
Best Regards!
>
Jeff
>


"?" stands for anonymous users and "*" for all users. So,

<allow users="Jv"/>
<deny users="?"/>

will allow user "Jv" but deny all anonymous users. You can use to separate
multiple identiies.

<allow users="Jv, Kylin"/>
<deny users="?"/>

"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message news:OjhGjTx4GHA.4352@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

This web page uses a theme
>
and it looks like the page can't use the theme either if
<authorization>
<deny users="?" />
</authorization>
>
<pages theme="Standard" maintainScrollPositionOnPostBack="true"></pages>
>
any suggestions?
>
>
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message news:OFg7n$w4GHA.1460@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

>Hey
>>
>asp.net 2.0
>>
>My problem is that the image web server control (see below) won't display the image if web.config have this setting:
><authorization>
> <deny users="?" />
></authorization>
>>
><asp:Image ID="logo" runat="server" ImageUrl="~/logo.png" />
>>
>Any ideas what I should do to solve this so the image is displayed if web.config have
><authorization>
> <deny users="?" />
></authorization>
>>
>>
>Best Regards!
>>
>Jeff
>>


>
>


thanks!

"Jon Paal" <Jon[ nospam ]Paal @. everywhere dot comwrote in message
news:OIVEUIz4GHA.3512@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

"?" stands for anonymous users and "*" for all users. So,
>
<allow users="Jv"/>
<deny users="?"/>
>
will allow user "Jv" but deny all anonymous users. You can use to separate
multiple identiies.
>
<allow users="Jv, Kylin"/>
<deny users="?"/>
>
>
>
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:OjhGjTx4GHA.4352@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

>This web page uses a theme
>>
>and it looks like the page can't use the theme either if
><authorization>
> <deny users="?" />
></authorization>
>>
><pages theme="Standard" maintainScrollPositionOnPostBack="true"></pages>
>>
>any suggestions?
>>
>>
>"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
>news:OFg7n$w4GHA.1460@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

>>Hey
>>>
>>asp.net 2.0
>>>
>>My problem is that the image web server control (see below) won't
>>display the image if web.config have this setting:
>><authorization>
>> <deny users="?" />
>></authorization>
>>>
>><asp:Image ID="logo" runat="server" ImageUrl="~/logo.png" />
>>>
>>Any ideas what I should do to solve this so the image is displayed if
>>web.config have
>><authorization>
>> <deny users="?" />
>></authorization>
>>>
>>>
>>Best Regards!
>>>
>>Jeff
>>>


>>
>>


>
>

Tuesday, March 13, 2012

Thread was being aborted exception in user control

I have an .ascx user control for creating dynamic charts from a datatable, which uses an external .aspx page for rendering the chart as a .png image. The control is not functioning as expected (ie. the chart image is not being saved in the specified folder), with the containing page catching a "Thread was being aborted" exception. The containing page itself is rendered correctly, and there is no further use of Response.Redirect or Server.Transfer after the page is loaded. Could the exception arise from the statement within the code behind file of the control where the control's image source is set:
imgGDI.imageURL = "somepage.apsx"
or is the only source likely to be the previous Server.Transfer call to the containing page? I have read other threads regarding the 'Thread was being aborted' exception and Try...Catch blocks, but the solutions detailed do not seem to have any effect.
Any suggestions most welcome.The Thread being aborted exception is the natural generation of a Server.Transfer or Response.Redirect. However a Reponse.Redirect has an option to supress the exception. Response.Redirect("foo.aspx", false);
We're using Server.Transfer("foo.aspx", false). The problem seems to be intermittant at the moment though, which is why I thought the problem may be to do with the external .aspx pages being used for the image source.