Saturday, March 31, 2012

What is neccessary?

Anyone's response would be appreciated.

I am a rookie on asp.net,I wanna use VB to write my website.The problem is I have no idea about which component I should install.The vb.net and theVisual web developer and .net framework?

Is that enough or only vb.net is just ok? Thanks.

Hi,

If you have Windows XP Pro as your home machine, you'd want to install IIS (Internet Information Server/Services) to it. It's available on Windows Components (Add/Remove programs tool in XP). Visual Web Developer has a built-in web server which migh suffice depending on how complex stuff you are developing.

Visual Basic .NET is one of programming languages in .NET and you get support for it by installing .NET Framework, you don't need to install anything specific in order to get it..

So to summarize:

If you want IIS, install it first. Visual Web Developer installs .NET Framework 2.0 by default, if memory serves, so basically by downloading VWD, you get all the other software you need.


Hi,

As suggested by first you will need to install IIS in your machine. Presuming that you have XP, follow the URL below which will give you step by step detail of installing IIS.

Installing IIS on Windows XP Pro

http://www.webwizguide.com/asp/tutorials/installing_iis_winXP_pro.asp

You can then install Visual Web Developer. But I will suggest to go for Visual Studio .NET instead if you really want to involve in serious web development profession. With Visual Web Developer IDE you will find very limited purview to explore and most of the stuffs can be achieved by just dragging and dropping things on page. IMO, you will not going to learn VB any thing serious using Visual Web Developer. So go for VS.NET from very beginning. This is just my suggestion.

Ok, move back to installation. With installation of VS.NET, setup will also install .NET framework for you. And so you don't need to install .NET independently.

You don't need to install other component and third party tools to develop web application. But as your project demands, you can then select thousand of third party components, developer productivity tools, application framework etc.

Regards,

Firoz Ansari


firoz.ansari wrote:

You can then install Visual Web Developer. But I will suggest to go for Visual Studio .NET instead if you really want to involve in serious web development profession. With Visual Web Developer IDE you will find very limited purview to explore and most of the stuffs can be achieved by just dragging and dropping things on page. IMO, you will not going to learn VB any thing serious using Visual Web Developer. So go for VS.NET from very beginning. This is just my suggestion.

I 100% agree if VS is available then using it is a must. But if not, and speaking about what you can do with VB (as programming language), I wouldn't totally agree with point & click view. You can write code with VWD. :-)

But of course, all these VWD tutorials etc always point the easiness, and no-code approach, so it's quite evident that you get that feeling, but it doesn't mean you couldn't learn to use VB.NET with VWD.

It's more structural & organizational stuff like having class libraries available, plus that you all these latest extensions and additions like Web Deployment Projects, Web Application projects etc etc, since they do not support VWD. So yes, that is professional stuff that you get with VS.NET.


Thanks for all your detailed reply.

So I have two options.

1.All I need is a VWD.

2.IIS + VB.net Am I right?

The second choice would be more interesting, and I am really crazy about writting code!Although the VWD is easier.

So I will choose the second.

I am a student in china.I wanna be a proficient in ASP.net.I hope we can be friends.


Zorro wrote:

So I have two options.

1.All I need is a VWD.

2.IIS + VB.net Am I right?

The second choice would be more interesting, and I am really crazy about writting code!Although the VWD is easier.

Umm, not exactly what I meant. You can have both three, and you can still write code. VWD does not prevent you writing code yourself. :-) Visual Web Developer is just IDE which you can use to develop web applications (though simpler by their nature due to previously mentioned reasons), and it supports VB, C# etc.

If you mean with VB desktop applications, you can also download VS2005 Express Editions (Visual Basic 2005 Express Edition). They are mentioned and explained behind following link:

http://msdn.microsoft.com/vstudio/express/default.aspx

What is namescape and base class in ASP.NET

Hi,
i would like to know the meaning of namespace in ASP.net?
is it something like header files in C?
any help in this regard is appreciated.
Thanks
ShekarHi there,
This should help you..
http://www.c-sharpcorner.com/Articles/NSInCSandVBNETSSK.asp
HTH

Namespaces are more like logical categorization of classes and objects.
You place each set of related classes in one namespace.

Regards

What is my website name

I am looking for a property in the page object that would return something like
"http://localhost:1530/myapp"
What property should I look for?

--
Arne Garvander
Certified Geek
Professional Data DudeOn Aug 2, 11:12 pm, Arne <A...@.discussions.microsoft.comwrote:

Quote:

Originally Posted by

I am looking for a property in the page object that would return something like
"http://localhost:1530/myapp"
What property should I look for?


Arne, you can use the Request.ServerVariables() method

http://www.4guysfromrolla.com/webtech/092298-3.shtml
"Arne" <Arne@.discussions.microsoft.comwrote in message
news:94C9C2BF-959D-4E36-8555-FC3D1259AA22@.microsoft.com...

Quote:

Originally Posted by

>I am looking for a property in the page object that would return something
>like
"http://localhost:1530/myapp"
What property should I look for?


Request.ServerVariables["HTTP_HOST"]

--
Mark Rae
ASP.NET MVP
http://www.markrae.net
page.request.url works better
--
Arne Garvander
Certified Geek
Professional Data Dude

"Mark Rae [MVP]" wrote:

Quote:

Originally Posted by

"Arne" <Arne@.discussions.microsoft.comwrote in message
news:94C9C2BF-959D-4E36-8555-FC3D1259AA22@.microsoft.com...
>

Quote:

Originally Posted by

I am looking for a property in the page object that would return something
like
"http://localhost:1530/myapp"
What property should I look for?


>
Request.ServerVariables["HTTP_HOST"]
>
>
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
>
>


No they don't work so well
The page.request.uri works better.
--
Arne Garvander
Certified Geek
Professional Data Dude

"Alexey Smirnov" wrote:

Quote:

Originally Posted by

On Aug 2, 11:12 pm, Arne <A...@.discussions.microsoft.comwrote:

Quote:

Originally Posted by

I am looking for a property in the page object that would return something like
"http://localhost:1530/myapp"
What property should I look for?


>
Arne, you can use the Request.ServerVariables() method
>
http://www.4guysfromrolla.com/webtech/092298-3.shtml
>
>


"Arne" <Arne@.discussions.microsoft.comwrote in message
news:6EAB5661-612F-49D6-BEBA-AE092365BD14@.microsoft.com...

Quote:

Originally Posted by

page.request.url works better


How exactly does it "work better"...?

--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Dim fullappname as string = Request.Url.Host
Dim port as string = Request.ServerVariables("SERVER_PORT")
Dim fullpathandport as string = "The full URL and port for the application root is : " & "http://" & fullappname & ":" &
port & Request.ApplicationPath & "/"

See a working example at : http://asp.net.do/test/apppath.aspx
( the last line returns the info you want ... )

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"Arne" <Arne@.discussions.microsoft.comwrote in message news:94C9C2BF-959D-4E36-8555-FC3D1259AA22@.microsoft.com...

Quote:

Originally Posted by

>I am looking for a property in the page object that would return something like
"http://localhost:1530/myapp"
What property should I look for?
>
--
Arne Garvander
Certified Geek
Professional Data Dude


"Juan T. Llibre" <nomailreplies@.nowhere.comwrote in message
news:OYTlMAX1HHA.4496@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Dim fullappname as string = Request.Url.Host
Dim port as string = Request.ServerVariables("SERVER_PORT")
Dim fullpathandport as string = "The full URL and port for the application
root is : " & "http://" & fullappname & ":" & port &
Request.ApplicationPath & "/"


What if it's https...?

--
Mark Rae
ASP.NET MVP
http://www.markrae.net
I don't have a server certificate handy to test this, but this should cover that :

Dim fullappname as string = Request.Url.Host
Dim port as string = Request.ServerVariables("SERVER_PORT")
Dim MyUrl As Uri = Request.Url
Dim fullappnameProtocolAndPort As String = "The full URL, protocol and port for the application root is : " _
& Server.HtmlEncode(MyUrl.Scheme) & "://" & fullappname & ":" & port & Request.ApplicationPath & "/"

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"Mark Rae [MVP]" <mark@.markNOSPAMrae.netwrote in message news:%23G2XEiZ1HHA.4428@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

"Juan T. Llibre" <nomailreplies@.nowhere.comwrote in message news:OYTlMAX1HHA.4496@.TK2MSFTNGP02.phx.gbl...
>

Quote:

Originally Posted by

>Dim fullappname as string = Request.Url.Host
>Dim port as string = Request.ServerVariables("SERVER_PORT")
>Dim fullpathandport as string = "The full URL and port for the application root is : " & "http://" & fullappname &
>":" & port & Request.ApplicationPath & "/"


>
What if it's https...?
>
>
--
Mark Rae
ASP.NET MVP
http://www.markrae.net


"Juan T. Llibre" <nomailreplies@.nowhere.comwrote in message
news:OZX4ebc1HHA.4428@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

>I don't have a server certificate handy to test this, but this should cover
>that :


I normally use something like this:

string strWebRoot = (Request.ServerVariables["HTTPS"] == "off" ? "http://" :
"https://") + Request.ServerVariables["SERVER_NAME"];

--
Mark Rae
ASP.NET MVP
http://www.markrae.net
You get portnumber, protocol
page.Request.Url.Scheme + "://" + page.Request.Url.Authority + _
"/" + page.Request.Url.Segments(1)
--
Arne Garvander
Certified Geek
Professional Data Dude

"Mark Rae [MVP]" wrote:

Quote:

Originally Posted by

"Arne" <Arne@.discussions.microsoft.comwrote in message
news:6EAB5661-612F-49D6-BEBA-AE092365BD14@.microsoft.com...
>

Quote:

Originally Posted by

page.request.url works better


>
How exactly does it "work better"...?
>
>
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
>
>


Request.ServerVariables["SERVER_NAME"]; and Request.Url.Host return the same object, right ?

You're missing the application's name and the port, per the OP's request, though.

There's many ways to skin a cat.

Dim fullappname as string = Request.Url.Host
Dim port as string = Request.ServerVariables("SERVER_PORT")
Dim prot as object = IIf(Request.ServerVariables("HTTPS")="on", "https://", "http://")
Dim path as String = prot.ToString() & fullappname & ":" & port & Request.ApplicationPath

...will also do the job.

:-)

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"Mark Rae [MVP]" <mark@.markNOSPAMrae.netwrote in message news:e7vbBhc1HHA.5796@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

"Juan T. Llibre" <nomailreplies@.nowhere.comwrote in message news:OZX4ebc1HHA.4428@.TK2MSFTNGP03.phx.gbl...
>

Quote:

Originally Posted by

>>I don't have a server certificate handy to test this, but this should cover that :


Quote:

Originally Posted by

I normally use something like this:


Quote:

Originally Posted by

string strWebRoot = (Request.ServerVariables["HTTPS"] == "off" ? "http://" : "https://") +
Request.ServerVariables["SERVER_NAME"];


Quote:

Originally Posted by

--
Mark Rae
ASP.NET MVP
http://www.markrae.net


"Juan T. Llibre" <nomailreplies@.nowhere.comwrote in message
news:eW84aAd1HHA.1164@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Request.ServerVariables["SERVER_NAME"]; and Request.Url.Host return the
same object, right ?


Yes - AFAIK, Request.Url is just a wrapper around Request.ServerVariables...

Quote:

Originally Posted by

You're missing the application's name and the port, per the OP's request,
though.


Probably... :-)

Quote:

