Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do I pass a querystring value as an Integer to a control?

Posted on 2009-05-06
2
Medium Priority
?
467 Views
Last Modified: 2012-05-11
Hi all,

I have a user control named ViewSubmission and I am not able to use a querystring inside the control.

I am trying to pass an integer value from the querystring to the control. The hyperlink is setup like this:
"testpage.com/test.aspx?Submission=85"

If I setup the code in my aspx page:
<Control:ViewSubmission runat="server" Submission='85' />,
 it works perfectly.

However if I try to pass the value from the querystring like this:
<Control:ViewSubmission runat="server" Submission='<%# Convert.ToInt32(Request.QueryString["Submission"]) %>' />,

the querystring is not passed and is treated as though there is nothing there.


Thanks in advance!
My codebehind for submission is shown below
 
private Int32 _SubmissionID;	
public Int32 Submission
	{
		get
		{
			return _SubmissionID;
		}
		set
		{
			_SubmissionID = value;
		}
	}

Open in new window

0
Comment
Question by:propractice
[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
2 Comments
 
LVL 1

Accepted Solution

by:
mmeisel earned 1500 total points
ID: 24317653
Won't

(ID of control).Submission = CInt(Request.QueryString("Submission"))

work?

Try putting that in your code behind of your ASPX page.
0
 

Author Comment

by:propractice
ID: 24376532
That works - we were trying to avoid using code behind for this.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
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 is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
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

722 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