Solved

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

Posted on 2009-05-06
2
465 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 500 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

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.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

636 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