Saturday, March 31, 2012
The asp Tags dosn't appear
I'm using the ASP.net 2.0 Beta 1, and in the html section of my page the
asp tags dosn't appear, and i get a warning if i wrote them.
Any helpCan you provide the error?
-Brock
DevelopMentor
http://staff.develop.com/ballen
> Hi all,
> I'm using the ASP.net 2.0 Beta 1, and in the html section of my page
> the
> asp tags dosn't appear, and i get a warning if i wrote them.
> Any help
The error i get is : asp is unrecognized tag prefix or device filter
Thanks for your reply and time
"Brock Allen" wrote:
> Can you provide the error?
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>
> The error i get is : asp is unrecognized tag prefix or device filter
Hmm, this is very strange. I don't think I've ever come across this problem.
It makes me feel like somehow some core configuration setting in ASP.NET
is messed up. Can you create a new project in VS.NET and make it work there?
Also, are you using a master page? If you are, then the root element you
need is a <asp:Content> elemenet.
-Brock
DevelopMentor
http://staff.develop.com/ballen
Thanks for your reply, but the idea is i'm not using the master pages, becus
e
it is not working on my laptob, and the project is new one!!!!!!
"Brock Allen" wrote:
> Hmm, this is very strange. I don't think I've ever come across this proble
m.
> It makes me feel like somehow some core configuration setting in ASP.NET
> is messed up. Can you create a new project in VS.NET and make it work ther
e?
> Also, are you using a master page? If you are, then the root element you
> need is a <asp:Content> elemenet.
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
The asp Tags dosnt appear
I'm using the ASP.net 2.0 Beta 1, and in the html section of my page the
asp tags dosn't appear, and i get a warning if i wrote them.
Any helpCan you provide the error?
-Brock
DevelopMentor
http://staff.develop.com/ballen
> Hi all,
> I'm using the ASP.net 2.0 Beta 1, and in the html section of my page
> the
> asp tags dosn't appear, and i get a warning if i wrote them.
> Any help
The error i get is : asp is unrecognized tag prefix or device filter
Thanks for your reply and time
"Brock Allen" wrote:
> Can you provide the error?
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
> > Hi all,
> > I'm using the ASP.net 2.0 Beta 1, and in the html section of my page
> > the
> > asp tags dosn't appear, and i get a warning if i wrote them.
> > Any help
>
>
> The error i get is : asp is unrecognized tag prefix or device filter
Hmm, this is very strange. I don't think I've ever come across this problem.
It makes me feel like somehow some core configuration setting in ASP.NET
is messed up. Can you create a new project in VS.NET and make it work there?
Also, are you using a master page? If you are, then the root element you
need is a <asp:Content> elemenet.
-Brock
DevelopMentor
http://staff.develop.com/ballen
Thanks for your reply, but the idea is i'm not using the master pages, becuse
it is not working on my laptob, and the project is new one!!!!!!
"Brock Allen" wrote:
> > The error i get is : asp is unrecognized tag prefix or device filter
> Hmm, this is very strange. I don't think I've ever come across this problem.
> It makes me feel like somehow some core configuration setting in ASP.NET
> is messed up. Can you create a new project in VS.NET and make it work there?
> Also, are you using a master page? If you are, then the root element you
> need is a <asp:Content> elemenet.
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
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.
>
Wednesday, March 28, 2012
The best way to construct a page
Hi,
I'm looking for the best way to construct a web page. I have to create a ResourceManager for HMC 4.0.
First I have to list all my mailstore (Name, Mailstore, Free Space), each mailstore can be edited with a button, and I have a button to each mailstore that permit to list all the organizations.
When I Edit the mailstore, I need to have the name and the Mailstore. After I submit my new info, I have to list the mailstore.
If I click on organization I need to list the organizations on the same page. Each organization can be edited or the user can be listed like the organization.
The users can be edited too.
I think that I can do It with an DataGrid and an arrayList(the date isn't in a DB), I can list my mailstore but after that I can't do nothing. I can't get the mailstore name of the line of the button, I can't list the organizations.
I looked on google since 2days and I don't find anything that can help me to do that.
Thank you for your help
Eventhough you can use one grid to view/edit different datasources, it would be difficult if you want customization(appearance, validation etc). What I would suggest is having 3 grids (each one for mailstore, organization and user). Depending upon the user's choice you show the relevant grid and hide all the others.
snakpak:
I can't get the mailstore name of the line of the button, I can't list the organizations.
I couldn't understand the question. Please provide more info.
Where are you storing the data if not in a DB? I prefer to use Datalists to list anything. I make the name / description a link to view the details and include a LinkButton / HyperLink to Edit... Is this what you're looking for?
I used 3 datagrid, it works now! thanks your help
The best way to display a panel of ads?
Hey everyone,
I am developing an online store application. I got stuck in one thing, which is how to build an ad area in the home page. For example: if you go to amazon.com you will see in top or in the side an area with let say 20 different ads (Dell,Microsoft,cingular, Sears, TJMAX,etc …..)For different companies. Each ad will appear randomly every 5 seconds. What is the best and most efficient way to accomplish such thing? And would you please provide me with an example!. Also can I have flash ad integrated in my VS2005 application? I am using ASP.Net 2.0
Your input will be truly appreciated!
i am going out on a limb here, because i have yet to really experiment with this. so i cannot testify to its usefulness nor can i provide any examples, but this may be what you are looking for. throw this link into your browser and check it out:
ms-help://MS.VSExpressCC.v80/MS.NETFramework.v20.en/dv_vwdcon/html/a307f03e-6bbd-4ec3-96ef-5b7188ba5eb9.htm
but, i came across this one day and marked it in my fav's to get back to once i am finished with the project i am currently on. hope it helps, and if it does, let me know.
thanks and good luck
http://aspnet.4guysfromrolla.com/articles/033104-1.aspx
Hope above will be helpful.
Google out about the ASP.NET 2.0 AdRotator control. Its XML based & easy to implement & handle.
I guess using Ad Rotator will be the best option.
However, you will get a new ad on after the page gets refreshed. Basically it will get ad from either an XML file (if u wish to have static list and can edit it manually) else ads can come from DB. You can have a small screen to add Ads.
Popo
Pls check outwww.constructionkerala.com......
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
publicpartialclassMasterPage : System.Web.UI.MasterPage
{
protectedvoid Page_Load(object sender,EventArgs e)
{
GridView1.PageSize =Utilities.ToInt(ConfigurationManager.AppSettings["subListCount"]);
if (Request.QueryString["td"] !=null && Request.QueryString["td"].Trim() !="")
hidSelectedTd.Value ="td_" + Request.QueryString["td"];
int subCategory=Request.QueryString["sub"]==null || Request.QueryString["sub"]=="" ? 0:Utilities.ToInt(Request.QueryString["sub"]);
System.Collections.Generic.List<Advertisement> advList =Advertisement.SelectAll(subCategory,Location.Top.ToString());
if (advList.Count > 0)
litImage.Text =Advertisement.BindAdds(advList[0].Image, advList[0].Width.ToString(), advList[0].Height.ToString());
}
protectedvoid GridView1_DataBound(object sender,EventArgs e)
{
Session["sub"] = GridView1.DataKeys[0][0];
}
protectedvoid lnkSearch_Click(object sender,EventArgs e)
{
if (txtSearch.Text !="")
Response.Redirect("SearchResult1.aspx?cont="+txtSearch.Text +"&type=" + cmbSearch.Text);
}
}
=======================
<%@dotnet.itags.org.MasterLanguage="C#"AutoEventWireup="true"CodeFile="MasterPage.master.cs"Inherits="MasterPage" %>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title>.:Master:.</title>
<script>
var subCat=0;
function onSubMouseOver(e){
document.getElementById(e.id).style.background="url(images/subOver.jpg)";
document.getElementById(e.id).style.backgroundRepeat="no-repeat"
document.getElementById("divToolTip").style.visibility="visible";
document.getElementById("divToolTip").innerHTML=document.getElementById(e.id).innerHTML;
document.getElementById("divToolTip").style.left=event.x+10;
document.getElementById("divToolTip").style.top=event.y+5;
}
function onSubMouseOut(e){
document.getElementById(e.id).style.background="url(images/subNormal.jpg)";
document.getElementById(e.id).style.backgroundRepeat="no-repeat"
document.getElementById("divToolTip").style.visibility="hidden";
}
function window_onload() {
document.getElementById("divToolTip").style.visibility="hidden";
document.getElementById("divImages").style.visibility="hidden";
}
function onSubCategory(url){
aspnetForm.action=url;
aspnetForm.submit();
}
</script>
<script>
var img="";
var imgLeft="";
var imgRight="";
var tdLeft;
var tdRight;
function link_onMouse(link){
selTdId=document.getElementById("<%=hidSelectedTd.ClientID%>").value;
selTd=document.getElementById(selTdId);
if(link.id==selTdId)
return;
tdLeft=document.getElementById("td_" + (parseInt(link.id.split("_")[1])-1).toString());
tdRight=document.getElementById("td_" + (parseInt(link.id.split("_")[1])+1).toString());
//Store current Styles
img=link.style.backgroundImage;
imgLeft=tdLeft.style.backgroundImage;
imgRight=tdRight.style.backgroundImage;
//set New Style
//Current
link.style.backgroundImage="url(linkImages/link_Over.jpg)";
//Left
if(link.id=="td_10")//Search
tdLeft.style.backgroundImage="url(linkImages/search_Over_L.jpg)";
elseif(link.id=="td_12" && selTdId=="td_10")//Login
tdLeft.style.backgroundImage="url(linkImages/search_Sel_login_Over.jpg)";
elseif(link.id=="td_12")//Login
tdLeft.style.backgroundImage="url(linkImages/login_Over_L.jpg)";
elseif(link.id=="td_14" && selTdId!="td_12")//Feedback
tdLeft.style.backgroundImage="url(linkImages/feedback_Over_L.jpg)";
elseif("td_" + (parseInt(tdLeft.id.split("_")[1])-1).toString()==document.getElementById("<%=hidSelectedTd.ClientID%>").value)
tdLeft.style.backgroundImage="url(linkImages/linkOver_L_Sel_R.jpg)";
else
tdLeft.style.backgroundImage="url(linkImages/linkOver_L.jpg)";
//Right
if(link.id=="td_10" && selTdId!="td_12")//Search
tdRight.style.backgroundImage="url(linkImages/search_Over_R.jpg)";
elseif(link.id=="td_10" && selTdId=="td_12")
tdRight.style.backgroundImage="url(linkImages/search_Over_login_Sel.jpg)";
elseif(link.id=="td_12" && selTdId!="td_14")//Login
tdRight.style.backgroundImage="url(linkImages/login_Over_R.jpg)";
elseif(link.id=="td_12" && selTdId!="td_14")
tdRight.style.backgroundImage="url(linkImages/login_Over_fdbk_Sel.jpg)";
elseif(link.id=="td_7")
tdRight.style.backgroundImage="url(linkImages/link_firstEnd_R_Over.jpg)";
elseif(link.cellIndex+2==selTd.cellIndex)
tdRight.style.backgroundImage="url(linkImages/linkOver_R_Sel_R.jpg)";
else
tdRight.style.backgroundImage="url(linkImages/linkOver_R.jpg)";
}
function link_onMouseOut(link){
selTdId=document.getElementById("<%=hidSelectedTd.ClientID%>").value;
if(link.id==selTdId)
return;
link.style.backgroundImage=img;
tdLeft.style.backgroundImage=imgLeft;
tdRight.style.backgroundImage=imgRight;
}
function Search(){
// var val=document.getElementById("<%=txtSearch.ClientID%>").value;
// //val = val.replace(/^\s*/,"");
// //val = val.replace(/\s*$/,"");
// while(val.indexOf("'")>-1)
// val = val.replace("'","");
// if(val != ""){
// var field=document.getElementById("<%=cmbSearch.ClientID%>").value;
// // var sub=<%=Request.QueryString["sub"]==null || Request.QueryString["sub"]=="" ? "0" : Request.QueryString["sub"] %>
//aspnetForm.action="SearchResults.aspx?td=10&field=" + field + "&val=" + val + "&sub=" + sub ;
aspnetForm.action="sa.aspx";
aspnetForm.submit();
//}
}
</script>
<linkhref="StyleSheet2.css"rel="stylesheet"type="text/css"/>
<metaname="keywords"content="Construction Kerala, Construction, About Construction,About Construction Kerala, Intellectual Publications , All Kerala Building Materials And Construction Dictionary, Building Materials And Construction Dictionary"/>
<metaname="Description"content="We are confident that continued cooperaton of our customers, we shall bring out exhaustive and timely editions of ABCD year after year."/>
</head>
<bodyleftmargin="0"topmargin="0"rightmargin="0"bottommargin="0"language="javascript"onload="return window_onload()">
<formid="form1"runat="server">
<div>
<tablealign="center"bgcolor="#ffffff"border="0"cellpadding="0"cellspacing="0"
style="width: 760px; height: 420px">
<tr>
<tdcolspan="3"height="72">
<tableborder="0"cellpadding="0"cellspacing="0"style="width: 100%; height: 72px">
<tr>
<tdwidth="240">
<imgsrc="images/banner_01.jpg"/></td>
<tdbgcolor="#ffd078"width="100%"align="center">
<asp:LiteralID="litImage"Text=""runat="server"></asp:Literal>
</td>
<tdwidth="284">
<imgsrc="images/banner_03.jpg"/></td>
</tr>
</table>
</td>
</tr>
<tr>
<tdcolspan="3"height="5">
</td>
</tr>
<tr>
<tdcolspan="2"height="18"style="padding-left: 4px">
<tableborder="0"cellpadding="0"cellspacing="0"width="100%">
<trheight="18">
<tdid="td_1"style="background-image: url(linkImages/linkhome_L.jpg); width: 3px;background-repeat: repeat-x">
<ahref="Default.aspx">
<imgalt="Home"border="0"src="linkImages/home.jpg"style="text-decoration: underline"/></a>
</td>
<tdid="td_2"class="linkNormalRight"style="color: #000000">
</td>
<tdid="td_3"align="center"class="linkNormal"onmouseout="link_onMouseOut(this)"
onmouseover="link_onMouse(this)"style="color: #000000">
<ahref="CompanyList.aspx?cat=1&td=3"title="Services">Products</a>
</td>
<tdid="td_4"class="linkNormalRight">
</td>
<tdid="td_5"align="center"class="linkNormal"onmouseout="link_onMouseOut(this)"
onmouseover="link_onMouse(this)">
<ahref="CompanyList.aspx?cat=2&td=5"title="Products">Services</a>
</td>
<tdid="td_6"class="linkNormalRight">
</td>
<tdid="td_7"align="center"class="linkNormal"onmouseout="link_onMouseOut(this)"
onmouseover="link_onMouse(this)">
<ahref="Aboutus.aspx?td=7"title="About Us">About Us</a>
</td>
<tdid="td_8"class="linkFirstEndNormal">
</td>
<!-- Search -->
<tdbgcolor="#d0d0d0"style="background-image: url(linkImages/search_Left.jpg); background-repeat: no-repeat;height: 18px"align="center">
<asp:TextBoxID="txtSearch"runat="server"CssClass="search"Height="15px"Width="50%"></asp:TextBox>
in
<asp:DropDownListID="cmbSearch"runat="server"CssClass="cmb"Height="15px"Width="30%">
<asp:ListItemValue="Title">Name</asp:ListItem>
<asp:ListItem>Place</asp:ListItem>
<asp:ListItem>District</asp:ListItem>
</asp:DropDownList>
</td>
<tdid="td_9"style="background-image: url(linkImages/search_L.jpg); width: 4px;background-repeat: no-repeat">
</td>
<tdid="td_10"align="center"class="linkNormal"onmouseout="link_onMouseOut(this)"
onmouseover="link_onMouse(this)">
<asp:LinkButtonID="lnkSearch"runat="server"ForeColor="black"OnClick="lnkSearch_Click"CausesValidation="False">Search</asp:LinkButton>
</td>
<tdid="td_11"style="font-size: 8pt; background-image: url(linkImages/search_R.jpg);width: 22px; background-repeat: repeat-x">
</td>
<!-- Last Links -->
<tdid="td_12"align="center"class="linkNormal"onmouseout="link_onMouseOut(this)"
onmouseover="link_onMouse(this)"style="font-size: 8pt">
<ahref="UserLogin.aspx?td=12"title="Login">Login</a>
</td>
<tdid="td_13"style="background-image: url(linkImages/login_R.jpg); width: 16px;background-repeat: no-repeat">
</td>
<tdid="td_14"align="center"class="linkNormal"onmouseout="link_onMouseOut(this)"
onmouseover="link_onMouse(this)">
<ahref="feedback.aspx?td=14&sub=<%=Request.QueryString["sub"]%>"title="Feedback">Feedback</a>
</td>
<tdid="td_15"style="background-image: url(linkImages/feedback_R.jpg); width: 3px;background-repeat: no-repeat">
</td>
</tr>
</table>
</td>
<tdbgcolor="#f5f2f2"rowspan="2"width="144"valign="top"align="center">
<asp:DataListID="dlstAdds"runat="server"DataSourceID="odsAdds">
<ItemTemplate>
<%#Advertisement.BindAdds((string)Eval("Image"),Eval("Width").ToString(),Eval("Height").ToString())%>
</ItemTemplate>
</asp:DataList><asp:ObjectDataSourceID="odsAdds"runat="server"SelectMethod="SelectAll"
TypeName="Advertisement">
<SelectParameters>
<asp:QueryStringParameterName="subDirectoryID"QueryStringField="sub"Type="Int32"/>
<asp:ParameterDefaultValue="R"Name="location"Type="String"/>
</SelectParameters>
</asp:ObjectDataSource>
</td>
</tr>
<tr>
<tdstyle="background-image: url(images/subBack.jpg); background-repeat: repeat-y"
valign="top"width="144">
<asp:GridViewID="GridView1"DataKeyNames="ID"runat="server"AllowPaging="True"
AutoGenerateColumns="False"CellPadding="0"DataSourceID="odsSubcategory"GridLines="None"
PageSize="3"ShowFooter="True"ShowHeader="False"Width="144px"OnDataBound="GridView1_DataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<ahref="javascript:onSubCategory('CompanyList.aspx?sub=<%#Eval("ID")%><%=Request.QueryString["cat"]!=null && Request.QueryString["cat"]!=""?"&cat="+Request.QueryString["cat"]:"" %>&td=<%=Request.QueryString["td"] %>')">
<divid='divItem<%#Eval("ID") %>'class="divItemNormal"onmouseout="onSubMouseOut(this)"
onmouseover="onSubMouseOver(this)">
<%#Eval("Name") %>
</div>
</a>
<script>
if(subCat==0)
subCat=<%#Eval("ID") %>;
</script>
</ItemTemplate>
<FooterTemplate>
<%if (Request.QueryString["sub"] ==null && Request.QueryString.Count>0)
{%>
<script>
try{
document.getElementById("divItem<%=GridView1.DataKeys[0][0]%>").className="divItemSelected";
document.getElementById("divItem<%=GridView1.DataKeys[0][0]%>").onmouseover="";
document.getElementById("divItem<%=GridView1.DataKeys[0][0]%>").onmouseout="";
}
catch(e){}
</script>
<%}
else
{ %>
<script>
try{
document.getElementById("divItem<%=Request.QueryString["sub"]%>").className="divItemSelected";
document.getElementById("divItem<%=Request.QueryString["sub"]%>").onmouseover="";
document.getElementById("divItem<%=Request.QueryString["sub"]%>").onmouseout="";
}
catch(e){}
</script>
<%} %>
</FooterTemplate>
</asp:TemplateField>
</Columns>
<PagerStyleCssClass="subFooter"HorizontalAlign="Right"/>
<PagerSettingsFirstPageImageUrl="~/images/btnFirst.jpg"LastPageImageUrl="~/images/btnLast.jpg"
Mode="NextPreviousFirstLast"NextPageImageUrl="~/images/btnNext.jpg"PreviousPageImageUrl="~/images/btnPrev.jpg"/>
</asp:GridView>
</td>
<tdstyle="padding-right: 5px; padding-left: 5px; padding-bottom: 3px; padding-top: 5px"
valign="top"width="472"height="225">
<asp:ContentPlaceHolderID="ContentPlaceHolder1"runat="server">
</asp:ContentPlaceHolder>
</td>
</tr>
<tr>
<tdcolspan="3"height="25"style="padding-left: 5px; background-color: #ffcc66">
<spanstyle="font-family: Times New Roman">?</span>
2007 constructionkerala.com.
All rights reserved. <br/>
<spanstyle="font-size: 8pt">Site Designed and maintained by<ahref="http://www.infoprismsolutions.com"
style="color: #ffffff"target="_blank">infoprismsolutions.com</a></span>
</td>
</tr>
</table>
</div>
<asp:ObjectDataSourceID="odsSubcategory"runat="server"SelectMethod="SelectAll"
TypeName="SubCategory">
<SelectParameters>
<asp:QueryStringParameterDefaultValue="1"Name="categoryID"QueryStringField="cat"
Type="Int32"/>
</SelectParameters>
</asp:ObjectDataSource>
<asp:HiddenFieldID="hidSelectedTd"runat="server"Value="td_3"/>
<br/>
<divid="divToolTip"style="left: 5px; top: 507px">
</div>
<divid="divImages"style="visibility:hidden;">
<imgsrc="images/subOver.jpg"/><imgsrc="linkImages/feedback_Over_L.jpg"/>
<imgsrc="linkImages/feedback_R.jpg"/>
<imgsrc="linkImages/feedback_Sel_L.jpg"/>
<imgsrc="linkImages/feedback_Sel_R.jpg"/>
<imgsrc="linkImages/link.jpg"/>
<imgsrc="linkImages/link_firstEnd_R.jpg"/>
<imgsrc="linkImages/link_firstEnd_R_Over.jpg"/>
<imgsrc="linkImages/link_firstEnd_R_Sel.jpg"/>
<imgsrc="linkImages/link_L.jpg"/>
<imgsrc="linkImages/link_Over.jpg"/>
<imgsrc="linkImages/link_R.jpg"/>
<imgsrc="linkImages/link_Sel.jpg"/>
<imgsrc="linkImages/linkhome_L.jpg"/>
<imgsrc="linkImages/linkOver_L.jpg"/>
<imgsrc="linkImages/linkOver_L_Sel_R.jpg"/>
<imgsrc="linkImages/linkOver_R.jpg"/>
<imgsrc="linkImages/linkOver_R_Sel_R.jpg"/>
<imgsrc="linkImages/linkSelected_L.jpg"/>
<imgsrc="linkImages/linkSelected_R.jpg"/>
<imgsrc="linkImages/login_Over_fdbk_Sel.jpg"/>
<imgsrc="linkImages/login_Over_L.jpg"/>
<imgsrc="linkImages/login_Over_R.jpg"/>
<imgsrc="linkImages/login_R.jpg"/>
<imgsrc="linkImages/login_Sel_L.jpg"/>
<imgsrc="linkImages/login_Sel_R.jpg"/>
<imgsrc="linkImages/search_L.jpg"/>
<imgsrc="linkImages/search_Left.jpg"/>
<imgsrc="linkImages/search_Over_L.jpg"/>
<imgsrc="linkImages/search_Over_login_Sel.jpg"/>
<imgsrc="linkImages/search_Over_R.jpg"/>
<imgsrc="linkImages/search_R.jpg"/>
<imgsrc="linkImages/search_Sel_L.jpg"/>
<imgsrc="linkImages/search_Sel_login_Over.jpg"/>
<imgsrc="linkImages/search_Sel_R.jpg"/></div>
<script>
//Set Default State
selTdId=document.getElementById("<%=hidSelectedTd.ClientID%>").value;
selTd=document.getElementById(selTdId);
selTd.className="linkSelected";
//left
if(selTdId=="td_10")//search
document.getElementById("td_9").style.backgroundImage="url(linkImages/search_Sel_L.jpg)";
elseif(selTdId=="td_12")//Login
document.getElementById("td_11").style.backgroundImage="url(linkImages/login_Sel_L.jpg)";
elseif(selTdId=="td_14")//Feedback
document.getElementById("td_13").style.backgroundImage="url(linkImages/feedback_Sel_L.jpg)";
else
document.getElementById("td_" + selTd.cellIndex.toString()).className="linkSelectedLeft";
//right
if(selTdId=="td_10")//search
document.getElementById("td_11").style.backgroundImage="url(linkImages/search_Sel_R.jpg)";
elseif(selTdId=="td_12")//Login
document.getElementById("td_13").style.backgroundImage="url(linkImages/linkSelected_R.jpg)";
elseif(selTdId=="td_14")//Feedback
document.getElementById("td_15").style.backgroundImage="url(linkImages/feedback_Sel_R.jpg)";
elseif(selTdId!="td_7")
document.getElementById("td_" + (selTd.cellIndex+2).toString()).className="linkSelectedRight";
else
document.getElementById("td_" + (selTd.cellIndex+2).toString()).className="linkFirstEndSelected";
</script>
</form></body>
</html>
====================================================================================================================
In Administrrative mode--
<%@dotnet.itags.org.PageLanguage="C#"AutoEventWireup="true"CodeFile="AddSettings.aspx.cs"Inherits="AddSettings" %>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title>AddSettings</title></head>
<bodytopmargin="0"leftmargin="0">
<formid="form1"runat="server">
<table>
<tr>
<tdstyle="width: 100px">
<tablewidth="100%">
<tr>
<tdstyle="width: 100px">
<imgsrc="images/banner_01.jpg"/></td>
<tdbgcolor="#ffd078"style="width: 6467%">
</td>
<tdstyle="width: 100px">
<imgsrc="images/banner_03.jpg"/></td>
</tr>
</table>
</td>
</tr>
<tr>
<tdstyle="width: 100px">
<table>
<tr>
<tdstyle="width: 100px"valign="top">
<tablewidth="100%">
<tr>
<tdid="controlPanel"align="center">
Control Panel</td>
</tr>
<tr>
<tdstyle="height: 157px">
<asp:MenuID="menu"runat="server"BackColor="#F7F6F3"CssClass="menu"DynamicHorizontalOffset="2"
EnableTheming="false"Font-Bold="True"Font-Names="Verdana"Font-Size="8pt"ForeColor="#7C6F57"
StaticSubMenuIndent="10px"Width="100%">
<StaticMenuItemStyleHorizontalPadding="5px"VerticalPadding="2px"/>
<DynamicHoverStyleBackColor="#7C6F57"ForeColor="White"/>
<DynamicMenuStyleBackColor="#F7F6F3"/>
<StaticSelectedStyleBackColor="#5D7B9D"/>
<DynamicSelectedStyleBackColor="#5D7B9D"/>
<DynamicMenuItemStyleHorizontalPadding="5px"VerticalPadding="2px"/>
<Items>
<asp:MenuItemNavigateUrl="Admin.aspx"Text="Home"Value="Home"></asp:MenuItem>
<asp:MenuItemNavigateUrl="Login1.aspx"Text="Login"Value="Login"></asp:MenuItem>
<asp:MenuItemNavigateUrl="SubcategoryTest.aspx"Text="Subcategory"Value="Subcategory">
</asp:MenuItem>
<asp:MenuItemNavigateUrl="CompanyList1.aspx"Text="Company"Value="Company">
</asp:MenuItem>
<asp:MenuItemNavigateUrl="FeedbackList.aspx"Text="Feedback"Value="Feedback">
</asp:MenuItem>
<asp:MenuItemNavigateUrl="Login1.aspx"Text="Chat"Value="Chat"></asp:MenuItem>
<asp:MenuItemNavigateUrl="AddSettings.aspx"Text="Advertisements"Value="Advertisements">
</asp:MenuItem>
<asp:MenuItemNavigateUrl="Password.aspx"Text="Security"Value="Security"></asp:MenuItem>
<asp:MenuItemNavigateUrl="Settings.aspx"Text="Settings"Value="Settings"></asp:MenuItem>
</Items>
<StaticHoverStyleBackColor="#7C6F57"ForeColor="White"/>
</asp:Menu>
</td>
</tr>
</table>
</td>
<tdstyle="width: 100px">
<tablewidth="100%">
<tr>
<td>
<asp:RadioButtonListID="rdPage"runat="server"RepeatColumns="2"AutoPostBack="True"
OnSelectedIndexChanged="rdPage_SelectedIndexChanged">
<asp:ListItemSelected="True">Home</asp:ListItem>
<asp:ListItem>General</asp:ListItem>
</asp:RadioButtonList>
</td>
<td>
<asp:DropDownListID="cmbSubcategory"runat="server"DataSourceID="odsSubcategory"
DataTextField="Name"DataValueField="ID"AutoPostBack="True"Visible="False"
OnSelectedIndexChanged="cmbSubcategory_SelectedIndexChanged">
</asp:DropDownList><asp:ObjectDataSourceID="odsSubcategory"runat="server"SelectMethod="SelectAll"
TypeName="SubCategory"></asp:ObjectDataSource>
</td>
</tr>
<tr>
<td>
Location :
</td>
<td>
<asp:DropDownListID="cmbLocation"runat="server"DataSourceID="odsLocation"DataTextField="Name"
DataValueField="Value"CssClass="cmb">
</asp:DropDownList><asp:ObjectDataSourceID="odsLocation"runat="server"SelectMethod="BindLocation"
TypeName="Advertisement"></asp:ObjectDataSource>
</td>
</tr>
<tr>
<td>
Image :
</td>
<td>
<asp:FileUploadID="fileImage"runat="server"/></td>
</tr>
<tr>
<td>
Width :
</td>
<td>
<asp:TextBoxID="txtWidth"runat="server"MaxLength="4"Width="56px"></asp:TextBox></td>
</tr>
<tr>
<td>
Height :
</td>
<td>
<asp:TextBoxID="txtHeight"runat="server"MaxLength="4"Width="56px"></asp:TextBox></td>
</tr>
<tr>
<td>
Link :
</td>
<td>
<asp:TextBoxID="txtLink"runat="server"MaxLength="100"></asp:TextBox></td>
</tr>
<tr>
<td>
Order :
</td>
<td>
<asp:TextBoxID="txtOrder"runat="server"MaxLength="2"Width="56px"></asp:TextBox></td>
</tr>
<tr>
<td>
</td>
<td>
<asp:ButtonID="btnAdd"runat="server"Text="Add"Width="59px"OnClick="btnAdd_Click"/></td>
</tr>
<tr>
<tdcolspan="2">
<asp:GridViewID="gvAdds"runat="server"AllowPaging="True"AutoGenerateColumns="False"
BackColor="White"BorderColor="#999999"BorderStyle="None"BorderWidth="1px"
CellPadding="3"GridLines="Vertical"DataSourceID="odsAdds"DataKeyNames="ID"OnRowUpdating="gvAdds_RowUpdating"OnRowDataBound="gvAdds_RowDataBound"OnRowEditing="gvAdds_RowEditing">
<Columns>
<asp:TemplateFieldHeaderText="Image"SortExpression="Image">
<EditItemTemplate>
<%#Advertisement.BindAdds((string)Eval("Image"),Eval("Width").ToString(),Eval("Height").ToString())%>
</EditItemTemplate>
<ItemTemplate>
<%#Advertisement.BindAdds((string)Eval("Image"),Eval("Width").ToString(),Eval("Height").ToString())%>
</ItemTemplate>
<ItemStyleWidth="100px"/>
</asp:TemplateField>
<asp:BoundFieldDataField="Width"HeaderText="Width"/>
<asp:BoundFieldDataField="Height"HeaderText="Height"/>
<asp:TemplateFieldHeaderText="Location"SortExpression="Location">
<EditItemTemplate>
<asp:DropDownListID="gvcmbLocation"runat="server"DataSourceID="odsLocation"DataTextField="Name"
DataValueField="Value"CssClass="cmb">
</asp:DropDownList>
</EditItemTemplate>
<ItemStyleWidth="75px"/>
<ItemTemplate>
<asp:LabelID="Label1"runat="server"Text='<%# Bind("Location") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundFieldDataField="Link"HeaderText="Link"SortExpression="Link">
<ItemStyleWidth="150px"/>
</asp:BoundField>
<asp:BoundFieldDataField="Order"HeaderText="Order"SortExpression="Order">
<ItemStyleWidth="25px"/>
</asp:BoundField>
<asp:TemplateFieldShowHeader="False">
<ItemTemplate>
<asp:LinkButtonID="LinkButton1"runat="server"CausesValidation="False"CommandName="Edit"
Text="Edit"></asp:LinkButton>
<asp:LinkButtonID="lnkDelete"runat="server"CausesValidation="False"CommandName="Delete"
Text="Delete"></asp:LinkButton>
</ItemTemplate>
<ItemStyleWidth="75px"/>
<EditItemTemplate>
<asp:LinkButtonID="lnkUpdate"runat="server"CausesValidation="False"CommandName="Update"
Text="Update"></asp:LinkButton>
<asp:LinkButtonID="LinkButton2"runat="server"CausesValidation="False"CommandName="Cancel"
Text="Cancel"></asp:LinkButton>
</EditItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyleBackColor="#CCCCCC"ForeColor="Black"/>
<RowStyleBackColor="#EEEEEE"ForeColor="Black"/>
<SelectedRowStyleBackColor="#008A8C"Font-Bold="True"ForeColor="White"/>
<PagerStyleBackColor="#999999"ForeColor="Black"HorizontalAlign="Center"/>
<HeaderStyleBackColor="#000084"Font-Bold="True"ForeColor="White"/>
<AlternatingRowStyleBackColor="Gainsboro"/>
</asp:GridView>
<asp:ObjectDataSourceID="odsAdds"runat="server"OnSelecting="odsAdds_Selecting"
SelectMethod="SelectAll"TypeName="Advertisement"DataObjectTypeName="Advertisement"
DeleteMethod="Delete"UpdateMethod="Update"OnUpdating="odsAdds_Updating">
<SelectParameters>
<asp:ControlParameterControlID="cmbSubcategory"DefaultValue="0"Name="subDirectoryID"
PropertyName="SelectedValue"Type="Int32"/>
</SelectParameters>
</asp:ObjectDataSource>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<tdstyle="width: 100px">
2007 Info Prism Solutions . All rights reserved. <br/>
<spanstyle="font-size: 8pt"> Centre Point, M G Road, Thrissur - 4 0487
- 2387546, 6543322 visit us -<ahref="http://www.infoprismsolution.com"target="_blank">
infoprismsolution.com</a> </span></td>
</tr>
</table>
</form></body>
</html>
=================================================================
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
publicpartialclassAddSettings : System.Web.UI.Page
{
#region Fields
Advertisement add =null;
Location loc;
publicstring selLoc;
#endregion
#region Methods
privatevoid UploadFile(string id)
{
string ext = System.IO.Path.GetExtension(fileImage.PostedFile.FileName);
string path = Server.MapPath("Adds") +"\\" +"Add_" + id + ext;
fileImage.PostedFile.SaveAs(path);
}
publicstring GetSize(string file)
{
string size ="";
System.Drawing.Image img =new System.Drawing.Bitmap(Server.MapPath("Directoryweb")+"\\Adds\\" + file);
size ="Width=" + (img.Width > 100 ? 100 : img.Width).ToString();
size +="Height=" + (img.Height > 100 ? 100 : img.Height).ToString();
return size;
}
#endregion
#region Event Handlers
protectedvoid Page_Load(object sender,EventArgs e)
{
//Client.CheckAuthorisation(Roles.Admin);
}
protectedvoid btnAdd_Click(object sender,EventArgs e)
{
if (btnAdd.Text =="Add")
{
add =newAdvertisement();
add.Image = System.IO.Path.GetExtension(fileImage.PostedFile.FileName);
add.Width =Utilities.ToInt(txtWidth.Text.Trim());
add.Height =Utilities.ToInt(txtHeight.Text.Trim());
add.Link = txtLink.Text;
add.Location = (Location)cmbLocation.SelectedValue[0];
add.Order =Utilities.ToInt(txtOrder.Text);
//==== add.Subcategory = rdPage.SelectedValue == "Home" ? null : SubCategory.Select(Utilities.ToInt(cmbSubcategory.SelectedValue));
Advertisement.Insert(add);
UploadFile(add.ID.ToString());
}
gvAdds.DataBind();
}
protectedvoid rdPage_SelectedIndexChanged(object sender,EventArgs e)
{
if (rdPage.SelectedValue =="General")
cmbSubcategory.Visible =true;
else
cmbSubcategory.Visible =false;
gvAdds.DataBind();
}
protectedvoid cmbSubcategory_SelectedIndexChanged(object sender,EventArgs e)
{
gvAdds.DataBind();
}
protectedvoid gvAdds_RowUpdating(object sender,GridViewUpdateEventArgs e)
{
//save Location for update
loc = (Location)((DropDownList)gvAdds.Rows[e.RowIndex].FindControl("gvcmbLocation")).SelectedValue[0];
}
protectedvoid odsAdds_Selecting(object sender,ObjectDataSourceSelectingEventArgs e)
{
if (rdPage.SelectedValue =="Home")
e.InputParameters["subDirectoryID"] ="0";
else
{
string selValue = cmbSubcategory.SelectedValue ==null ?"" : cmbSubcategory.SelectedValue;
cmbSubcategory.DataBind();
if (selValue !="")
cmbSubcategory.SelectedValue = selValue;
e.InputParameters["subDirectoryID"] = cmbSubcategory.SelectedValue;
}
}
protectedvoid odsAdds_Updating(object sender,ObjectDataSourceMethodEventArgs e)
{
((Advertisement)e.InputParameters[0]).Location = loc;
}
protectedvoid gvAdds_RowDataBound(object sender,GridViewRowEventArgs e)
{
DropDownList cmbEditLocation;
if (gvAdds.EditIndex == e.Row.RowIndex && e.Row.RowIndex != -1)
{
cmbEditLocation = (DropDownList)e.Row.FindControl("gvcmbLocation");
if (cmbEditLocation !=null && cmbEditLocation.Items.Count > 0)
cmbEditLocation.SelectedValue = selLoc[0].ToString();
}
}
protectedvoid gvAdds_RowEditing(object sender,GridViewEditEventArgs e)
{
selLoc = ((System.Web.UI.WebControls.Label)gvAdds.Rows[e.NewEditIndex].Cells[3].Controls[1]).Text;
}
#endregion
}
Thank you guys very much. I am going to start working on it tonight! I will update you with what happen :)
I appreciate your input
The best way to update a site?
I currently have a site online. I added more features to my datagrid page,
so users can update and stuff. I though I could just copy the aspx, aspx.vb
and the server page including the web config, and paste then on the server.
At c:\intepub\wwwroot\website.
But now I get a runtime error when I go to that page. What is the best way
to update a site after maiking modifications on the developer machine?
TIA
Rudy"Rudy" <Rudy@dotnet.itags.org.discussions.microsoft.com> wrote in message
news:9FB474C1-0B6A-4216-BCD8-5248826FC1EE@dotnet.itags.org.microsoft.com...
> I currently have a site online. I added more features to my datagrid
> page,
> so users can update and stuff. I though I could just copy the aspx,
> aspx.vb
> and the server page including the web config, and paste then on the
> server.
> At c:\intepub\wwwroot\website.
> But now I get a runtime error when I go to that page. What is the best
> way
> to update a site after maiking modifications on the developer machine?
1) What exactly do you mean by "the server page"?
2) Why are you trying to copy the .vb files?
3) Are you using Visual Studio.NET?
Typically, you do not have to move the files containing source code to the
web server (eg .cs, .vb, etc.), you only need to move the content files
(.aspx, .htm, .css, .config, etc.).
When you make updates to the code, you need to rebuild the project and then
copy the content files and the new dll over to the webserver. When you buil
d
the project, your "code files" are compiled into the dll
(yourapp/bin/youapp.dll).
Hope this helps. You may also try google to get a better understanding of
the deployment process and why certain files are needed on the webserver and
others are not.
"Rudy" wrote:
> Hello!
> I currently have a site online. I added more features to my datagrid page
,
> so users can update and stuff. I though I could just copy the aspx, aspx.
vb
> and the server page including the web config, and paste then on the server
.
> At c:\intepub\wwwroot\website.
> But now I get a runtime error when I go to that page. What is the best wa
y
> to update a site after maiking modifications on the developer machine?
> TIA
> Rudy
> But now I get a runtime error when I go to that page. What is the best
way
> to update a site after maiking modifications on the developer machine?
Sounds like you are using VS.net and, as such, you are likely compiling all
your vb pages into a DLL before uploading.
So, if that is the case, you don't want to upload your .vb files, but,
rather, recompile the project, upload your ASPX pages, and then upload your
project's dll file (in the BIN folder).
-Darrel
As a result of what everyone has suggested, please note that re-deploying
your website will cause all session state information to be lost (that is if
you do use In-process state). So, if this is a very busy website, I
wouldn't want to tick your user's off by killing their session information
when you update. So, do you updates at a time when it is not that busy
"Rudy" <Rudy@dotnet.itags.org.discussions.microsoft.com> wrote in message
news:9FB474C1-0B6A-4216-BCD8-5248826FC1EE@dotnet.itags.org.microsoft.com...
> Hello!
> I currently have a site online. I added more features to my datagrid
> page,
> so users can update and stuff. I though I could just copy the aspx,
> aspx.vb
> and the server page including the web config, and paste then on the
> server.
> At c:\intepub\wwwroot\website.
> But now I get a runtime error when I go to that page. What is the best
> way
> to update a site after maiking modifications on the developer machine?
> TIA
> Rudy
Thank you all who replied! I got my site up and running. I forgot about the
dll, and just put the vb files because i thought it couldn't hurt. But is
there harm put those files in, they are not very big.
Anyway, I dumped my entire site and just loaded in a new one. When I moved
the project file from my home to my office developer computer, and named the
project diffrent, off by one letter. So my new project was a little diffrent
then what I had on the server. It's a intranet site, so I just sent a memo
about the new name. Not sure how that happened, but I do remember I had a
heck of a time moving the project over and getting it to work again. Thanks
again!
Rudy
"Tampa.NET Koder" wrote:
> As a result of what everyone has suggested, please note that re-deploying
> your website will cause all session state information to be lost (that is
if
> you do use In-process state). So, if this is a very busy website, I
> wouldn't want to tick your user's off by killing their session information
> when you update. So, do you updates at a time when it is not that busy
> "Rudy" <Rudy@dotnet.itags.org.discussions.microsoft.com> wrote in message
> news:9FB474C1-0B6A-4216-BCD8-5248826FC1EE@dotnet.itags.org.microsoft.com...
>
>
The best way to update a site?
I currently have a site online. I added more features to my datagrid page,
so users can update and stuff. I though I could just copy the aspx, aspx.vb
and the server page including the web config, and paste then on the server.
At c:\intepub\wwwroot\website.
But now I get a runtime error when I go to that page. What is the best way
to update a site after maiking modifications on the developer machine?
TIA
Rudy"Rudy" <Rudy@dotnet.itags.org.discussions.microsoft.com> wrote in message
news:9FB474C1-0B6A-4216-BCD8-5248826FC1EE@dotnet.itags.org.microsoft.com...
> I currently have a site online. I added more features to my datagrid
> page,
> so users can update and stuff. I though I could just copy the aspx,
> aspx.vb
> and the server page including the web config, and paste then on the
> server.
> At c:\intepub\wwwroot\website.
> But now I get a runtime error when I go to that page. What is the best
> way
> to update a site after maiking modifications on the developer machine?
1) What exactly do you mean by "the server page"?
2) Why are you trying to copy the .vb files?
3) Are you using Visual Studio.NET?
Typically, you do not have to move the files containing source code to the
web server (eg .cs, .vb, etc.), you only need to move the content files
(.aspx, .htm, .css, .config, etc.).
When you make updates to the code, you need to rebuild the project and then
copy the content files and the new dll over to the webserver. When you build
the project, your "code files" are compiled into the dll
(yourapp/bin/youapp.dll).
Hope this helps. You may also try google to get a better understanding of
the deployment process and why certain files are needed on the webserver and
others are not.
"Rudy" wrote:
> Hello!
> I currently have a site online. I added more features to my datagrid page,
> so users can update and stuff. I though I could just copy the aspx, aspx.vb
> and the server page including the web config, and paste then on the server.
> At c:\intepub\wwwroot\website.
> But now I get a runtime error when I go to that page. What is the best way
> to update a site after maiking modifications on the developer machine?
> TIA
> Rudy
> But now I get a runtime error when I go to that page. What is the best
way
> to update a site after maiking modifications on the developer machine?
Sounds like you are using VS.net and, as such, you are likely compiling all
your vb pages into a DLL before uploading.
So, if that is the case, you don't want to upload your .vb files, but,
rather, recompile the project, upload your ASPX pages, and then upload your
project's dll file (in the BIN folder).
-Darrel
As a result of what everyone has suggested, please note that re-deploying
your website will cause all session state information to be lost (that is if
you do use In-process state). So, if this is a very busy website, I
wouldn't want to tick your user's off by killing their session information
when you update. So, do you updates at a time when it is not that busy
"Rudy" <Rudy@dotnet.itags.org.discussions.microsoft.com> wrote in message
news:9FB474C1-0B6A-4216-BCD8-5248826FC1EE@dotnet.itags.org.microsoft.com...
> Hello!
> I currently have a site online. I added more features to my datagrid
> page,
> so users can update and stuff. I though I could just copy the aspx,
> aspx.vb
> and the server page including the web config, and paste then on the
> server.
> At c:\intepub\wwwroot\website.
> But now I get a runtime error when I go to that page. What is the best
> way
> to update a site after maiking modifications on the developer machine?
> TIA
> Rudy
Thank you all who replied! I got my site up and running. I forgot about the
dll, and just put the vb files because i thought it couldn't hurt. But is
there harm put those files in, they are not very big.
Anyway, I dumped my entire site and just loaded in a new one. When I moved
the project file from my home to my office developer computer, and named the
project diffrent, off by one letter. So my new project was a little diffrent
then what I had on the server. It's a intranet site, so I just sent a memo
about the new name. Not sure how that happened, but I do remember I had a
heck of a time moving the project over and getting it to work again. Thanks
again!
Rudy
"Tampa.NET Koder" wrote:
> As a result of what everyone has suggested, please note that re-deploying
> your website will cause all session state information to be lost (that is if
> you do use In-process state). So, if this is a very busy website, I
> wouldn't want to tick your user's off by killing their session information
> when you update. So, do you updates at a time when it is not that busy
> "Rudy" <Rudy@dotnet.itags.org.discussions.microsoft.com> wrote in message
> news:9FB474C1-0B6A-4216-BCD8-5248826FC1EE@dotnet.itags.org.microsoft.com...
> > Hello!
> > I currently have a site online. I added more features to my datagrid
> > page,
> > so users can update and stuff. I though I could just copy the aspx,
> > aspx.vb
> > and the server page including the web config, and paste then on the
> > server.
> > At c:\intepub\wwwroot\website.
> > But now I get a runtime error when I go to that page. What is the best
> > way
> > to update a site after maiking modifications on the developer machine?
> > TIA
> > Rudy
>
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
The clicking twice hair pulling doesnt do anything problem!
I have a single page in which everything is loaded from user controls based upon a specific value in the URL. The user controls are dynamically loaded (only load the user controls I need based upon the key in the URL). Within the user control is a form with a single button. When I click the button, nothing happens. When I click it again it does a full postback but all user controls are gone and I haven't the slightest idea if it upated or not. Now the form is in an update panel so it shouldn't be doing a post back.
To reiterate:
1. single page (call it default.aspx)
2. click a link with the key in the url (kind of like "?k=1048")
3. default.aspx runs through a case statement and find the key value that matches the URL then loads the user control.
4. user control has form on it
5. click the submit button, nothing happens. Click it again and it does a postback and all user controls are gone (AJAX didn't work).
So, any ideas about having to click twice and also why the update panel doesn't seem to be working?
thanks
^_^
ps. if i put the user control in a completely separate page where it isn't dynamically loaded, things work as intended.
To start with, when using Dynamic Controls, you should already know that you should RECREATE your controls on every page request. Keeping this in mind, you should keep track of which UserControl was loaded before and then reload it again!
Hope this helps,
Regards
That's nice but didn't help at all nor directed me to even an idea
What I did find was that when I removed the triggers from the update panel then the double-clicking went away and it operated as intended. but I wonder what will happen when I have multiple controls on a page that each have an update panel and I update one, will it cause the others to fire as well even with the mode set to conditional.
Does anyone have an idea of this cause that knows what they are talking about.
thanks
The code of my page doesnt execute.
1. I have installed iis v5.1 - runs ok (http://localhost... )
2. I have also installed VStudio.Net, no problem.
3. I have started my first project on C#, which consists on a webform, some controls, and a hyperlink buttons.
My problem is: when run the application, the browser (I've tried with ie, mozilla & opera ) shows the page. The html seems to be ok, but no action at all occures.
I have used break points to make sure no action at all runs after javascript calls submit() function.
In my oppinion, theres something I haven't done , probably a question of folder/file project config, permits... dunno.
I will appreciate any help, thx
Have you build the solution?
Grz, Kris.
Hi,
First of all... thx for answering.
Yes, I have also tried building de solution, but had no success.
In my oppinion, it is more a question of assigning the right permissions or so, because aspx code doesn't run even when I run "Debug" from Visual studio.
Running debug (F5), for example, shows the page correctly. If I place the cursor over the hlinkbuttons it shows the jscript function call to the right event handler "__doPostBack(hlCon,'')". But, when I click the button, nothing happens, the page refreshes but nothing happens.
For example, what I've done now is a Step by step debug (F11) and the browser opens, shos the template, but no action / interruption occurs.
(I write the shortkeys cause I'm working with the Spanish version of Visual studio, inn order to avoid a mistake with menu names)
I'm a little bit lost with this, and also a little bit desperated... :(
thx for your help in an advice, url, or whatever way.
Juanjo.
PS: There's only one more thing... I dunno if it will help. When I created the first Webform, I changed the name from Webform1 to index, in order to convert the page as default one. (My iis admits index.aspx as def. page).
uhmm...
does your page declaration match with the name of your code-behind?
does your Codebhind attribute match the code-behind file? doesthe "Inherits" match the name of your class of your code-behind?
Yes, it does...
the problem was I was specting the same behaviour from a linkbutton Click than from a buttons.
I'm sorry, to waste your time with this stupidity.
Thx to all for reading and helping me.