Originally Posted by

There's many ways to skin a cat.
>
Dim fullappname as string = Request.Url.Host
Dim port as string = Request.ServerVariables("SERVER_PORT")
Dim prot as object = IIf(Request.ServerVariables("HTTPS")="on",
"https://", "http://")
Dim path as String = prot.ToString() & fullappname & ":" & port &
Request.ApplicationPath
>
...will also do the job.


Indeed.

--
Mark Rae
ASP.NET MVP
http://www.markrae.net
That's very compact, Arne.

That only leaves the port to be added :

Dim port as string = Request.ServerVariables("SERVER_PORT")
Dim fullpath as string = page.Request.Url.Scheme + "://" + page.Request.Url.Authority + ":" + port + "/" +
page.Request.Url.Segments(1)

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"Arne" <Arne@.discussions.microsoft.comwrote in message news:2D26E478-EB26-43E6-AA31-D7DD0118E099@.microsoft.com...

Quote:

Originally Posted by

You get portnumber, protocol
page.Request.Url.Scheme + "://" + page.Request.Url.Authority + _
"/" + page.Request.Url.Segments(1)
--
Arne Garvander
Certified Geek
Professional Data Dude
>
>
"Mark Rae [MVP]" wrote:
>

Quote:

Originally Posted by

>"Arne" <Arne@.discussions.microsoft.comwrote in message
>news:6EAB5661-612F-49D6-BEBA-AE092365BD14@.microsoft.com...
>>

Quote:

Originally Posted by

page.request.url works better


>>
>How exactly does it "work better"...?
>>
>>
>--
>Mark Rae
>ASP.NET MVP
>http://www.markrae.net
>>
>>


page.request.uri

--
<a href="http://links.10026.com/?link=http://1pakistangifts.com">Send Gifts to Pakisan at #Pakistan Gifts
Store</a| <a href="http://links.10026.com/?link=http://dotspecialists.com">Leading Software offshoring
and outsourcing service provider</a| <a
href="http://websitedesignersrus.com">Professional Websites at affordable
prices</a>
"Arne" <Arne@.discussions.microsoft.comwrote in message
news:94C9C2BF-959D-4E36-8555-FC3D1259AA22@.microsoft.com...

Quote:

Originally Posted by

>I am looking for a property in the page object that would return something
>like
"http://localhost:1530/myapp"
What property should I look for?
>
--
Arne Garvander
Certified Geek
Professional Data Dude
>


re:
!page.request.uri

That does *not* produce what the OP requested.

The OP wants to :

1. include the port number
2. *not* include the page's name

Please review this thread. The answer has already been provided in it.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"Enigma Boy" <enigma777@.pp.newsgroups.userwrote in message news:CTzti.3393$9W6.2439@.fe103.usenetserver.com...

Quote:

Originally Posted by

page.request.uri
>
--
<a href="http://links.10026.com/?link=http://1pakistangifts.com">Send Gifts to Pakisan at #Pakistan Gifts Store</a| <a
href="http://dotspecialists.com">Leading Software offshoring and outsourcing service provider</a| <a
href="http://websitedesignersrus.com">Professional Websites at affordable prices</a>
"Arne" <Arne@.discussions.microsoft.comwrote in message news:94C9C2BF-959D-4E36-8555-FC3D1259AA22@.microsoft.com...

Quote:

Originally Posted by

>>I am looking for a property in the page object that would return something like
>"http://localhost:1530/myapp"
>What property should I look for?
>>
>--
>Arne Garvander
>Certified Geek
>Professional Data Dude
>>


>
>
>

What is my website name

I am looking for a property in the page object that would return something l
ike
"http://localhost:1530/myapp"
What property should I look for?
Arne Garvander
Certified G
Professional Data DudeOn Aug 2, 11:12 pm, Arne <A...@.discussions.microsoft.com> wrote:
> I am looking for a property in the page object that would return something
like
> "http://localhost:1530/myapp"
> What property should I look for?
Arne, you can use the Request.ServerVariables() method
http://www.4guysfromrolla.com/webtech/092298-3.shtml
"Arne" <Arne@.discussions.microsoft.com> wrote in message
news:94C9C2BF-959D-4E36-8555-FC3D1259AA22@.microsoft.com...

>I am looking for a property in the page object that would return something
>like
> "http://localhost:1530/myapp"
> What property should I look for?
Request.ServerVariables["HTTP_HOST"]
Mark Rae
ASP.NET MVP
http://www.markrae.net
page.request.url works better
--
Arne Garvander
Certified G
Professional Data Dude
"Mark Rae [MVP]" wrote:

> "Arne" <Arne@.discussions.microsoft.com> wrote in message
> news:94C9C2BF-959D-4E36-8555-FC3D1259AA22@.microsoft.com...
>
> Request.ServerVariables["HTTP_HOST"]
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
>
No they don't work so well
The page.request.uri works better.
--
Arne Garvander
Certified G
Professional Data Dude
"Alexey Smirnov" wrote:

> On Aug 2, 11:12 pm, Arne <A...@.discussions.microsoft.com> wrote:
> Arne, you can use the Request.ServerVariables() method
> http://www.4guysfromrolla.com/webtech/092298-3.shtml
>
"Arne" <Arne@.discussions.microsoft.com> wrote in message
news:6EAB5661-612F-49D6-BEBA-AE092365BD14@.microsoft.com...

> page.request.url works better
How exactly does it "work better"...?
Mark Rae
ASP.NET MVP
http://www.markrae.net
Dim fullappname as string = Request.Url.Host
Dim port as string = Request.ServerVariables("SERVER_PORT")
Dim fullpathandport as string = "The full URL and port for the application r
oot is : " & "http://" & fullappname & ":" &
port & Request.ApplicationPath & "/"
See a working example at : http://asp.net.do/test/apppath.aspx
( the last line returns the info you want ... )
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"Arne" <Arne@.discussions.microsoft.com> wrote in message news:94C9C2BF-959D-4E36-8555-FC3D1
259AA22@.microsoft.com...
>I am looking for a property in the page object that would return something
like
> "http://localhost:1530/myapp"
> What property should I look for?
> --
> Arne Garvander
> Certified G
> Professional Data Dude
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:OYTlMAX1HHA.4496@.TK2MSFTNGP02.phx.gbl...

> Dim fullappname as string = Request.Url.Host
> Dim port as string = Request.ServerVariables("SERVER_PORT")
> Dim fullpathandport as string = "The full URL and port for the application
> root is : " & "http://" & fullappname & ":" & port &
> Request.ApplicationPath & "/"
What if it's https...?
Mark Rae
ASP.NET MVP
http://www.markrae.net
I don't have a server certificate handy to test this, but this should cover
that :
Dim fullappname as string = Request.Url.Host
Dim port as string = Request.ServerVariables("SERVER_PORT")
Dim MyUrl As Uri = Request.Url
Dim fullappnameProtocolAndPort As String = "The full URL, protocol and port
for the application root is : " _
& Server.HtmlEncode(MyUrl.Scheme) & "://" & fullappname & ":" & port & Reque
st.ApplicationPath & "/"
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"Mark Rae [MVP]" <mark@.markNOSPAMrae.net> wrote in message news:%23G2XEiZ1HHA.4428@.TK2MSFTNGP03.
phx.gbl...
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message news:OYTlMAX
1HHA.4496@.TK2MSFTNGP02.phx.gbl...
>
> What if it's https...?
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:OZX4ebc1HHA.4428@.TK2MSFTNGP03.phx.gbl...

>I don't have a server certificate handy to test this, but this should cover
>that :
I normally use something like this:
string strWebRoot = (Request.ServerVariables["HTTPS"] == "off" ? "http://" :
"https://") + Request.ServerVariables["SERVER_NAME"];
Mark Rae
ASP.NET MVP
http://www.markrae.net

what is needed on the webserver

I have a web site built with asp.net and I have been told that the only
files I need on the webserver are the files in the bin folder and aspx
files, I don't need the .vb or the .resx files on the webserver. Or do I
need them on the webserver?

And whatis a .resx file and what does it do?

--
J. D.thanks.

"Kostadin Kostov" <KostadinKostov@.discussions.microsoft.com> wrote in
message news:34E007CB-F827-4026-91C2-36979608E0FC@.microsoft.com...
> That's right! All you need is to deploy the .dll files which reside in the
> bin directory, and the .aspx files. The code form the .vb or .cs files is
> compiled in the .dlls
> Regards,
> Kostadin Kostov
> "JD" wrote:
>> I have a web site built with asp.net and I have been told that the only
>> files I need on the webserver are the files in the bin folder and aspx
>> files, I don't need the .vb or the .resx files on the webserver. Or do I
>> need them on the webserver?
>>
>> And whatis a .resx file and what does it do?
>>
>> --
>> J. D.
>>
>>
>
Hmmm...

Maybe a few more files than those are needed.

The *.resx files certainly would be needed if there's any compiled
localization resources which are expected to work on the web server.

Also, *.ascx files are needed if any custom controls are used.

And, how about *.asmx files ? They should be uploaded, too.
And, surely, any *.ashx and *.soap files should be uploaded, too.

And, don't forget global.asax, web.config and any images you use.

:-)

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
Ven, y hablemos de ASP.NET...
======================

"Kostadin Kostov" <KostadinKostov@.discussions.microsoft.com> wrote in
message news:34E007CB-F827-4026-91C2-36979608E0FC@.microsoft.com...
> That's right! All you need is to deploy the .dll files which reside in the
> bin directory, and the .aspx files. The code form the .vb or .cs files is
> compiled in the .dlls
> Regards,
> Kostadin Kostov
> "JD" wrote:
>> I have a web site built with asp.net and I have been told that the only
>> files I need on the webserver are the files in the bin folder and aspx
>> files, I don't need the .vb or the .resx files on the webserver. Or do I
>> need them on the webserver?
>>
>> And whatis a .resx file and what does it do?
>>
>> --
>> J. D.
>>
>>
>
"Kostadin Kostov" <KostadinKostov@.discussions.microsoft.com> wrote in
message news:34E007CB-F827-4026-91C2-36979608E0FC@.microsoft.com...

> All you need is to deploy the .dll files which reside in the bin
> directory,
> and the .aspx files.

Plus all the other required files, of course... :-)

*.ascx
*.asmx
Global.asax
Web.config

Plus all the other "support" files e.g. images, JavaScript includes,
cascading style sheets etc etc

what is needed on the webserver

I have a web site built with asp.net and I have been told that the only
files I need on the webserver are the files in the bin folder and aspx
files, I don't need the .vb or the .resx files on the webserver. Or do I
need them on the webserver?
And whatis a .resx file and what does it do?
J. D.That's right! All you need is to deploy the .dll files which reside in the
bin directory, and the .aspx files. The code form the .vb or .cs files is
compiled in the .dlls
Regards,
Kostadin Kostov
"JD" wrote:

