"Will" <ws*****@comcast.net> wrote in
news:0e****************************@phx.gbl:
I've included both the System.Drawing namespance and the
System.Web.UI.WebControls namespace on my page. Both of
these have an Image class, so when I call the Image class
(refering to the System.Drawing namespace) can I do it
without having to write the entire string?
System.Drawing.Image... I get errors saying Image is
ambiguous otherwise.
Will,
Both VB.Net and C# support namespace aliases. You can use this
mechanism to give different (usually shorter) names to a specified
namespace.
VB.Net:
Imports Draw = System.Drawing
Imports WebUI = System.Web.UI.WebControls
' Create a System.Drawing Image:
Dim MyDrawImage As Draw.Image = Draw.Image.FromFile('myfile.bmp')
' Create a System.Web.UI.WebControls Image:
Dim MyWebImage As New WebUI.Image()
C#:
using Draw = System.Drawing;
using WebUI = System.Web.UI.WebControls;
// Create a System.Drawing Image:
Draw.Image MyDrawImage = Draw.Image.FromFile("myfile.bmp");
// Create a System.Web.UI.WebControls Image:
WebUI.Image MyWebImage = new WebUI.Image();
Hope this helps.
Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/