Re: ASP.Net Newbie Questions

From: MDW (MDW_at_discussions.microsoft.com)
Date: 11/27/04


Date: Sat, 27 Nov 2004 12:05:03 -0800

Kevin,

Thanks for the quick response. I still have a question, though, regarding
this:

> An ASP.Net WebForm is an entity which posts back to itself, in order to enable
> the ASP.Net event model, which requires postbacks to handle client-side
> events on the server. In general, you should confine the functionality of a
> single page to only the appropriate functionality for that page.

I'm a bit unclear as to what you mean by "client-side events on the server".
When I hear client-side, I think of JavaScript and stuff like form
validation. Is ASP.Net trying to pre-empt the kind of things that JavaScript
does? There does seem to be quite a bit of architecture in place that could
be used to validate user input. Is that the whole purpose of the PostBack
entity?

Also, if the philosophy of ASP.Net is not to have everything on one page,
does that mean that Request.Form still exists? Can I still put
"action=nextpage.aspx" on a form to have that form post its data to another
page?

As I've said, the book I'm using seems to be pretty sub-par. I can't find
the answers in there, and all the examples I can find use single pages -
there is no "how to post a form to another page" example. I apologize if
these are ridiculously stupid questions.

"Kevin Spencer" wrote:

> Hi MDW,
>
> > 1) It seems like the philosophy of ASP.Net is to have one gigantic page
> that
> > constantly posts back on itself. Instead of moving from page to page, you
> > simply show and hide different parts of the same page using Panels. Is
> that
> > an accurate impression? If so, what is advantageous about that?
>
> That is incorrect. Putting all of the functionality of all of your pages
> into a single page would make that one page take forever to process. An
> ASP.Net WebForm is an entity which posts back to itself, in order to enable
> the ASP.Net event model, which requires postbacks to handle client-side
> events on the server. In general, you should confine the functionality of a
> single page to only the appropriate functionality for that page. For
> example, it wouldn't make sense to create a login page, and include
> functionality in that page for ordering a product. The login page is only
> used once, and should therefore only be loaded once, when logging in. A
> product ordering page should be a page unto itself.
>
> > 2) I'm still confused about these pseudo-HTML controls that have"<asp:" in
> > front of them. In the book I'm reading, they have one example -
> > <asp:DropDownList
> > id="List1"
> > runat="Server">
> > <asp:ListItem>Hour</asp:ListItem>
> > <asp:ListItem>Minute</asp:ListItem>
> > <asp:ListItem>Second</asp:ListItem>
> > </asp:DropDownList>
> >
> > And then later on -
> > <select
> > id="MySelect"
> > size="1"
> > runat="server">
> > <option>Hour</option>
> > <option>Minute</option>
> > <option>Second</option>
> > </select>
>
> These are 2 different types of classes, each with its own set of
> functionality. They certainly do overlap somewhat. One is an HtmlControl.
> The other is a WebControl. Use the one that fits your needs best.
>
> > 3) Can a cookie set in ASP.Net be read in classic ASP, and vice versa? Or,
> > to be more general, are there any dangers in having a web app that
> contains
> > both classic ASP and ASP.Net?
>
> Yes, a cookie can be set by either and read by the other. Cookies are pure
> text. You may run into some Character set issues, which can be solved fairly
> easily.
>
> Dangers? If I understand you correctly, there are a couple of issues. ASP
> and ASP.Net are 2 entirely different ISAPIs, and therefore, do not share any
> memory space. Sessions and Application cannot be shared between them. There
> are some techniques you can use to pass data back and forth between them
> (form submit, query string, etc).
>
> --
> HTH,
> Kevin Spencer
> ..Net Developer
> Microsoft MVP
> Neither a follower
> nor a lender be.
>
> "MDW" <MDW@discussions.microsoft.com> wrote in message
> news:9733F1D9-7601-4DAC-A97A-BEE2E7276873@microsoft.com...
> > Hey all.
> >
> > I'm fairly well versed in classic ASP, and I'm trying to teach myself
> > ASP.Net. I have a book - which isn't very good - and I'm kind of trudging
> > through. I haven't been working at this for very long, but I already have
> > some questions. If someone could help me out or point me in the right
> > direction, I'd appreciate it.
> >
> > 1) It seems like the philosophy of ASP.Net is to have one gigantic page
> that
> > constantly posts back on itself. Instead of moving from page to page, you
> > simply show and hide different parts of the same page using Panels. Is
> that
> > an accurate impression? If so, what is advantageous about that?
> >
> > 2) I'm still confused about these pseudo-HTML controls that have"<asp:" in
> > front of them. In the book I'm reading, they have one example -
> > <asp:DropDownList
> > id="List1"
> > runat="Server">
> > <asp:ListItem>Hour</asp:ListItem>
> > <asp:ListItem>Minute</asp:ListItem>
> > <asp:ListItem>Second</asp:ListItem>
> > </asp:DropDownList>
> >
> > And then later on -
> > <select
> > id="MySelect"
> > size="1"
> > runat="server">
> > <option>Hour</option>
> > <option>Minute</option>
> > <option>Second</option>
> > </select>
> >
> > It seems to me that these two things are identical. Why would you have a
> > need to use something like "<asp:DropDownList>"? It seems like it would be
> > harder to create CSS for all these wierd form controls or....whatever they
> > are....
> >
> > 3) Can a cookie set in ASP.Net be read in classic ASP, and vice versa? Or,
> > to be more general, are there any dangers in having a web app that
> contains
> > both classic ASP and ASP.Net?
> >
> >
> > Thanks!
> > --
> > Hmm...they have the Internet on COMPUTERS now!
>
>
>



Relevant Pages

  • Re: ASP.Net Newbie Questions
    ... which requires postbacks to handle client-side ... > single page to only the appropriate functionality for that page. ... I'm a bit unclear as to what you mean by "client-side events on the server". ... >> constantly posts back on itself. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: possible attribute-oriented class
    ... the namespace/AttrDict concept (see Ken Newton's, ... posts). ... If you do need such functionality, ... But it's not the reason to resign from a feature that has particular common ...
    (comp.lang.python)
  • Re: WTD: Collins KWM-2 or -2A
    ... blocking software so my email to them dissappears or gets bounced back to ... He used the word "functional," also, and there is a range of functionality ... you turn on the power switch, tubes light up and rig puts out half power ... just four posts down from the original thread, is a post for a KWM-2A for ...
    (rec.radio.amateur.boatanchors)
  • Re: Can Help me?
    ... these lines in the past week, but now your scenario is only ... If this is a study question you ... They don't provide the functionality of a newsreader. ... But i think from reading all his posts, ...
    (microsoft.public.windows.server.active_directory)
  • Re: textbox lost focus in aspnet
    ... I believe you're mixing up server-side and client-side functionality here. ... Anything that ahppens on the client, such as handling an HTML ...
    (microsoft.public.dotnet.framework.aspnet)