Solved

Pass Variable from ASPX to vb

Posted on 2014-09-11
5
216 Views
Last Modified: 2014-09-11
Hello I am working with a ASPX script and it works just fine. I am new to .NET and need help passing a variable from

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="SearchBranchListTest.aspx.vb" Inherits="SearchBranchListTest" %>

Open in new window


to the .vb page I am using to execute to request..

What is the best way for me to pass a variable.

Thanks
0
Comment
Question by:bradley525
  • 3
  • 2
5 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 40318404
A bit more of an explanation of what you are trying to achieve would help it's a bit vague as it stands.

A common way to pass a value from the aspx page to the codebehind would be to use an asp:HiddenField control to store a value and read the value from the codebehind by referencing the hiddenfield control
0
 

Author Comment

by:bradley525
ID: 40318412
Hello,

What you described will work. I have a URL directing to the page with a few variables in the string such as

?id=1&type=new

I need to pass them to the vb page.
Thank you
0
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 500 total points
ID: 40318416
To read variables passed as part of the url as a querystring you can use the Request object :

Dim id as String = Request.QueryString("id")
Dim type as String = Request.QueryString("type")
0
 

Author Comment

by:bradley525
ID: 40318417
I can do this on the vb page?
0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 40318418
Yes
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

786 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