> I have a web site built with asp.net and I have been told that the only
> files I need on the webserver are the files in the bin folder and aspx
> files, I don't need the .vb or the .resx files on the webserver. Or do I
> need them on the webserver?
> And whatis a .resx file and what does it do?
> --
> J. D.
>
>
thanks.
"Kostadin Kostov" <KostadinKostov@.discussions.microsoft.com> wrote in
message news:34E007CB-F827-4026-91C2-36979608E0FC@.microsoft.com...
> That's right! All you need is to deploy the .dll files which reside in the
> bin directory, and the .aspx files. The code form the .vb or .cs files is
> compiled in the .dlls
> Regards,
> Kostadin Kostov
> "JD" wrote:
>
Hmmm...
Maybe a few more files than those are needed.
The *.resx files certainly would be needed if there's any compiled
localization resources which are expected to work on the web server.
Also, *.ascx files are needed if any custom controls are used.
And, how about *.asmx files ? They should be uploaded, too.
And, surely, any *.ashx and *.soap files should be uploaded, too.
And, don't forget global.asax, web.config and any images you use.
:-)
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
Ven, y hablemos de ASP.NET...
======================
"Kostadin Kostov" <KostadinKostov@.discussions.microsoft.com> wrote in
message news:34E007CB-F827-4026-91C2-36979608E0FC@.microsoft.com...
> That's right! All you need is to deploy the .dll files which reside in the
> bin directory, and the .aspx files. The code form the .vb or .cs files is
> compiled in the .dlls
> Regards,
> Kostadin Kostov
> "JD" wrote:
>
"Kostadin Kostov" <KostadinKostov@.discussions.microsoft.com> wrote in
message news:34E007CB-F827-4026-91C2-36979608E0FC@.microsoft.com...

> All you need is to deploy the .dll files which reside in the bin
> directory,
> and the .aspx files.
Plus all the other required files, of course... :-)
*.ascx
*.asmx
Global.asax
Web.config
Plus all the other "support" files e.g. images, JavaScript includes,
cascading style sheets etc etc

what is needed for me to run this forum?

it is stated that microsoft server 2003 is needed but i only have windows XP sp2...is it enough?? do i need IIS as well??well, are you trying to host it yourself? are you just trying to start one and host it on someone elses computer? whether you are doing either, you are going to need IIS- which comes with XP pro- xp home does not have it and cant get it- you would need pro-

what is needed for asp.net

what is needed to run a asp.net program on my local machine. I have iis, asp.net sdk framework 1.1. What else is needed? Do I need that Cassini web server.You only need IIS and the .NET Framework installed on the machine (in that order!). The Cassini web server is a little web server which can be used if you don't have IIS (for example on Windows XP Home).
I have windows xp professional. Ok, what do you type in browser to get to my asp.net page? Obviously not www/
do I type local/
?
http://localhost/folder/filename.aspx
another question relating. I have a file in my computer in C:\NetworkEvolution\Project2\TCInOutTile\inoutBoard.aspx
I typed in http://localhost/networkevolution/Project2/TCInOutTile/inoutBoard.aspx
my
and I got the error

Server Error in '/' Application.
------------------------
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested Url: /networkevolution/Project2/TCInOutTile/inoutBoard.aspx
------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET Version:1.0.3705.0

in regular asp I have the personal web server and had to alias the directory do I need to do something similar here? And does

 runat="server"/
have anything to do with that.

Here is contents of file:


<HTML>
<HEAD>
<TITLE>In-Out Board</TITLE>
</HEAD>
<BODY>
<FORM runat="server">
<TABLE CELLPADDING='6' CELLSPACING='0' ALIGN='center'>
<TR>
<TD COLSPAN='2' ALIGN='center'><IMG SRC='./images/InOut.jpg' BORDER='0' HSPACE='20'><FONT SIZE="+4" FACE="Arial">NE In/Out</FONT><IMG SRC='./images/InOut.jpg' BORDER='0' HSPACE='20'></TD>
</TR>
<TR>
<TD WIDTH='125'><FONT FACE="Arial">Login Name: </FONT></TD>
<TD>
<ASP:TextBox id="LoginNameBox" Width="50" MAXLENGTH="30" runat="server"/></TD>
<td>
<asp:RequiredFieldValidator id="RequiredFieldValidatorname"
ControlToValidate="LoginNameBox"
ErrorMessage="*"
Display="Static"
Width="100%" runat="server">
</asp:RequiredFieldValidator>
</td>
</TR>
<TR>
<TD><FONT FACE="Arial">Password: </FONT></TD>
<TD><ASP:TextBox id="passwordBox" Width="20" MAXLENGTH="16" TextMode="Password" runat="server"/></TD>
</TR>
<td>
<asp:RequiredFieldValidator id="RequiredFieldValidatorpassword"
ControlToValidate="passwordBox"
ErrorMessage="*"
Display="Static"
Width="100%" runat="server">
</asp:RequiredFieldValidator>
</td>
<TR>
<TD COLSPAN="3" ALIGN="center" HEIGHT='50'>
<ASP:Button id=Button1 text="Validate" runat=server /></TD>
</TR>
</TABLE>
</FORM
</BODY>
</HTML

any help is appreciated. I am working on a project for employer and am trying to get asp.net going on my local home computer for working at home. Thank you.
What do you mean in that order?? Do you have to install IIS before the .NET Framework? If so maybe that is why I am having this trouble. I am sorry if this has already been answered, I am new to this forum.

1. I installed Windows XP professional (without IIS, didn't need it at the time)
2. I installed the .NET Framework 1.1 today
3. I then installed the ASP.MATRIX
4. I then installed IIS to do the turtorials on the Matrix page.

I really do not know how to explain this, but when I do the tutorial using the IIS instead of the built in server, the only thing that shows up in my browser is the word "label" I have no button or textbox like I did just running the built in server. I followed the directions exactly. What am I doing wrong? What do I need to configure? New to IIS.

Here is the exercise I am trying to do:
http://www.asp.net/webmatrix/guidedtour/section1/runviaiisweb.aspx

Here is the output: "label" that is all that appears on the screen. Where is my button and textbox from the prior exercise??

Here is what my address bar says:http://localhost/MatrixTour/myFirstPage.aspx and the word "label" on the screen.

Please help me. What am I doing wrong?? Thanks, Dave
If you did not have IIS installed when the framework was installed, you need to:

Find aspnet_regiis.exe
In that folder, run: aspnet_regiis -i

This will set all folders to run the ASP.NET framework. Had IIS been installed before the framework, this would have been handled dusing the installation.
Okay I ran the aspnet_regiis /i in a command line window and it installed fine. I then ran my turorial again (the one to use IIS) and this is what I get now.

Server Error in '/MatrixTour' Application.
------------------------

Server cannot access application directory 'D:\Documents and Settings\Administrator.ME.000\My Documents\'. The directory does not exist or is not accessible because of security settings.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Server cannot access application directory 'D:\Documents and Settings\Administrator.DAVE.000\My Documents\'. The directory does not exist or is not accessible because of security settings.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): Server cannot access application directory 'D:\Documents and Settings\Administrator.DAVE.000\My Documents\'. The directory does not exist or is not accessible because of security settings.]
System.Web.HttpRuntime.EnsureAccessToApplicationDirectory() +72
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +263

[HttpException (0x80004005): ASP.NET Initialization Error]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +965
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +128

What does all that mean? Am I getting closer??

Thanks,

Dave
I expect that the application folder is not an application in IIS. If you make it so, perhaps that will work. I am not an expert in Web Matrix, and do not know what the implications of doing this are for that tool.
the IIS server can only deliver pages in its directory structure (usually located under the "inetpub" directory); it will not deliver any page from the hard drive).

AutoFed
That is not entirely true. You can configure any folder anywhere on the machine to be an IIS virtual folder. You are correct that IIS will not just serve files from anywhere. You could add the folder c:\test\folder to be, say, http://localhost/test/folder if you wish, or really practically any name you wish.
of course; I simply meant that you cannot equate "c:\" with "http://localhost", which seemed to be what was happening.

AutoFed
thank you, but how do I configure A directory like that? I knew how on my old 98se machine but that had personal web server and was with asp. Now with Windows xp pro and asp.net and iis I have no idea.
in IIS, you need to create a Virtual Directory. Open IIS, then right-click on the directory that you want tocontain the virtual directory (if you want the directory to be top level, right click on "Default Web Site"). Then go to "New", "Virtual Directory". It will ask you what you want the name of the Virtual Directory; you can name it the same as the actual directory, or something else if you want. Then it will ask you the actual location of the directory you want to refer to. You can then access the directory through "http://localhost/containing-directory/virtual-directory" (or if you clicked on "Default Web Site", "http://localhost/virtual-directory")

AutoFed
Ok
when I got new computer (win xp pro) in June this year it had no check mark by iis in windows components wizard.
I checked it and all the iss sub-component and installed it using win xp pro CD.
Then I install server 2000 tools and then the asp.net sdk.
Can't seem to find where to open iis to set virtual directory.
What is it under in all programs or where is it that I could create my own shortcut to get to opening iss? It doesn't seem to be in all programs or all programs accessories.
Please help getting close to needing it for a deadline.
Thank you for any assistance.

What is Needed to Get an ASP.NET Page to Work?

