Solved

Pass Variable from ASPX to vb

Posted on 2014-09-11
5
213 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

932 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now