Saturday, March 31, 2012
The ASPX name
Inside an .aspx code, what would be the reliable way to know what is the
..aspx page file name on IIS?
Thanks,
Ali> Inside an .aspx code, what would be the reliable way to know what is the
> .aspx page file name on IIS?
Request.ServerVariables["SCRIPT_NAME"] would return the base name. You can
combine it with Request.ServerVariables["SERVER_NAME"] and a "http://"
prefix to get the full url.
This is C#, you should replace brackets with parentheses for VB.
Here's another:
string myPath = Page.Request.Path;
string pageName = myPath.Substring(myPath.LastIndexOf('/') + 1);
Michael Earls
"A.M" <IHateSpam@dotnet.itags.org.sapm123.com> wrote in message
news:uhiYpoB5DHA.3848@dotnet.itags.org.TK2MSFTNGP11.phx.gbl...
> Hi,
> Inside an .aspx code, what would be the reliable way to know what is the
> .aspx page file name on IIS?
> Thanks,
> Ali
>> Inside an .aspx code, what would be the reliable way to know what is the
>> .aspx page file name on IIS?
> string myPath = Page.Request.Path;
> string pageName = myPath.Substring(myPath.LastIndexOf('/') + 1);
That would actually be the pretty way, I gave you the old and ugly way.
Martin.
The beginning.
I have a file 'WeatherPage.aspx' with the following code, basic stuff:
<%@dotnet.itags.org. Page language="VB" %>
<script runat="server"
Shared rand As Random = New Random()
Function GetForecast(zip As String) As String
Dim ret As String = String.Empty
Select rand.Next(5)
Case 0
ret = "Sunny and warm"
Case 1
ret = "Partly cloudy and chilly"
Case 2
ret = "Cold with a chance of snow"
Case 3
ret = "Rain"
Case 4
ret = "Foggy and damp"
End Select
Return ret
End Function
</script>
<html>
<body>
<h1>My weather forecast page</h1>
<p>The weather for zipcode 04090 is: <%= GetForecast("04090") %> </p>
<p>The weather for zipcode 90210 is: <%= GetForecast("90210") %> </p>
<p>The weather for zipcode 84101 is: <%= GetForecast("84101") %> </p>
<p>The weather for zipcode 80014 is: <%= GetForecast("80014") %> </p>
<p>The weather for zipcode 02101 is: <%= GetForecast("02101") %> </p>
</body>
</html
my operating system is Windows XP profesional. I use Internet Information
Services 5.1 (IIS).
When I run this page in a webbrowser, the function 'GetForecast' doesn't
display anything ( no error's). All I see is the HTML text. What can I be
doing wrong? I got this code from a tutorial.
Is the code incorrect? Can IIS have incorrect settings?
Thanks.The browser does give an error: Line 4, ";" is expected.
Isn't ";" used for "C#".
Page language is set to "VB".
"Qwert" <nosp@dotnet.itags.org.nosp.com> schreef in bericht
news:Cpidncmdb6Qw76TfRVnyvg@dotnet.itags.org.casema.nl...
> Ok,
> I have a file 'WeatherPage.aspx' with the following code, basic stuff:
> <%@dotnet.itags.org. Page language="VB" %>
> <script runat="server">
> Shared rand As Random = New Random()
> Function GetForecast(zip As String) As String
> Dim ret As String = String.Empty
> Select rand.Next(5)
> Case 0
> ret = "Sunny and warm"
> Case 1
> ret = "Partly cloudy and chilly"
> Case 2
> ret = "Cold with a chance of snow"
> Case 3
> ret = "Rain"
> Case 4
> ret = "Foggy and damp"
> End Select
> Return ret
> End Function
> </script>
> <html>
> <body>
> <h1>My weather forecast page</h1>
> <p>The weather for zipcode 04090 is: <%= GetForecast("04090") %> </p>
> <p>The weather for zipcode 90210 is: <%= GetForecast("90210") %> </p>
> <p>The weather for zipcode 84101 is: <%= GetForecast("84101") %> </p>
> <p>The weather for zipcode 80014 is: <%= GetForecast("80014") %> </p>
> <p>The weather for zipcode 02101 is: <%= GetForecast("02101") %> </p>
> </body>
> </html>
>
> my operating system is Windows XP profesional. I use Internet Information
> Services 5.1 (IIS).
> When I run this page in a webbrowser, the function 'GetForecast' doesn't
> display anything ( no error's). All I see is the HTML text. What can I be
> doing wrong? I got this code from a tutorial.
> Is the code incorrect? Can IIS have incorrect settings?
> Thanks.
You need to enclose your frunctions within
Sub
End Sub
statements.
If you want the code to execut automatically
when the page loads, use Sub Page_Load :
<script runat="server">
Sub Page_Load(Src as Object, e As System.EventArgs)
...rest of your code
End Sub
<//script
best,
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
Ven, y hablemos de ASP.NET...
======================
"Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
news:Cpidncmdb6Qw76TfRVnyvg@dotnet.itags.org.casema.nl...
> Ok,
> I have a file 'WeatherPage.aspx' with the following code, basic stuff:
> <%@dotnet.itags.org. Page language="VB" %>
> <script runat="server"
> Shared rand As Random = New Random()
> Function GetForecast(zip As String) As String
> Dim ret As String = String.Empty
> Select rand.Next(5)
> Case 0
> ret = "Sunny and warm"
> Case 1
> ret = "Partly cloudy and chilly"
> Case 2
> ret = "Cold with a chance of snow"
> Case 3
> ret = "Rain"
> Case 4
> ret = "Foggy and damp"
> End Select
> Return ret
> End Function
> </script>
> <html>
> <body>
> <h1>My weather forecast page</h1>
> <p>The weather for zipcode 04090 is: <%= GetForecast("04090") %> </p>
> <p>The weather for zipcode 90210 is: <%= GetForecast("90210") %> </p>
> <p>The weather for zipcode 84101 is: <%= GetForecast("84101") %> </p>
> <p>The weather for zipcode 80014 is: <%= GetForecast("80014") %> </p>
> <p>The weather for zipcode 02101 is: <%= GetForecast("02101") %> </p>
> </body>
> </html>
>
> my operating system is Windows XP profesional. I use Internet Information
> Services 5.1 (IIS).
> When I run this page in a webbrowser, the function 'GetForecast' doesn't
> display anything ( no error's). All I see is the HTML text. What can I be
> doing wrong? I got this code from a tutorial.
> Is the code incorrect? Can IIS have incorrect settings?
> Thanks.
You mean something like this, it does not work either:
<html
<script language="VB" runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Message.Text = "You last accessed this page at: " & DateTime.Now
End Sub
</script
<body>
<h3><font face="Verdana">Manipulating Server Controls</font></h3>
This sample demonstrates how to manipulate the <asp:label>
server control within
the Page_Load event to output the current time.
<p>
<hr>
<asp:label id="Message" font-size="24" font-bold="true"
runat=server/>
</body>
</html
I see the HTML in the browser, but not the Message.Text in the label
control.
"Juan T. Llibre" <nomailreplies@dotnet.itags.org.nowhere.com> schreef in bericht
news:ew9vH$uKFHA.1948@dotnet.itags.org.TK2MSFTNGP14.phx.gbl...
> You need to enclose your frunctions within
> Sub
> End Sub
> statements.
> If you want the code to execut automatically
> when the page loads, use Sub Page_Load :
> <script runat="server">
> Sub Page_Load(Src as Object, e As System.EventArgs)
> ...rest of your code
> End Sub
> <//script>
> best,
>
> Juan T. Llibre
> ASP.NET MVP
> http://asp.net.do/foros/
> Foros de ASP.NET en Espaol
> Ven, y hablemos de ASP.NET...
> ======================
> "Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
> news:Cpidncmdb6Qw76TfRVnyvg@dotnet.itags.org.casema.nl...
>> Ok,
>>
>> I have a file 'WeatherPage.aspx' with the following code, basic stuff:
>>
>> <%@dotnet.itags.org. Page language="VB" %>
>> <script runat="server">
>> Shared rand As Random = New Random()
>> Function GetForecast(zip As String) As String
>> Dim ret As String = String.Empty
>> Select rand.Next(5)
>> Case 0
>> ret = "Sunny and warm"
>> Case 1
>> ret = "Partly cloudy and chilly"
>> Case 2
>> ret = "Cold with a chance of snow"
>> Case 3
>> ret = "Rain"
>> Case 4
>> ret = "Foggy and damp"
>> End Select
>> Return ret
>> End Function
>>
>> </script>
>> <html>
>> <body>
>> <h1>My weather forecast page</h1>
>> <p>The weather for zipcode 04090 is: <%= GetForecast("04090") %> </p>
>> <p>The weather for zipcode 90210 is: <%= GetForecast("90210") %> </p>
>> <p>The weather for zipcode 84101 is: <%= GetForecast("84101") %> </p>
>> <p>The weather for zipcode 80014 is: <%= GetForecast("80014") %> </p>
>> <p>The weather for zipcode 02101 is: <%= GetForecast("02101") %> </p>
>> </body>
>> </html>
>>
>>
>> my operating system is Windows XP profesional. I use Internet Information
>> Services 5.1 (IIS).
>>
>> When I run this page in a webbrowser, the function 'GetForecast' doesn't
>> display anything ( no error's). All I see is the HTML text. What can I be
>> doing wrong? I got this code from a tutorial.
>> Is the code incorrect? Can IIS have incorrect settings?
>>
>> Thanks.
I just pasted your code into
http://asp.net.do/test/vbtest2.aspx
It works fine.
Are you using http://localhost/virtualdirectory/yourfile.aspx ?
Or http://localhost/yourfile.aspx ?
Or http://YourComputerName/virtualdirectory/yourfile.aspx ?
Or http://yourserver.com/directory/yourfile.aspx ?
If you are, and it still doesn't work, try re-registering ASP.NET
from the .NET framework's main directory :
aspnet_regiis -i
( You did install the .NET Framework, right ? )
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
Ven, y hablemos de ASP.NET...
======================
"Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
news:CpOdnY2NHqHpHKTfRVnyiw@dotnet.itags.org.casema.nl...
> You mean something like this, it does not work either:
> <html>
> <script language="VB" runat="server">
> Sub Page_Load(Sender As Object, E As EventArgs)
> Message.Text = "You last accessed this page at: " &
> DateTime.Now
> End Sub
> </script>
> <body>
> <h3><font face="Verdana">Manipulating Server Controls</font></h3>
> This sample demonstrates how to manipulate the <asp:label>
> server control within
> the Page_Load event to output the current time.
> <p>
> <hr>
> <asp:label id="Message" font-size="24" font-bold="true"
> runat=server/>
> </body>
> </html>
>
> I see the HTML in the browser, but not the Message.Text in the label
> control.
>
> "Juan T. Llibre" <nomailreplies@dotnet.itags.org.nowhere.com> schreef in bericht
> news:ew9vH$uKFHA.1948@dotnet.itags.org.TK2MSFTNGP14.phx.gbl...
>> You need to enclose your frunctions within
>>
>> Sub
>>
>> End Sub
>>
>> statements.
>>
>> If you want the code to execut automatically
>> when the page loads, use Sub Page_Load :
>>
>> <script runat="server">
>> Sub Page_Load(Src as Object, e As System.EventArgs)
>>
>> ...rest of your code
>>
>> End Sub
>> <//script>
>>
>> best,
>>
>>
>> Juan T. Llibre
>> ASP.NET MVP
>> http://asp.net.do/foros/
>> Foros de ASP.NET en Espaol
>> Ven, y hablemos de ASP.NET...
>> ======================
>>
>> "Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
>> news:Cpidncmdb6Qw76TfRVnyvg@dotnet.itags.org.casema.nl...
>>> Ok,
>>>
>>> I have a file 'WeatherPage.aspx' with the following code, basic stuff:
>>>
>>> <%@dotnet.itags.org. Page language="VB" %>
>>> <script runat="server">
>>
>>> Shared rand As Random = New Random()
>>> Function GetForecast(zip As String) As String
>>> Dim ret As String = String.Empty
>>> Select rand.Next(5)
>>> Case 0
>>> ret = "Sunny and warm"
>>> Case 1
>>> ret = "Partly cloudy and chilly"
>>> Case 2
>>> ret = "Cold with a chance of snow"
>>> Case 3
>>> ret = "Rain"
>>> Case 4
>>> ret = "Foggy and damp"
>>> End Select
>>> Return ret
>>> End Function
>>>
>>> </script>
>>> <html>
>>> <body>
>>> <h1>My weather forecast page</h1>
>>> <p>The weather for zipcode 04090 is: <%= GetForecast("04090") %> </p>
>>> <p>The weather for zipcode 90210 is: <%= GetForecast("90210") %> </p>
>>> <p>The weather for zipcode 84101 is: <%= GetForecast("84101") %> </p>
>>> <p>The weather for zipcode 80014 is: <%= GetForecast("80014") %> </p>
>>> <p>The weather for zipcode 02101 is: <%= GetForecast("02101") %> </p>
>>> </body>
>>> </html>
>>>
>>>
>>> my operating system is Windows XP profesional. I use Internet
>>> Information Services 5.1 (IIS).
>>>
>>> When I run this page in a webbrowser, the function 'GetForecast' doesn't
>>> display anything ( no error's). All I see is the HTML text. What can I
>>> be doing wrong? I got this code from a tutorial.
>>> Is the code incorrect? Can IIS have incorrect settings?
>>>
>>> Thanks.
>>
>>
> If you are, and it still doesn't work, try re-registering ASP.NET
> from the .NET framework's main directory :
> aspnet_regiis -i
It worked....but weird. Someone already installed .NET Framework. Doesn't
make sense ASP.NET needs a seperate installement...I wasn't there when it
was installed on my comp, maybe you can select an option during installation
that you don't want to install ASP.NET.
3 cheers for spain!
Thanks.
> ( You did install the .NET Framework, right ? )
> Juan T. Llibre
> ASP.NET MVP
> http://asp.net.do/foros/
> Foros de ASP.NET en Espaol
> Ven, y hablemos de ASP.NET...
> ======================
> "Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
> news:CpOdnY2NHqHpHKTfRVnyiw@dotnet.itags.org.casema.nl...
>> You mean something like this, it does not work either:
>>
>> <html>
>>
>> <script language="VB" runat="server">
>> Sub Page_Load(Sender As Object, E As EventArgs)
>> Message.Text = "You last accessed this page at: " &
>> DateTime.Now
>> End Sub
>> </script>
>>
>> <body>
>> <h3><font face="Verdana">Manipulating Server Controls</font></h3>
>> This sample demonstrates how to manipulate the <asp:label>
>> server control within
>> the Page_Load event to output the current time.
>> <p>
>> <hr>
>> <asp:label id="Message" font-size="24" font-bold="true"
>> runat=server/>
>> </body>
>> </html>
>>
>>
>> I see the HTML in the browser, but not the Message.Text in the label
>> control.
>>
>>
>> "Juan T. Llibre" <nomailreplies@dotnet.itags.org.nowhere.com> schreef in bericht
>> news:ew9vH$uKFHA.1948@dotnet.itags.org.TK2MSFTNGP14.phx.gbl...
>>> You need to enclose your frunctions within
>>>
>>> Sub
>>>
>>> End Sub
>>>
>>> statements.
>>>
>>> If you want the code to execut automatically
>>> when the page loads, use Sub Page_Load :
>>>
>>> <script runat="server">
>>> Sub Page_Load(Src as Object, e As System.EventArgs)
>>>
>>> ...rest of your code
>>>
>>> End Sub
>>> <//script>
>>>
>>> best,
>>>
>>>
>>> Juan T. Llibre
>>> ASP.NET MVP
>>> http://asp.net.do/foros/
>>> Foros de ASP.NET en Espaol
>>> Ven, y hablemos de ASP.NET...
>>> ======================
>>>
>>> "Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
>>> news:Cpidncmdb6Qw76TfRVnyvg@dotnet.itags.org.casema.nl...
>>>> Ok,
>>>>
>>>> I have a file 'WeatherPage.aspx' with the following code, basic stuff:
>>>>
>>>> <%@dotnet.itags.org. Page language="VB" %>
>>>> <script runat="server">
>>>
>>>> Shared rand As Random = New Random()
>>>> Function GetForecast(zip As String) As String
>>>> Dim ret As String = String.Empty
>>>> Select rand.Next(5)
>>>> Case 0
>>>> ret = "Sunny and warm"
>>>> Case 1
>>>> ret = "Partly cloudy and chilly"
>>>> Case 2
>>>> ret = "Cold with a chance of snow"
>>>> Case 3
>>>> ret = "Rain"
>>>> Case 4
>>>> ret = "Foggy and damp"
>>>> End Select
>>>> Return ret
>>>> End Function
>>>>
>>>> </script>
>>>> <html>
>>>> <body>
>>>> <h1>My weather forecast page</h1>
>>>> <p>The weather for zipcode 04090 is: <%= GetForecast("04090") %> </p>
>>>> <p>The weather for zipcode 90210 is: <%= GetForecast("90210") %> </p>
>>>> <p>The weather for zipcode 84101 is: <%= GetForecast("84101") %> </p>
>>>> <p>The weather for zipcode 80014 is: <%= GetForecast("80014") %> </p>
>>>> <p>The weather for zipcode 02101 is: <%= GetForecast("02101") %> </p>
>>>> </body>
>>>> </html>
>>>>
>>>>
>>>> my operating system is Windows XP profesional. I use Internet
>>>> Information Services 5.1 (IIS).
>>>>
>>>> When I run this page in a webbrowser, the function 'GetForecast'
>>>> doesn't display anything ( no error's). All I see is the HTML text.
>>>> What can I be doing wrong? I got this code from a tutorial.
>>>> Is the code incorrect? Can IIS have incorrect settings?
>>>>
>>>> Thanks.
>>>
>>>
>>
>>
re:
> Thanks.
You're very much welcome!
Glad it worked!
re:
> Someone already installed .NET Framework. Doesn't make sense ASP.NET needs
> a seperate installement.
Maybe someone uninstalled/reinstalled IIS ?
That would require re-registering ASP.NET with the new IIS.
re:
> 3 cheers for spain!
Make that the Dominican Republic... ;-)
Happy coding!
Don't let the bug(ger)s get you!
:-)
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
Ven, y hablemos de ASP.NET...
======================
"Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
news:-b6dnYlGzYMPDaTfRVnyiw@dotnet.itags.org.casema.nl...
>> If you are, and it still doesn't work, try re-registering ASP.NET
>> from the .NET framework's main directory :
>>
>> aspnet_regiis -i
> It worked....but weird. Someone already installed .NET Framework. Doesn't
> make sense ASP.NET needs a seperate installement...I wasn't there when it
> was installed on my comp, maybe you can select an option during
> installation that you don't want to install ASP.NET.
> 3 cheers for spain!
> Thanks.
>> ( You did install the .NET Framework, right ? )
>>
>> Juan T. Llibre
>> ASP.NET MVP
>> http://asp.net.do/foros/
>> Foros de ASP.NET en Espaol
>> Ven, y hablemos de ASP.NET...
>> ======================
>>
>> "Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
>> news:CpOdnY2NHqHpHKTfRVnyiw@dotnet.itags.org.casema.nl...
>>> You mean something like this, it does not work either:
>>>
>>> <html>
>>>
>>> <script language="VB" runat="server">
>>> Sub Page_Load(Sender As Object, E As EventArgs)
>>> Message.Text = "You last accessed this page at: " &
>>> DateTime.Now
>>> End Sub
>>> </script>
>>>
>>> <body>
>>> <h3><font face="Verdana">Manipulating Server Controls</font></h3>
>>> This sample demonstrates how to manipulate the <asp:label>
>>> server control within
>>> the Page_Load event to output the current time.
>>> <p>
>>> <hr>
>>> <asp:label id="Message" font-size="24" font-bold="true"
>>> runat=server/>
>>> </body>
>>> </html>
>>>
>>>
>>> I see the HTML in the browser, but not the Message.Text in the label
>>> control.
>>>
>>>
>>> "Juan T. Llibre" <nomailreplies@dotnet.itags.org.nowhere.com> schreef in bericht
>>> news:ew9vH$uKFHA.1948@dotnet.itags.org.TK2MSFTNGP14.phx.gbl...
>>>> You need to enclose your frunctions within
>>>>
>>>> Sub
>>>>
>>>> End Sub
>>>>
>>>> statements.
>>>>
>>>> If you want the code to execut automatically
>>>> when the page loads, use Sub Page_Load :
>>>>
>>>> <script runat="server">
>>>> Sub Page_Load(Src as Object, e As System.EventArgs)
>>>>
>>>> ...rest of your code
>>>>
>>>> End Sub
>>>> <//script>
>>>>
>>>> best,
>>>>
>>>>
>>>> Juan T. Llibre
>>>> ASP.NET MVP
>>>> http://asp.net.do/foros/
>>>> Foros de ASP.NET en Espaol
>>>> Ven, y hablemos de ASP.NET...
>>>> ======================
>>>>
>>>> "Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
>>>> news:Cpidncmdb6Qw76TfRVnyvg@dotnet.itags.org.casema.nl...
>>>>> Ok,
>>>>>
>>>>> I have a file 'WeatherPage.aspx' with the following code, basic stuff:
>>>>>
>>>>> <%@dotnet.itags.org. Page language="VB" %>
>>>>> <script runat="server">
>>>>
>>>>> Shared rand As Random = New Random()
>>>>> Function GetForecast(zip As String) As String
>>>>> Dim ret As String = String.Empty
>>>>> Select rand.Next(5)
>>>>> Case 0
>>>>> ret = "Sunny and warm"
>>>>> Case 1
>>>>> ret = "Partly cloudy and chilly"
>>>>> Case 2
>>>>> ret = "Cold with a chance of snow"
>>>>> Case 3
>>>>> ret = "Rain"
>>>>> Case 4
>>>>> ret = "Foggy and damp"
>>>>> End Select
>>>>> Return ret
>>>>> End Function
>>>>>
>>>>> </script>
>>>>> <html>
>>>>> <body>
>>>>> <h1>My weather forecast page</h1>
>>>>> <p>The weather for zipcode 04090 is: <%= GetForecast("04090") %> </p>
>>>>> <p>The weather for zipcode 90210 is: <%= GetForecast("90210") %> </p>
>>>>> <p>The weather for zipcode 84101 is: <%= GetForecast("84101") %> </p>
>>>>> <p>The weather for zipcode 80014 is: <%= GetForecast("80014") %> </p>
>>>>> <p>The weather for zipcode 02101 is: <%= GetForecast("02101") %> </p>
>>>>> </body>
>>>>> </html>
>>>>>
>>>>>
>>>>> my operating system is Windows XP profesional. I use Internet
>>>>> Information Services 5.1 (IIS).
>>>>>
>>>>> When I run this page in a webbrowser, the function 'GetForecast'
>>>>> doesn't display anything ( no error's). All I see is the HTML text.
>>>>> What can I be doing wrong? I got this code from a tutorial.
>>>>> Is the code incorrect? Can IIS have incorrect settings?
>>>>>
>>>>> Thanks.
>>>>
>>>>
>>>
>>>
>>
>>
The beginning.
I have a file 'WeatherPage.aspx' with the following code, basic stuff:
<%@dotnet.itags.org. Page language="VB" %>
<script runat="server">
Shared rand As Random = New Random()
Function GetForecast(zip As String) As String
Dim ret As String = String.Empty
Select rand.Next(5)
Case 0
ret = "Sunny and warm"
Case 1
ret = "Partly cloudy and chilly"
Case 2
ret = "Cold with a chance of snow"
Case 3
ret = "Rain"
Case 4
ret = "Foggy and damp"
End Select
Return ret
End Function
</script>
<html>
<body>
<h1>My weather forecast page</h1>
<p>The weather for zipcode 04090 is: <%= GetForecast("04090") %> </p>
<p>The weather for zipcode 90210 is: <%= GetForecast("90210") %> </p>
<p>The weather for zipcode 84101 is: <%= GetForecast("84101") %> </p>
<p>The weather for zipcode 80014 is: <%= GetForecast("80014") %> </p>
<p>The weather for zipcode 02101 is: <%= GetForecast("02101") %> </p>
</body>
</html>
my operating system is Windows XP profesional. I use Internet Information
Services 5.1 (IIS).
When I run this page in a webbrowser, the function 'GetForecast' doesn't
display anything ( no error's). All I see is the HTML text. What can I be
doing wrong? I got this code from a tutorial.
Is the code incorrect? Can IIS have incorrect settings?
Thanks.The browser does give an error: Line 4, ";" is expected.
Isn't ";" used for "C#".
Page language is set to "VB".
"Qwert" <nosp@dotnet.itags.org.nosp.com> schreef in bericht
news:Cpidncmdb6Qw76TfRVnyvg@dotnet.itags.org.casema.nl...
> Ok,
> I have a file 'WeatherPage.aspx' with the following code, basic stuff:
> <%@dotnet.itags.org. Page language="VB" %>
> <script runat="server">
> Shared rand As Random = New Random()
> Function GetForecast(zip As String) As String
> Dim ret As String = String.Empty
> Select rand.Next(5)
> Case 0
> ret = "Sunny and warm"
> Case 1
> ret = "Partly cloudy and chilly"
> Case 2
> ret = "Cold with a chance of snow"
> Case 3
> ret = "Rain"
> Case 4
> ret = "Foggy and damp"
> End Select
> Return ret
> End Function
> </script>
> <html>
> <body>
> <h1>My weather forecast page</h1>
> <p>The weather for zipcode 04090 is: <%= GetForecast("04090") %> </p>
> <p>The weather for zipcode 90210 is: <%= GetForecast("90210") %> </p>
> <p>The weather for zipcode 84101 is: <%= GetForecast("84101") %> </p>
> <p>The weather for zipcode 80014 is: <%= GetForecast("80014") %> </p>
> <p>The weather for zipcode 02101 is: <%= GetForecast("02101") %> </p>
> </body>
> </html>
>
> my operating system is Windows XP profesional. I use Internet Information
> Services 5.1 (IIS).
> When I run this page in a webbrowser, the function 'GetForecast' doesn't
> display anything ( no error's). All I see is the HTML text. What can I be
> doing wrong? I got this code from a tutorial.
> Is the code incorrect? Can IIS have incorrect settings?
> Thanks.
>
You need to enclose your frunctions within
Sub
End Sub
statements.
If you want the code to execut automatically
when the page loads, use Sub Page_Load :
<script runat="server">
Sub Page_Load(Src as Object, e As System.EventArgs)
...rest of your code
End Sub
<//script>
best,
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
Ven, y hablemos de ASP.NET...
======================
"Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
news:Cpidncmdb6Qw76TfRVnyvg@dotnet.itags.org.casema.nl...
> Ok,
> I have a file 'WeatherPage.aspx' with the following code, basic stuff:
> <%@dotnet.itags.org. Page language="VB" %>
> <script runat="server">
> Shared rand As Random = New Random()
> Function GetForecast(zip As String) As String
> Dim ret As String = String.Empty
> Select rand.Next(5)
> Case 0
> ret = "Sunny and warm"
> Case 1
> ret = "Partly cloudy and chilly"
> Case 2
> ret = "Cold with a chance of snow"
> Case 3
> ret = "Rain"
> Case 4
> ret = "Foggy and damp"
> End Select
> Return ret
> End Function
> </script>
> <html>
> <body>
> <h1>My weather forecast page</h1>
> <p>The weather for zipcode 04090 is: <%= GetForecast("04090") %> </p>
> <p>The weather for zipcode 90210 is: <%= GetForecast("90210") %> </p>
> <p>The weather for zipcode 84101 is: <%= GetForecast("84101") %> </p>
> <p>The weather for zipcode 80014 is: <%= GetForecast("80014") %> </p>
> <p>The weather for zipcode 02101 is: <%= GetForecast("02101") %> </p>
> </body>
> </html>
>
> my operating system is Windows XP profesional. I use Internet Information
> Services 5.1 (IIS).
> When I run this page in a webbrowser, the function 'GetForecast' doesn't
> display anything ( no error's). All I see is the HTML text. What can I be
> doing wrong? I got this code from a tutorial.
> Is the code incorrect? Can IIS have incorrect settings?
> Thanks.
You mean something like this, it does not work either:
<html>
<script language="VB" runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Message.Text = "You last accessed this page at: " & DateTime.Now
End Sub
</script>
<body>
<h3><font face="Verdana">Manipulating Server Controls</h3>
This sample demonstrates how to manipulate the <asp:label>
server control within
the Page_Load event to output the current time.
<p>
<hr>
<asp:label id="Message" font-size="24" font-bold="true"
runat=server/>
</body>
</html>
I see the HTML in the browser, but not the Message.Text in the label
control.
"Juan T. Llibre" <nomailreplies@dotnet.itags.org.nowhere.com> schreef in bericht
news:ew9vH$uKFHA.1948@dotnet.itags.org.TK2MSFTNGP14.phx.gbl...
> You need to enclose your frunctions within
> Sub
> End Sub
> statements.
> If you want the code to execut automatically
> when the page loads, use Sub Page_Load :
> <script runat="server">
> Sub Page_Load(Src as Object, e As System.EventArgs)
> ...rest of your code
> End Sub
> <//script>
> best,
>
> Juan T. Llibre
> ASP.NET MVP
> http://asp.net.do/foros/
> Foros de ASP.NET en Espaol
> Ven, y hablemos de ASP.NET...
> ======================
> "Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
> news:Cpidncmdb6Qw76TfRVnyvg@dotnet.itags.org.casema.nl...
>
>
I just pasted your code into
http://asp.net.do/test/vbtest2.aspx
It works fine.
Are you using http://localhost/virtualdirectory/yourfile.aspx ?
Or http://localhost/yourfile.aspx ?
Or http://YourComputerName/virtualdirectory/yourfile.aspx ?
Or http://yourserver.com/directory/yourfile.aspx ?
If you are, and it still doesn't work, try re-registering ASP.NET
from the .NET framework's main directory :
aspnet_regiis -i
( You did install the .NET Framework, right ? )
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
Ven, y hablemos de ASP.NET...
======================
"Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
news:CpOdnY2NHqHpHKTfRVnyiw@dotnet.itags.org.casema.nl...
> You mean something like this, it does not work either:
> <html>
> <script language="VB" runat="server">
> Sub Page_Load(Sender As Object, E As EventArgs)
> Message.Text = "You last accessed this page at: " &
> DateTime.Now
> End Sub
> </script>
> <body>
> <h3><font face="Verdana">Manipulating Server Controls</h3>
> This sample demonstrates how to manipulate the <asp:label>
> server control within
> the Page_Load event to output the current time.
> <p>
> <hr>
> <asp:label id="Message" font-size="24" font-bold="true"
> runat=server/>
> </body>
> </html>
>
> I see the HTML in the browser, but not the Message.Text in the label
> control.
>
> "Juan T. Llibre" <nomailreplies@dotnet.itags.org.nowhere.com> schreef in bericht
> news:ew9vH$uKFHA.1948@dotnet.itags.org.TK2MSFTNGP14.phx.gbl...
>
> If you are, and it still doesn't work, try re-registering ASP.NET
> from the .NET framework's main directory :
> aspnet_regiis -i
It worked....but weird. Someone already installed .NET Framework. Doesn't
make sense ASP.NET needs a seperate installement...I wasn't there when it
was installed on my comp, maybe you can select an option during installation
that you don't want to install ASP.NET.
3 cheers for spain!
Thanks.
> ( You did install the .NET Framework, right ? )
> Juan T. Llibre
> ASP.NET MVP
> http://asp.net.do/foros/
> Foros de ASP.NET en Espaol
> Ven, y hablemos de ASP.NET...
> ======================
> "Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
> news:CpOdnY2NHqHpHKTfRVnyiw@dotnet.itags.org.casema.nl...
>
re:
> Thanks.
You're very much welcome!
Glad it worked!
re:
> Someone already installed .NET Framework. Doesn't make sense ASP.NET needs
> a seperate installement.
Maybe someone uninstalled/reinstalled IIS ?
That would require re-registering ASP.NET with the new IIS.
re:
> 3 cheers for spain!
Make that the Dominican Republic... ;-)
Happy coding!
Don't let the bug(ger)s get you!
:-)
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
Ven, y hablemos de ASP.NET...
======================
"Qwert" <nosp@dotnet.itags.org.nosp.com> wrote in message
news:-b6dnYlGzYMPDaTfRVnyiw@dotnet.itags.org.casema.nl...
> It worked....but weird. Someone already installed .NET Framework. Doesn't
> make sense ASP.NET needs a seperate installement...I wasn't there when it
> was installed on my comp, maybe you can select an option during
> installation that you don't want to install ASP.NET.
> 3 cheers for spain!
> Thanks.
>
The best file format to import/export data into sql database through asp.net application
We are developing a SQL server based asp.net application. As part of
requirement we should allow users import/export some relational data through
web user interface. We are investigation which file format would be the most
efficient format to import export relational data.
So far we came up with two options: XML and Access MDB files and we prefer
MDB files.
Is there any better file format for import/export data?
Any help would be appreciated,
MaxThe format is not part of the requirements ? What is the exact purpose ?
IMO users are more used to spreadsheet files rather than to xml or even
Access files. Of course it depends if the overall goal is to import/export
data to automated systems or if this is to allows users to handle those
files by themselves in a familiar tool...
My personal default preference would be likely Excel files but your berst
bet is liekly to ask them what they intend to do with those files...
--
Patrice
"Max2006" <alanalan1@dotnet.itags.org.newsgroup.nospama crit dans le message de news:
OtaUPQpCIHA.464@dotnet.itags.org.TK2MSFTNGP02.phx.gbl...
Quote:
Originally Posted by
Hi,
>
We are developing a SQL server based asp.net application. As part of
requirement we should allow users import/export some relational data
through web user interface. We are investigation which file format would
be the most efficient format to import export relational data.
>
So far we came up with two options: XML and Access MDB files and we prefer
MDB files.
>
Is there any better file format for import/export data?
>
Any help would be appreciated,
Max
>
>
>
CSV is what I would pick.
"Max2006" <alanalan1@dotnet.itags.org.newsgroup.nospamwrote in message
news:OtaUPQpCIHA.464@dotnet.itags.org.TK2MSFTNGP02.phx.gbl...
Quote:
Originally Posted by
Hi,
>
We are developing a SQL server based asp.net application. As part of
requirement we should allow users import/export some relational data
through web user interface. We are investigation which file format would
be the most efficient format to import export relational data.
>
So far we came up with two options: XML and Access MDB files and we prefer
MDB files.
>
Is there any better file format for import/export data?
>
Any help would be appreciated,
Max
>
>
>
I see nothing wrong with MDB as asp.net has a data provider for it. You can
read it directly into SQL Server using dataset, I would think.
David
"Max2006" <alanalan1@dotnet.itags.org.newsgroup.nospamwrote in message
news:OtaUPQpCIHA.464@dotnet.itags.org.TK2MSFTNGP02.phx.gbl...
Quote:
Originally Posted by
Hi,
>
We are developing a SQL server based asp.net application. As part of
requirement we should allow users import/export some relational data
through web user interface. We are investigation which file format would
be the most efficient format to import export relational data.
>
So far we came up with two options: XML and Access MDB files and we prefer
MDB files.
>
Is there any better file format for import/export data?
>
Any help would be appreciated,
Max
>
>
>
CSV (Comma Separated Values) is generally considered to be the most
platform-agnostic file format.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com
"Max2006" wrote:
Quote:
Originally Posted by
Hi,
>
We are developing a SQL server based asp.net application. As part of
requirement we should allow users import/export some relational data through
web user interface. We are investigation which file format would be the most
efficient format to import export relational data.
>
So far we came up with two options: XML and Access MDB files and we prefer
MDB files.
>
Is there any better file format for import/export data?
>
Any help would be appreciated,
Max
>
>
>
>
The Best Software To Edit .ASP File
Microsoft Expressions Web is out of CTP and is now in Beta. It is very stable at this point. I've been suing it for several weeks now, and as a Dreamweaver guy (who gave up on DW when ASP.Net 2.0 came out), I am extremely impressed. It is so much like Dreamweaver, I'll be surprised if MS doesn't catch flak from Adobe...
I'm curious if you have had an corruption issues with projects you use with expressions. that would be my biggest worry. Also, what OS are you using?
I'm using XP Professional SP2. And no corruption issues at all.
Of course, keep in mind that EW doesn't touch the code-behind at all, only the design/source layer, so there's no way it can mess with your code. In fact, if you attempt to edit code with it, it launches and opens your code file in Visual Studio. It is really designed to work hand in hand with VS.
Since it's in Beta, I assume that most of the functionality is in place. The only part that appears kind of "unfinished" is some of the help files are sketchy, and some error messages still have generic placeholder text in them. Also, there is error/UE reporting running in the background, so I suspect it's a bit more sluggish than the release version will be.
So is itVisual Web Developer 2005 Express Edition ? or ?
Since you say you are just learning, VWD should work very well for you.
But how come i can't open a .ASP files to view in Design view?
Mostly because VWD works with ASP.NET files and the development server does not support Classic ASP.
Jeff
So what shoud i do to view the classic .ASP files in design view?
Choose a different editor. Or open them in IE.
Jeff
Can you tell me what editor i should use?
darenlow:
So what shoud i do to view theclassic .ASP files in design view?
These forums are for ASP.NET, not classic ASP. You should try your question at theASP Messageboard, Microsoft's ASP newgroup (microsoft.public.inetserver.asp.general), or another community which deals with ASP.
Wednesday, March 28, 2012
The best way to parse an html file?
I have a html file file that I want to parse with ASP.NET to retreive the
value of a custom tag. Let's say that the average html file is about 30 ko.
Once the html file is loaded and converted into a single string, I'm using
for now is two string.indexOf to find the begin and the end of the desired
tag and then a string.substring to extract the data. I'm not using regular
expressions since I know exactly what are the tags to find.
My function goes like this:
private string ParseHtml(string html)
{
html = html.Replace("\r\n","");
int begin = html.IndexOf("%%StartGetHtml%%");
int end = html.IndexOf("%%EndGetHtml%%",begin);
int begin2, end2;
string str = null;
if (begin > 0 && end > 0)
{
// Gets the beginning of the tag
begin2 = html.IndexOf("<",begin);
// Gets the end of the tag
end2 = html.IndexOf(">",end-3);
if (begin2 < end2 && end2 < end)
{
// Gets the tag
str = html.Substring(begin2,end-begin2);
}
}
return str;
}
Is this the fastest way or there could be a better way to do this?
Thanks
Stephane
Stephane wrote:
> I have a html file file that I want to parse with ASP.NET to retreive the
> value of a custom tag. Let's say that the average html file is about 30 ko
.
> Once the html file is loaded and converted into a single string, I'm using
> for now is two string.indexOf to find the begin and the end of the desired
> tag and then a string.substring to extract the data. I'm not using regular
> expressions since I know exactly what are the tags to find.
> My function goes like this:
> private string ParseHtml(string html)
> {
> html = html.Replace("\r\n","");
> int begin = html.IndexOf("%%StartGetHtml%%");
> int end = html.IndexOf("%%EndGetHtml%%",begin);
> int begin2, end2;
> string str = null;
> if (begin > 0 && end > 0)
> {
> // Gets the beginning of the tag
> begin2 = html.IndexOf("<",begin);
> // Gets the end of the tag
> end2 = html.IndexOf(">",end-3);
> if (begin2 < end2 && end2 < end)
> {
> // Gets the tag
> str = html.Substring(begin2,end-begin2);
> }
> }
> return str;
> }
> Is this the fastest way or there could be a better way to do this?
If those string processing attempts suffice for you then use them but in
general if you want to parse HTML you might want to check SGMLReader, see
http://www.gotdotnet.com/community/...uery=sgmlreader
Martin Honnen
http://JavaScript.FAQTs.com/
The best way to parse an html file?
I have a html file file that I want to parse with ASP.NET to retreive the
value of a custom tag. Let's say that the average html file is about 30 ko.
Once the html file is loaded and converted into a single string, I'm using
for now is two string.indexOf to find the begin and the end of the desired
tag and then a string.substring to extract the data. I'm not using regular
expressions since I know exactly what are the tags to find.
My function goes like this:
private string ParseHtml(string html)
{
html = html.Replace("\r\n","");
int begin = html.IndexOf("%%StartGetHtml%%");
int end = html.IndexOf("%%EndGetHtml%%",begin);
int begin2, end2;
string str = null;
if (begin > 0 && end > 0)
{
// Gets the beginning of the tag
begin2 = html.IndexOf("<",begin);
// Gets the end of the tag
end2 = html.IndexOf(">",end-3);
if (begin2 < end2 && end2 < end)
{
// Gets the tag
str = html.Substring(begin2,end-begin2);
}
}
return str;
}
Is this the fastest way or there could be a better way to do this?
Thanks
Stephane
Stephane wrote:
> I have a html file file that I want to parse with ASP.NET to retreive the
> value of a custom tag. Let's say that the average html file is about 30 ko.
> Once the html file is loaded and converted into a single string, I'm using
> for now is two string.indexOf to find the begin and the end of the desired
> tag and then a string.substring to extract the data. I'm not using regular
> expressions since I know exactly what are the tags to find.
> My function goes like this:
> private string ParseHtml(string html)
> {
> html = html.Replace("\r\n","");
> int begin = html.IndexOf("%%StartGetHtml%%");
> int end = html.IndexOf("%%EndGetHtml%%",begin);
> int begin2, end2;
> string str = null;
> if (begin > 0 && end > 0)
> {
> // Gets the beginning of the tag
> begin2 = html.IndexOf("<",begin);
> // Gets the end of the tag
> end2 = html.IndexOf(">",end-3);
> if (begin2 < end2 && end2 < end)
> {
> // Gets the tag
> str = html.Substring(begin2,end-begin2);
> }
> }
> return str;
> }
> Is this the fastest way or there could be a better way to do this?
If those string processing attempts suffice for you then use them but in
general if you want to parse HTML you might want to check SGMLReader, see
http://www.gotdotnet.com/community/...uery=sgmlreader
--
Martin Honnen
http://JavaScript.FAQTs.com/
the brower doesnt compile aspx
thanks in advance,
ling
my practice code is:
---------
<%@dotnet.itags.org. Page Language="C#" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="form.aspx" method="post" runat="server">
<asp:textbox id="Name" runat="server" />
<asp:dropdownlist ID="form" runat="server"
<asp:listitem Value="Category" Text="Category" runat="server"></asp:listitem>
<asp:listitem Value="psycchology" runat="server"></asp:listitem>
<asp:listitem Value="popular_comp" runat="server"></asp:listitem>
</asp:dropdownlist
<asp:button ID="Lookup" runat="server" /
</form>
</body>
</html>your browser doesn't compile the code. What are you writting your code in? WebMatrix, Visual Studio,...etc.
Hi,
I've experience the same situation with the following code.
<html>
<head>
</head>
<body>
<form runat=server>
<asp:Label text="Hello World" runat=server />
</form>
</body>
</html
I'm using notepad to write the .aspx file and I've save it to C:\Inetpub\wwwroot. Using the IE6.0 browser and type http://localhost/HelloWorld2.aspx, the resulting page is blank screen.
What seems to be the problem with this? Hope to hear from anybody & thanks.
-Jun
I used visual studio and dreamweaver MX for writing the code and saved it in wwwroot.
thanks in advance,
Make sure aspnet is installed correctly by using the "aspnet_regiis -i" exe that you can find under your framework folder, usually in [system_drive]\[windows]\framework\v1.0.3705 or[system_drive]\[windows]\framework\v1.1.4322 if it's FX1.1
HTH,
Ting-hao
Monday, March 26, 2012
The ConnectionString property has not been initialized.
Try
Dim cmd As String = _
("SELECT [Name], BirthDate, StartDate From " & _
"Employees WHERE PayGroup='20' AND Status='A'")
Dim conn As String = _
System.Configuration. _
ConfigurationManager. _
AppSettings("myConString")
Dim myConn As New SqlConnection(conn)
Dim myCmd As New SqlDataAdapter(cmd, myConn)
Dim ds As New DataSet
myCmd.Fill(ds)
gvEmp.DataSource = ds
gvEmp.DataBind()
Catch ex As Exception
Response.Write(ex.Message & "<br>")
Finally
End Try
I am getting The ConnectionString property has not been initialized. What am I doing wrong?Show your web.config code.
<connectionStrings>
<add name="myConString" connectionString="Data Source=myServer;Initial Catalog=Employees;User ID=myUser;Password=mypass"
providerName="System.Data.SqlClient" />
</connectionStrings>
Saturday, March 24, 2012
The data is invalid - windows media player error
the following code.
I need to be able to use either response.outpustream or
response.binarywrite since
I will be getting the file from an sql server image field. Other types
of files such as gif or pdf work fine. Here is the code for the wmv:
Dim sql As String
sql = "select * from TblBlobs where blob_id = " & iBlobId
Dim da As New SqlDataAdapter(sql, cn)
Dim MyCB As SqlCommandBuilder = New SqlCommandBuilder(da)
Dim ds As New DataSet
cn.Open()
da.Fill(ds, "Default")
Dim myRow As DataRow
myRow = ds.Tables("Default").Rows(0)
Dim MyData() As Byte
MyData = myRow("filedata")
Response.ClearContent()
Response.ClearHeaders()
Response.Buffer = False
Response.ContentType = "video/x-ms-wmv"
Response.OutputStream.Write(MyData, 0, MyData.Length)
Response.Flush()
Response.Close()
MyCB = Nothing
ds = Nothing
da = Nothing
cn.Close()
cn = Nothing
When the user clicks on a button to run this code, the error "The data
is invalid" is displayed from windows media player. I cannot figure
out what is specific about wmv's that they will not stream.
Thanks Before Hand,
AdielUpdate:
The error when testing on system with Windows Media Player Version
7.10.00.3077 is "The data is invalid"
The error when testing on system with Windows Media Player Version
10.00.00.3700 is "Windows Media Player cannot play the file. The
Player might not support the file type or might not support the codec
that was used to compress the file." and if you click on "More
Information", the error is "C00D1199: Cannot play the file" Error ID =
0xC00D1199, Condition ID = 0x00000000.
Thanks,
Adiel
The data is invalid - windows media player error
the following code.
I need to be able to use either response.outpustream or
response.binarywrite since
I will be getting the file from an sql server image field. Other types
of files such as gif or pdf work fine. Here is the code for the wmv:
Dim sql As String
sql = "select * from TblBlobs where blob_id = " & iBlobId
Dim da As New SqlDataAdapter(sql, cn)
Dim MyCB As SqlCommandBuilder = New SqlCommandBuilder(da)
Dim ds As New DataSet
cn.Open()
da.Fill(ds, "Default")
Dim myRow As DataRow
myRow = ds.Tables("Default").Rows(0)
Dim MyData() As Byte
MyData = myRow("filedata")
Response.ClearContent()
Response.ClearHeaders()
Response.Buffer = False
Response.ContentType = "video/x-ms-wmv"
Response.OutputStream.Write(MyData, 0, MyData.Length)
Response.Flush()
Response.Close()
MyCB = Nothing
ds = Nothing
da = Nothing
cn.Close()
cn = Nothing
When the user clicks on a button to run this code, the error "The data
is invalid" is displayed from windows media player. I cannot figure
out what is specific about wmv's that they will not stream.
Thanks Before Hand,
AdielCAn you scesfully download the WMV file.
"adiel_g@dotnet.itags.org.hotmail.com" wrote:
> I cannot seem to get a wmv file to stream from asp.net. I have tried
> the following code.
> I need to be able to use either response.outpustream or
> response.binarywrite since
> I will be getting the file from an sql server image field. Other types
> of files such as gif or pdf work fine. Here is the code for the wmv:
>
> Dim sql As String
> sql = "select * from TblBlobs where blob_id = " & iBlobId
> Dim da As New SqlDataAdapter(sql, cn)
> Dim MyCB As SqlCommandBuilder = New SqlCommandBuilder(da)
> Dim ds As New DataSet
> cn.Open()
> da.Fill(ds, "Default")
> Dim myRow As DataRow
> myRow = ds.Tables("Default").Rows(0)
> Dim MyData() As Byte
> MyData = myRow("filedata")
> Response.ClearContent()
> Response.ClearHeaders()
> Response.Buffer = False
> Response.ContentType = "video/x-ms-wmv"
> Response.OutputStream.Write(MyData, 0, MyData.Length)
> Response.Flush()
> Response.Close()
> MyCB = Nothing
> ds = Nothing
> da = Nothing
> cn.Close()
> cn = Nothing
>
> When the user clicks on a button to run this code, the error "The data
> is invalid" is displayed from windows media player. I cannot figure
> out what is specific about wmv's that they will not stream.
> Thanks Before Hand,
> Adiel
>
No, if I click on the link and choose "Save target as", the error is:
Internet Explorer cannot down from ... _ctl18$lnkLoadImageItem','').
I can understand the above error because the system has to call the
function before it can actually download the file. Basically the
function above is being called from a LinkButton. I have also tried
calling the function from a regular button and same results: I can load
gifs, pdfs, jpgs, etc but windows video files (wmv) receive the error
"The data is invalid" when the system starts Windows Media Player.
Update:
The error when testing on system with Windows Media Player Version
7.10.00.3077 is "The data is invalid"
The error when testing on system with Windows Media Player Version
10.00.00.3700 is "Windows Media Player cannot play the file. The
Player might not support the file type or might not support the codec
that was used to compress the file." and if you click on "More
Information", the error is "C00D1199: Cannot play the file" Error ID =
0xC00D1199, Condition ID = 0x00000000.
Thanks,
Adiel
The designer could not be shown for this file ... in VS 2003 - Please HELP!
1. Uninstalled Visual Studio.NET and any related programs that get
installed with Visual Studio.NEt (Framework 1.1, etc.)
2. Deleted the directory C:\Documents and Settings\Administrator\Local
Settings\Application Data\Microsoft\VisualStudio. Repeat this for the
"All Users" directory under "Documents and Settings".
3. Removed any applications that had anything to do with eVB, eVC,
CompactFramework, SmartPhone SDK, etc.
4. Removed any residual directories on the hard drive that had to do
with eVB, eVC, CompactFramework, SmartPhone SDK, etc.
5. Removed from the registry everything that had to do with eVB, eVC,
"Windows CE", "Platman", "Visual Studio.NET"
5. Ran Microsoft RegClean to clean up the registry.
6. Rebooted the machine and reinstalled Visual Studio.NET 2003.
Hope this helps,
Johann Blake
Mobile solutions using GPS
www.closerworlds.com/engI solved this problem but didn't have the time to post what I found.
All I had to do is delete the OBJ and BIN folders from all projects in
the solution, then choose rebuild all. It worked then without even
restarting Visual Studio.NET itself
I hope this helps
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
I was having the same problem and you post help fixes it.
Thank you so much!
"Mohammed Banat" <mbanat@.e-sensejo.com> wrote in message
news:ukRrI8SRDHA.2196@.TK2MSFTNGP11.phx.gbl...
> I solved this problem but didn't have the time to post what I found.
> All I had to do is delete the OBJ and BIN folders from all projects in
> the solution, then choose rebuild all. It worked then without even
> restarting Visual Studio.NET itself
> I hope this helps
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
Happy to hear it worked.
I will be happier to learn that the next service release/service pack
will have this solved.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
I was encountering this issue as well. I tried a lot of the
suggestions, but it came down to a project version issue. This is hard
to explain as it was hard to discover.
I have 3 projects. Project 1 is my asp.net application. Project 2 has
my base page. Project 3 has a lot of core classes used by both project
1 and 2. Project 2 and 3 are in the same solution. I built project 3
and copied the dll from the build directory to a central place where I
store my dlls. Later I made changes to project 2 and only copied the
dll from project 2 to the central location. Since project 2 and 3 are
in the same solution project 2 has a project reference to project 3.
Both of them have an AssemblyVersion of "1.0.*". Since the dlls from
project 2 and 3 were from different builds project 2 had a version
conflict.
The designer was the only thing that did not work. The application
still ran fine. All I had to do was make sure that I use the dlls from
the output (bin folder) of project 2 from the same build version. I
performed a lot of the above mentioned steps from removing the bin and
obj folders to deleting temp files. Getting the same versions of the
dlls was the step that finally resolved my issue and let me use the
designer again.
the dreaded WAT is not working
I'm using a file based ASP.net web type on my local machine
I've not had this problem before, but I started a brand new website and I
clicked on the ASP.net configuration icon in solution explorer and I get thi
s
message
'An error was encountered. Please return to the previous page and try again.
'
when I click the link that says 'how do I use this tool' I get the message
that 'the tool has timed out'
how can I make this flaky heap of junk show me the normal 4 tabs
regards and many thanks in advance
CharlesAASP.Net requires a web server running the ASP.Net ISAPI to work. It is
HTTP-Protocol-based, and can not be run as a file-based web.
HTH,
Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com
If you have little, is that your lot?
"CharlesA" <CharlesA@.discussions.microsoft.com> wrote in message
news:4AAB887E-3954-47D4-A51B-62FE56C43B60@.microsoft.com...
> Hi folks, using ASP.net 2.0 VS 2005 and C# on XP pro
> I'm using a file based ASP.net web type on my local machine
> I've not had this problem before, but I started a brand new website and I
> clicked on the ASP.net configuration icon in solution explorer and I get
> this
> message
> 'An error was encountered. Please return to the previous page and try
> again. '
> when I click the link that says 'how do I use this tool' I get the message
> that 'the tool has timed out'
> how can I make this flaky heap of junk show me the normal 4 tabs
> regards and many thanks in advance
> CharlesA
Did you create the membership database with the aspnet_regsql tool ?
If you have not yet created the membership database, exit the Web Site
Administration tool, use the aspnet_regsql command-line utility to create
and configure the database, and then return to the WAT to set the provider.
aspnet_regsql.exe is located in the .Net Framework directory :
Drive:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
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/
===================================
"CharlesA" <CharlesA@.discussions.microsoft.com> wrote in message
news:4AAB887E-3954-47D4-A51B-62FE56C43B60@.microsoft.com...
> Hi folks, using ASP.net 2.0 VS 2005 and C# on XP pro
> I'm using a file based ASP.net web type on my local machine
> I've not had this problem before, but I started a brand new website and I
> clicked on the ASP.net configuration icon in solution explorer and I get t
his
> message
> 'An error was encountered. Please return to the previous page and try agai
n. '
> when I click the link that says 'how do I use this tool' I get the message
> that 'the tool has timed out'
> how can I make this flaky heap of junk show me the normal 4 tabs
> regards and many thanks in advance
> CharlesA
Kevin, are you sure about that? I seem to remember using it on a machine the
other day (not my home one) with a file based system
Juan, surely I don't have to create the database first, how does the WAT
tool know that I want to do data stuff, I might just want to change some
config type things
I'm willing to give it a go, but I thought that the WAT tool itself created
the databases in App_data and that you used aspnet_regsql to change the
location of the database
Thanks for your posts so far any further reaction to what I've said here
would be really appreciated
Regards
CharlesA
Hi,
CharlesA wrote:
> Kevin, are you sure about that? I seem to remember using it on a machine t
he
> other day (not my home one) with a file based system
You can use file-based web in ASP.NET 2.0 only (not 1.1), and only from
Visual Studio, because it has a built-in development web server. You
cannot however run ASP.NET based pages/services using the file:// protocol.
So you're both right ;-)
HTH,
Laurent
> Juan, surely I don't have to create the database first, how does the WAT
> tool know that I want to do data stuff, I might just want to change some
> config type things
> I'm willing to give it a go, but I thought that the WAT tool itself create
d
> the databases in App_data and that you used aspnet_regsql to change the
> location of the database
> Thanks for your posts so far any further reaction to what I've said here
> would be really appreciated
> Regards
> CharlesA
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
thanks Laurent,
i am indeed using http://
I moved to a local IIS based website (through a virtual dir) and there I
can't even see my default.aspx let alone use the WAT
this is the error I get
This error (HTTP 500 Internal Server Error) means that the website you are
visiting had a server problem which prevented the webpage from displaying.
despite having used added in MAIN\ASPNET (main is my machine name) into the
directory security tab
I had none of these security probs in .net 1.1, now with VS 2005 I can't use
my local IIS anymore and if I try to use the WAT I'm told that it has timed
out, what am I missing (I'm at home and I'm the admin) any ideas on the
missing steps that I failed to take after installing both VS2005 with .net
2.0 and SServer 2005 on an XP pro machine?
Regards and thanks again for any help
CharlesA
just out of interest folks...if I go for a complete reinstall of all this (t
o
sort it out) what do I install first,
a) .Net2.0/Visual Studio 2005 and then SQL server 2005
b) the othe way round
c) it doesn't matter
Regards
CharlesA
re:
> I might just want to change some config type things
There's very little you can change in web.config using the WAT.
If that's all you want to do, change the website to http-based,
and use the ASP.NET configuration manager in the MMC.
Using the WAT for minor web.config configuration changes is spotty,
at best, since there's a lot of settings you don't have access to from the W
AT tool.
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/
===================================
"CharlesA" <CharlesA@.discussions.microsoft.com> wrote in message
news:DC414BA9-AF4E-41B2-A50B-D35C2C6C38A2@.microsoft.com...
> Kevin, are you sure about that? I seem to remember using it on a machine t
he
> other day (not my home one) with a file based system
> Juan, surely I don't have to create the database first, how does the WAT
> tool know that I want to do data stuff, I might just want to change some
> config type things
> I'm willing to give it a go, but I thought that the WAT tool itself create
d
> the databases in App_data and that you used aspnet_regsql to change the
> location of the database
> Thanks for your posts so far any further reaction to what I've said here
> would be really appreciated
> Regards
> CharlesA
re:
> a) .Net2.0/Visual Studio 2005 and then SQL server 2005
.Net2.0, SQL Server 2005 (Express, presumably), then Visual Studio 2005
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/
===================================
"CharlesA" <CharlesA@.discussions.microsoft.com> wrote in message
news:D26EC97F-863C-4476-A551-36D330EDBDE4@.microsoft.com...
> just out of interest folks...if I go for a complete reinstall of all this
(to
> sort it out) what do I install first,
> a) .Net2.0/Visual Studio 2005 and then SQL server 2005
> b) the othe way round
> c) it doesn't matter
> Regards
> CharlesA
ah yes Juan, but I needed to follow some steps in a tutorial so that
eventually I can use the Membership stuff, now either my website full stop
doesn't work with IIS or my WAT doesn't work with either the built-in web
server or IIS
Regards and thanks,
Charles
the dreaded WAT is not working
I'm using a file based ASP.net web type on my local machine
I've not had this problem before, but I started a brand new website and I
clicked on the ASP.net configuration icon in solution explorer and I get this
message
'An error was encountered. Please return to the previous page and try again. '
when I click the link that says 'how do I use this tool' I get the message
that 'the tool has timed out'
how can I make this flaky heap of junk show me the normal 4 tabs
regards and many thanks in advance
CharlesAASP.Net requires a web server running the ASP.Net ISAPI to work. It is
HTTP-Protocol-based, and can not be run as a file-based web.
--
HTH,
Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com
If you have little, is that your lot?
"CharlesA" <CharlesA@.discussions.microsoft.comwrote in message
news:4AAB887E-3954-47D4-A51B-62FE56C43B60@.microsoft.com...
Quote:
Originally Posted by
Hi folks, using ASP.net 2.0 VS 2005 and C# on XP pro
>
I'm using a file based ASP.net web type on my local machine
>
I've not had this problem before, but I started a brand new website and I
clicked on the ASP.net configuration icon in solution explorer and I get
this
message
>
'An error was encountered. Please return to the previous page and try
again. '
>
when I click the link that says 'how do I use this tool' I get the message
that 'the tool has timed out'
>
how can I make this flaky heap of junk show me the normal 4 tabs
>
regards and many thanks in advance
>
CharlesA
Did you create the membership database with the aspnet_regsql tool ?
If you have not yet created the membership database, exit the Web Site
Administration tool, use the aspnet_regsql command-line utility to create
and configure the database, and then return to the WAT to set the provider.
aspnet_regsql.exe is located in the .Net Framework directory :
Drive:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
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/
===================================
"CharlesA" <CharlesA@.discussions.microsoft.comwrote in message
news:4AAB887E-3954-47D4-A51B-62FE56C43B60@.microsoft.com...
Quote:
Originally Posted by
Hi folks, using ASP.net 2.0 VS 2005 and C# on XP pro
>
I'm using a file based ASP.net web type on my local machine
>
I've not had this problem before, but I started a brand new website and I
clicked on the ASP.net configuration icon in solution explorer and I get this
message
>
'An error was encountered. Please return to the previous page and try again. '
>
when I click the link that says 'how do I use this tool' I get the message
that 'the tool has timed out'
>
how can I make this flaky heap of junk show me the normal 4 tabs
>
regards and many thanks in advance
>
CharlesA
Kevin, are you sure about that? I seem to remember using it on a machine the
other day (not my home one) with a file based system
Juan, surely I don't have to create the database first, how does the WAT
tool know that I want to do data stuff, I might just want to change some
config type things
I'm willing to give it a go, but I thought that the WAT tool itself created
the databases in App_data and that you used aspnet_regsql to change the
location of the database
Thanks for your posts so far any further reaction to what I've said here
would be really appreciated
Regards
CharlesA
Hi,
CharlesA wrote:
Quote:
Originally Posted by
Kevin, are you sure about that? I seem to remember using it on a machine the
other day (not my home one) with a file based system
You can use file-based web in ASP.NET 2.0 only (not 1.1), and only from
Visual Studio, because it has a built-in development web server. You
cannot however run ASP.NET based pages/services using the file:// protocol.
So you're both right ;-)
HTH,
Laurent
Quote:
Originally Posted by
Juan, surely I don't have to create the database first, how does the WAT
tool know that I want to do data stuff, I might just want to change some
config type things
>
I'm willing to give it a go, but I thought that the WAT tool itself created
the databases in App_data and that you used aspnet_regsql to change the
location of the database
>
Thanks for your posts so far any further reaction to what I've said here
would be really appreciated
>
Regards
CharlesA
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
thanks Laurent,
i am indeed using http://
I moved to a local IIS based website (through a virtual dir) and there I
can't even see my default.aspx let alone use the WAT
this is the error I get
This error (HTTP 500 Internal Server Error) means that the website you are
visiting had a server problem which prevented the webpage from displaying.
despite having used added in MAIN\ASPNET (main is my machine name) into the
directory security tab
I had none of these security probs in .net 1.1, now with VS 2005 I can't use
my local IIS anymore and if I try to use the WAT I'm told that it has timed
out, what am I missing (I'm at home and I'm the admin) any ideas on the
missing steps that I failed to take after installing both VS2005 with .net
2.0 and SServer 2005 on an XP pro machine?
Regards and thanks again for any help
CharlesA
just out of interest folks...if I go for a complete reinstall of all this (to
sort it out) what do I install first,
a) .Net2.0/Visual Studio 2005 and then SQL server 2005
b) the othe way round
c) it doesn't matter
Regards
CharlesA
re:
Quote:
Originally Posted by
I might just want to change some config type things
There's very little you can change in web.config using the WAT.
If that's all you want to do, change the website to http-based,
and use the ASP.NET configuration manager in the MMC.
Using the WAT for minor web.config configuration changes is spotty,
at best, since there's a lot of settings you don't have access to from the WAT tool.
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/
===================================
"CharlesA" <CharlesA@.discussions.microsoft.comwrote in message
news:DC414BA9-AF4E-41B2-A50B-D35C2C6C38A2@.microsoft.com...
Quote:
Originally Posted by
Kevin, are you sure about that? I seem to remember using it on a machine the
other day (not my home one) with a file based system
>
Juan, surely I don't have to create the database first, how does the WAT
tool know that I want to do data stuff, I might just want to change some
config type things
>
I'm willing to give it a go, but I thought that the WAT tool itself created
the databases in App_data and that you used aspnet_regsql to change the
location of the database
>
Thanks for your posts so far any further reaction to what I've said here
would be really appreciated
>
Regards
CharlesA
re:
Quote:
Originally Posted by
a) .Net2.0/Visual Studio 2005 and then SQL server 2005
..Net2.0, SQL Server 2005 (Express, presumably), then Visual Studio 2005
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/
===================================
"CharlesA" <CharlesA@.discussions.microsoft.comwrote in message
news:D26EC97F-863C-4476-A551-36D330EDBDE4@.microsoft.com...
Quote:
Originally Posted by
just out of interest folks...if I go for a complete reinstall of all this (to
sort it out) what do I install first,
>
a) .Net2.0/Visual Studio 2005 and then SQL server 2005
b) the othe way round
c) it doesn't matter
>
Regards
CharlesA
ah yes Juan, but I needed to follow some steps in a tutorial so that
eventually I can use the Membership stuff, now either my website full stop
doesn't work with IIS or my WAT doesn't work with either the built-in web
server or IIS
Regards and thanks,
Charles
FYI
"Kevin Spencer"
Quote:
Originally Posted by
ASP.Net requires a web server
Not really - just a process to handle:
HttpRuntime.ProcessRequest Method
Drives all ASP.NET Web processing execution
Quote:
Originally Posted by
running the ASP.Net ISAPI to work. It is
HTTP-Protocol-based, and can not be
run as a file-based web.
>
Well it all depends on what your goal is:
perhaps a sales CD (etc.) that looks like
it is using a "web server", or whatever!
Anyway here are two oldies but goodies:
"HTML is often thought of as the sole
domain for Web applications. But HTML's
versatile display attributes are also
very useful for handling data display of
all sorts in desktop applications. "
Hosting the ASP.Net Runtime in desktop applications
http://www.west-wind.com/presentati...pnetruntime.asp
Executing ASPX pages without a web server
http://radio.weblogs.com/0105476/st...AWebServer.html
I stand corrected! Or at least, adjusted!
--
;-),
Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com
If you have little, is that your lot?
"Flowering Weeds" <floweringnoweedsno@.hotmail.comwrote in message
news:Od3tmiQBHHA.3536@.TK2MSFTNGP03.phx.gbl...
Quote:
Originally Posted by
>
>
FYI
>
"Kevin Spencer"
>
Quote:
Originally Posted by
>ASP.Net requires a web server
>
Not really - just a process to handle:
>
HttpRuntime.ProcessRequest Method
Drives all ASP.NET Web processing execution
>
Quote:
Originally Posted by
>running the ASP.Net ISAPI to work. It is
>HTTP-Protocol-based, and can not be
>run as a file-based web.
>>
>
Well it all depends on what your goal is:
perhaps a sales CD (etc.) that looks like
it is using a "web server", or whatever!
>
Anyway here are two oldies but goodies:
>
"HTML is often thought of as the sole
domain for Web applications. But HTML's
versatile display attributes are also
very useful for handling data display of
all sorts in desktop applications. "
>
Hosting the ASP.Net Runtime in desktop applications
http://www.west-wind.com/presentati...pnetruntime.asp
>
Executing ASPX pages without a web server
http://radio.weblogs.com/0105476/st...AWebServer.html
>
>
>
>
The easiest way to save data into a text file on server side - Help me please
![]()
Hi guys, I'm new at ASP and all I wanna know is, what is the simplest code for gathering info from my website visitors (using the FORM object) and saving it to a text file (*.TXT) on the web server? The whole procedure. I know it's lame, but is there anyone out there, that could help me with this one? Thanks guys.
Andrew
You could do something like the following. Here txtName and txtAddress are textboxes. Similarly you can add all the controls that you want to save.
The collected data is saved in the current directory on the webserver in a file called Test.txt. All subsequent saves will be appended to the same file (change the last parameter
to false to overwrite on every save)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim s As String
s += txtName.Text + vbCrLf
s += txtAddress.Text + vbCrLf
My.Computer.FileSystem.WriteAllText(Server.MapPath("Test.txt"), s, True)
end sub
The Ellipsis (.) Character Is Not Showing Up When Read From A Text File
certain directory of mine to use as the Text property of a HyperLink
Control. However, in one of my recently added text files in the directory it
is using all but the ellipsis character (this is the last character in the
line, but it does the same thing when I place the character in other
places). For example, here is what the line looks like in the *.txt file and
the generated HTML code:
*.txt File:
Whate.ver you say.
HTML Code:
Whatever you say
When I create the text files, which I do in Windows Notepad on Windows XP
Pro SP2, I enter the character using the ALT+0133 key combination. Even if
ASP.NET did not recognize this character, I would at least expect it to put
some character in it's place, even if it was not the one I wanted. When
reading the *.txt file I use the System.IO.StreamReader.ReadLine() method. I
am assuming the fix has something to do with the character sets I am using
when creating and/or reading the *.txt files, but I was unable to find the
character set that Notepad saves the file as. Can somebody help me here?
Thanks.
--
Nathan Sokalski
njsokalski@dotnet.itags.org.hotmail.com
http://www.nathansokalski.com/
>but I was unable to find the
>character set that Notepad saves the file as. Can somebody help me here?
The Encoding field in Notepad's File -> Save As... dialog.
Mattias
Mattias Sjgren [C# MVP] mattias @. mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Thursday, March 22, 2012
The file '/AHSD/MainMenu.aspx' has not been pre-compiled, and cannot be requested.
pre-compiled, and cannot be requested." when I try to deploy one of my
applications that I am just migrating to VS 2005. I have searched on
the web for a solution, but none of the suggestions so far have
worked. Here is my scenario:
I am using Visual Studio 2005 with SP1 installed and I have created a
Web Deployment Project with the following items selected in the
Property Pages:
compliation tab: just defaults, nothing special selected. Output
folder .\Release\
output assemblies tab: Merge all pages and control outputs to a
single assembly (AssemblyName: AHSD.CompiledApplication)
sigining tab: just defaults
deployment tab: just defaults
I created a virutal directory pointing to the Release folder so that I
could see if it worked and it seems to work perfectly. On our server
there was an existing folder called AHSD that used to contain the
files for the application before it was migrated. I deleted all of
the files and copied the new ones. This is when I get the error.
I have made sure that our Network technician has changed the virtual
directory asp.net tab to use Framework 2.0, I asked him to restart IIS
and I have ensured that the additional assemblies that we reference
within the application have been registered in the GAC.
Any other suggestions?On Oct 3, 11:39 am, lds <lisa.stap...@.gnb.cawrote:
Quote:
Originally Posted by
I am getting the error "The file '/AHSD/MainMenu.aspx' has not been
pre-compiled, and cannot be requested." when I try to deploy one of my
applications that I am just migrating to VS 2005. I have searched on
the web for a solution, but none of the suggestions so far have
worked. Here is my scenario:
>
I am using Visual Studio 2005 with SP1 installed and I have created a
Web Deployment Project with the following items selected in the
Property Pages:
>
compliation tab: just defaults, nothing special selected. Output
folder .\Release\
output assemblies tab: Merge all pages and control outputs to a
single assembly (AssemblyName: AHSD.CompiledApplication)
sigining tab: just defaults
deployment tab: just defaults
>
I created a virutal directory pointing to the Release folder so that I
could see if it worked and it seems to work perfectly. On our server
there was an existing folder called AHSD that used to contain the
files for the application before it was migrated. I deleted all of
the files and copied the new ones. This is when I get the error.
>
I have made sure that our Network technician has changed the virtual
directory asp.net tab to use Framework 2.0, I asked him to restart IIS
and I have ensured that the additional assemblies that we reference
within the application have been registered in the GAC.
>
Any other suggestions?
This afternoon, mysteriously this application started working on our
server. Now for some reason the other apps that are still using the
1.1 version of the framework have stopped working. Any ideas why?
On Oct 3, 3:49 pm, lds <lisa.stap...@.gnb.cawrote:
Quote:
Originally Posted by
On Oct 3, 11:39 am, lds <lisa.stap...@.gnb.cawrote:
>
>
>
>
>
Quote:
Originally Posted by
I am getting the error "The file '/AHSD/MainMenu.aspx' has not been
pre-compiled, and cannot be requested." when I try to deploy one of my
applications that I am just migrating to VS 2005. I have searched on
the web for a solution, but none of the suggestions so far have
worked. Here is my scenario:
>
Quote:
Originally Posted by
I am using Visual Studio 2005 with SP1 installed and I have created a
Web Deployment Project with the following items selected in the
Property Pages:
>
Quote:
Originally Posted by
compliation tab: just defaults, nothing special selected. Output
folder .\Release\
output assemblies tab: Merge all pages and control outputs to a
single assembly (AssemblyName: AHSD.CompiledApplication)
sigining tab: just defaults
deployment tab: just defaults
>
Quote:
Originally Posted by
I created a virutal directory pointing to the Release folder so that I
could see if it worked and it seems to work perfectly. On our server
there was an existing folder called AHSD that used to contain the
files for the application before it was migrated. I deleted all of
the files and copied the new ones. This is when I get the error.
>
Quote:
Originally Posted by
I have made sure that our Network technician has changed the virtual
directory asp.net tab to use Framework 2.0, I asked him to restart IIS
and I have ensured that the additional assemblies that we reference
within the application have been registered in the GAC.
>
Quote:
Originally Posted by
Any other suggestions?
>
This afternoon, mysteriously this application started working on our
server. Now for some reason the other apps that are still using the
1.1 version of the framework have stopped working. Any ideas why?- Hide quoted text -
>
- Show quoted text -
Just incase anyone is wondering...we got this app working. It turned
out that this app was using the same application pool as the 1.1
apps. Once we put it in its own applicaiton pool for 2.0 apps it
worked fine.
The file could not be loaded into the Web Forms designer
install. I am unable to use the web forms designer with any aspx file
whose
form class inherits from a base class. I'm implementing the page
controller
design pattern and everything has been working fine until now. My form
inherits from a base class called CampusNET.CampusPage. The class
exists, is
included in the project and compiles just fine. If I replace the base
class
for my form with the standard System.Web.UI.Page, the designer can open
the
form without any problems, but as soon as I try to inherit from my base
class, it breaks down. I've tried it with an empty base class with only
the
Page_Load method, but the problem remains.
The base class is not abstract so that's not the issue. Neither is the
problem related to the registry entry that leads to the "Illegal
character
in path" error. The full error message looks like this:
"The file could not be loaded into the Web Forms designer. Please
correct
the following error and then try loading it again:
The designer could not be shown for this file because none of the
classes
within can be designed. The designer inspected the following classes in
the
file:
MenuTest -- The base class 'CampusNET.CampusPage' could not be loaded.
Ensure the assembly has been referenced or built if it is part of the
project.
Make sure all of the classes used in the page are build or referenced
in the
project. Click Help for more information."
Has anyone encountered this problem before? I really need to get this
fixed
as soon as possible.
Regards
/CThis is a known issue. I'm pretty certain that it's fixed in VS2005.
I've had something similar with my own base classes... probably a simpler
situation than yours. Mine rears it's head the first time you get the source
code from source control, before you build your project. My project also
contains the base class. It seems as if the designer needs the compiled
version of the base class present - so my fix is to build the project so the
base class gets fixed and all seems to work OK
Hope this helps
Richard MCSD .NET
"crusell@.gmail.com" wrote:
> I'm having some problem with my Visual Studio.NET 2003 (.NET 1.1 SP1)
> install. I am unable to use the web forms designer with any aspx file
> whose
> form class inherits from a base class. I'm implementing the page
> controller
> design pattern and everything has been working fine until now. My form
> inherits from a base class called CampusNET.CampusPage. The class
> exists, is
> included in the project and compiles just fine. If I replace the base
> class
> for my form with the standard System.Web.UI.Page, the designer can open
> the
> form without any problems, but as soon as I try to inherit from my base
> class, it breaks down. I've tried it with an empty base class with only
> the
> Page_Load method, but the problem remains.
> The base class is not abstract so that's not the issue. Neither is the
> problem related to the registry entry that leads to the "Illegal
> character
> in path" error. The full error message looks like this:
> "The file could not be loaded into the Web Forms designer. Please
> correct
> the following error and then try loading it again:
> The designer could not be shown for this file because none of the
> classes
> within can be designed. The designer inspected the following classes in
> the
> file:
> MenuTest -- The base class 'CampusNET.CampusPage' could not be loaded.
> Ensure the assembly has been referenced or built if it is part of the
> project.
> Make sure all of the classes used in the page are build or referenced
> in the
> project. Click Help for more information."
> Has anyone encountered this problem before? I really need to get this
> fixed
> as soon as possible.
> Regards
> /C
>