SOME BACKGROUND:
I am new to ASP.NET, but somehow managed to install a perfectly working
.aspx page on our production server that I compiled in Visual Studio.
However, I recently needed to update it, so I first added a ".old"
suffix to the MyPage.aspx, MyProject.dll, and global.asax files on the
production server so I had a backup copy of the original files in case
something went wrong. Indeed, something did go wrong when I installed
the files on the production server, so I deleted the ".old" suffixes to
return the application to its original state ... AND NOW IT DOESN"T
WORK?!!?!?!
I get Parser Error messages like "Could not load type
'MyProject.MyPage' " and "Could not load type 'MyProject.Global' " I
do not have this problem on my localhost, EXCEPT when I try to copy the
application into a different test directory on my localhost. Which
leads me to ...
MY QUESTION:
What exactly is needed on a host to make an .aspx page work? I was
under the impression that all you need are fully compiled (built)
.aspx, .dll, and .asax files. I thought you could just copy these
anywhere and they would work together (provided that they're in the
right folders).
What am I misunderstanding?There is other dll's that need to be included in addition to
MyProject.dll, basically everything in the bin folder after compiling,
minus the .pdb files, these are for debugging purposes.
Besides the entire bin folder, and any aspx pages, it should work fine.
The key is the entire bin folder though. Or at least this is what I
have found.
Also, everytime you compile an asp.net 2.0 website, a number of dll
files are generated that are pre-compiled aspx pages, EVERYTIME you
compile, these change. This is why you have to replace the entire bin
folder.
If you don't want it to pre-compile each aspx, you can get the "Web
Deployment Projects" from msdn that gives you additional deployment
options such as compiling all pages into a single DLL, I use that now
as it is much easier than managing all the seperate dll files.
Altemir wrote:
> SOME BACKGROUND:
> I am new to ASP.NET, but somehow managed to install a perfectly working
> .aspx page on our production server that I compiled in Visual Studio.
> However, I recently needed to update it, so I first added a ".old"
> suffix to the MyPage.aspx, MyProject.dll, and global.asax files on the
> production server so I had a backup copy of the original files in case
> something went wrong. Indeed, something did go wrong when I installed
> the files on the production server, so I deleted the ".old" suffixes to
> return the application to its original state ... AND NOW IT DOESN"T
> WORK?!!?!?!
> I get Parser Error messages like "Could not load type
> 'MyProject.MyPage' " and "Could not load type 'MyProject.Global' " I
> do not have this problem on my localhost, EXCEPT when I try to copy the
> application into a different test directory on my localhost. Which
> leads me to ...
> MY QUESTION:
> What exactly is needed on a host to make an .aspx page work? I was
> under the impression that all you need are fully compiled (built)
> .aspx, .dll, and .asax files. I thought you could just copy these
> anywhere and they would work together (provided that they're in the
> right folders).
> What am I misunderstanding?
ASP.Net 1.1?
Check... Global.asax.cs exists and is referred to in the project.
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujinionline.com
http://eduzine.edujinionline.com
---
"Altemir" <david.altemir@.gmail.com> wrote in message
news:1160570649.011924.254120@.m7g2000cwm.googlegroups.com...
> SOME BACKGROUND:
> I am new to ASP.NET, but somehow managed to install a perfectly working
> .aspx page on our production server that I compiled in Visual Studio.
> However, I recently needed to update it, so I first added a ".old"
> suffix to the MyPage.aspx, MyProject.dll, and global.asax files on the
> production server so I had a backup copy of the original files in case
> something went wrong. Indeed, something did go wrong when I installed
> the files on the production server, so I deleted the ".old" suffixes to
> return the application to its original state ... AND NOW IT DOESN"T
> WORK?!!?!?!
> I get Parser Error messages like "Could not load type
> 'MyProject.MyPage' " and "Could not load type 'MyProject.Global' " I
> do not have this problem on my localhost, EXCEPT when I try to copy the
> application into a different test directory on my localhost. Which
> leads me to ...
> MY QUESTION:
> What exactly is needed on a host to make an .aspx page work? I was
> under the impression that all you need are fully compiled (built)
> .aspx, .dll, and .asax files. I thought you could just copy these
> anywhere and they would work together (provided that they're in the
> right folders).
> What am I misunderstanding?
>
Sorry, I forgot to ask if you were using asp.net 1.1 or asp.net 2.0
My response applies to asp.net 2.0
Gaurav Vaish (www.EdujiniOnline.com) wrote:
> ASP.Net 1.1?
> Check... Global.asax.cs exists and is referred to in the project.
>
> --
> Happy Hacking,
> Gaurav Vaish | www.mastergaurav.com
> www.edujinionline.com
> http://eduzine.edujinionline.com
> ---
>
> "Altemir" <david.altemir@.gmail.com> wrote in message
> news:1160570649.011924.254120@.m7g2000cwm.googlegroups.com...
your assumption is correct, you can move the files to a server and they shou
ld run.
".old" has special meaning in visual studio, check that the files were not a
ltered by VS, which it sometimes will do...
"Altemir" <david.altemir@.gmail.com> wrote in message news:1160570649.011924.254120@.m7g2000c
wm.googlegroups.com...
> SOME BACKGROUND:
> I am new to ASP.NET, but somehow managed to install a perfectly working
> .aspx page on our production server that I compiled in Visual Studio.
> However, I recently needed to update it, so I first added a ".old"
> suffix to the MyPage.aspx, MyProject.dll, and global.asax files on the
> production server so I had a backup copy of the original files in case
> something went wrong. Indeed, something did go wrong when I installed
> the files on the production server, so I deleted the ".old" suffixes to
> return the application to its original state ... AND NOW IT DOESN"T
> WORK?!!?!?!
> I get Parser Error messages like "Could not load type
> 'MyProject.MyPage' " and "Could not load type 'MyProject.Global' " I
> do not have this problem on my localhost, EXCEPT when I try to copy the
> application into a different test directory on my localhost. Which
> leads me to ...
> MY QUESTION:
> What exactly is needed on a host to make an .aspx page work? I was
> under the impression that all you need are fully compiled (built)
> .aspx, .dll, and .asax files. I thought you could just copy these
> anywhere and they would work together (provided that they're in the
> right folders).
> What am I misunderstanding?
>
On 10/11/06 06:19, Sean Chambers wrote:
> There is other dll's that need to be included in addition to
> MyProject.dll, basically everything in the bin folder after compiling,
> minus the .pdb files, these are for debugging purposes.
> Besides the entire bin folder, and any aspx pages, it should work fine.
> The key is the entire bin folder though. Or at least this is what I
> have found.
> Also, everytime you compile an asp.net 2.0 website, a number of dll
> files are generated that are pre-compiled aspx pages, EVERYTIME you
> compile, these change. This is why you have to replace the entire bin
> folder.
> If you don't want it to pre-compile each aspx, you can get the "Web
> Deployment Projects" from msdn that gives you additional deployment
> options such as compiling all pages into a single DLL, I use that now
> as it is much easier than managing all the seperate dll files.
Sean,
I don't know if this will help your situation, but there is a setting
in the project properties that governs how the generated component DLL
files are named. I've selected "Use fixed naming and single page assemblies"
and no longer get the random DLL file names. They are named based on the
page name.
FYI.

> Altemir wrote:
>
Oh, I wasn't aware that there was an option in vs to do this.
Now I use web deployment projects which give me more control over
dev/production config section replacements, which was a large issues as
I developed one app on a pc,laptop and remote machine.
thanks!
Mark E. Hansen wrote:
> On 10/11/06 06:19, Sean Chambers wrote:
> Sean,
> I don't know if this will help your situation, but there is a setting
> in the project properties that governs how the generated component DLL
> files are named. I've selected "Use fixed naming and single page assemblie
s"
> and no longer get the random DLL file names. They are named based on the
> page name.
> FYI.
>
I finally got it to work but I'm not sure exactly what fixed it! But
I'm pretty sure it had to do with the MyProject.dll not being in the
right place.
Previously (i.e., before the update), the .dll was in the wwwroot/bin
folder. There were no .dlls in the wwwroot/MyProject folder and there
was no wwwroot/MyProject/bin folder at all. Yet it worked!!
I went to update the .aspx and .dll files and it stopped working. I
was eventually able to fix it simply by copying the bin folder into
wwwroot/MyProject. But I also noticed that the bin folder contains, in
addition to MyProject.dll, a subfolder named "_vti_cnf", that itself
contains an ADDITIONAL copy of MyProject.dll.
So at this point, I'm not sure which actually fixed the problem:
wwwroot/MyProject/bin/MyProject.dll or
wwwroot/MyProject/bin/_vti_cnf/MyProject.dll. I also don't understand
why it worked before without any .dlls in the MyProject folder. Which
leads me to ask:
1) How does the .aspx file know where its .dll is located?
2) What is the role of the _vti_cnf folder and its contents?
Thank for all your help!
P.S. I am using ASP.NET 2.0

What is Needed to Get an ASP.NET Page to Work?

SOME BACKGROUND:

I am new to ASP.NET, but somehow managed to install a perfectly working
..aspx page on our production server that I compiled in Visual Studio.
However, I recently needed to update it, so I first added a ".old"
suffix to the MyPage.aspx, MyProject.dll, and global.asax files on the
production server so I had a backup copy of the original files in case
something went wrong. Indeed, something did go wrong when I installed
the files on the production server, so I deleted the ".old" suffixes to
return the application to its original state ... AND NOW IT DOESN"T
WORK?!!?!?!

I get Parser Error messages like "Could not load type
'MyProject.MyPage' " and "Could not load type 'MyProject.Global' " I
do not have this problem on my localhost, EXCEPT when I try to copy the
application into a different test directory on my localhost. Which
leads me to ...

MY QUESTION:

What exactly is needed on a host to make an .aspx page work? I was
under the impression that all you need are fully compiled (built)
..aspx, .dll, and .asax files. I thought you could just copy these
anywhere and they would work together (provided that they're in the
right folders).

What am I misunderstanding?There is other dll's that need to be included in addition to
MyProject.dll, basically everything in the bin folder after compiling,
minus the .pdb files, these are for debugging purposes.

Besides the entire bin folder, and any aspx pages, it should work fine.
The key is the entire bin folder though. Or at least this is what I
have found.

Also, everytime you compile an asp.net 2.0 website, a number of dll
files are generated that are pre-compiled aspx pages, EVERYTIME you
compile, these change. This is why you have to replace the entire bin
folder.

If you don't want it to pre-compile each aspx, you can get the "Web
Deployment Projects" from msdn that gives you additional deployment
options such as compiling all pages into a single DLL, I use that now
as it is much easier than managing all the seperate dll files.

Altemir wrote:

Quote:

Originally Posted by

SOME BACKGROUND:
>
I am new to ASP.NET, but somehow managed to install a perfectly working
.aspx page on our production server that I compiled in Visual Studio.
However, I recently needed to update it, so I first added a ".old"
suffix to the MyPage.aspx, MyProject.dll, and global.asax files on the
production server so I had a backup copy of the original files in case
something went wrong. Indeed, something did go wrong when I installed
the files on the production server, so I deleted the ".old" suffixes to
return the application to its original state ... AND NOW IT DOESN"T
WORK?!!?!?!
>
I get Parser Error messages like "Could not load type
'MyProject.MyPage' " and "Could not load type 'MyProject.Global' " I
do not have this problem on my localhost, EXCEPT when I try to copy the
application into a different test directory on my localhost. Which
leads me to ...
>
MY QUESTION:
>
What exactly is needed on a host to make an .aspx page work? I was
under the impression that all you need are fully compiled (built)
.aspx, .dll, and .asax files. I thought you could just copy these
anywhere and they would work together (provided that they're in the
right folders).
>
What am I misunderstanding?


ASP.Net 1.1?

Check... Global.asax.cs exists and is referred to in the project.

--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujinionline.com
http://eduzine.edujinionline.com
-------------

"Altemir" <david.altemir@.gmail.comwrote in message
news:1160570649.011924.254120@.m7g2000cwm.googlegro ups.com...

Quote:

Originally Posted by

SOME BACKGROUND:
>
I am new to ASP.NET, but somehow managed to install a perfectly working
.aspx page on our production server that I compiled in Visual Studio.
However, I recently needed to update it, so I first added a ".old"
suffix to the MyPage.aspx, MyProject.dll, and global.asax files on the
production server so I had a backup copy of the original files in case
something went wrong. Indeed, something did go wrong when I installed
the files on the production server, so I deleted the ".old" suffixes to
return the application to its original state ... AND NOW IT DOESN"T
WORK?!!?!?!
>
I get Parser Error messages like "Could not load type
'MyProject.MyPage' " and "Could not load type 'MyProject.Global' " I
do not have this problem on my localhost, EXCEPT when I try to copy the
application into a different test directory on my localhost. Which
leads me to ...
>
MY QUESTION:
>
What exactly is needed on a host to make an .aspx page work? I was
under the impression that all you need are fully compiled (built)
.aspx, .dll, and .asax files. I thought you could just copy these
anywhere and they would work together (provided that they're in the
right folders).
>
What am I misunderstanding?
>


Sorry, I forgot to ask if you were using asp.net 1.1 or asp.net 2.0

My response applies to asp.net 2.0

Gaurav Vaish (www.EdujiniOnline.com) wrote:

Quote:

Originally Posted by

ASP.Net 1.1?
>
Check... Global.asax.cs exists and is referred to in the project.
>
>
--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujinionline.com
http://eduzine.edujinionline.com
-------------
>
>
"Altemir" <david.altemir@.gmail.comwrote in message
news:1160570649.011924.254120@.m7g2000cwm.googlegro ups.com...

Quote:

Originally Posted by

SOME BACKGROUND:

I am new to ASP.NET, but somehow managed to install a perfectly working
.aspx page on our production server that I compiled in Visual Studio.
However, I recently needed to update it, so I first added a ".old"
suffix to the MyPage.aspx, MyProject.dll, and global.asax files on the
production server so I had a backup copy of the original files in case
something went wrong. Indeed, something did go wrong when I installed
the files on the production server, so I deleted the ".old" suffixes to
return the application to its original state ... AND NOW IT DOESN"T
WORK?!!?!?!

