IT Community - Software Programming, Web Development and Technical Support

Query string doubt

This is a discussion on Query string doubt within the ASP and ASP.NET Programming forums, part of the Web Development category; Hello, How can we pass more then one string elements through query string from one page to the other?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > ASP and ASP.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 02-21-2008, 09:57 PM
Kirubhananth Kirubhananth is offline
D-Web Programmer
 
Join Date: Feb 2008
Location: My native is Madurai but now in Chennai
Posts: 61
Kirubhananth is on a distinguished road
Send a message via AIM to Kirubhananth Send a message via Skype™ to Kirubhananth
Question Query string doubt

Hello,

How can we pass more then one string elements through query string from one page to the other?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-21-2008, 10:20 PM
prasannavigneshr prasannavigneshr is offline
D-Web Incredible
 
Join Date: Feb 2007
Posts: 1,321
prasannavigneshr is on a distinguished road
Send a message via MSN to prasannavigneshr
Thumbs up Re: Query string doubt

Hi Kirubhananth,

Its very simple...

Quote:
domainname.com/pagename.aspx?firstname=kirubha&lastname=nanth &age=23

Use & to separate each string values....
Hope useful..
__________________
Prasanna Vignesh
MCPD | Web Developer

Last edited by prasannavigneshr : 02-21-2008 at 10:23 PM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-22-2008, 01:58 AM
Kirubhananth Kirubhananth is offline
D-Web Programmer
 
Join Date: Feb 2008
Location: My native is Madurai but now in Chennai
Posts: 61
Kirubhananth is on a distinguished road
Send a message via AIM to Kirubhananth Send a message via Skype™ to Kirubhananth
Question Re: Query string doubt

Thank you Mr. Prasana.

I wrote the query string in the redirect function as

string s = TextBox1.Text;
Response.Redirect("default2.aspx?a="+s);


and retreived the value in the default2.aspx page as

txttitle.Text = Request.QueryString["a"].ToString();


Suppose if i have two strings to be passed from here as

string s = TextBox1.Text;
string s1 = TextBox2.Text;
Response.Redirect("default2.aspx?a="+s);


Then how can i pass these two dynamic strings s amd s1 to the default2.aspx page.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-22-2008, 02:55 AM
bluesky bluesky is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 201
bluesky is on a distinguished road
Default Re: Query string doubt

Hi,
string s = TextBox1.Text;
string s1 = TextBox2.Text;
Response.Redirect("default2.aspx?a="+s+"&"+s1);
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-22-2008, 09:45 PM
poornima poornima is offline
D-Web Sr.Programmer
 
Join Date: Dec 2007
Posts: 189
poornima is on a distinguished road
Smile Re: Query string doubt

Hi,
You can pass like this also,
string s=TextBox1.Text;
string s1=TextBox2.Text;
Response.Redirect("Default2.aspx?s="+s+"&s1="+s1);


To Retrieve Use the Following in Default2.aspx,
string a=Request.QueryString["s"];
string a1=Request.QueryString["s1"];
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-27-2008, 02:15 AM
rrrajesh84in rrrajesh84in is offline
D-Web Master
 
Join Date: Mar 2007
Posts: 399
rrrajesh84in is on a distinguished road
Default Re: Query string doubt

hi

It was really helpful.. thanks for your code.
__________________
.....................................
''''''
Rajesh''''''
Ants. . . . . . Like me
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 03-03-2008, 09:16 PM
GDevakii GDevakii is offline
D-Web Sr.Programmer
 
Join Date: Aug 2007
Posts: 138
GDevakii is on a distinguished road
Smile Re: Query string doubt

Hi,
Session["buid"] = Text1Box.text;
intType = 2;
Response.Redirect("Default.aspx?mode=E&buid=" + Session["buid"] + "&PageID=2&SubPageID=5&Type=" + intType);
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is diffrenece between string.compare and string.compareordinal shaalini ASP and ASP.NET Programming 3 12-28-2007 10:46 PM
Is it possible to Pass Query String to Javascript? velhari HTML, CSS and Javascript Coding Techniques 1 11-20-2007 10:47 PM
how to pass and retrieve variable(query string) in same page using ajax? ursklakshmanan PHP Programming 0 09-17-2007 12:05 PM
Query String raj PHP Programming 1 07-16-2007 06:55 AM
encrypt and decrypt query string hanusoftware VB.NET Programming 0 06-07-2007 05:55 AM


All times are GMT -7. The time now is 06:52 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0