Thursday, March 29, 2012
newbie - page load not firing
**********************************
<%@dotnet.itags.org. Page Language="VB" AutoEventWireup="false"
CodeFile="confirm.aspx.vb" Inherits="confirm" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
****************************************
*****************
This is my page behind page (confirm.aspx.vb):
Partial Class confirm
Inherits System.Web.UI.Page
Sub Page_Load(ByVal s As Object, ByVal e As EventArgs)
Response.Write("hello")
End Sub
End Class
****************************************
*******
When I confirm.aspx loads in the browser nothing happens. i.e. a blank
page is returned. Shouldn't "hello" be displayed? What am I doing
wrong?Change AutoEventWireup="false" to AutoEventWireup="true" and it should work.
If you're a newbie to .Net from classic asp, note that response.write will
output before all the other content. - i.e. before "<!DOCTYPE.....". But
you'll see that when you run it :)
Jevon
"Steve" <bahram@.iranmania.com> wrote in message
news:1130840485.862653.166360@.g43g2000cwa.googlegroups.com...
> Using asp.net 2.0. I have a page confirm.aspx:
> **********************************
> <%@. Page Language="VB" AutoEventWireup="false"
> CodeFile="confirm.aspx.vb" Inherits="confirm" %>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
> "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" >
> <head runat="server">
> <title>Untitled Page</title>
> </head>
> <body>
> <form id="form1" runat="server">
> <div>
> </div>
> </form>
> </body>
> </html>
> ****************************************
*****************
> This is my page behind page (confirm.aspx.vb):
>
> Partial Class confirm
> Inherits System.Web.UI.Page
> Sub Page_Load(ByVal s As Object, ByVal e As EventArgs)
> Response.Write("hello")
> End Sub
> End Class
> ****************************************
*******
> When I confirm.aspx loads in the browser nothing happens. i.e. a blank
> page is returned. Shouldn't "hello" be displayed? What am I doing
> wrong?
>
Set AutoEventWireup to True and try.
"Steve" wrote:
> Using asp.net 2.0. I have a page confirm.aspx:
> **********************************
> <%@. Page Language="VB" AutoEventWireup="false"
> CodeFile="confirm.aspx.vb" Inherits="confirm" %>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
> "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" >
> <head runat="server">
> <title>Untitled Page</title>
> </head>
> <body>
> <form id="form1" runat="server">
> <div>
> </div>
> </form>
> </body>
> </html>
> ****************************************
*****************
> This is my page behind page (confirm.aspx.vb):
>
> Partial Class confirm
> Inherits System.Web.UI.Page
> Sub Page_Load(ByVal s As Object, ByVal e As EventArgs)
> Response.Write("hello")
> End Sub
> End Class
> ****************************************
*******
> When I confirm.aspx loads in the browser nothing happens. i.e. a blank
> page is returned. Shouldn't "hello" be displayed? What am I doing
> wrong?
>
Thank you so much for that. I spent more than 2 needless hours this
morning getting frustrated over this. Thank you so much.
So does that mean the Page_Load event can never be captured if the
AutoEventWireup is set to false, or is there a way for the
AutoEventWireup to be set to false and for the Page_Load event to still
be captured?
Yes, manually hook up the handler method with the event:
Sub Page_Load (..., ...) Handles MyBase.Load
...
End Sub
(OR)
' Have the following line in any method/event handler that runs before page
load event.
AddHandler Me.Load, AddressOf Page_Load
"Steve" wrote:
> Thank you so much for that. I spent more than 2 needless hours this
> morning getting frustrated over this. Thank you so much.
> So does that mean the Page_Load event can never be captured if the
> AutoEventWireup is set to false, or is there a way for the
> AutoEventWireup to be set to false and for the Page_Load event to still
> be captured?
>
newbie - page load not firing
**********************************
<%@dotnet.itags.org. Page Language="VB" AutoEventWireup="false"
CodeFile="confirm.aspx.vb" Inherits="confirm" %
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
************************************************** *******
This is my page behind page (confirm.aspx.vb):
Partial Class confirm
Inherits System.Web.UI.Page
Sub Page_Load(ByVal s As Object, ByVal e As EventArgs)
Response.Write("hello")
End Sub
End Class
***********************************************
When I confirm.aspx loads in the browser nothing happens. i.e. a blank
page is returned. Shouldn't "hello" be displayed? What am I doing
wrong?Change AutoEventWireup="false" to AutoEventWireup="true" and it should work.
If you're a newbie to .Net from classic asp, note that response.write will
output before all the other content. - i.e. before "<!DOCTYPE.....". But
you'll see that when you run it :)
Jevon
"Steve" <bahram@.iranmania.com> wrote in message
news:1130840485.862653.166360@.g43g2000cwa.googlegr oups.com...
> Using asp.net 2.0. I have a page confirm.aspx:
> **********************************
> <%@. Page Language="VB" AutoEventWireup="false"
> CodeFile="confirm.aspx.vb" Inherits="confirm" %>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
> "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" >
> <head runat="server">
> <title>Untitled Page</title>
> </head>
> <body>
> <form id="form1" runat="server">
> <div>
> </div>
> </form>
> </body>
> </html>
> ************************************************** *******
> This is my page behind page (confirm.aspx.vb):
>
> Partial Class confirm
> Inherits System.Web.UI.Page
> Sub Page_Load(ByVal s As Object, ByVal e As EventArgs)
> Response.Write("hello")
> End Sub
> End Class
> ***********************************************
> When I confirm.aspx loads in the browser nothing happens. i.e. a blank
> page is returned. Shouldn't "hello" be displayed? What am I doing
> wrong?
Set AutoEventWireup to True and try.
"Steve" wrote:
> Using asp.net 2.0. I have a page confirm.aspx:
> **********************************
> <%@. Page Language="VB" AutoEventWireup="false"
> CodeFile="confirm.aspx.vb" Inherits="confirm" %>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
> "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" >
> <head runat="server">
> <title>Untitled Page</title>
> </head>
> <body>
> <form id="form1" runat="server">
> <div>
> </div>
> </form>
> </body>
> </html>
> ************************************************** *******
> This is my page behind page (confirm.aspx.vb):
>
> Partial Class confirm
> Inherits System.Web.UI.Page
> Sub Page_Load(ByVal s As Object, ByVal e As EventArgs)
> Response.Write("hello")
> End Sub
> End Class
> ***********************************************
> When I confirm.aspx loads in the browser nothing happens. i.e. a blank
> page is returned. Shouldn't "hello" be displayed? What am I doing
> wrong?
>
Thank you so much for that. I spent more than 2 needless hours this
morning getting frustrated over this. Thank you so much.
So does that mean the Page_Load event can never be captured if the
AutoEventWireup is set to false, or is there a way for the
AutoEventWireup to be set to false and for the Page_Load event to still
be captured?
Yes, manually hook up the handler method with the event:
Sub Page_Load (..., ...) Handles MyBase.Load
...
End Sub
(OR)
' Have the following line in any method/event handler that runs before page
load event.
AddHandler Me.Load, AddressOf Page_Load
"Steve" wrote:
> Thank you so much for that. I spent more than 2 needless hours this
> morning getting frustrated over this. Thank you so much.
> So does that mean the Page_Load event can never be captured if the
> AutoEventWireup is set to false, or is there a way for the
> AutoEventWireup to be set to false and for the Page_Load event to still
> be captured?
>
Newbie - Protecting source code
ripped off when I load it onto a 3rd party web server? (Someone copying the
.cs files, and removing them)
Is there a way to compile these .cs files for the ASP.NET pages to read.If you're using VS.NET, compile the project,
and only upload the dll's and .aspx files to your
server or, if you're not using VS.NET, compile
the assemblies ( dlls ) from the command line
and deploy them, with your .aspx files, to the server.
Juan T. Llibre
ASP.NET MVP
===========
"Fronky" <nospam@.nospam.com> wrote in message
news:OJmXokTCFHA.2032@.tk2msftngp13.phx.gbl...
> If I create an ASP.NET (c#) web application, how can I prevent my code
> being
> ripped off when I load it onto a 3rd party web server? (Someone copying
> the
> .cs files, and removing them)
> Is there a way to compile these .cs files for the ASP.NET pages to read.
>
Sorted it! Thanks for your help!
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:uxQbcyTCFHA.1396@.TK2MSFTNGP14.phx.gbl...
> If you're using VS.NET, compile the project,
> and only upload the dll's and .aspx files to your
> server or, if you're not using VS.NET, compile
> the assemblies ( dlls ) from the command line
> and deploy them, with your .aspx files, to the server.
>
>
> Juan T. Llibre
> ASP.NET MVP
> ===========
> "Fronky" <nospam@.nospam.com> wrote in message
> news:OJmXokTCFHA.2032@.tk2msftngp13.phx.gbl...
>
Of course, if the security on the server is such that someone could view the
source code of your ASP.Net pages, you have a more serious problem.
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.
"Fronky" <nospam@.nospam.com> wrote in message
news:u5HmNDUCFHA.520@.TK2MSFTNGP09.phx.gbl...
> Sorted it! Thanks for your help!
>
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:uxQbcyTCFHA.1396@.TK2MSFTNGP14.phx.gbl...
>
"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
news:O$DN%23pVCFHA.3976@.tk2msftngp13.phx.gbl...
> Of course, if the security on the server is such that someone could view
> the source code of your ASP.Net pages, you have a more serious problem.
LOL! Absolutely!
Newbie - Protecting source code
ripped off when I load it onto a 3rd party web server? (Someone copying the
..cs files, and removing them)
Is there a way to compile these .cs files for the ASP.NET pages to read.If you're using VS.NET, compile the project,
and only upload the dll's and .aspx files to your
server or, if you're not using VS.NET, compile
the assemblies ( dlls ) from the command line
and deploy them, with your .aspx files, to the server.
Juan T. Llibre
ASP.NET MVP
===========
"Fronky" <nospam@.nospam.com> wrote in message
news:OJmXokTCFHA.2032@.tk2msftngp13.phx.gbl...
> If I create an ASP.NET (c#) web application, how can I prevent my code
> being
> ripped off when I load it onto a 3rd party web server? (Someone copying
> the
> .cs files, and removing them)
> Is there a way to compile these .cs files for the ASP.NET pages to read.
Sorted it! Thanks for your help!
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:uxQbcyTCFHA.1396@.TK2MSFTNGP14.phx.gbl...
> If you're using VS.NET, compile the project,
> and only upload the dll's and .aspx files to your
> server or, if you're not using VS.NET, compile
> the assemblies ( dlls ) from the command line
> and deploy them, with your .aspx files, to the server.
>
>
> Juan T. Llibre
> ASP.NET MVP
> ===========
> "Fronky" <nospam@.nospam.com> wrote in message
> news:OJmXokTCFHA.2032@.tk2msftngp13.phx.gbl...
> > If I create an ASP.NET (c#) web application, how can I prevent my code
> > being
> > ripped off when I load it onto a 3rd party web server? (Someone copying
> > the
> > .cs files, and removing them)
> > Is there a way to compile these .cs files for the ASP.NET pages to read.
Of course, if the security on the server is such that someone could view the
source code of your ASP.Net pages, you have a more serious problem.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
"Fronky" <nospam@.nospam.com> wrote in message
news:u5HmNDUCFHA.520@.TK2MSFTNGP09.phx.gbl...
> Sorted it! Thanks for your help!
>
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:uxQbcyTCFHA.1396@.TK2MSFTNGP14.phx.gbl...
>> If you're using VS.NET, compile the project,
>> and only upload the dll's and .aspx files to your
>> server or, if you're not using VS.NET, compile
>> the assemblies ( dlls ) from the command line
>> and deploy them, with your .aspx files, to the server.
>>
>>
>>
>>
>> Juan T. Llibre
>> ASP.NET MVP
>> ===========
>> "Fronky" <nospam@.nospam.com> wrote in message
>> news:OJmXokTCFHA.2032@.tk2msftngp13.phx.gbl...
>> > If I create an ASP.NET (c#) web application, how can I prevent my code
>> > being
>> > ripped off when I load it onto a 3rd party web server? (Someone copying
>> > the
>> > .cs files, and removing them)
>> > Is there a way to compile these .cs files for the ASP.NET pages to
>> > read.
>>>>
>>
"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
news:O$DN%23pVCFHA.3976@.tk2msftngp13.phx.gbl...
> Of course, if the security on the server is such that someone could view
> the source code of your ASP.Net pages, you have a more serious problem.
LOL! Absolutely!
Saturday, March 24, 2012
Newbie dynamic color question
MyTable.BackColor = Color.Red
But I can't seem to do a table cell. I have tried this:
MyTable.Rows(1).Cells(1).BackColor = Color.Blue
With this I get the error:
"Specified argument was out of the range of valid values. Parameter name: index "
I have tried inheriting the namespace "System.Drawing"
Can this be done, if so how? If not, how would I do this normally with VB?
ThanksThis means that the row or cell does not exist. Namely, the index of the first row in table is 0, not 1. Same goes for the cells.
So if you have only one row and only one cell, you get an error.
Try
MyTable.Rows(0).Cells(0).BackColor = Color.Blue
I looked back on it and adjusted my code to row 0 and cell 0. I can now get the row to change color, but regardless of what cell I call, it changes the entire row. I tried putting an entry for two cells in the same row, but it just ignores the anything after the first call. Any ideas?