I get Parser Error messages like "Could not load type
'MyProject.MyPage' " and "Could not load type 'MyProject.Global' " I
do not have this problem on my localhost, EXCEPT when I try to copy the
application into a different test directory on my localhost. Which
leads me to ...

MY QUESTION:

What exactly is needed on a host to make an .aspx page work? I was
under the impression that all you need are fully compiled (built)
.aspx, .dll, and .asax files. I thought you could just copy these
anywhere and they would work together (provided that they're in the
right folders).

What am I misunderstanding?


your assumption is correct, you can move the files to a server and they should run.

".old" has special meaning in visual studio, check that the files were not altered by VS, which it sometimes will do...

"Altemir" <david.altemir@.gmail.comwrote in message news:1160570649.011924.254120@.m7g2000cwm.googlegro ups.com...

Quote:

Originally Posted by

SOME BACKGROUND:
>
I am new to ASP.NET, but somehow managed to install a perfectly working
.aspx page on our production server that I compiled in Visual Studio.
However, I recently needed to update it, so I first added a ".old"
suffix to the MyPage.aspx, MyProject.dll, and global.asax files on the
production server so I had a backup copy of the original files in case
something went wrong. Indeed, something did go wrong when I installed
the files on the production server, so I deleted the ".old" suffixes to
return the application to its original state ... AND NOW IT DOESN"T
WORK?!!?!?!
>
I get Parser Error messages like "Could not load type
'MyProject.MyPage' " and "Could not load type 'MyProject.Global' " I
do not have this problem on my localhost, EXCEPT when I try to copy the
application into a different test directory on my localhost. Which
leads me to ...
>
MY QUESTION:
>
What exactly is needed on a host to make an .aspx page work? I was
under the impression that all you need are fully compiled (built)
.aspx, .dll, and .asax files. I thought you could just copy these
anywhere and they would work together (provided that they're in the
right folders).
>
What am I misunderstanding?
>


On 10/11/06 06:19, Sean Chambers wrote:

Quote:

Originally Posted by

There is other dll's that need to be included in addition to
MyProject.dll, basically everything in the bin folder after compiling,
minus the .pdb files, these are for debugging purposes.
>
Besides the entire bin folder, and any aspx pages, it should work fine.
The key is the entire bin folder though. Or at least this is what I
have found.
>
Also, everytime you compile an asp.net 2.0 website, a number of dll
files are generated that are pre-compiled aspx pages, EVERYTIME you
compile, these change. This is why you have to replace the entire bin
folder.
>
If you don't want it to pre-compile each aspx, you can get the "Web
Deployment Projects" from msdn that gives you additional deployment
options such as compiling all pages into a single DLL, I use that now
as it is much easier than managing all the seperate dll files.


Sean,

I don't know if this will help your situation, but there is a setting
in the project properties that governs how the generated component DLL
files are named. I've selected "Use fixed naming and single page assemblies"
and no longer get the random DLL file names. They are named based on the
page name.

FYI.

Quote:

Originally Posted by

>
Altemir wrote:

Quote:

Originally Posted by

>SOME BACKGROUND:
>>
>I am new to ASP.NET, but somehow managed to install a perfectly working
>.aspx page on our production server that I compiled in Visual Studio.
>However, I recently needed to update it, so I first added a ".old"
>suffix to the MyPage.aspx, MyProject.dll, and global.asax files on the
>production server so I had a backup copy of the original files in case
>something went wrong. Indeed, something did go wrong when I installed
>the files on the production server, so I deleted the ".old" suffixes to
>return the application to its original state ... AND NOW IT DOESN"T
>WORK?!!?!?!
>>
>I get Parser Error messages like "Could not load type
>'MyProject.MyPage' " and "Could not load type 'MyProject.Global' " I
>do not have this problem on my localhost, EXCEPT when I try to copy the
>application into a different test directory on my localhost. Which
>leads me to ...
>>
>MY QUESTION:
>>
>What exactly is needed on a host to make an .aspx page work? I was
>under the impression that all you need are fully compiled (built)
>.aspx, .dll, and .asax files. I thought you could just copy these
>anywhere and they would work together (provided that they're in the
>right folders).
>>
>What am I misunderstanding?


>


Oh, I wasn't aware that there was an option in vs to do this.

Now I use web deployment projects which give me more control over
dev/production config section replacements, which was a large issues as
I developed one app on a pc,laptop and remote machine.

thanks!

Mark E. Hansen wrote:

Quote:

Originally Posted by

On 10/11/06 06:19, Sean Chambers wrote:

Quote:

Originally Posted by

There is other dll's that need to be included in addition to
MyProject.dll, basically everything in the bin folder after compiling,
minus the .pdb files, these are for debugging purposes.

Besides the entire bin folder, and any aspx pages, it should work fine.
The key is the entire bin folder though. Or at least this is what I
have found.

Also, everytime you compile an asp.net 2.0 website, a number of dll
files are generated that are pre-compiled aspx pages, EVERYTIME you
compile, these change. This is why you have to replace the entire bin
folder.

If you don't want it to pre-compile each aspx, you can get the "Web
Deployment Projects" from msdn that gives you additional deployment
options such as compiling all pages into a single DLL, I use that now
as it is much easier than managing all the seperate dll files.


>
Sean,
>
I don't know if this will help your situation, but there is a setting
in the project properties that governs how the generated component DLL
files are named. I've selected "Use fixed naming and single page assemblies"
and no longer get the random DLL file names. They are named based on the
page name.
>
FYI.
>

Quote:

Originally Posted by


Altemir wrote:

Quote:

Originally Posted by

SOME BACKGROUND:
>
I am new to ASP.NET, but somehow managed to install a perfectly working
.aspx page on our production server that I compiled in Visual Studio.
However, I recently needed to update it, so I first added a ".old"
suffix to the MyPage.aspx, MyProject.dll, and global.asax files on the
production server so I had a backup copy of the original files in case
something went wrong. Indeed, something did go wrong when I installed
the files on the production server, so I deleted the ".old" suffixes to
return the application to its original state ... AND NOW IT DOESN"T
WORK?!!?!?!
>
I get Parser Error messages like "Could not load type
'MyProject.MyPage' " and "Could not load type 'MyProject.Global' " I
do not have this problem on my localhost, EXCEPT when I try to copy the
application into a different test directory on my localhost. Which
leads me to ...
>
MY QUESTION:
>
What exactly is needed on a host to make an .aspx page work? I was
under the impression that all you need are fully compiled (built)
.aspx, .dll, and .asax files. I thought you could just copy these
anywhere and they would work together (provided that they're in the
right folders).
>
What am I misunderstanding?



I finally got it to work but I'm not sure exactly what fixed it! But
I'm pretty sure it had to do with the MyProject.dll not being in the
right place.

Previously (i.e., before the update), the .dll was in the wwwroot/bin
folder. There were no .dlls in the wwwroot/MyProject folder and there
was no wwwroot/MyProject/bin folder at all. Yet it worked!!

I went to update the .aspx and .dll files and it stopped working. I
was eventually able to fix it simply by copying the bin folder into
wwwroot/MyProject. But I also noticed that the bin folder contains, in
addition to MyProject.dll, a subfolder named "_vti_cnf", that itself
contains an ADDITIONAL copy of MyProject.dll.

So at this point, I'm not sure which actually fixed the problem:
wwwroot/MyProject/bin/MyProject.dll or
wwwroot/MyProject/bin/_vti_cnf/MyProject.dll. I also don't understand
why it worked before without any .dlls in the MyProject folder. Which
leads me to ask:

1) How does the .aspx file know where its .dll is located?

2) What is the role of the _vti_cnf folder and its contents?

Thank for all your help!

P.S. I am using ASP.NET 2.0

what is option to create chart in asp.net?

Hi all,
If i need to create chart with the existing library in vs.net2003, how to
call it out and use it. Any example?

If i need to create more complicated chart, the exsiting library in vs.net
2003 supported? If not, what is the free/charge external library recomended?

Thank you in advance.
Best regards,
Gin Lye khor"Daniel" <Daniel@.discussions.microsoft.com> wrote in message
news:2F73C7C4-9CEF-49C6-AF68-AE3652ADDE7B@.microsoft.com...

> If not, what is the free/charge external library recomended?

http://www.advsofteng.com/cdnet.html

what is option to create chart in asp.net?

Hi all,
If i need to create chart with the existing library in vs.net2003, how to
call it out and use it. Any example?
If i need to create more complicated chart, the exsiting library in vs.net
2003 supported? If not, what is the free/charge external library recomended?
Thank you in advance.
Best regards,
Gin Lye khor"Daniel" <Daniel@.discussions.microsoft.com> wrote in message
news:2F73C7C4-9CEF-49C6-AF68-AE3652ADDE7B@.microsoft.com...

> If not, what is the free/charge external library recomended?
http://www.advsofteng.com/cdnet.html

What is OnServerClick?

I would like to know what OnServerClick is. I normally use 'onclick=' which I thought was executed on the server when I have runat server attribute.Per thedocs:

OnServerClick raises the ServerClick event. This allows you to provide a custom handler for the event.

Thus handling the click event server-side. OnClick is interpreted client-side via JavaScript. See this web page for more info:

http://www.htmlgoodies.com/beyond/adv_js.html#click
Thanks - I presume this only applies to HTML buttons and not server controls. Can you have onclick and onserver click in a server control button ?
Correct, it only is available on HTML controls that support it.

If you want to add JavaScript to an asp.net webcontrol, you can do something like this:

myButton.Attributes.Add("OnClick", "return confirm('Did you really want to click me?')")
Thanks - that is most helpful

what is Page_Init Use?

In most of code behind pages of sample applications I see the constructor with page_int initializer
e.g. web page is ProjectEntry.aspx then in ProjectEntry.aspx.cs
public ProjectEntry()
{
Page.Init += new System.EventHandler(Page_Init);
}
private void Page_Init(object sender, EventArgs e)
{
InitializeComponent();
}

What is its use and its advantage ?
is it a good practice or bad to use it
This will explain it better than I can and it is from this link. Hope this helps.
http://blog.daveranck.com


ASP.Net 1.x Page Lifecycle

I thought I would put together some quick notes om ASP.Net 1.x Page Execution Lifecycle. There have been many posts on this before and the data here was originally taken from a list on ASPAlliance found here:http://authors.aspalliance.com/aldotnet/examples/plediagram.htm . First here's the list and next I'll comment on a few of the events and how to leverage them.

Use the following key for the events below:
Black - every time page is processed
Red - only if the request is transacted
Green - only on postback
Blue - only if tracing is enabled

Begin Transaction (only when transactions are enabled for the page)
Begin TransactionProcessRequestTransacted()

