Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Questions for Alex Homer


Message #1 by Daniel Walker <danielw@w...> on Tue, 29 May 2001 14:29:28 +0100
Questions for Alex Homer

This mail contains the questions submitted in advance of today's author

ssession with Alex Homer.



----------------------------------------------------------------------------

--------------



paklions@y...

Hello

I'm new Beginner to ASP, I have one question. What is the basic difference

between ASP and ASP.NET?



----------------------------------------------------------------------------

---------------

santosh_nadgeri@s...

I have one problem.

I have a page which we say Pagelet.

I want to include output of this Pagelet in my aspx page.

I will register the ascx page in my aspx page, it will work fine.

But problem is that I have codebehind for both aspx as well as ascx pages.

Because I am having codebehind for both it is giving some problem. Can you

suggest a solution for this? Actually I am placing menubar in my pagelet,

which is having codebehind.



----------------------------------------------------------------------------

---------------

john.mandia@x...

There seems to be a lot of examples of ASP.Net with VB.Net but I'm having

trouble finding C# examples.

Do you think VB.Net will be the common language for ASP.Net (Like VBScript

is today)?

Does your new book give a lot of C# examples?



----------------------------------------------------------------------------

---------------

martin.putz@u...

What do I need to do that the Web Control (e.g. a Login-Control containing a

couple of Controls) I am currently building with C# does render itself also

in design mode in vs.net?



----------------------------------------------------------------------------

---------------

Brent@3...

Concerning speed issues.

One of the passages in Wrox professional mentions that the size of the page

affects the speed of the application.

What it doesn't say is that the size of the ASP page or is it the size of

the routine that displays a web page for the User to see?



----------------------------------------------------------------------------

---------------

shaikh_farhan@y...

Is .NET Framework had Form Component, is the component they are working on

Netscape or their own Browser





----------------------------------------------------------------------------

---------------

Sharon.wan@d...

I am a member of ASP Today and an enthusiastic reader of your books and

articles. I have learned a lot from you and am very grateful for your

instruction. Now I have some questions which I hope you could anwser at your

convenience.



1. I am trying to use recordset.filter get what I want and hide others. I

succeeded in filtering and got the data, but have difficulty to present the

data in the table format. For example, I use recordset.filter

"CategoryID=1" to get one set of data and recordset.filter ="Category=2" to

get the second set of data and maybe a third or fourth filter to get some

more sets of data. But I need to present those data under one <tr></tr> and

different <td></td>'s. Since I loop through the original recordset several

times and got different set of data each time, I can not present in the

right table format. I need to present them individually after each filter

but in one table and in one <tr></tr>,could you tell me how to fulfill that

purpose.





2. I need to get some of the column headers from a database table and

present them as table row names in my web application, and get one column

from the database table and present it as table column names in my web

application. It is like a crosstab but not exactly. I know how to get one

column and present it as row names and get another column and present it as

column names, but do not know how to get some of the column headers from a

database table and present them as row names efficiently. Also for sure, I

need to get the value data related to those rows and columns. And I am using

ASP and trying XML.



Would you please give me some suggestions on how to solve the problems? I

really appreciate it. Look forward to hearing from you.



Sharon Wan

DTN Data Services



----------------------------------------------------------------------------

---------------

osmanc@v...



I have got win 2000 server and already IIS 5.0 and today I had installed

framework (for .aspx pages) ,mdacsdk2.6 and  mobile mwbsdk.exe in  my

machine  after that

I had written in my url  "localhost/deneme/ilk.aspx" its gives error like

"Failed to start monitoring directory changes in D:\YNETPUB\WWWROOT " I

didn't understand why it s gives this error (you should know this  my root

address is  D:\Inetpub\wwwroot  , xspwp.exe is running ,xspisapi.dll is

registered  and Deneme is virtual directory  ) my ilk.aspx file is like this

but  I had chanced this page but result didn't chanced

 

