Saturday, March 31, 2012
Set ASPNET Version for Virtual Directory from C# App
n
our Win 2003 server machines. Using the System.DirectoryServices
DirectoryEntry class I have had very little trouble remotely creating and
configuring virtual directories on our servers. My problem is that I have
not found a way to remotely configure the version of ASPNET that will be use
d
by the application running in the virtual directories I create. We have a
mix of Web applications that require either version 1.1 or 2.0. The only wa
y
that I have found to manipulate ASPNET setting, other than doing it manually
through IIS Manager, is with the ASPNET_regiis.exe tool, which must be run o
n
the machine that is serving the virtual directory. Is there any way to set
a
virtual directory's ASPNET version remotely?
Mikere:
!> The only way that I have found to manipulate ASP.NET setting, other than
doing it
!> manually through IIS Manager, is with the ASPNET_regiis.exe tool, which m
ust be
!> run on the machine that is serving the virtual directory.
Right...
re:
!> Is there any way to set a virtual directory's ASP.NET version remotely?
Not that I know of.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"mikes" <mikes@.discussions.microsoft.com> wrote in message news:8F4530DF-4CAA-4A93-A19E-53B
AECAF5432@.microsoft.com...
>I am writing a C# Windows Application that will create virtual directories
on
> our Win 2003 server machines. Using the System.DirectoryServices
> DirectoryEntry class I have had very little trouble remotely creating and
> configuring virtual directories on our servers. My problem is that I have
> not found a way to remotely configure the version of ASPNET that will be u
sed
> by the application running in the virtual directories I create. We have a
> mix of Web applications that require either version 1.1 or 2.0. The only
way
> that I have found to manipulate ASPNET setting, other than doing it manual
ly
> through IIS Manager, is with the ASPNET_regiis.exe tool, which must be run
on
> the machine that is serving the virtual directory. Is there any way to se
t a
> virtual directory's ASPNET version remotely?
> Mike
Set ASPNET Version for Virtual Directory from C# App
our Win 2003 server machines. Using the System.DirectoryServices
DirectoryEntry class I have had very little trouble remotely creating and
configuring virtual directories on our servers. My problem is that I have
not found a way to remotely configure the version of ASPNET that will be used
by the application running in the virtual directories I create. We have a
mix of Web applications that require either version 1.1 or 2.0. The only way
that I have found to manipulate ASPNET setting, other than doing it manually
through IIS Manager, is with the ASPNET_regiis.exe tool, which must be run on
the machine that is serving the virtual directory. Is there any way to set a
virtual directory's ASPNET version remotely?
Mikere:
!The only way that I have found to manipulate ASP.NET setting, other than doing it
!manually through IIS Manager, is with the ASPNET_regiis.exe tool, which must be
!run on the machine that is serving the virtual directory.
Right...
re:
!Is there any way to set a virtual directory's ASP.NET version remotely?
Not that I know of.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"mikes" <mikes@.discussions.microsoft.comwrote in message news:8F4530DF-4CAA-4A93-A19E-53BAECAF5432@.microsoft.com...
Quote:
Originally Posted by
>I am writing a C# Windows Application that will create virtual directories on
our Win 2003 server machines. Using the System.DirectoryServices
DirectoryEntry class I have had very little trouble remotely creating and
configuring virtual directories on our servers. My problem is that I have
not found a way to remotely configure the version of ASPNET that will be used
by the application running in the virtual directories I create. We have a
mix of Web applications that require either version 1.1 or 2.0. The only way
that I have found to manipulate ASPNET setting, other than doing it manually
through IIS Manager, is with the ASPNET_regiis.exe tool, which must be run on
the machine that is serving the virtual directory. Is there any way to set a
virtual directory's ASPNET version remotely?
>
Mike
Thursday, March 22, 2012
Set IHttpHandler for all files in a directory?
I have tried both:
<add verb="*" path="html-image\*.jpg" type="BitmapView"/>
and
<add verb="*" path="html-image\*" type="BitmapView"/>
But neither works. In both cases I just get file cannot be found and it
never calls my code.
If I set
<add verb="*" path="html-image.*" type="BitmapView"/>
That works - but it is not what I need.
Any ideas?
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htmIn IIS, there is a wildcard application map. Do that on your virtual
directory. Then, you should be a step closer to what you want...
David Thielen wrote:
Quote:
Originally Posted by
Hi;
>
I have tried both:
<add verb="*" path="html-image\*.jpg" type="BitmapView"/>
and
<add verb="*" path="html-image\*" type="BitmapView"/>
But neither works. In both cases I just get file cannot be found and it
never calls my code.
>
If I set
<add verb="*" path="html-image.*" type="BitmapView"/>
That works - but it is not what I need.
>
Any ideas?
>
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
>
Cubicle Wars - http://www.windwardreports.com/film.htm
Er... and if the file isn't real make sure you turn OFF file existence
verification in IIS for the mapping.
David Thielen wrote:
Quote:
Originally Posted by
Hi;
>
I have tried both:
<add verb="*" path="html-image\*.jpg" type="BitmapView"/>
and
<add verb="*" path="html-image\*" type="BitmapView"/>
But neither works. In both cases I just get file cannot be found and it
never calls my code.
>
If I set
<add verb="*" path="html-image.*" type="BitmapView"/>
That works - but it is not what I need.
>
Any ideas?
>
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
>
Cubicle Wars - http://www.windwardreports.com/film.htm
Hello Dave,
As for the httphandler configuration, as far as I knew, it supports limited
wildcard mapping format. So far based on my test, as long as you've
configured the IIS extension mapping to redirect the certain document
extension to ASP.NET isapi.dll, the following wildcard format httphandler
path is supported:
<add path="test.*" verb="*" type="PPTHandler, __code"/>
<add path="*.test" verb="*" type="PPTHandler, __code"/>
<add path="*asm.bsd" verb="*" type="PPTHandler, __code"></add>
<add path="asm*.bsd" verb="*" type="PPTHandler, __code"/>
As for the test path you provided, why did you put an "\" char in the path,
is it necessary for your application?
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
I have to return bitmaps that I have stored in a database. So my plan was
that the filenames woul be html-file\1234.jpg, html-file\1235.jpg, etc. The
html-file directory would say it's a bitmap in the database and then the file
name would be it's PK in the database.
Is there another way to do this? Because it looks like I can't use the
directory for the path. This is presently on the VS2005 integrated server but
it needs to work on IIS also.
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
"Steven Cheng[MSFT]" wrote:
Quote:
Originally Posted by
Hello Dave,
>
As for the httphandler configuration, as far as I knew, it supports limited
wildcard mapping format. So far based on my test, as long as you've
configured the IIS extension mapping to redirect the certain document
extension to ASP.NET isapi.dll, the following wildcard format httphandler
path is supported:
>
<add path="test.*" verb="*" type="PPTHandler, __code"/>
>
<add path="*.test" verb="*" type="PPTHandler, __code"/>
>
<add path="*asm.bsd" verb="*" type="PPTHandler, __code"></add>
>
<add path="asm*.bsd" verb="*" type="PPTHandler, __code"/>
>
As for the test path you provided, why did you put an "\" char in the path,
is it necessary for your application?
>
>
Sincerely,
>
Steven Cheng
>
Microsoft MSDN Online Support Lead
>
>
This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
Hi Dave,
I would suggest you avoid using any particular characters (like the
backward slash ) in your custom httphandler's request url, you can use some
normal separaor char such as "-" to separate different part in your custom
handler's url and then parse them in your httphandler's code. e.g.
http://servername/appname/databasename-filename1.rpt
Also, directory path is not allowed as content in url path directly. The
correct way is to use them as a querystring parameter. I'm afraid there is
no other means for this so far.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
ok - thanks
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
"Steven Cheng[MSFT]" wrote:
Quote:
Originally Posted by
Hi Dave,
>
I would suggest you avoid using any particular characters (like the
backward slash ) in your custom httphandler's request url, you can use some
normal separaor char such as "-" to separate different part in your custom
handler's url and then parse them in your httphandler's code. e.g.
>
http://servername/appname/databasename-filename1.rpt
>
Also, directory path is not allowed as content in url path directly. The
correct way is to use them as a querystring parameter. I'm afraid there is
no other means for this so far.
>
>
Sincerely,
>
Steven Cheng
>
Microsoft MSDN Online Support Lead
>
>
This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>
>
Set IHttpHandler for all files in a directory?
I have tried both:
<add verb="*" path="html-image\*.jpg" type="BitmapView"/>
and
<add verb="*" path="html-image\*" type="BitmapView"/>
But neither works. In both cases I just get file cannot be found and it
never calls my code.
If I set
<add verb="*" path="html-image.*" type="BitmapView"/>
That works - but it is not what I need.
Any ideas?
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htmIn IIS, there is a wildcard application map. Do that on your virtual
directory. Then, you should be a step closer to what you want...
David Thielen wrote:
> Hi;
> I have tried both:
> <add verb="*" path="html-image\*.jpg" type="BitmapView"/>
> and
> <add verb="*" path="html-image\*" type="BitmapView"/>
> But neither works. In both cases I just get file cannot be found and it
> never calls my code.
> If I set
> <add verb="*" path="html-image.*" type="BitmapView"/>
> That works - but it is not what I need.
> Any ideas?
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
> Cubicle Wars - http://www.windwardreports.com/film.htm
Er... and if the file isn't real make sure you turn OFF file existence
verification in IIS for the mapping.
David Thielen wrote:
> Hi;
> I have tried both:
> <add verb="*" path="html-image\*.jpg" type="BitmapView"/>
> and
> <add verb="*" path="html-image\*" type="BitmapView"/>
> But neither works. In both cases I just get file cannot be found and it
> never calls my code.
> If I set
> <add verb="*" path="html-image.*" type="BitmapView"/>
> That works - but it is not what I need.
> Any ideas?
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
> Cubicle Wars - http://www.windwardreports.com/film.htm
Hello Dave,
As for the httphandler configuration, as far as I knew, it supports limited
wildcard mapping format. So far based on my test, as long as you've
configured the IIS extension mapping to redirect the certain document
extension to ASP.NET isapi.dll, the following wildcard format httphandler
path is supported:
<add path="test.*" verb="*" type="PPTHandler, __code"/>
<add path="*.test" verb="*" type="PPTHandler, __code"/>
<add path="*asm.bsd" verb="*" type="PPTHandler, __code"></add>
<add path="asm*.bsd" verb="*" type="PPTHandler, __code"/>
As for the test path you provided, why did you put an "\" char in the path,
is it necessary for your application?
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
I have to return bitmaps that I have stored in a database. So my plan was
that the filenames woul be html-file\1234.jpg, html-file\1235.jpg, etc. The
html-file directory would say it's a bitmap in the database and then the fil
e
name would be it's PK in the database.
Is there another way to do this? Because it looks like I can't use the
directory for the path. This is presently on the VS2005 integrated server bu
t
it needs to work on IIS also.
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
"Steven Cheng[MSFT]" wrote:
> Hello Dave,
> As for the httphandler configuration, as far as I knew, it supports limite
d
> wildcard mapping format. So far based on my test, as long as you've
> configured the IIS extension mapping to redirect the certain document
> extension to ASP.NET isapi.dll, the following wildcard format httphandler
> path is supported:
> <add path="test.*" verb="*" type="PPTHandler, __code"/>
> <add path="*.test" verb="*" type="PPTHandler, __code"/>
> <add path="*asm.bsd" verb="*" type="PPTHandler, __code"></add>
> <add path="asm*.bsd" verb="*" type="PPTHandler, __code"/>
> As for the test path you provided, why did you put an "\" char in the path
,
> is it necessary for your application?
>
> Sincerely,
> Steven Cheng
> Microsoft MSDN Online Support Lead
>
> This posting is provided "AS IS" with no warranties, and confers no rights
.
>
Hi Dave,
I would suggest you avoid using any particular characters (like the
backward slash ) in your custom httphandler's request url, you can use some
normal separaor char such as "-" to separate different part in your custom
handler's url and then parse them in your httphandler's code. e.g.
http://servername/appname/databasename-filename1.rpt
Also, directory path is not allowed as content in url path directly. The
correct way is to use them as a querystring parameter. I'm afraid there is
no other means for this so far.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Lines: 40
Thread-Topic: Set IHttpHandler for all files in a directory?
thread-index: AcbrwiA3mpAIgerrRbaY5XH7yI7/5g==
X-WBNR-Posting-Host: 207.174.201.190
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
NNTP-Posting-Host: TK2MSFTNGXA01.phx.gbl 10.40.2.250
Xref: leafnode.mcse.ms microsoft.public.dotnet.framework.aspnet:23986
ok - thanks
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
"Steven Cheng[MSFT]" wrote:
> Hi Dave,
> I would suggest you avoid using any particular characters (like the
> backward slash ) in your custom httphandler's request url, you can use som
e
> normal separaor char such as "-" to separate different part in your custo
m
> handler's url and then parse them in your httphandler's code. e.g.
> http://servername/appname/databasename-filename1.rpt
> Also, directory path is not allowed as content in url path directly. The
> correct way is to use them as a querystring parameter. I'm afraid there i
s
> no other means for this so far.
>
> Sincerely,
> Steven Cheng
> Microsoft MSDN Online Support Lead
>
> This posting is provided "AS IS" with no warranties, and confers no rights
.
>
>
set image url programmatically for image control
I have a print page that uses an image control to display an image that is saved in a directory that is dynamically created upon a session start. I have the path readily available for the image control...but I am failing to get the image to display in the image control...
what is the syntax to properly set the url for an image control programmatically in the code behind?
the control is named printImage
thanks in advance
Eric
printImage.src=
printImage.ImageUrl = "your URL";
simple as that.
I am not getting the .src in intellisense for the control - is there a namespace/directive that I am missing?
ekeefauver:
I am not getting the .src in intellisense for the control - is there a namespace/directive that I am missing?
Nope, it's just, that property is called "ImageUrl" and not "src".
doesn't seem to work for me...do I somehow need to refresh the control after setting the URL to the image?
the path to the image is: C:\Documents and Settings\dekeefau\My Documents\Visual Studio 2005\WebSites\CMAT_FINAL\sessions\sd_ewwewtjwy23b5vnrmxm1mffz\print\theimage.bmp
which is stored in a string variable
No, there is no need to refresh the control. Perhaps the path you are using is not valid? Try using Server.MapPath() function with the relative path to the image in question.
Example:
Image is in the /Images subfolder of the application and its name is MyImage.gif
Then the code to display this image would be:
printImage.ImageUrl = Server.MapPath("~/Images/MyImage.gif");