TransactedCallback() on
-------
Process Request Main
-------
(described below)
Transactions.InvokeTransacted -- parts of the request that need to be done under transacted context
Process Request Main (every page, this is the main execution path)
InitInitRecursive()
Raise OnInit (recursive)
Begin tracking viewstate
LoadViewStateLoadPageViewState()
LoadPageStateFromPersistenceMedium()
ProcessPostData1ProcessPostData(_requestValueCollection, true /* BeforeLoad */);
Hand postback data to the controls that exist before Page_Load
Page.Validate()
LoadLoadRecursive();
Fire OnLoad() (recursive)
ProcessPostData2ProcessPostData(_leftoverPostData, false /* BeforeLoad */);
Hand postback data to controls added in Load (using LoadControl, for example)
Raise ChangedEventsRaiseChangedEvents()
RaisePostDataChangedEvent() on each control with postback data that is not an IPostBackEventHandler
Raise PostBackEventRaisePostBackEvent(_requestValueCollection)
RaisePostBackEvent() on the control that caused the postback
PreRenderPreRenderRecursive()
if Page.Visible
EnsureChildControls() -- creates controls if they haven't already been created by databinding
Fire OnPreRender (recursive)
Build Trace TreeBuildProfileTree("ROOT", EnableViewState)
SaveViewStateSavePageViewState()
Save state recursively for the page and it's controls
RenderRenderControl(CreateHtmlTextWriter(Response.Output))
if Page.Visible
Render() (recursive)
Finish Transaction (only when transactions are enabled for the page)
End TransactionFire OnAbortTransaction() or OnCommitTransaction()
End Trace (only when Tracing is enabled)
Trace.EndRequestif PageOutput
Trace.Render
Process Request Cleanup (every request)
* Set Request and Response to null
UnloadRecursiveUnloadRecursive()
Fire OnUnload() (recursive)
Dispose()

First, Page Init executes (I'm going to leave out the transaction-related events - you do create a DAL for your data access code, don't you ;-) ). One good use for this event is for wiring up event handlers. Just be aware that viewstate has not yet loaded.

The next method we'll talk about is the familiar Page Load event. It is in this event that most of our code that we want to run when the page loads will be placed. At this point ViewState is available and all controls that have been declared on the page have been handed the postback data. Note that if you have controls or user controls on the page, their individual Page_Load events will fire after the page's Page_Load event, in the order they were added to the control tree. The same is true for other controls events.

The PreRender event fires after the Page_Load events and after any controls events, such as a Button Click event. This is useful for manipulating anything you want, just before the page is rendered. One use is to store member variables in ViewState here to create a "Stateful" web page. To read the ViewState, we would re-hydrate the member variables in the Page Load event. Handling ViewState in this way, keeps the code in one place and creates a consistent state handling mechanism.

Finally, the page is rendered. We can override the Render event in controls to change the behavior of the control (useful for example when creating derived controls that extend the functionality of existing ASP Web Controls).

To give you an example of the execution sequence, here is the sequence from a page with one button and one user control that contains one button. The example shows the execution list after the user has clicked the button on the user control:

WebUserControl1_Init
WebForm1_Init
Page_Load
Page Button1_Load
WebUserControl1_Page_Load
UC1 Button1_Load
UC1 Button1_Click
WebForm1_PreRender
Page Button1_PreRender
WebUserControl1_PreRender
UC1 Button1_PreRender

Hope this is helpful. I'll address this in ASP.Net 2.0 in the near future.


What is Page.DataBind doing? For what is this useful?

Hello,
for what is Page.DataBind useful and what is it doing?

Thanks for any answer!
AndreasThe methodology in ADO was to loop through data and write it out to the
stream. In ADO.NET, you bind data instead of looping. Both Windows Forms and
ASP.NET have data aware controls that can be bound to. For each control that
can be bound to, there is a DataBind method. For example, a DataGrid:

DataGrid1.DataSource = MyDataSet.Table["MyTable"].DefaultView;
DataGrid1.DataBind();

If you have a lot of controls, rather than bind each individually, you can
use Page.DataBind(). This tells the rendering engine to find all controls
with a DataSource and bind them.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"Andreas Klemt" <aklemt68@.hotmail.com> wrote in message
news:eEx2MDq2DHA.208@.TK2MSFTNGP12.phx.gbl...
> Hello,
> for what is Page.DataBind useful and what is it doing?
> Thanks for any answer!
> Andreas

what is partial class ?

i heared that a new type of class is introduced in VS.NET 2005 called partial class. so i want to know what is partial class and when i should use
this partial class. please help me with source code.With Partial class you can split a class into several files:

MyClass1.cs:


public partial class MyClass
{
public void method1()
{
}
}

MyClass2.cs:

public partial class MyClass
{
public void method2()
{
}
}

Look atDan Fernandez's Blog for comprehensive details on partial types.

Hope this helps,
Appan
What is it used for?

Regards

Yahya
With Partial class you can split a class into several files.

The new "code-behind" (code separation) uses Partial.

You can use it if you want to split your classes into several of files, could for example, be useful if you auto generate the classes attributes from a data source and want the application logic to be in a file that should be included into the class etc.
In the beta, the partial class that results form a code separation page (ASPX and say .CS), means that the ultimate page class that ASP.NET generates when it parses the page and creates an assembly is built from the two files. The point is that there is only one class, and one assembly. It requires no compile step within the tool, just dynamic compilation by ASP.NET when the page is accessed.

In v1.x, the model of code behind meant that the .CS file for the page created an assembly(along with other code ebhind files) and separate class that the page-generated class inherited from. (This required the Build step to produce the code behind assembly), then ASP.NET would perform class and code generation for the actual page. This model resulted in the need to replicate protected members for the top-;level controls in the code-behind and perform explicit event wire up. All that required what we call "code-spit" from the tool.

The new model does away with the need for explicit member declarations, as these are simply the declarative form of the page.

Hope this helps explain what's going on.

Tim explained some other pieces in the followingpost

What is PostBack

What is PostBack forHi Patrick,
Postback is a mechanism to provide that you can do server-side actions. Some
actions can be handled on the client side, meaning they don't require
anything to be processed on the server side. (For example showing a mouseove
r
image effect.) On the other hand, sometimes you need to do more complex
things which you cannot do on the client side. (For example, changing a data
source on the server side.) Because of this need, there's the postback
mechanism. The page "posts" back the page to the server. (As the name
implies, this is a POST, not a GET). I recommend that you use the following
link as a starting point to get more insight how pages are processed and the
event model;
http://support.microsoft.com/defaul...kb;en-us;305141
Hope this helps,
Ethem Azun
"Patrick.O.Ige" wrote:

> What is PostBack for

What is PostBack

What is PostBack forHi Patrick,

Postback is a mechanism to provide that you can do server-side actions. Some
actions can be handled on the client side, meaning they don't require
anything to be processed on the server side. (For example showing a mouseover
image effect.) On the other hand, sometimes you need to do more complex
things which you cannot do on the client side. (For example, changing a data
source on the server side.) Because of this need, there's the postback
mechanism. The page "posts" back the page to the server. (As the name
implies, this is a POST, not a GET). I recommend that you use the following
link as a starting point to get more insight how pages are processed and the
event model;

http://support.microsoft.com/defaul...kb;en-us;305141

Hope this helps,

Ethem Azun

"Patrick.O.Ige" wrote:

> What is PostBack for

What is portable executable (PE) file?

explain it.Didn't your mommy ever tell you to say please?
ti_inn,

You need to learn something for yourself. 95% of the questions you ask here could be answered in a few minutes by searching Google or MSDN.Microsoft.com.

What is PreRender Event

Hello,

What is PreRender Event ? When it occures and what is its importance ?

Sometimes I have to use this event to change the Selected Item in Drop Down List. I am not able to change it from Page Load event ?

Hi,

please see:ASP.NET Page Lifecycle Overview

Essentially PreRender event happens just before control/page renders itself. To be exact, Page's PreRenderComplete event is the last one in that cycle. Therefore PreRender stage's significance is in that it's the last place to change anything, so that changes contribute to page/control's state plus that they get rendered.

What is preferred layout method of forms

I've built some web sites using asp.net and have used flow layout and grid layout but wonder whether there is a standard technique (like flow layout and then embedding everything in a table) that most exeperienced asp.net programmers use.

When I tried the flow layout with the table, I found that the cell sizes of the table rather awkward to try to size/resize to fit specific contents as I built the page up (adding text and labels and images).

It seems to me that grid layout is simple and straight forward but I believe that the web page can get all jumbled up if viewed on a significantly different resolution screen (at least my friends said their displays were jumbled).

Thanks,

MikePersonally, I use flowlayout and I rely heavily on tables to do the layout control. To accomodate multiple resolutions, I use percentages in combination with "fixed width" specifications on columns/cells to accomodate width variations. Generally I will try to do a minimum target (readable on a single page) of 800x600, an optimal target(intended look and layout) of 1024x768, and all other higher res receive a full window of contents... I will look over them all to make sure its functional on any level though.