''''''''''''''''ilk.aspx '''''''''''''''''''''''''''''''''''''''''''

> <%@ Page Language="vb" Debug="true" %>

> <%@ Register TagPrefix="Acme" Namespace="Acme" %>

> <html>

>    <head>

>       <link rel="stylesheet"href="intro.css">

>    </head>

>    <!-- scripts language="VB" runat=server>

>        Sub SubmitBtn_Click(Sender As Object, E As EventArgs)

>            Message.Text = "Hi " & Name.Text & ", you selected: " &

> Category.SelectedItem.Text & " on: " & MyCal.Date.ToShortDateString()

>        End Sub

>    </scripts -->

>    <body>

>        <center>

>        <form action="intro7.aspx" method="post" runat="server"

target="_new">

>            <asp:adrotator AdvertisementFile="ads.xml" BorderColor="black"

> BorderWidth=1 runat="server"/>

>            <h3> Name: <asp:textbox id="Name" runat="server"/>

>            Category:  <asp:dropdownlist id="Category" runat=server>

>                          <asp:listitem >psychology</asp:listitem>

>                          <asp:listitem >business</asp:listitem>

>                          <asp:listitem >popular_comp</asp:listitem>

>                       </asp:dropdownlist>

>            <asp:button type=submit text="Lookup" OnClick="SubmitBtn_Click"

> runat="server"/>

>            <p>

>            <Acme:Calendar id="MyCal" runat=server/>

>            <p>

>            <asp:label id="Message" runat="server"/>

>        </form>

>        </center>

>    </body>

> </html>



''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

----------------------------------------------------------------------------

---------------



uma1@v...

1st Question:

I seem to find it difficult to post XML data using POST Method to a

Webserver (particularly to a webservice) after a connection is created using

WebRequestFactory. Actually I am trying to use an httphandler class

intercept an improperly formatted SOAP message sent to a particular web

address, alter it into proper format, sent to a web service and have a web

service read its incoming message and handle it. However much I try, I am

unable to send the properly formatted SOAP message sent to the service by

the http handler. Can you enlighten me? (I think that the webservice context

receives the message after it has been similarly received and prcessed by

its system handler - I am not sure though)



2nd question:



I tried to override a MimeReturnWriter class and had my webservice use this

class for writing the return message by making an entry in the config.web

file <ReturnWriterTypes> However, my custom return writer class is not

detected by the service whether I place it in the Bin directory under the

assembly or anywhere else. Can you enlighten me?

Message #2 by alex@b... on Tue, 29 May 2001 14:54:50
I would say that it's all down to the new runtime framework that .NET 

introduces. It means that an ASP page including all the code is now 

compiled into Intermediate Language (IL) - together with any of the new 

server controls that are provided with .NET. This gives better 

performance, easier development and the ability to write code that is a 

lot better structured. You can handle events that occur on the client 

within your servers-side code through the postback architecture, which 

looks after a lot of the things that were awkward in ASP such as 

remembering the values that were entered into controls on the page.



> paklions@y...

> Hello

> I'm new Beginner to ASP, I have one question. What is the basic 

difference

> between ASP and ASP.NET?

> 



Message #3 by alex@b... on Tue, 29 May 2001 14:55:55
I tend not to use code-behind, as I'm a geek and still wrote ASP.NET pages 

in a text editor (I use TextPad from http://www.textpad.com which is 

excellent). Certainly for a Pagelet (or user control) I would tend to put 

the code into the Pagelet file itself.





> santosh_nadgeri@s...

> I have one problem.

> I have a page which we say Pagelet.

> I want to include output of this Pagelet in my aspx page.

> I will register the ascx page in my aspx page, it will work fine.

> But problem is that I have codebehind for both aspx as well as ascx 

pages.

> Because I am having codebehind for both it is giving some problem. Can 

you

> suggest a solution for this? Actually I am placing menubar in my pagelet,

> which is having codebehind.

> 



Message #4 by alex@b... on Tue, 29 May 2001 14:57:49
I guess you mean 'Professional ASP 3.0'. Two things generally affect the 

perceived response of a page (as seen by the user) - the execution time 

for the code and the download speed of the resulting HTML and content. 

ASP.NET is much quicker for anything other than a trivial page when 

executing the code. The delays are most likely to appear when you access 

something like a database to build the results. If you are creating a lot 

of content to send to the client this obviously also affects performance. 

In ASP.NET there are several extra features that can help to speed up the 

server response, such as output caching. Remember other things like 

flushing output to the client so that they see something early on if parts 

of your code take a long time to run. Also be aware of the HTML issues 

like tables, where in most cases the user has to wait for the whole page 

to arrive before they get to see anything (as the browser only knows how 

wide to make the columns after it has got all the cell content).



> Brent@3...

> Concerning speed issues.

> One of the passages in Wrox professional mentions that the size of the 

page

> affects the speed of the application.

> What it doesn't say is that the size of the ASP page or is it the size of

> the routine that displays a web page for the User to see?



Message #5 by alex@b... on Tue, 29 May 2001 14:57:14
There are plenty of C# examples in the SDK that comes with .NET and in the 

sample files that are also included (the ASP QuickStart). Our new book 

will feature mainly VB code, but there will be some C# and many of the 

samples we provide will be in C# as well. At the moment, VB is by far the 

most common language for ASP pages, and this is likely to continue at 

least for the time being. As all languages are compiled to IL code before 

being executed, there is no longer the issue of which is best or which is 

fastest - you use the one you prefer to program in.



> john.mandia@x...

> There seems to be a lot of examples of ASP.Net with VB.Net but I'm having

> trouble finding C# examples.

> Do you think VB.Net will be the common language for ASP.Net (Like 

VBScript

> is today)?

> Does your new book give a lot of C# examples?



Message #6 by "Alex Homer" <alex@b...> on Tue, 29 May 2001 14:59:33
I think you mean "will the server-side Form control work on all browsers". 

The answer is yes, as (in general) server controls output HTML 3.2 code 

and certainly for an HTML form the code they create will work on all 

browsers.



> shaikh_farhan@y...

> Is .NET Framework had Form Component, is the component they are working 

on

> Netscape or their own Browser

> 



Message #7 by "Alex Homer" <alex@b...> on Tue, 29 May 2001 15:00:33
In reality, you probably want to get the data from the database in a 

format that is better suited to your display requirements. You can use a 

stored procedure in most databases that build a recordset containing all 

the columns you need in each row, and then it is easy to display the 

results. The only other solution I can think of is to use the GetRows 

method to convert the records into arrays and then access the three arrays 

to build the table rows.



The name of a column in a recordset can be obtained by accessing the Name 

property of each field. If you've got a recordset in a variable named oRs:



For Each objItem In oRs.Fields

    Response.Write objItem.Name & "<br />"

Next





> Sharon.wan@d...

> I am a member of ASP Today and an enthusiastic reader of your books and

> articles. I have learned a lot from you and am very grateful for your

> instruction. Now I have some questions which I hope you could anwser at 

your

> convenience.

> 

> 1. I am trying to use recordset.filter get what I want and hide others. I

> succeeded in filtering and got the data, but have difficulty to present 

the

> data in the table format. For example, I use recordset.filter

> "CategoryID=1" to get one set of data and recordset.filter ="Category=2" 

to

> get the second set of data and maybe a third or fourth filter to get some

> more sets of data. But I need to present those data under one <tr></tr> 

and

> different <td></td>'s. Since I loop through the original recordset 

several

> times and got different set of data each time, I can not present in the

> right table format. I need to present them individually after each filter

> but in one table and in one <tr></tr>,could you tell me how to fulfill 

that

> purpose.

> 

> 

> 2. I need to get some of the column headers from a database table and

> present them as table row names in my web application, and get one column

> from the database table and present it as table column names in my web

> application. It is like a crosstab but not exactly. I know how to get one

> column and present it as row names and get another column and present it 

as

> column names, but do not know how to get some of the column headers from 

a

> database table and present them as row names efficiently. Also for sure, 

I

> need to get the value data related to those rows and columns. And I am 

using

> ASP and trying XML.

> 

> Would you please give me some suggestions on how to solve the problems? I

> really appreciate it. Look forward to hearing from you.

> 

> Sharon Wan

> DTN Data Services



Message #8 by "Alex Homer" <alex@b...> on Tue, 29 May 2001 15:04:08
Sorry, but you've beaten me there. I haven't got this far yet, as I've 

been concentrating on learning (and writing about) the data access stuff 

and the server controls provided with the frameworks. Maybe someone else 

can provide you with an answer?



> martin.putz@u...

> What do I need to do that the Web Control (e.g. a Login-Control 

containing a

> couple of Controls) I am currently building with C# does render itself 

also

> in design mode in vs.net?



Message #9 by "Alex Homer" <alex@b...> on Tue, 29 May 2001 15:05:43
I don't know where the error message you mention is coming from, it sounds 

like some internal error generated by ASP.NET itself, maybe due to an 

installation error. Your code also contains an error: it should be <script 

runat="server"> and not <scripts> (plus you have it commented out in your 

example code anyway). Note also that you should never set the action 

attribute of a <form> element when you use runat="server". Let ASP.NET set 

it for you.





> osmanc@v...

> 

> I have got win 2000 server and already IIS 5.0 and today I had installed

> framework (for .aspx pages) ,mdacsdk2.6 and  mobile mwbsdk.exe in  my

> machine  after that

> I had written in my url  "localhost/deneme/ilk.aspx" its gives error like

> "Failed to start monitoring directory changes in D:\YNETPUB\WWWROOT " I

> didn't understand why it s gives this error (you should know this  my 

root

> address is  D:\Inetpub\wwwroot  , xspwp.exe is running ,xspisapi.dll is

> registered  and Deneme is virtual directory  ) my ilk.aspx file is like 

this

> but  I had chanced this page but result didn't chanced

>  

> ''''''''''''''''ilk.aspx '''''''''''''''''''''''''''''''''''''''''''

