Read file from webcontrol

S

STech

What is the recommended way for reading a file in a webcontrol.
I cannot use the code below because HttpContext is not available in design
time and so the user cannot preview the data at design time.

HttpContext hc = HttpContext.Current;
if (hc != null)
myDataset.ReadXml(hc.Request.MapPath(this.XmlFilePath));

Thanks.
 
K

Kevin Yu [MSFT]

Hi

We have reviewed this issue and are currently researching on it. We will
update you ASAP. Thanks for your patience!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
S

Steven Cheng[MSFT]

Hi Stech,

Welcome to ASP.NET newsgroup.
As for the accessing content file for custom web server control at
design-time, I think this is a hard problem. Yes, as you've mentioned the
HttpContext is unavailable at design-time. Based on my experience, there're
many developer guys choose to use the VS.NET IDE's design-time object model
(mainly used for IDE automation) to access design-time IDE objects( such as
Active Project, active document....). Also, we can get the current VS.NET
IDE's active project or active document's path through it. Here are some
former threads discussing on such topc:


http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/brow
se_thread/thread/ba5d8a9774972cd4/eede345d74317e1c?lnk=st&q=VS.NET+IDE+dte+p
roject+path&rnum=4&hl=en#eede345d74317e1c

http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet.buil
dingcontrols/browse_thread/thread/a4cfcb5715a664fa/b5fec3e8703b52cb?lnk=st&q
=VS.NET+IDE+dte+project+path&rnum=1&hl=en#b5fec3e8703b52cb

BTW, since design-time object model and interfaces are all IDE specific ,
so it is not compatiblle between multiple IDE versions (like VS.NET 2003
and VS.NET 2005). The above items are all targeting vs.net 2003

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



--------------------
| Thread-Topic: Read file from webcontrol
| thread-index: AcXhTxAnh+oo4QekS8aoRVuGfMFZXw==
| X-WBNR-Posting-Host: 128.194.92.153
| From: "=?Utf-8?B?U1RlY2g=?=" <[email protected]>
| Subject: Read file from webcontrol
| Date: Fri, 4 Nov 2005 06:50:13 -0800
| Lines: 9
| Message-ID: <[email protected]>
| 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.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:11676
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| What is the recommended way for reading a file in a webcontrol.
| I cannot use the code below because HttpContext is not available in
design
| time and so the user cannot preview the data at design time.
|
| HttpContext hc = HttpContext.Current;
| if (hc != null)
| myDataset.ReadXml(hc.Request.MapPath(this.XmlFilePath));
|
| Thanks.
|
 
S

Steven Cheng[MSFT]

Hi Stech,