You might want to do something similar. A lot of developers I see target a specific resolution and fix their sites width/layout to this. This forum does more of what I am using (resize your window to see the percentage-based controls "move" with your window), and something like cnn (http://www.cnn.com) actually targets a fixed (800x600) window.

So basically, neither layout setting will really fix your display problems, you'd be better going through and fixing it specifically for how you would like it to appear to a client.
Thanks for the quick response.

The flow layout with tables seems to essentially be a grid for controls but why is it any better than the grid layout provided in ASP.NET?

Using tables works OK for me but then I have another control to deal (the underlying table container).

I have noticed problems with (at least in the visual development environment of VS.NET) moving the cell borders in lower rows after some controls have been placed in the first row seems to move cell widths in the first row and others in the same row and also usually doen't permit a cell to be set to a much smaller width (say only 20%) of the cell above it (which has an image that spans 3 or 4 columns).

I guess that I don't understand how and why the cells in a table interact from row to row (at least in the visual development environment ). I can see that there is some type of relationship embedded into the table definition. Is there some documentation regarding tables that I am ignoring?

Mike
When I first started with .NET (late Beta1), I used Grid Layout for my first project. It was just like VB6, and I felt right at home.. After a few projects, I found that what looked good on one screen, didnt look to hot on others when I used grid layout.. i also found that VS.NET IDE really screwed up a lot when I used grid layout (for other than non-trivial interfaces). I am sure by now its been fixed, but I just got used to working in Flow Layout.

2 years (omg already?!) later, I am still using flow layout.. using Tables for my layout. Before, I had to create complex table layouts in Dreamweaver and copy/paste the HTML.. nowadays, I do it with my eyes closed.

I guess you just get used to something and keep using it.
Generally if you resize a row the rows above/below will inherit the maximum value property (width) you specified for the same columns, regardless of which row and what width properties each cell contains. Are you using the 'colspan' property on the cell(s) that contain the image you are talking about? If so, if you are using the first cell in both rows (the image row and the underlying row) then chances arethe width property of the cell below is inheriting the width you specified for the image cell or the width of the image itself...
Exactly. Grid Layout was made so that VB developers feel at home. It's ok if you're doing a form-type application. But flow layout is really what you should use for a web site.
Yes, I think that you've identified the issue that I'm seeing. The rows above/below inherit the maximum value property (width) specified for the same columns, regardless of which row and what properties each cell contains.

I do use the 'colspan' property but not on the images. I'll give that a try. It makes sense that it would allow the cell widths in the columns to then remain stable.

Thanks everyone for your responses.

Mike

What is Postback?

I know that this has been asked and answered thousands of times. As a
matter of fact, I know that I need to say

If Not Page.IsPostBack Then
'Do something
End If

for things that needs to be processed by the web server. I am still
struggling to understand this postback logic, and hope that some kind
gurus out there could help me clarify the confusion I have.

I did read quite some articles/posts about this, but still could not
clearly understand this terminology.

The MSDN documentation at the following URL says:

http://msdn.microsoft.com/library/d...stBackTopic.asp
Page.IsPostBack Property
Gets a value indicating whether the page is being loaded in response to
a client postback, or if it is being loaded and accessed for the first
time.

Quote:

Originally Posted by

>From my understanding, there is no doubt that "postback" means that


some bits of information has been transmitted to the Web server from
the client.

But what exactly is meant by "being loaded and accessed for the first
time"? How is "for the first time" defined? If I fill up the forms on
a page and submit it to server, is this a postback or no? And when the
server processes the form and returns it to the client, is this the
first time or no? Since the returned page would likely be different
from the original one.

For example, if I have a page called test.aspx. When a user puts the
following URL into the address bar of his/her browser:

http://www.someserver.com/test.aspx
The web server gets this request and compiles the test.aspx page and
sends the resulting HTML back to the client.

Up to this point, OK, there is no problem. This is absolutely the first
time that test.aspx is being accessed or loaded.

Now, suppose that the user enters some user profile information on
test.aspx page and hits the "Submit" button to update his/her profile.
And usually in this case, we enclose our implementation of the
EventHandler of the Submit button with

If Not Page.IsPostBack Then
'Do something
End If

This is exactly where it confuses me (and maybe many others out there).
This "If Not" condition is exactly opposite to my understanding of the
logic. Instead, I think it should be,

If Page.IsPostBack Then
'Do something
End If

Because, after the user fills up his/her profile info and hits the
"Submit" button, isn't this data-submission a postback? So, naturally,
we should state in our code, "if this is a postback, please do this and
this."

But, contrary to my understanding, in order for the web server to
really update the user profile, we are required to state, "if this is
not a postback, please do this and this." Hey, if an updating request
from a client is NOT a postback, then what is a postback?

Any kind guru please clarify postback?Your confusion is not at all about what a postback is, I think that you
have that clear enough. Your confusion is just what the If statement is
used for.

The code in the "If Not Page.IsPostBack" block is executed when the page
is loaded for the first time. This is used to set the initial values for
controls in the page. When the page loads for a postback, you don't want
to initialise the controls as you want them to get their values from the
data that the user posted.

If you instead want to do something when the page is loaded for a
postback, you use an "If Page.IsPostBack" statement, just as you
thought. This is not used very much, though, that's why you rarely see
it in examples. Usually you use the click event for the submit button to
perform anything on postback.

antonyliu2002@dotnet.itags.org.yahoo.com wrote:

Quote:

Originally Posted by

I know that this has been asked and answered thousands of times. As a
matter of fact, I know that I need to say
>
If Not Page.IsPostBack Then
'Do something
End If
>
for things that needs to be processed by the web server. I am still
struggling to understand this postback logic, and hope that some kind
gurus out there could help me clarify the confusion I have.
>
I did read quite some articles/posts about this, but still could not
clearly understand this terminology.
>
The MSDN documentation at the following URL says:
>
http://msdn.microsoft.com/library/d...stBackTopic.asp
>
Page.IsPostBack Property
Gets a value indicating whether the page is being loaded in response to
a client postback, or if it is being loaded and accessed for the first
time.
>

Quote:

Originally Posted by

>>From my understanding, there is no doubt that "postback" means that


some bits of information has been transmitted to the Web server from
the client.
>
But what exactly is meant by "being loaded and accessed for the first
time"? How is "for the first time" defined? If I fill up the forms on
a page and submit it to server, is this a postback or no? And when the
server processes the form and returns it to the client, is this the
first time or no? Since the returned page would likely be different
from the original one.
>
For example, if I have a page called test.aspx. When a user puts the
following URL into the address bar of his/her browser:
>
http://www.someserver.com/test.aspx
>
The web server gets this request and compiles the test.aspx page and
sends the resulting HTML back to the client.
>
Up to this point, OK, there is no problem. This is absolutely the first
time that test.aspx is being accessed or loaded.
>
Now, suppose that the user enters some user profile information on
test.aspx page and hits the "Submit" button to update his/her profile.
And usually in this case, we enclose our implementation of the
EventHandler of the Submit button with
>
If Not Page.IsPostBack Then
'Do something
End If
>
This is exactly where it confuses me (and maybe many others out there).
This "If Not" condition is exactly opposite to my understanding of the
logic. Instead, I think it should be,
>
If Page.IsPostBack Then
'Do something
End If
>
Because, after the user fills up his/her profile info and hits the
"Submit" button, isn't this data-submission a postback? So, naturally,
we should state in our code, "if this is a postback, please do this and
this."
>
But, contrary to my understanding, in order for the web server to
really update the user profile, we are required to state, "if this is
not a postback, please do this and this." Hey, if an updating request
from a client is NOT a postback, then what is a postback?
>
Any kind guru please clarify postback?
>


Gran Andersson wrote:

Quote:

Originally Posted by

Your confusion is not at all about what a postback is, I think that you
have that clear enough. Your confusion is just what the If statement is
used for.
>
The code in the "If Not Page.IsPostBack" block is executed when the page
is loaded for the first time. This is used to set the initial values for
controls in the page. When the page loads for a postback, you don't want
to initialise the controls as you want them to get their values from the
data that the user posted.
>
If you instead want to do something when the page is loaded for a
postback, you use an "If Page.IsPostBack" statement, just as you
thought. This is not used very much, though, that's why you rarely see
it in examples. Usually you use the click event for the submit button to
perform anything on postback.
>


Thank you so much. But I am still not clear. So you suggest that in
plain English, "If Not Page.IsPostBack" simply means "If this page is
being loaded for the first time"?

So, in other words, if I have

If Not Page.IsPostBack Then
'populate the textboxes with the latest stored session values.
End If

I am saying, "If this page is loaded for the first time, please fill up
the textboxes with whatever info the user has just supplied?"

Then, in what kind of situations, a page is NOT considered being loaded
for the first time?
<antonyliu2002@dotnet.itags.org.yahoo.comwrote in message
news:1163227077.798074.64140@dotnet.itags.org.i42g2000cwa.googlegro ups.com...

Quote:

Originally Posted by

Then, in what kind of situations, a page is NOT considered being loaded
for the first time?


When it's being posted back.

Consider a page which displays a record fetched from a database so that the
user can edit it.

1) When the page first loads (i.e. it is NOT being posted back to itself for
server-side processing), it fetches the record from the database and
displays its various fields for the user to edit, maybe in TextBox,
DropDownList, CheckBox webcontrols or whatever.

2) The user makes the changes etc and then clicks the Save button.

3) Clicking on the Save button causes the page to post back to itself,
persisting the newly edited values so that they can be written back to the
database.
THE VERY LAST THING YOU WANT TO DO HERE IS FETCH THE CURRENT RECORD FROM THE
DATABASE AND POTENTIALLY OVERWRITE ALL THE EDITS THAT THE USER HAS JUST
MADE!!!

Therefore, the code which does that is surrounded by the IsPostBack logic so
that it DOES NOT RUN when the page is being posted back.

Is this clear now...?
Mark Rae wrote:

Quote:

Originally Posted by

<antonyliu2002@dotnet.itags.org.yahoo.comwrote in message
news:1163227077.798074.64140@dotnet.itags.org.i42g2000cwa.googlegro ups.com...
>

Quote:

Originally Posted by

Then, in what kind of situations, a page is NOT considered being loaded
for the first time?


>
When it's being posted back.


Thanks a lot, Mark.

But, what is postback? What is the definition of postback? What are
involved in a postback event? What exactly is meant by "a page being
posted back to itself"?

There is a two-line definition of postback at webopedia, but it does
not help clear my confusion.

So a postback event ONLY happens on the client side, and its function
is to refresh the screen and persist the newly entered data? And it is
only after this, the new data is sent back to the web server?

I guess I need a definition of postback before I can possibly
understand the whole thing.

AL

Quote:

Originally Posted by

>
Consider a page which displays a record fetched from a database so that the
user can edit it.
>
1) When the page first loads (i.e. it is NOT being posted back to itself for
server-side processing), it fetches the record from the database and
displays its various fields for the user to edit, maybe in TextBox,
DropDownList, CheckBox webcontrols or whatever.
>
2) The user makes the changes etc and then clicks the Save button.
>
3) Clicking on the Save button causes the page to post back to itself,
persisting the newly edited values so that they can be written back to the
database.
THE VERY LAST THING YOU WANT TO DO HERE IS FETCH THE CURRENT RECORD FROM THE
DATABASE AND POTENTIALLY OVERWRITE ALL THE EDITS THAT THE USER HAS JUST
MADE!!!
>
Therefore, the code which does that is surrounded by the IsPostBack logic so
that it DOES NOT RUN when the page is being posted back.
>
Is this clear now...?


re:

Quote:

Originally Posted by

So a postback event ONLY happens on the client side, and its function
is to refresh the screen and persist the newly entered data? And it is
only after this, the new data is sent back to the web server?


The IsPostBack page property allows you to check whether
it is the first time that the page has been requested, or whether
the page has been requested more than once by the same client,
i.e., whether the page is posting data to itself.

If the page is posting data to itself, IsPostback is true.
If the page is requested from a page other than itself, IsPostback is false.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
<antonyliu2002@dotnet.itags.org.yahoo.comwrote in message
news:1163269209.370081.244660@dotnet.itags.org.f16g2000cwb.googlegr oups.com...

Quote:

Originally Posted by

Mark Rae wrote:

Quote:

Originally Posted by

><antonyliu2002@dotnet.itags.org.yahoo.comwrote in message
>news:1163227077.798074.64140@dotnet.itags.org.i42g2000cwa.googlegro ups.com...
>>

Quote:

Originally Posted by

Then, in what kind of situations, a page is NOT considered being loaded
for the first time?


>>
>When it's being posted back.


>
Thanks a lot, Mark.
>
But, what is postback? What is the definition of postback? What are
involved in a postback event? What exactly is meant by "a page being
posted back to itself"?
>
There is a two-line definition of postback at webopedia, but it does
not help clear my confusion.
>
So a postback event ONLY happens on the client side, and its function
is to refresh the screen and persist the newly entered data? And it is
only after this, the new data is sent back to the web server?
>
I guess I need a definition of postback before I can possibly
understand the whole thing.
>
AL
>
>

Quote:

Originally Posted by

>>
>Consider a page which displays a record fetched from a database so that the
>user can edit it.
>>
>1) When the page first loads (i.e. it is NOT being posted back to itself for
>server-side processing), it fetches the record from the database and
>displays its various fields for the user to edit, maybe in TextBox,
>DropDownList, CheckBox webcontrols or whatever.
>>
>2) The user makes the changes etc and then clicks the Save button.
>>
>3) Clicking on the Save button causes the page to post back to itself,
>persisting the newly edited values so that they can be written back to the
>database.
>THE VERY LAST THING YOU WANT TO DO HERE IS FETCH THE CURRENT RECORD FROM THE
>DATABASE AND POTENTIALLY OVERWRITE ALL THE EDITS THAT THE USER HAS JUST
>MADE!!!
>>
>Therefore, the code which does that is surrounded by the IsPostBack logic so
>that it DOES NOT RUN when the page is being posted back.
>>
>Is this clear now...?


>


<antonyliu2002@dotnet.itags.org.yahoo.comwrote in message
news:1163269209.370081.244660@dotnet.itags.org.f16g2000cwb.googlegr oups.com...

Quote:

Originally Posted by

But, what is postback? What is the definition of postback? What are
involved in a postback event? What exactly is meant by "a page being
posted back to itself"?


OK - think we need a bit of a step back here.

The entire ASP / ASP.NET paradigm works on the fact that the webserver and
web clients are entirely disconnected one from another. Communication
between them is, generally speaking, via an HttpRequest and an HttpResponse.
The client sends a request to the server and the server responds with a
stream of HTML markup back down to the client.