> > <%@ Page Language="vb" Debug="true" %>

> > <%@ Register TagPrefix="Acme" Namespace="Acme" %>

> > <html>

> >    <head>

> >       <link rel="stylesheet"href="intro.css">

> >    </head>

> >    <!-- scripts language="VB" runat=server>

> >        Sub SubmitBtn_Click(Sender As Object, E As EventArgs)

> >            Message.Text = "Hi " & Name.Text & ", you selected: " &

> > Category.SelectedItem.Text & " on: " & MyCal.Date.ToShortDateString()

> >        End Sub

> >    </scripts -->

> >    <body>

> >        <center>

> >        <form action="intro7.aspx" method="post" runat="server"

> target="_new">

> >            <asp:adrotator AdvertisementFile="ads.xml" 

BorderColor="black"

> > BorderWidth=1 runat="server"/>

> >            <h3> Name: <asp:textbox id="Name" runat="server"/>

> >            Category:  <asp:dropdownlist id="Category" runat=server>

> >                          <asp:listitem >psychology</asp:listitem>

> >                          <asp:listitem >business</asp:listitem>

> >                          <asp:listitem >popular_comp</asp:listitem>

> >                       </asp:dropdownlist>

> >            <asp:button type=submit text="Lookup" 

OnClick="SubmitBtn_Click"

