querystring

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike

    querystring

    I'm new to the asp.net world and on my app i have a querystring to pass data
    to the update screen.
    can querystrings still be used in asp.net or no?

    Example:

    response.redire ct("update.aspx ?Status=Edit")
    or
    response.redire ct("update.aspx ?Status=New")

    how can i capture the Status and execute the correct query on my update.aspx
    page?

    thanks


  • William F. Robertson, Jr.

    #2
    Re: querystring

    Page_Load( ... )
    {
    if ( !Page.IsPostbac k )
    {
    string s = Request.QuerySt ring["Status"]

    if ( s == "Edit" )
    //do edit stuff
    else if ( s == "New" )
    //do new stuff
    }
    }

    "Mike" <me@me.com> wrote in message
    news:ONyAIQ3QEH A.1340@TK2MSFTN GP12.phx.gbl...[color=blue]
    > I'm new to the asp.net world and on my app i have a querystring to pass[/color]
    data[color=blue]
    > to the update screen.
    > can querystrings still be used in asp.net or no?
    >
    > Example:
    >
    > response.redire ct("update.aspx ?Status=Edit")
    > or
    > response.redire ct("update.aspx ?Status=New")
    >
    > how can i capture the Status and execute the correct query on my[/color]
    update.aspx[color=blue]
    > page?
    >
    > thanks
    >
    >[/color]


    Comment

    • Rich

      #3
      RE: querystring

      Pretty much like classic ASP

      If Request.QuerySt ring("Status")= "Edit

      ....that type of thing

      Comment

      • Steven Cheng[MSFT]

        #4
        RE: querystring

        Hi Mike,

        Yes, as other members have mentioned, it's rather easier to handle
        querystring in ASP.NET, just use the HttpRequest.Que ryString collection,
        here is the reference in MSDN:

        #HttpRequest.Qu eryString Property
        Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.

        ClassQueryStrin gTopic.asp?fram e=true

        In addition, here are some other tech articles on migrating from asp to
        asp.net

        #Migrating to ASP.NET: Key Considerations
        Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.

        me=true

        #Converting ASP to ASP.NET
        Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.

        ?frame=true

        #ASP to ASP.NET Migration Assistant
        http://msdn.microsoft.com/asp.net/us...igasst/default.
        aspx

        Hope also helps. Thanks.

        Regards,

        Steven Cheng
        Microsoft Online Support

        Get Secure! www.microsoft.com/security
        (This posting is provided "AS IS", with no warranties, and confers no
        rights.)

        Get Preview at ASP.NET whidbey
        Build web apps and services that run on Windows, Linux, and macOS using C#, HTML, CSS, and JavaScript. Get started for free on Windows, Linux, or macOS.


        Comment

        • Steven Cheng[MSFT]

          #5
          RE: querystring

          Hi Mike,

          Have you had a chance to check out the suggestions in my last reply or have
          you got any further ideas on this issue? If you have anything unclear or if
          there're anything else we can help, please feel free to post here. Thanks.

          Regards,

          Steven Cheng
          Microsoft Online Support

          Get Secure! www.microsoft.com/security
          (This posting is provided "AS IS", with no warranties, and confers no
          rights.)

          Get Preview at ASP.NET whidbey
          Build web apps and services that run on Windows, Linux, and macOS using C#, HTML, CSS, and JavaScript. Get started for free on Windows, Linux, or macOS.


          Comment

          Working...