Saturday, March 31, 2012
The ASPNET Sql Server Account
We're using Windows authentication on our network and to give any user permission in the database I have to grant it to the ASPNET account. This seems to defeat the purpose of using Windows authentication because anyone that opens the ASP.NET page will have those rights in the database even if they aren't listed as a user in the DB.
For example, I give read-only rights to the ASPNET account and even if I give an individual user db_datawriter rights, they still cannot write to the DB unless I grant the ASPNET account db_datawriter rights. Then anyone can save/modify the data.Is SQL server installed on the same machine as IIS?
This will have an impace on how the ASPNET user operates.
Both are on the same machine.
set impersonation on in the web config file
<impersonate=true/>
Or something to that affect...
This is a good article on the microsoft site, it explains the different methods for accessing SQL server.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconaccessingsqlserverfromwebapplication.asp
This is also a good article.
http://support.microsoft.com/default.aspx?scid=kb;en-us;815154
Originally posted by hellswraith
set impersonation on in the web config file
<impersonate=true/>
Or something to that affect...
that did the trick. well actually it was
<identity impersonate="true" />
then you can get rid of the ASPNET account if using Windows authentication.
Does anyone know if this impersonate would work if IIS and SQL server are on different machines.
I have a feeling it won't but I am happy to be told I am wrong.
I'm pretty sure they have to be on the same machine. I think I read that on MSDN.
That was my understanding. The first article in on of my previous posts talks about it.
Sometimes I wonder if I understand it the way they mean it.
From my interpretation of the article, You need to have the SQL Server and IIS (web server) on the same machine if you want to use Windows authentication OR anonymous access with the ASPNET account.
If you want to access the SQL Server using a Mapped Windows Domain User or prompting for the username and password and passing them as credentials then you don't need the SQL Server and web server on the same machine.
I went on ASP.NET training last week where IIS and SQL were on the same server, the ASPNET account was used.
We came away thinking that is how it naturally worked. It took me half a day and some searching to find out it wasn't so cut and dried.
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 solution of URL rewriting method
I want rewrite url, but I don't know, whoch method is the best:
- ISAPI filters at the IIS Web server levelor HTTP modules
or HTTP handlers
Thanks
You may want to read this >>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/urlrewriting.asp
Looks like URL rewriting using http modules seems to be a better idea...
Wednesday, March 28, 2012
The best way to archieve this? Help please
access a shared folder in other server. To access this shared folder, I have
to login with user name and password.
I used IWshRuntimeLibrary.WshNetwork() and mapped the folder to a network
drive (Y:\) in the page_load. Then I disconnected this drive in the
page_unload. I got it works but not stable. Sometimes it fails to disconnect
and to map.
thanks"dbui" <nnngoan@dotnet.itags.org.hotmail.com> wrote in
news:u6zLB9pbEHA.1408@dotnet.itags.org.TK2MSFTNGP12.phx.gbl:
> I used IWshRuntimeLibrary.WshNetwork() and mapped the folder to a
> network drive (Y:\) in the page_load. Then I disconnected this drive
> in the page_unload. I got it works but not stable. Sometimes it fails
> to disconnect and to map.
How about impersonating a user with access to that drive?
http://support.microsoft.com/defaul...b;EN-US;Q306158
--
Lucas Tam (REMOVEnntp@dotnet.itags.org.rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
thanks for the link.
"Lucas Tam" <REMOVEnntp@dotnet.itags.org.rogers.com> wrote in message
news:Xns952CB1601E166nntprogerscom@dotnet.itags.org.140.99.99.130.. .
> "dbui" <nnngoan@dotnet.itags.org.hotmail.com> wrote in
> news:u6zLB9pbEHA.1408@dotnet.itags.org.TK2MSFTNGP12.phx.gbl:
> > I used IWshRuntimeLibrary.WshNetwork() and mapped the folder to a
> > network drive (Y:\) in the page_load. Then I disconnected this drive
> > in the page_unload. I got it works but not stable. Sometimes it fails
> > to disconnect and to map.
> How about impersonating a user with access to that drive?
> http://support.microsoft.com/defaul...b;EN-US;Q306158
> --
> Lucas Tam (REMOVEnntp@dotnet.itags.org.rogers.com)
> Please delete "REMOVE" from the e-mail address when replying.
> http://members.ebay.com/aboutme/coolspot18/
The best way to archieve this? Help please
access a shared folder in other server. To access this shared folder, I have
to login with user name and password.
I used IWshRuntimeLibrary.WshNetwork() and mapped the folder to a network
drive (Y:\) in the page_load. Then I disconnected this drive in the
page_unload. I got it works but not stable. Sometimes it fails to disconnect
and to map.
thanks"dbui" <nnngoan@dotnet.itags.org.hotmail.com> wrote in
news:u6zLB9pbEHA.1408@dotnet.itags.org.TK2MSFTNGP12.phx.gbl:
> I used IWshRuntimeLibrary.WshNetwork() and mapped the folder to a
> network drive (Y:\) in the page_load. Then I disconnected this drive
> in the page_unload. I got it works but not stable. Sometimes it fails
> to disconnect and to map.
>
How about impersonating a user with access to that drive?
http://support.microsoft.com/defaul...b;EN-US;Q306158
Lucas Tam (REMOVEnntp@dotnet.itags.org.rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
[url]http://members.ebay.com/aboutme/
spot18/[/url]thanks for the link.
"Lucas Tam" <REMOVEnntp@dotnet.itags.org.rogers.com> wrote in message
news:Xns952CB1601E166nntprogerscom@dotnet.itags.org.140.99.99.130...
> "dbui" <nnngoan@dotnet.itags.org.hotmail.com> wrote in
> news:u6zLB9pbEHA.1408@dotnet.itags.org.TK2MSFTNGP12.phx.gbl:
>
> How about impersonating a user with access to that drive?
> http://support.microsoft.com/defaul...b;EN-US;Q306158
> --
> Lucas Tam (REMOVEnntp@dotnet.itags.org.rogers.com)
> Please delete "REMOVE" from the e-mail address when replying.
> [url]http://members.ebay.com/aboutme/
spot18/[/url]
The big hole in .Net - Reporting
Your database works a treat, the user interface looks great on screen and then your customer spoils it all by asking - "how do I print an invoice" ?
Mmmm - never thought about that !
Well, I'm just a dumb developer who has been writing Windows app's for 10 years and is used to easily creating all the reports once the main application is working.
What is Microsoft's excuse ?
Why is there no reporting capability for ASP.Net ?
Their "partners" who have just such a product to fill the gap, must be raking it in - especially as they all provide a license on a per server basis !
I'd like to know how other developers are currently reporting and printing from their ASP.Net applications and if any improvements are planned for the next version.
Steve.Crystal Reports is included with VS.NET, if you have that. That's the reporting solution. You can also use Microsoft's SQL Server Reporting Services, a free add-on to SQL Server 2000.
Or you could create a PDF file from the server with it. Or you could just have them print the Web page (admittedly this is less than desireable).
Lots of options. Any of these work?
Don
Well, actually MS just release SQL Reporting Services that is based on the .NET framework, and can be expanded using .NET.
Don,
Thanks for the suggestions.
Some time ago, I wasted several hours and could not even get a connection to SQL Server from Crystal Reports. I wasted many more hours trying other things with it. Some of my applications ship to customers to run on their intranets and I would not want them to go anywhere near Crystal Reports. There is also very little support - unless you flash the cash of course !
I have been looking at PDF writers for over 12 months in the hope that one will appear where you do not need a license for each server. I have still not found any.
I am not familiar with the SQL Server Reporting add on - can you point me in the right direction as I would be very interested to find out more.
Matt,
Sounds good - where can I find out more.
Steve.
Steve,
i'm using ActiveReports.NET to generate Reports as HTML Pages, Excel Sheets and PDF's within my web site. It works well and it is easy to use. You can download a trial version at
Data Dynamics
Tom
Thanks Tom,
I've been considering Active Reports. Would I be able to design an invoice report and ensure that it prints out exactly as required - regardless of the users browser or screen resolution ?
Steve.
I use ActiveReports. Very easy, extendible, and affordable.
You have several options, but usually you would generate PDFs,
which do print exactly as required, regardless of browser, etc.
You can find SQL Reporting Services at http://www.microsoft.com/sql/reporting
I wrote a small vb.net windows app which is using the crystal report components integreated in VS.net. I had to create a setup project and put in the licence keys. Now it works perfect on the machine I installed the app.
So I think it's very easy to use Crystal Reports. You can do the same with webprojects and generate pdf's there.
Just an idea ...
Many of my clients use MSDE. When asked if MSDE is supported - the FAQ from SQL Server Reporting states...
"Although Reporting Services can use data from MSDE databases, the Report Server Database cannot be stored in an instance of MSDE."
I'm not too sure if that's a Yes or a No ?
Can anyone expand on that ?
Thanks for the other suggestions - I'm looking into those too.
Steve.
I might be missing something here, and I'd like one of the ActiveReports users to correct me if I'm wrong, but...
I use Crystal Reports. I'm a big fan of the product froma development point-of-view, but have always hated it from a deployment perspective.
That said, at $9,000 + for each per-site license of the professional edition of Active Reports, what exactly am I getting that the 'free', out-of-the-box .net edition of CR doesn't already give me? With a few lines of code, I can export to pdf. I can do HTML reports. I can export effortlessly to word and excel and RTF.
Trust me, I'm not an avid CR defender; I'm really just curious here...
Well, I would start by reading the license for the "free" Crystal Reports edition.
Note that I'm not a reader of "legalese" either, but people I work with do read it,
and I can assure you many places pay a heck of a lot more than $9000 for CR.
Its also a question of you get what you pay for -- CR just sucks most of the time.
Well, we'll have to agree to disagree on that last point. I think that there is real value in CR< though the support sucks.
But I've implemented numerous site with the CR that comes bundled with enterprise edition. And I didn't see anything that suggested to me that Active Reports offers anything above and beyond. What are the features that it offers that make it a solid alternative to CR?
By the sounds of it - I think that licensing seems to be the key issue as both CR and Active Reports are very powerful products.
The problem I have with CR (other than not being able to get it to work) is that they have given very little in the free version for developers requiring a runtime-free product. They have "dangled a carrot" by getting it bundled with Visual Studio.Net - but it's really not worth taking a bite.
A $9,000 licence fee may be acceptable for large projects, but unfortunately, I rely on selling ASP.Net applications to smaller companies - at a lot less than $9K a go !
Looks like Active Reports is favourite for me.
By the way - don't Microsoft own Crystal anyway ? - that would explain a lot.
Steve.
Well that is my point. For the Professional Version of Active Reports, at least according to the website, you'll be paying that $9,000 per site liscensing fee. And given that, I wonder just what it has and does that Crystal doesn't...
The Cache object...
I need to get some clarification on how this object is being implemented:
1. Global to the entire application (single server) -- is this on a per user session? Meaning Cache for user session A will be different from Cache for user session B?
2. What could cause the Cache values to be unreliable aka -- not available or cleared out (prior to expiration time)?
Thanks, Rob.
Hi,
Cache is global to entire application. It is one and the same for all users e.g shared for all users. Session is the user-specific data storage on the server.
Cache values can be cleared under memory pressure (priority depends on if one is explicitly given when cache item is added), and when AppDomain restarts: application pool restarts, web.config change, multiple file operations, maximum number of recompiles etc etc
Therefore you should check cache item for null reference before trying to access it. Steve Smith ahs written excellent article about ASP.NET caching (it's old but still valid):http://msdn2.microsoft.com/en-us/library/aa478965.aspx
Thank you for the response.
So if I were to add something like TextBox.ClientID (as the key) to the Cache, it would be possible for another user session to overwrite or get that same Cache item if they used the same TextBox.ClientID?
Rob.
Yes because it it is essentially one and the same storage for all users.
The code is not working
copy the code that supposed to print me 'hello world' from my manual
it didn't work. It showed me the page, but ignored the '.net' script.
What could be the reason?
Does my server version support asp.net?
This is the code I copy:
<%@dotnet.itags.org.Page Language="C#"%>
<script runat="server">
void Page_Load(object sender, EventArgs e) {
myLabel.Text = "Hello World!";
}
</script>
<html>
<head>
<title>My first ASP.NET page</title>
</head>
<body>
<asp:Label runat="server" id="myLabel"></asp:Label>
</body>
</html>
thanksOn Jul 13, 12:28 pm, Gandalf <goldn...@dotnet.itags.org.gmail.com> wrote:
> I download the framework and install the IIS server 5.1, But when I
> copy the code that supposed to print me 'hello world' from my manual
> it didn't work. It showed me the page, but ignored the '.net' script.
> What could be the reason?
> Does my server version support asp.net?
> This is the code I copy:
> <%@dotnet.itags.org.Page Language="C#"%>
> <script runat="server">
> void Page_Load(object sender, EventArgs e) {
> myLabel.Text = "Hello World!";
> }
> </script>
> <html>
> <head>
> <title>My first ASP.NET page</title>
> </head>
> <body>
> <asp:Label runat="server" id="myLabel"></asp:Label>
> </body>
> </html>
> thanks
Execute C:\WINDOWS\Microsoft.NET\Framework
\v2.0.50727\aspnet_regiis.aspx -i
That should register the ASP.NET with IIS.
http://support.microsoft.com/kb/306005
On Jul 13, 1:01 pm, Alexey Smirnov <alexey.smir...@dotnet.itags.org.gmail.com> wrote:
> On Jul 13, 12:28 pm, Gandalf <goldn...@dotnet.itags.org.gmail.com> wrote:
>
>
>
>
>
>
>
> Execute C:\WINDOWS\Microsoft.NET\Framework
> \v2.0.50727\aspnet_regiis.aspx -i
> That should register the ASP.NET with IIS.
> http://support.microsoft.com/kb/306005
I only have this two 'version' directories:
v1.1.4322
v1.0.3705
and none of them contains the file aspnet_regiis.aspx
On Jul 13, 8:57 am, Gandalf <goldn...@dotnet.itags.org.gmail.com> wrote:
> On Jul 13, 1:01 pm, Alexey Smirnov <alexey.smir...@dotnet.itags.org.gmail.com> wrote:
>
>
>
>
>
>
>
>
>
>
>
>
> I only have this two 'version' directories:
> v1.1.4322
> v1.0.3705
> and none of them contains the file aspnet_regiis.aspx- Hide quoted text -
> - Show quoted text -
I recommend you install .Net framework 3.0.
On Jul 13, 3:07 pm, Larry Bud <larrybud2...@dotnet.itags.org.yahoo.com> wrote:
> On Jul 13, 8:57 am, Gandalf <goldn...@dotnet.itags.org.gmail.com> wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> I recommend you install .Net framework 3.0.
Thanks I will try it. it supposed to make it work?
re:
!> I recommend you install .Net framework 3.0.
I hope you meant *.Net Framework 2.0*, and not 3.0,
since 3.0 has nothing which an ASP.NET developer needs.
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/
======================================
"Larry Bud" <larrybud2002@dotnet.itags.org.yahoo.com> wrote in message news:1184332075.248198.101630@dotnet.itags.org.m3g2000
hsh.googlegroups.com...
> On Jul 13, 8:57 am, Gandalf <goldn...@dotnet.itags.org.gmail.com> wrote:
> I recommend you install .Net framework 3.0.
>
On Jul 13, 1:44 pm, "Juan T. Llibre" <nomailrepl...@dotnet.itags.org.nowhere.com>
wrote:
> re:
> !> I recommend you install .Net framework 3.0.
> I hope you meant *.Net Framework 2.0*, and not 3.0,
> since 3.0 has nothing which an ASP.NET developer needs.
> Juan T. Llibre, asp.net MVP
> asp.net faq :http://asp.net.do/faq/
> foros de asp.net, en espa=F1ol :http://asp.net.do/foros/
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D
>
> "LarryBud" <larrybud2...@dotnet.itags.org.yahoo.com> wrote in messagenews:1184332075.24819=
8=2E101630@dotnet.itags.org.m3g2000hsh.googlegroups.com...
>
>
al
ipt.
>
>
>
>
>
>
>
>
>
>
t -
>
>
Yes, I mean 2.0
The compiler failed with error code 128
SAP\ITS is an ISAPI Filter that runs to provide Web access to SAP. My application not using SAP for anything.
We found one Weblog that mentioned a rogue ISAPI filter and moving it's priority below ASP.NET fixed their problem. We tried moving the ITS ISAPI filter below ASP.NET, rebooted the machine and it worked. We don't know if the reboot fixed it or the moving of the ISAPI filter.
After I made a change to the C# application and re-copied the .DLL to the server it died again with the same message.Check out this discussion on GotDotNet:
http://www.gotdotnet.com/community/messageboard/Thread.aspx?id=139158&Page=1
The compiler failed with error code 128
We have got a W2k server running IIS5 with .NET framework 1.1 and .NET
framework SP1. All ASP.NET applications cannot run on this box. It all
returned with the same error:
Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.
Compiler Error Message: The compiler failed with error code 128.
I have made sure there is only ASP.NET ISAPI filter running and tried
aspnet_iis -i. Basically I'm out of ideas. Can someone please tell me what
the heck is going on here?
RogerHi, Roger.
I googled for "The compiler failed with error code 128"
and found a few references. The most promising are :
http://www.sitepoint.com/forums/pri...ad.php?t=164998
where it's reported that either
http://www.hanselman.com/blog/Perma...b4.
aspx
or
http://www.webservertalk.com/Uwe/Fo...
irus_k=100252
Here's the Google search,
to facilitate your search for more info:
http://www.google.com/search?as_q=&...ch=&safe=images
Good luck !
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
=====================
"Roger Wang" <rogerw@dotnet.itags.org.sybrel.com> wrote in message
news:uXyaKb$CFHA.3376@dotnet.itags.org.TK2MSFTNGP12.phx.gbl...
> HELP!!!!
> We have got a W2k server running IIS5 with .NET framework 1.1 and .NET
> framework SP1. All ASP.NET applications cannot run on this box. It all
> returned with the same error:
> Compilation Error
> Description: An error occurred during the compilation of a resource
> required to service this request. Please review the following specific
> error details and modify your source code appropriately.
> Compiler Error Message: The compiler failed with error code 128.
>
> I have made sure there is only ASP.NET ISAPI filter running and tried
> aspnet_iis -i. Basically I'm out of ideas. Can someone please tell me what
> the heck is going on here?
> Roger
>
I have the same error too.
I installed the SP1 of .NET Framework:
http://www.microsoft.com/downloads/...db-a83353618b38
and when I restarted my computer I could see my aspx pages, but then, when I
opened Visual Studio.NET and I continued with my ASP.NET application, when I
debug my app the error occurred again.
I don't know why, and I don't know if there's a good solution
I updated Windows but the problem continues.
I have Windows 2000 Sever with SP3.
I hope someone can help me.
Regards.
"Juan T. Llibre" wrote:
> Hi, Roger.
> I googled for "The compiler failed with error code 128"
> and found a few references. The most promising are :
> http://www.sitepoint.com/forums/pri...ad.php?t=164998
> where it's reported that either
> http://www.hanselman.com/blog/Perma...b
4.aspx
> or
> http://www.webservertalk.com/Uwe/Fo...ode-128
> solved the problem.
> Though both links refer to faulty ISAPI filter
> issues, which you say you've discarded, it might
> help you to get the background info at those links.
> There's an additional comment by Jacob Yang
> ( Microsoft Online Partner Support ) which refers
> that the issue might be related to this backdoor trojan:
> http://de.mcafee.com/root/genericVI...&virus_k=100252
> Here's the Google search,
> to facilitate your search for more info:
> http://www.google.com/search?as_q=&...ch=&safe=images
> Good luck !
>
> Juan T. Llibre
> ASP.NET MVP
> http://asp.net.do/foros/
> Foros de ASP.NET en Espa?ol
> =====================
> "Roger Wang" <rogerw@dotnet.itags.org.sybrel.com> wrote in message
> news:uXyaKb$CFHA.3376@dotnet.itags.org.TK2MSFTNGP12.phx.gbl...
>
>
Monday, March 26, 2012
The compiler failed with error code 128
We have got a W2k server running IIS5 with .NET framework 1.1 and .NET
framework SP1. All ASP.NET applications cannot run on this box. It all
returned with the same error:
Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.
Compiler Error Message: The compiler failed with error code 128.
I have made sure there is only ASP.NET ISAPI filter running and tried
aspnet_iis -i. Basically I'm out of ideas. Can someone please tell me what
the heck is going on here?
RogerHi, Roger.
I googled for "The compiler failed with error code 128"
and found a few references. The most promising are :
http://www.sitepoint.com/forums/pri...ad.php?t=164998
where it's reported that either
http://www.hanselman.com/blog/Perma...ad081eaab4.aspx
or
http://www.dotnetmonster.com/Uwe/Fo...-error-code-128
solved the problem.
Though both links refer to faulty ISAPI filter
issues, which you say you've discarded, it might
help you to get the background info at those links.
There's an additional comment by Jacob Yang
( Microsoft Online Partner Support ) which refers
that the issue might be related to this backdoor trojan:
http://de.mcafee.com/root/genericVI...&virus_k=100252
Here's the Google search,
to facilitate your search for more info:
http://www.google.com/search?as_q=&...ch=&safe=images
Good luck !
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
=====================
"Roger Wang" <rogerw@dotnet.itags.org.sybrel.com> wrote in message
news:uXyaKb$CFHA.3376@dotnet.itags.org.TK2MSFTNGP12.phx.gbl...
> HELP!!!!
> We have got a W2k server running IIS5 with .NET framework 1.1 and .NET
> framework SP1. All ASP.NET applications cannot run on this box. It all
> returned with the same error:
> Compilation Error
> Description: An error occurred during the compilation of a resource
> required to service this request. Please review the following specific
> error details and modify your source code appropriately.
> Compiler Error Message: The compiler failed with error code 128.
>
> I have made sure there is only ASP.NET ISAPI filter running and tried
> aspnet_iis -i. Basically I'm out of ideas. Can someone please tell me what
> the heck is going on here?
> Roger
I have the same error too.
I installed the SP1 of .NET Framework:
http://www.microsoft.com/downloads/...db-a83353618b38
and when I restarted my computer I could see my aspx pages, but then, when I
opened Visual Studio.NET and I continued with my ASP.NET application, when I
debug my app the error occurred again.
I don't know why, and I don't know if there's a good solution
I updated Windows but the problem continues.
I have Windows 2000 Sever with SP3.
I hope someone can help me.
Regards.
"Juan T. Llibre" wrote:
> Hi, Roger.
> I googled for "The compiler failed with error code 128"
> and found a few references. The most promising are :
> http://www.sitepoint.com/forums/pri...ad.php?t=164998
> where it's reported that either
> http://www.hanselman.com/blog/Perma...ad081eaab4.aspx
> or
> http://www.dotnetmonster.com/Uwe/Fo...-error-code-128
> solved the problem.
> Though both links refer to faulty ISAPI filter
> issues, which you say you've discarded, it might
> help you to get the background info at those links.
> There's an additional comment by Jacob Yang
> ( Microsoft Online Partner Support ) which refers
> that the issue might be related to this backdoor trojan:
> http://de.mcafee.com/root/genericVI...&virus_k=100252
> Here's the Google search,
> to facilitate your search for more info:
> http://www.google.com/search?as_q=&...ch=&safe=images
> Good luck !
>
> Juan T. Llibre
> ASP.NET MVP
> http://asp.net.do/foros/
> Foros de ASP.NET en Espa?ol
> =====================
> "Roger Wang" <rogerw@dotnet.itags.org.sybrel.com> wrote in message
> news:uXyaKb$CFHA.3376@dotnet.itags.org.TK2MSFTNGP12.phx.gbl...
> > HELP!!!!
> > We have got a W2k server running IIS5 with .NET framework 1.1 and .NET
> > framework SP1. All ASP.NET applications cannot run on this box. It all
> > returned with the same error:
> > Compilation Error
> > Description: An error occurred during the compilation of a resource
> > required to service this request. Please review the following specific
> > error details and modify your source code appropriately.
> > Compiler Error Message: The compiler failed with error code 128.
> > I have made sure there is only ASP.NET ISAPI filter running and tried
> > aspnet_iis -i. Basically I'm out of ideas. Can someone please tell me what
> > the heck is going on here?
> > Roger
>
The control that triggered the UpdatePanel controls to refresh
On my page, I have a custom control in which asp server controls can be
added and a UpdatePanel to notify the server of any edit in progress in the
custom control...I would like to know which server control triggered the
postback whitin my custom control. Currently, my customControl is declared a
s
follow:
<daf:UpdateInProgressPanel ID="UpdateInProgressPanel1"
runat="server" DisabledStateControlId="Button1"
OnUpdateOccured="UpdateInProgressPanel1_UpdateOccured">
and the following events will trigger a postback:
document.onchange = handleEvent;
interceptor.onclick = handleEvent;
interceptor.onkeypress = handleEvent;
interceptor.onkeydown = handleEvent;
interceptor.onpaste = handleEvent;
My problem is that after postback, I would like to set the focus on the
control which triggered the post back. So far, I have used the following:
string ctrlname = page.Request.Params.Get("__EVENTTARGET");
and
if
(((ScriptManager)this.Page.FindControl("ScriptManager1")).IsInAsyncPostBack)
fromWhere =
this.Page.Request[((ScriptManager)this.Page.FindControl("ScriptManager1")).I
D];
in order to get the control but i am always getting the custom control. I
want to associated postback events to the custom control only but would like
to know which control within it originated the postback...
Any help will be appreciated.
Thanks,
KikaOn Jan 17, 12:09 pm, Kika <K...@dotnet.itags.org.discussions.microsoft.com> wrote:
> Hi All,
> On my page, I have a custom control in which asp server controls can be
> added and a UpdatePanel to notify the server of any edit in progress in th
e
> custom control...I would like to know which server control triggered the
> postback whitin my custom control. Currently, my customControl is declared
as
> follow:
> <daf:UpdateInProgressPanel ID="UpdateInProgressPanel1"
> runat="server" DisabledStateControlId="Button1"
> OnUpdateOccured="UpdateInProgressPanel1_UpdateOccured">
> and the following events will trigger a postback:
> document.onchange = handleEvent;
> interceptor.onclick = handleEvent;
> interceptor.onkeypress = handleEvent;
> interceptor.onkeydown = handleEvent;
> interceptor.onpaste = handleEvent;
> My problem is that after postback, I would like to set the focus on the
> control which triggered the post back. So far, I have used the following:
> string ctrlname = page.Request.Params.Get("__EVENTTARGET");
> and
> if
> (((ScriptManager)this.Page.FindControl("ScriptManager1")).IsInAsyncPostBac
k)
> fromWhere =
> this.Page.Request[((ScriptManager)this.Page.FindControl("ScriptManager1"))
.ID];
> in order to get the control but i am always getting the custom control. I
> want to associated postback events to the custom control only but would li
ke
> to know which control within it originated the postback...
> Any help will be appreciated.
> Thanks,
> Kika
You should open up your custom control as open source so I can take a
gander. I've always wanted a control like what you have created. :)
in client script register a BeginRequestHandler and write the control id to
a
hidden field.
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(
function(sender, args)
{
$get('myHiddenCtl').value = args.get_postBackElement();
});
-- bruce (sqlwork.com)
"Kika" wrote:
> Hi All,
> On my page, I have a custom control in which asp server controls can be
> added and a UpdatePanel to notify the server of any edit in progress in th
e
> custom control...I would like to know which server control triggered the
> postback whitin my custom control. Currently, my customControl is declared
as
> follow:
> <daf:UpdateInProgressPanel ID="UpdateInProgressPanel1"
> runat="server" DisabledStateControlId="Button1"
> OnUpdateOccured="UpdateInProgressPanel1_UpdateOccured">
> and the following events will trigger a postback:
> document.onchange = handleEvent;
> interceptor.onclick = handleEvent;
> interceptor.onkeypress = handleEvent;
> interceptor.onkeydown = handleEvent;
> interceptor.onpaste = handleEvent;
> My problem is that after postback, I would like to set the focus on the
> control which triggered the post back. So far, I have used the following:
> string ctrlname = page.Request.Params.Get("__EVENTTARGET");
> and
> if
> (((ScriptManager)this.Page.FindControl("ScriptManager1")).IsInAsyncPostBac
k)
> fromWhere =
> this.Page.Request[((ScriptManager)this.Page.FindControl("ScriptManager1"))
.ID];
> in order to get the control but i am always getting the custom control. I
> want to associated postback events to the custom control only but would li
ke
> to know which control within it originated the postback...
> Any help will be appreciated.
> Thanks,
> Kika
The conversion of a char data type to a datetime data type resulted in an out-of-range dat
format into american date format
(asp to sql server 2000)
im getting the date using
mortsourcedlabel.Text = Date.Today
mortsourcedlabel.Visible = True
mortsourced.Visible = False
which throws the date out (in uk format) to 13/02/2004 - all well and good
but -
im assuming that its going out of range as sql needs 02/13/2004
heh im guessing ive been testing code the past 2 weeks -- and now its the
13th which has now thrown up the error!
how do i change the date format not in the code above (i still need to see
the date in english-UK format on the page) but before the sql statement
(maybe in my stored procedure?)
thanks
marknm i sussed it with :-
Dim msl As String = mortsourcedlabel.Text.ToString ' date
Dim day, month, year As String
If mortsourcedlabel.Text.ToString = "" Then
msl = "01/01/1900"
Else
Dim mydate As Date
mydate = mortsourcedlabel.Text.ToString
day = mydate.Day.ToString
month = mydate.Month.ToString
year = mydate.Year.ToString
msl = month + "/" + day + "/" + year
End If
cheers
mark
The conversion of a char data type to a datetime data type resulted....
I'm trying to insert a date time value into a SQL Server Database field of type date time using a c# web form.
I get the following error...
"The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. The statement has been terminated"
My SQL looks like this:
INSERT INTO tblname (fldname) VALUES ('" + DateTime.Now.ToString() + "')"
What am I doing wrong?Remove the ToString() method as that is changing the DateTime type to a string (or Char type) ...at least thats what it looks like.
Nope sorry to say that didn't work.
My C# now looks like
SqlConnection myConn = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["eTeam_ConnectionString"].ToString());
string mySQL = "INSERT INTO tblname (datestamp) VALUES ('" + DateTime.Now + "')";
SqlCommand myCMD = new SqlCommand(mySQL, myConn);
myConn.Open();
myCMD.ExecuteNonQuery();
myConn.Close();
myCMD.Dispose();
myConn.Dispose();
And the field 'datestamp' is a SQL Server Data Type datetime
Anyone else?
You can use getDate() method of SQL server to update date.
INSERT INTO tblname (datestamp) VALUES (getDate())";
Thanks for that - definately half way to solving my problem.
What if I need to take a value from an ASP:Calendar control?
Is there a ToDate() function that will convert it as required?
You can use
Calendar1.SelectedDate.ToShortDateString())
which will convert this date into short date format.
Saturday, March 24, 2012
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
Thursday, March 22, 2012
The file [filename] has not been pre-compiled, and cannot be requested.
I hvae develop a web site. and in this i have use ajax beta2 release it work fine on server but when i upgrade Asp.net Ajax 1.0 with january release. it work fine on my system but when i hvae compile the project and upload this on server then it give me the following error.
The file [filename] has not been pre-compiled, and cannot be requested.
how can i have solve this problem. help me
Hi, amritpal
You can turn this question into asp.net ajax forums for a try. Good luck!
The file exist but cant delete on server (c#)
Hi all, have an c# page that allows users to uploaded files to the server. I was hoping to also hoping to allow users to delete files aswell. I have the following code, but it dose no delete the file, even though it can find the file (the response.write outputs). Here is my code:
if(File.Exists(sPhysicalPath + @dotnet.itags.org."\" + sOrgFileName)){
Response.Write("delete");
File.Delete(sPhysicalPath + @dotnet.itags.org."" + sOrgFileName);
}
Any suggestions appreciated.
Thanks,
Hi,
by default, and for security reasons, ASP.NET doesn't have the privileges to perform IO actions like deleting a file. You can create a new windows user account that has the same privileges as the ASP.NET account and augment it with the needed privileges to delete certain files on the disk. After that you can impersonate your application with that new account by setting, in the web.config of your application, the<identity impersonate="true" userName="yournewaccount" />
Grz, Kris.
The first application gives server load error
I have not changed anything except for adding a header in the global.aspx file in between the form tags. also the application did'nt create the .vsdisco file. Heard vs2003 does'nt create one. Does it have to do anything with it. Help please!!!!!!!!!!!a header in global.aspx ?
global.aspx to my knowledge isnt used for anything other than writing
applicaiton onstart... on end... session on start and on end etc...
you just write methods for each in global file.
remove the header (cause i dont know y you are adding that header)
open the code file... gloabal.aspx.cs or vb
save the project... build it... and run it...
HTH
HD
"BSL" <anonymous@.discussions.microsoft.com> wrote in message
news:C4D05D3F-F9B6-44F2-B649-A78B81844844@.microsoft.com...
> I'm new to asp.net. Started following a book, I created a FirstApplication
and when i try to run it on the browser it gives me the server parse error
'firstapplication.global file not loaded'. Error line 1.
> I have not changed anything except for adding a header in the global.aspx
file in between the form tags. also the application did'nt create the
..vsdisco file. Heard vs2003 does'nt create one. Does it have to do anything
with it. Help please!!!!!!!!!!!