[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

VB.net Query String

Posted on 2009-07-09
1
Medium Priority
?
546 Views
Last Modified: 2012-05-07
I am having a problem with Query Strings in a ASP.net application VB.net.

Here is a simplified version of the scenario:

URL: MyPage.aspx?QuoteNumber=12345

1) A user navigates to the page using a hyperlink in an email.
2) The page loads and pulls up the Quote from the Query String (Quote Number = 12345). Code looks like this:
       
        Dim QryStringFound As Integer
        Dim QuoteNumber As Integer

        QryStringFound = 0
        QuoteNumber = 0

        QuoteNumber = Request.QueryString("QuoteNumber")

        If QuoteNumber > 0 Then

            QryStringFound = 1

        End If

        If QryStringFound = 1 Then

            Me.txtQuote.Text = QuoteNumber

            'This code loads the Quote information using the Quote Number in the textbox.
            QuoteDetails()

        End If
3) The user decides to look at another quote, but when the page relaods the Query String, QuoteNumber=12345 is still there so it pulls up Quote Number 12345 again.

How do I make the QueryString only execute the first time the page is loaded?
0
Comment
Question by:yonbret
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 41

Accepted Solution

by:
guru_sami earned 2000 total points
ID: 24818967
You can check if page is postBack like below in your PageLoad:
If Not Page.IsPostBack Then
    'This is first time the page is loaded
    'execute your code here
End If
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question