Solved

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

Posted on 2009-05-06
2
456 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 500 total points
Comment Utility
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
Comment Utility
That works - we were trying to avoid using code behind for this.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

772 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

10 Experts available now in Live!

Get 1:1 Help Now