How are you doing on this issue? Does the suggestion in my last reply helps
a little? If there're anything else we can help, please feel free to post
here. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| X-Tomcat-ID: 217568924
| References: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: (e-mail address removed) (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Sun, 06 Nov 2005 08:25:34 GMT
| Subject: RE: Read file from webcontrol
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| Lines: 71
| Path: TK2MSFTNGXA01.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:11717
| NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
|
| Hi Stech,
|
| Welcome to ASP.NET newsgroup.
| As for the accessing content file for custom web server control at
| design-time, I think this is a hard problem. Yes, as you've mentioned
the
| HttpContext is unavailable at design-time. Based on my experience,
there're
| many developer guys choose to use the VS.NET IDE's design-time object
model
| (mainly used for IDE automation) to access design-time IDE objects( such
as
| Active Project, active document....). Also, we can get the current VS.NET
| IDE's active project or active document's path through it. Here are some
| former threads discussing on such topc:
|
|
|
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/brow
|
se_thread/thread/ba5d8a9774972cd4/eede345d74317e1c?lnk=st&q=VS.NET+IDE+dte+p
| roject+path&rnum=4&hl=en#eede345d74317e1c
|
|
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet.buil
|
dingcontrols/browse_thread/thread/a4cfcb5715a664fa/b5fec3e8703b52cb?lnk=st&q
| =VS.NET+IDE+dte+project+path&rnum=1&hl=en#b5fec3e8703b52cb
|
| BTW, since design-time object model and interfaces are all IDE specific ,
| so it is not compatiblle between multiple IDE versions (like VS.NET 2003
| and VS.NET 2005). The above items are all targeting vs.net 2003
|
| Hope helps. Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure! www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
|
|
|
| --------------------
| | Thread-Topic: Read file from webcontrol
| | thread-index: AcXhTxAnh+oo4QekS8aoRVuGfMFZXw==
| | X-WBNR-Posting-Host: 128.194.92.153
| | From: "=?Utf-8?B?U1RlY2g=?=" <[email protected]>
| | Subject: Read file from webcontrol
| | Date: Fri, 4 Nov 2005 06:50:13 -0800
| | Lines: 9
| | Message-ID: <[email protected]>
| | 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.0
| | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| | Xref: TK2MSFTNGXA01.phx.gbl
| microsoft.public.dotnet.framework.aspnet.webcontrols:11676
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| |
| | What is the recommended way for reading a file in a webcontrol.
| | I cannot use the code below because HttpContext is not available in
| design
| | time and so the user cannot preview the data at design time.
| |
| | HttpContext hc = HttpContext.Current;
| | if (hc != null)
| | myDataset.ReadXml(hc.Request.MapPath(this.XmlFilePath));
| |
| | Thanks.
| |
|
|
 
S

STech

Thanks! Please close this incident.

Steven Cheng said:
Hi Stech,

How are you doing on this issue? Does the suggestion in my last reply helps
a little? If there're anything else we can help, please feel free to post
here. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| X-Tomcat-ID: 217568924
| References: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: (e-mail address removed) (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Sun, 06 Nov 2005 08:25:34 GMT
| Subject: RE: Read file from webcontrol
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| Lines: 71
| Path: TK2MSFTNGXA01.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:11717
| NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
|
| Hi Stech,
|
| Welcome to ASP.NET newsgroup.
| As for the accessing content file for custom web server control at
| design-time, I think this is a hard problem. Yes, as you've mentioned
the
| HttpContext is unavailable at design-time. Based on my experience,
there're
| many developer guys choose to use the VS.NET IDE's design-time object
model
| (mainly used for IDE automation) to access design-time IDE objects( such
as
| Active Project, active document....). Also, we can get the current VS.NET
| IDE's active project or active document's path through it. Here are some
| former threads discussing on such topc:
|
|
|
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/brow
|
se_thread/thread/ba5d8a9774972cd4/eede345d74317e1c?lnk=st&q=VS.NET+IDE+dte+p
| roject+path&rnum=4&hl=en#eede345d74317e1c
|
|
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet.buil
|
dingcontrols/browse_thread/thread/a4cfcb5715a664fa/b5fec3e8703b52cb?lnk=st&q
| =VS.NET+IDE+dte+project+path&rnum=1&hl=en#b5fec3e8703b52cb
|
| BTW, since design-time object model and interfaces are all IDE specific ,
| so it is not compatiblle between multiple IDE versions (like VS.NET 2003
| and VS.NET 2005). The above items are all targeting vs.net 2003
|
| Hope helps. Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure! www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
|
|
|
| --------------------
| | Thread-Topic: Read file from webcontrol
| | thread-index: AcXhTxAnh+oo4QekS8aoRVuGfMFZXw==
| | X-WBNR-Posting-Host: 128.194.92.153
| | From: "=?Utf-8?B?U1RlY2g=?=" <[email protected]>
| | Subject: Read file from webcontrol
| | Date: Fri, 4 Nov 2005 06:50:13 -0800
| | Lines: 9
| | Message-ID: <[email protected]>
| | 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.0
| | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| | Xref: TK2MSFTNGXA01.phx.gbl
| microsoft.public.dotnet.framework.aspnet.webcontrols:11676
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| |
| | What is the recommended way for reading a file in a webcontrol.
| | I cannot use the code below because HttpContext is not available in
| design
| | time and so the user cannot preview the data at design time.
| |
| | HttpContext hc = HttpContext.Current;
| | if (hc != null)
| | myDataset.ReadXml(hc.Request.MapPath(this.XmlFilePath));
| |
| | Thanks.
| |
|
|
 
S

Steven Cheng[MSFT]

You're welcome Stech.

Have a good day!

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: Read file from webcontrol
| thread-index: AcXmFN1TkSrvKieVQ0aYFNsv1yZA4w==
| X-WBNR-Posting-Host: 128.194.92.153
| From: "=?Utf-8?B?U1RlY2g=?=" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
| Subject: RE: Read file from webcontrol
| Date: Thu, 10 Nov 2005 08:36:13 -0800
| Lines: 119
| Message-ID: <[email protected]>
| 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.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:31057
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| Thanks! Please close this incident.
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Stech,
| >
| > How are you doing on this issue? Does the suggestion in my last reply
helps
| > a little? If there're anything else we can help, please feel free to
post
| > here. Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| > --------------------
| > | X-Tomcat-ID: 217568924
| > | References: <[email protected]>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain
| > | Content-Transfer-Encoding: 7bit
| > | From: (e-mail address removed) (Steven Cheng[MSFT])
| > | Organization: Microsoft
| > | Date: Sun, 06 Nov 2005 08:25:34 GMT
| > | Subject: RE: Read file from webcontrol
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | Lines: 71
| > | Path: TK2MSFTNGXA01.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet.webcontrols:11717
| > | NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
| > |
| > | Hi Stech,
| > |
| > | Welcome to ASP.NET newsgroup.
| > | As for the accessing content file for custom web server control at
| > | design-time, I think this is a hard problem. Yes, as you've mentioned

| > the
| > | HttpContext is unavailable at design-time. Based on my experience,
| > there're
| > | many developer guys choose to use the VS.NET IDE's design-time object
| > model
| > | (mainly used for IDE automation) to access design-time IDE objects(
such
| > as
| > | Active Project, active document....). Also, we can get the current
VS.NET
| > | IDE's active project or active document's path through it. Here are
some
| > | former threads discussing on such topc:
| > |
| > |
| > |
| >
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/brow
| > |
| >
se_thread/thread/ba5d8a9774972cd4/eede345d74317e1c?lnk=st&q=VS.NET+IDE+dte+p
| > | roject+path&rnum=4&hl=en#eede345d74317e1c
| > |
| > |
| >
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet.buil
| > |
| >
dingcontrols/browse_thread/thread/a4cfcb5715a664fa/b5fec3e8703b52cb?lnk=st&q
| > | =VS.NET+IDE+dte+project+path&rnum=1&hl=en#b5fec3e8703b52cb
| > |
| > | BTW, since design-time object model and interfaces are all IDE
specific ,
| > | so it is not compatiblle between multiple IDE versions (like VS.NET
2003
| > | and VS.NET 2005). The above items are all targeting vs.net 2003
| > |
| > | Hope helps. Thanks,
| > |
| > | Steven Cheng
| > | Microsoft Online Support
| > |
| > | Get Secure! www.microsoft.com/security
| > | (This posting is provided "AS IS", with no warranties, and confers no
| > | rights.)
| > |
| > |
| > |
| > | --------------------
| > | | Thread-Topic: Read file from webcontrol
| > | | thread-index: AcXhTxAnh+oo4QekS8aoRVuGfMFZXw==
| > | | X-WBNR-Posting-Host: 128.194.92.153
| > | | From: "=?Utf-8?B?U1RlY2g=?=" <[email protected]>
| > | | Subject: Read file from webcontrol
| > | | Date: Fri, 4 Nov 2005 06:50:13 -0800
| > | | Lines: 9
| > | | Message-ID: <[email protected]>
| > | | 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.0
| > | | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | | Xref: TK2MSFTNGXA01.phx.gbl
| > | microsoft.public.dotnet.framework.aspnet.webcontrols:11676
| > | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | |
| > | | What is the recommended way for reading a file in a webcontrol.
| > | | I cannot use the code below because HttpContext is not available in
| > | design
| > | | time and so the user cannot preview the data at design time.
| > | |
| > | | HttpContext hc = HttpContext.Current;
| > | | if (hc != null)
| > | | myDataset.ReadXml(hc.Request.MapPath(this.XmlFilePath));
| > | |
| > | | Thanks.
| > | |
| > |
| > |
| >
| >
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,141
Messages
2,570,814
Members
47,359
Latest member
Claim Bitcoin Earnings. $

Latest Threads

Top