When you first go to a webpage, it is served back to you "clean", for want
of a better description. There may be a QueryString or there may be a Form
object which the server processes to decide what data to serve back to the
client, but that's pretty much it.

With ASP.NET we have the concept of a postback. That means that, in response
to a client-side event (e.g. a button click etc) the page is requested A
SECOND TIME. Behind the scenes a submit action has been intiated on the
page's Form object. Two hidden elements of the page's Form collection tell
the server which webcontrol has initiated this "postback", and which
server-side event to process.

Broadly speaking, that tells the server which server-side code to run. If an
<asp:Buttoncontrol has been clicked, it is likely that the event to be
processed with be that button's Click event. The developer writes code
"behind" that event which gets processed with the button is clicked.

Postback is really not much more than a form submission which the server is
able to interpret.

However, through the IsPostback property of the page object, ASP.NET is able
to tell whether the page is being reqested for the first time, or as the
result of a postback. This allows the developer to control which code runs
in either scenario.

Let's say we have an aspx page with the following webcontrols:

<asp:Form ID="MyForm" runat="server">
<asp:TextBox ID="MyTextBox runat="server">
<asp:Button ID="MyButton" runat="server" Text="Save"
OnClick="MyButton_Click" />
</asp:Form>

When the page first loads, it fetches a value from the database, which it
pokes into the Text property of the TextBox.

Let's say we have a Page_Load event as follows:

private void Page_Load(object sender, System.EventArgs e)
{
string strText = <fetch value from database>; // fetch value
MyTextBox.Text = strText; // populate TextBox
}

Now the TextBox is displayed on the webpage with the value from the database
because every time this webpage loads, the Page_Load event fires.

When the Button object is clicked, it will fire the event as defined in its
OnClick property, so we'd better write one...

protected void MyButton_Click(object sender, EventArgs e)
{
string strNewValue = MyTextBox.Text; // get the new value of the
TextBox
<update database with value from TextBox>
}

However, there is an obvious flaw in the above, since the Page_Load event
fires whenever the page is loaded, whether in response to a postback or not.
Therefore the following will happen:

1) The user loads the page for the first time

2) The Page_Load event fires, queries the database, and populates the
TextBox

3) The user edits the value of the TextBox

4) The user clicks the Save button

5) The page is posted back to itself in response to the click of the button

6) The Page_Load event fires, queries the database, and populates the
TextBox - hint: here's the problem!

7) The MyButton_Click event fires, reads the value from the TextBox and
updates the database

We could go round in circles like this ad infinitum. The new value never
gets written back to the database because it's being overwritten with the
old value every time.

Therefore, all we need to do to fix this is surround the code in the
Page_Load event with the IsPostback logic, as follows:

private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostback)
{
string strText = <fetch value from database>; // fetch value
MyTextBox.Text = strText; // populate
TextBox
}
}

Now, the following happens:

1) The user loads the page for the first time

2) The Page_Load event fires, queries the database, and populates the
TextBox BECAUSE IT'S NOT A POSTBACK!!!

3) The user edits the value of the TextBox

4) The user clicks the Save button

5) The page is posted back to itself in response to the click of the button

6) The Page_Load event fires as it always does BUT DOES NOT RUN ANY OF THE
Page_Load CODE BECAUSE IT'S SURROUNDED BY THE IsPostback LOGIC!!!

7) The MyButton_Click event fires, reads the value from the TextBox WHICH
HASN'T BEEN OVERWRITTEN THIS TIME and updates the database.
antonyliu2002@dotnet.itags.org.yahoo.com wrote:

Quote:

Originally Posted by

But, what is postback? What is the definition of postback? What are
involved in a postback event? What exactly is meant by "a page being
posted back to itself"?


A postback is when a form with runat="server" is posted back to the same
page.

If you come to the page from a link, from a redirect, from a typed in
url, from a form without runat="server", or from a form with
runat="server" but on a different page, it's not a postback.
Mark Rae wrote:

Quote:

Originally Posted by

<antonyliu2002@dotnet.itags.org.yahoo.comwrote in message
news:1163269209.370081.244660@dotnet.itags.org.f16g2000cwb.googlegr oups.com...
>

Quote:

Originally Posted by

But, what is postback? What is the definition of postback? What are
involved in a postback event? What exactly is meant by "a page being
posted back to itself"?


>
OK - think we need a bit of a step back here.
>
The entire ASP / ASP.NET paradigm works on the fact that the webserver and
web clients are entirely disconnected one from another. Communication
between them is, generally speaking, via an HttpRequest and an HttpResponse.
The client sends a request to the server and the server responds with a
stream of HTML markup back down to the client.
>
When you first go to a webpage, it is served back to you "clean", for want
of a better description. There may be a QueryString or there may be a Form
object which the server processes to decide what data to serve back to the
client, but that's pretty much it.
>
With ASP.NET we have the concept of a postback. That means that, in response
to a client-side event (e.g. a button click etc) the page is requested A
SECOND TIME. Behind the scenes a submit action has been intiated on the
page's Form object. Two hidden elements of the page's Form collection tell
the server which webcontrol has initiated this "postback", and which
server-side event to process.
>
Broadly speaking, that tells the server which server-side code to run. If an
<asp:Buttoncontrol has been clicked, it is likely that the event to be
processed with be that button's Click event. The developer writes code
"behind" that event which gets processed with the button is clicked.
>
Postback is really not much more than a form submission which the server is
able to interpret.
>
However, through the IsPostback property of the page object, ASP.NET is able
to tell whether the page is being reqested for the first time, or as the
result of a postback. This allows the developer to control which code runs
in either scenario.
>
Let's say we have an aspx page with the following webcontrols:
>
<asp:Form ID="MyForm" runat="server">
<asp:TextBox ID="MyTextBox runat="server">
<asp:Button ID="MyButton" runat="server" Text="Save"
OnClick="MyButton_Click" />
</asp:Form>
>
When the page first loads, it fetches a value from the database, which it
pokes into the Text property of the TextBox.
>
Let's say we have a Page_Load event as follows:
>
private void Page_Load(object sender, System.EventArgs e)
{
string strText = <fetch value from database>; // fetch value
MyTextBox.Text = strText; // populate TextBox
}
>
Now the TextBox is displayed on the webpage with the value from the database
because every time this webpage loads, the Page_Load event fires.
>
When the Button object is clicked, it will fire the event as defined in its
OnClick property, so we'd better write one...
>
protected void MyButton_Click(object sender, EventArgs e)
{
string strNewValue = MyTextBox.Text; // get the new value of the
TextBox
<update database with value from TextBox>
}
>
However, there is an obvious flaw in the above, since the Page_Load event
fires whenever the page is loaded, whether in response to a postback or not.
Therefore the following will happen:
>
1) The user loads the page for the first time
>
2) The Page_Load event fires, queries the database, and populates the
TextBox
>
3) The user edits the value of the TextBox
>
4) The user clicks the Save button
>
5) The page is posted back to itself in response to the click of the button
>
6) The Page_Load event fires, queries the database, and populates the
TextBox - hint: here's the problem!
>
7) The MyButton_Click event fires, reads the value from the TextBox and
updates the database
>
We could go round in circles like this ad infinitum. The new value never
gets written back to the database because it's being overwritten with the
old value every time.
>
Therefore, all we need to do to fix this is surround the code in the
Page_Load event with the IsPostback logic, as follows:
>
private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostback)
{
string strText = <fetch value from database>; // fetch value
MyTextBox.Text = strText; // populate
TextBox
}
}
>
Now, the following happens:
>
1) The user loads the page for the first time
>
2) The Page_Load event fires, queries the database, and populates the
TextBox BECAUSE IT'S NOT A POSTBACK!!!
>
3) The user edits the value of the TextBox
>
4) The user clicks the Save button
>
5) The page is posted back to itself in response to the click of the button
>
6) The Page_Load event fires as it always does BUT DOES NOT RUN ANY OF THE
Page_Load CODE BECAUSE IT'S SURROUNDED BY THE IsPostback LOGIC!!!
>
7) The MyButton_Click event fires, reads the value from the TextBox WHICH
HASN'T BEEN OVERWRITTEN THIS TIME and updates the database.


Hey, Mark. Thanks so much for dedicating so much time in writing this.
I think I am pretty clear about this issue now.

After I read your eplanation, I realize that it is important to know
that the code is being executed linearly from top to bottom, such that
if every time the code in Page_Load is executed, it overwrites the
newly-entered data. And things happen so fast that we cannot eyeball
it, thus causing quite a bit confusing. (An animated flash movie
showing the whole thing frame by frame will certainly help in an
ASP.NET classroom.) I will save this and share it with my
co-student-worker who is also confused about the whole thing.
Gran Andersson wrote:

Quote:

Originally Posted by

antonyliu2002@dotnet.itags.org.yahoo.com wrote:

Quote:

Originally Posted by

But, what is postback? What is the definition of postback? What are
involved in a postback event? What exactly is meant by "a page being
posted back to itself"?


>
A postback is when a form with runat="server" is posted back to the same
page.
>
If you come to the page from a link, from a redirect, from a typed in
url, from a form without runat="server", or from a form with
runat="server" but on a different page, it's not a postback.


Velli good, much clearer now. Thanks a million.

AL
<antonyliu2002@dotnet.itags.org.yahoo.comwrote in message
news:1163295087.866017.80040@dotnet.itags.org.b28g2000cwb.googlegro ups.com...

Quote:

Originally Posted by

After I read your eplanation, I realize that it is important to know
that the code is being executed linearly from top to bottom,


That's a common mistake that people new to ASP.NET make - there is indeed an
"order of events", but it most certainly isn't "top to bottom" - it may look
like that because Page_Load is by default the first event in the page's
class. However, if you wrote an event and placed it's code above Page_Load,
that would make no difference to when it fired.
http://msdn2.microsoft.com/en-us/library/ms178472.aspx

Quote:

Originally Posted by

such that if every time the code in Page_Load is executed, it overwrites
the
newly-entered data.


This was just an example to try to demonstrate one possible effect of not
using the page's IsPostback property...

Quote:

Originally Posted by

And things happen so fast that we cannot eyeball it, thus causing quite a
bit
confusing.


? So put a breakpoint on the first line of each event and step through
your page's entire code line by line...
Mark Rae wrote:

Quote:

Originally Posted by

<antonyliu2002@dotnet.itags.org.yahoo.comwrote in message
news:1163295087.866017.80040@dotnet.itags.org.b28g2000cwb.googlegro ups.com...
>

Quote:

Originally Posted by

After I read your eplanation, I realize that it is important to know
that the code is being executed linearly from top to bottom,


>
That's a common mistake that people new to ASP.NET make - there is indeed an
"order of events", but it most certainly isn't "top to bottom" - it may look
like that because Page_Load is by default the first event in the page's
class. However, if you wrote an event and placed it's code above Page_Load,
that would make no difference to when it fired.
http://msdn2.microsoft.com/en-us/library/ms178472.aspx
>


Thanks a lot for pointing this out. That's entirely correct.

Quote:

Originally Posted by

Quote:

Originally Posted by

such that if every time the code in Page_Load is executed, it overwrites
the newly-entered data.


>
This was just an example to try to demonstrate one possible effect of not
using the page's IsPostback property...
>

Quote:

Originally Posted by

And things happen so fast that we cannot eyeball it, thus causing quite a
bit confusion.


>
? So put a breakpoint on the first line of each event and step through
your page's entire code line by line...


I haven't seriously used such debugging tools. But will definitely try.