Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 17th, 2005, 10:57 PM
Registered User
 
Join Date: Jan 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing multi-parameters using C#

Dear All,

Currenlty, I got 2 files, one called "default.aspx" and second called "viewpage.aspx", the default.aspx is the default page of all of my page, if you type "www.domain.com.kh" the default page will be display, and if you click on the content inside the default page it will link you to "www.domain.com.kh/viewpage.aspx?PageID=10", but my code can pass only one parameter here is PageID, but how can I pass multi-parameters?
-Inside my viewpage.aspx i have added many user controls, so if the viewpage.aspx check that the parameter which is pass from default.aspx only one, so it will display the viewpage.aspx with few user controls, but how can I make it to check, suppose the parameters which are pass from default.aspx are 2 or multi-parameters and then it will display all the user controls?

Anybody know how to do it with C#?

Please help me ASAP.
Thank you in advance,
HUY FAMILY.
 
Old May 18th, 2005, 02:23 AM
Authorized User
 
Join Date: Jul 2004
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Default

-> You can pass multiple paramters in a querystring like this:

http://www.domain.com.kh/viewpage.as...ram2Name=value
Replace "Param2Name" with your paramter name
Replace "value" with the value you want to pass

-> To access the values in viewpage.aspx, write this in the
   codebehind:

i=Request.QueryString["PageID"];
j=Request.QueryString["Param2Name"];

-> If only one parameter is passed, the second value will
   give null. For eg, if only PageID was passed as a
   parameter to the querystring, Request.QueryString["Param2Name"]
   would return null. So you can do this:

   if(i==null || j==null)
   {
        //write your code here
    Response.Write("One value was passed");
   }

Cheers
Spacy

 
Old May 18th, 2005, 11:09 PM
Registered User
 
Join Date: Jan 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Spacy,

Thank you for your reply :), I will try it.

Thank you,
HUY FAMILY.





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to passing multi parameter diablo Crystal Reports 0 May 26th, 2008 06:13 AM
Multi Valued Parameters in XSL anwatson XSLT 1 November 23rd, 2007 02:04 PM
Passing parameters tal Ajax 5 May 26th, 2007 08:07 AM
Multi-Select Parameters jparkgb BOOK: Professional SQL Server 2005 Reporting Services ISBN: 0-7645-8497-9 0 August 14th, 2006 06:02 AM
Multi Parameters jcwc888 BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 March 16th, 2006 12:57 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.