ASP Request Object into ASP.Net 
Author Message
 ASP Request Object into ASP.Net

Please help.  I am trying to convert an asp page into asp.net easily.
I kept getting an error on one line with the Request object.
Therefore, I created a simple page called webform1.aspx and passed
variable "a" through the querystring.  So the url is
http://localhost/webform1.aspx?a=1.  The code on the page is the
following:

HTML Code:


Codebehind="WebForm2.aspx.vb" Inherits="TheInsiderWeb.WebForm2"
ASPCompat="true"%>
<script language=VBScript runat=server>
        response.write(request.querystring("a"))
</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
        <head>
                <title>WebForm2</title>
                <meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
                <meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
                <meta name="vs_defaultClientScript" content="VBScript">
                <meta name="vs_targetSchema"
content=" http://www.*-*-*.com/ ;>
        </head>
        <body MS_POSITIONING="GridLayout">
                <form id="Form1" method="post" runat="server">

                </form>
        </body>
</html>

Code Behind:
Public Class WebForm2
    Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.De{*filter*}StepThrough()> Private Sub
InitializeComponent()

    End Sub

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form
Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
    End Sub

End Class

I get the error:

BC30188: Declaration expected.

Anyone know how to make the response and reuqest objects to work in
the page?

I appreciate any help

Walter



Fri, 08 Apr 2005 23:22:48 GMT  
 ASP Request Object into ASP.Net
One more thing. You should put as much, if not all, of your code in the
codeBehind.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Author: ADO.NET and XML: ASP.NET on the Edge

****************************************************************************
****
Think outside the box!
****************************************************************************
****

Quote:
> Please help.  I am trying to convert an asp page into asp.net easily.
> I kept getting an error on one line with the Request object.
> Therefore, I created a simple page called webform1.aspx and passed
> variable "a" through the querystring.  So the url is
> http://localhost/webform1.aspx?a=1.  The code on the page is the
> following:

> HTML Code:


> Codebehind="WebForm2.aspx.vb" Inherits="TheInsiderWeb.WebForm2"
> ASPCompat="true"%>
> <script language=vbscript runat=server>
> response.write(request.querystring("a"))
> </script>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <html>
> <head>
> <title>WebForm2</title>
> <meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
> <meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
> <meta name="vs_defaultClientScript" content="VBScript">
> <meta name="vs_targetSchema"
> content=" http://www.*-*-*.com/ ;>
> </head>
> <body MS_POSITIONING="GridLayout">
> <form id="Form1" method="post" runat="server">

> </form>
> </body>
> </html>

> Code Behind:
> Public Class WebForm2
>     Inherits System.Web.UI.Page

> #Region " Web Form Designer Generated Code "

>     'This call is required by the Web Form Designer.
>     <System.Diagnostics.De{*filter*}StepThrough()> Private Sub
> InitializeComponent()

>     End Sub

>     Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Init
>         'CODEGEN: This method call is required by the Web Form
> Designer
>         'Do not modify it using the code editor.
>         InitializeComponent()
>     End Sub

> #End Region

>     Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
>         'Put user code to initialize the page here
>     End Sub

> End Class

> I get the error:

> BC30188: Declaration expected.

> Anyone know how to make the response and reuqest objects to work in
> the page?

> I appreciate any help

> Walter



Fri, 08 Apr 2005 23:55:45 GMT  
 ASP Request Object into ASP.Net
Dim strA1 as String = Request.Querystring.Item("a1")

Note that you have to test if this is empty (nothing) just to be safe.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Author: ADO.NET and XML: ASP.NET on the Edge

****************************************************************************
****
Think outside the box!
****************************************************************************
****

Quote:
> Please help.  I am trying to convert an asp page into asp.net easily.
> I kept getting an error on one line with the Request object.
> Therefore, I created a simple page called webform1.aspx and passed
> variable "a" through the querystring.  So the url is
> http://localhost/webform1.aspx?a=1.  The code on the page is the
> following:

> HTML Code:


> Codebehind="WebForm2.aspx.vb" Inherits="TheInsiderWeb.WebForm2"
> ASPCompat="true"%>
> <script language=vbscript runat=server>
> response.write(request.querystring("a"))
> </script>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <html>
> <head>
> <title>WebForm2</title>
> <meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
> <meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
> <meta name="vs_defaultClientScript" content="VBScript">
> <meta name="vs_targetSchema"
> content=" http://www.*-*-*.com/ ;>
> </head>
> <body MS_POSITIONING="GridLayout">
> <form id="Form1" method="post" runat="server">

> </form>
> </body>
> </html>

> Code Behind:
> Public Class WebForm2
>     Inherits System.Web.UI.Page

> #Region " Web Form Designer Generated Code "

>     'This call is required by the Web Form Designer.
>     <System.Diagnostics.De{*filter*}StepThrough()> Private Sub
> InitializeComponent()

>     End Sub

>     Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Init
>         'CODEGEN: This method call is required by the Web Form
> Designer
>         'Do not modify it using the code editor.
>         InitializeComponent()
>     End Sub

> #End Region

>     Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
>         'Put user code to initialize the page here
>     End Sub

> End Class

> I get the error:

> BC30188: Declaration expected.

> Anyone know how to make the response and reuqest objects to work in
> the page?

> I appreciate any help

> Walter



Fri, 08 Apr 2005 23:55:07 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Looking for feedback on code handling COM/ASP and .NET/ASPx Request object

2. Problem passing VB COM+ ASP Request object to .NET component System.Web.HTTPRequest through COM interop

3. MAC address of ASP.NET Request or VB.NET connection

4. Survey on ASP/VS6.0 versus ASP.NET/VS.NET

5. Visual Basic.NET , ASP or ASP.NET

6. VB6/ASP vs .NET/ASP.NET development

7. Using VB/ASP.net to save user requested web data

8. Passing Form Fields to VB.NET Custom Business Object in an ASP.NET Code Behind Page

9. Problem in using Request.Form in ASP.NET

10. Returning Dataset to ASP.NET from .NET Component / Business Object Serialization

11. XMLHTTP & ASP's Request object

12. Request.Form object Not accessible in ASp page

 

 
Powered by phpBB® Forum Software