Solved

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

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

740 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