> > runat="server"/>

> >            <p>

> >            <Acme:Calendar id="MyCal" runat=server/>

> >            <p>

> >            <asp:label id="Message" runat="server"/>

> >        </form>

> >        </center>

> >    </body>

> > </html>

> 

> ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''



Message #10 by "Alex Homer" <alex@b...> on Tue, 29 May 2001 15:07:40
Sorry, but you've also beaten me. I haven't got this far yet, as I've 

been concentrating on learning (and writing about) the data access stuff 

and the server controls provided with the frameworks. Maybe someone else 

can provide you with an answer?





> uma1@v...

> 1st Question:

> I seem to find it difficult to post XML data using POST Method to a

> Webserver (particularly to a webservice) after a connection is created 

using

> WebRequestFactory. Actually I am trying to use an httphandler class

> intercept an improperly formatted SOAP message sent to a particular web

> address, alter it into proper format, sent to a web service and have a 

web

> service read its incoming message and handle it. However much I try, I am

> unable to send the properly formatted SOAP message sent to the service by

> the http handler. Can you enlighten me? (I think that the webservice 

context

> receives the message after it has been similarly received and prcessed by

> its system handler - I am not sure though)

> 

> 2nd question:

> 

> I tried to override a MimeReturnWriter class and had my webservice use 

this

> class for writing the return message by making an entry in the config.web

> file <ReturnWriterTypes> However, my custom return writer class is not

> detected by the service whether I place it in the Bin directory under the

> assembly or anywhere else. Can you enlighten me?

Message #11 by "Dave Sussman" <davids@i...> on Wed, 30 May 2001 09:09:11
> Sorry, but you've beaten me there. I haven't got this far yet, as I've 

> been concentrating on learning (and writing about) the data access stuff 

> and the server controls provided with the frameworks. Maybe someone else 

> can provide you with an answer?

> 

> > martin.putz@u...

> > What do I need to do that the Web Control (e.g. a Login-Control 

> containing a

> > couple of Controls) I am currently building with C# does render itself 

> also

> > in design mode in vs.net?

> 


  Return to Index