Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2009-05-06
2
Medium Priority
?
469 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
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Loops Section Overview
Suggested Courses

783 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