[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to capture URL in a string using VB.Net?

Posted on 2006-04-06
8
Medium Priority
?
4,944 Views
Last Modified: 2012-06-21
I have a query in a dataset that is used to navigate from a gridview on a Master page to a detailview on the Details page. The query returns a URL like this:

details.aspx?ProductID=365

What is the best way to capture that url and use it again? What I want to do is capture it, cut out everything except the 365 and use it to insert into another table. I don't know when to capture it (before the details page loads? after?) or how to capture it.


Thanks,

MH
0
Comment
Question by:MHenry
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 10

Accepted Solution

by:
bchoor earned 2000 total points
ID: 16394906
Dim ProductID As Integer = Convert.ToInt32(Request.QueryString("ProductID"))

HTH
~BC
0
 
LVL 10

Expert Comment

by:bchoor
ID: 16394934
BTW, Use it in Page_Load event
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16394952
If you want the entire URL, then try this in the Page_Load:

   Dim url As String = Request.RawUrl

Bob
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 18

Expert Comment

by:Elvio Lujan
ID: 16395005
Dim S As String = Request.UrlReferrer.AbsolutePath.ToString & Request.UrlReferrer.Query.ToString
0
 
LVL 7

Author Comment

by:MHenry
ID: 16395732
I'll have to check these later tonight.

Just at a glance (and being new to this) I think bchoor is on the right track. I do want it to be an integer. But I don't want the whole string, just the number at the end of the URL, the 365.

Does that make sense?

Best,
MH
0
 
LVL 18

Expert Comment

by:Elvio Lujan
ID: 16395776
then the way is bchoor solution
0
 
LVL 7

Author Comment

by:MHenry
ID: 16412304
Sorry for the delay, took a while for me to figure out how to test it.

bchoor's solution worked perfectly. Thanks for all the help!

Best,

MH
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month20 days, 9 hours left to enroll

868 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