473,379 Members | 1,252 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

How to pass a value from aspx page to code behind...

I have a grid view with a SSN column as a hyperlink. Whenever I click SSN I want to populate grid view in same page for that particular SSN. For this I need to pass SSN from aspx page to code behind(C#).

I tried like this...

Expand|Select|Wrap|Line Numbers
  1. public string SSN
  2. {
  3.   get
  4.     {
  5.       return request.querystring["ssn"];
  6.     }
  7. }
  8.  
but I am getting error " Object reference not set to an instance of an object"

Please let me know how can I pass...
Dec 24 '08 #1
2 2118
phvfl
173 Expert 100+
Sorry to ask the obvious question does the hyperlink contain a querystring with an ssn value eg. "foo.aspx?ssn=1234"?

Also, check your cases. I thought the line should be (notice the capitalisation):
Expand|Select|Wrap|Line Numbers
  1. return Request.QueryString["ssn"];
Dec 24 '08 #2
Curtis Rutland
3,256 Expert 2GB
This page should help you.
Dec 24 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Terry | last post by:
hi, could any1 help me with this? There're one button and one textbox on Page A. click the button: <Code Behind > Dim ClientScript As String = ""
0
by: dotnet | last post by:
I am trying to make a page that is changing the page schema(colors and graphics) depends on the specific value (for example, test.aspx?page=1) I have so far achieved accepting page values (with...
3
by: Hermit Dave | last post by:
Hi, Trying to pass a value to user control within a page. 1. Couldnt find a way to pass it from code behind file. 2. Trying to pass it from aspx page... using EditURL='<% "mypage.aspx?myvar=" +...
1
by: | last post by:
Hi guys! I am a beginner with aspx (i have some background with .asp). And i am trying tu use a 'code-behind' page in order to execute all transactions in that page and leave as clean as possible...
9
by: Frank Rizzo | last post by:
I've got a number of user controls on the web page. How can I pass some data to it? I don't see where the user control is instantiated in the page code-behind page. Thanks.
3
by: Wayne Wengert | last post by:
I have an application where a session variable is set in an ASPX page, The process calls an ASP page and when in that page the session variable appears to be null. How can I pass a session variable...
2
by: Steven K | last post by:
Hello, I am trying to learn how to use Code Behind. Essentially, the example of Block 1 and Block 2 are the same. The difference is that in Block 1 I explicitly set the parameter value to...
0
by: ab_j | last post by:
I have a user control that contains a dropdown which I want to use as a menu on multiple .aspx pages. Basically, all I am trying to do is pass the selected value of the dropdown in the user...
12
by: Phil Certain | last post by:
Hi, I'm trying to do something very simple...or at least it should be. I have created a host page (gen.aspx) and a very simple user control (us.ascx). The corresponding code-behind files are...
5
by: slowmotiongenius | last post by:
All- I have established an adodb recordset in my code-behind, and I need to pass it to the aspx file. I can't seem to figure out if there is a way to do this. I see you can pass a string over...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.