#278872 Author: Anil Kumar Pandey Member Level: Diamond Member Rank: 1 Date: 08/Aug/2008 Rating:  Points: 3 |
hello, u can pass the value through Query String from one page to another.
here is the example
Response.Redirect("managearticles.aspx?Mode=Edit&" + "ArticleID=" + intID + "&IssueID=" + lintIssueId + "&pi=1");
thanks Anil pandey
Thanks & Regards Anil Kumar Pandey Microsoft MVP, DNS MVM
|
#278876 Author: Vidhya Member Level: Gold Member Rank: 0 Date: 08/Aug/2008 Rating:  Points: 6 |
hi,
here we r trying to pass url between two pages using get method .
refer this code you can get some idea abt ur code.
1. How do I append stuff to the URL? There are more than one ways to append "stuff" to the URL. The method depends on the way you want variables to be passed.
If the next page is accessed through a link, then the <a> tag can be used alone. <a href="redirect.html?page=1">Page 1</a> <a href="redirect.html?page=2">Page 2</a> <a href="redirect.html?page=3">Page 3</a> etc.
The other way is through form values. For your form tag: <form name="tform" action="redirect.html" method="get"> <select name="page"> <option value="1" selected="selected">Page 1</option> <option value="2">Page 2</option> <option value="3">Page 3</option> </select><br> <input type="submit" value="Go!"> </form>
For this tutorial, I will use a simple name page, one with a field to enter the name, another with a page to display it. However, this method will work for as many variables as necessary, as long as the maximum length of the URL is not passed.
<!-- entername.html (pseudocode) --> <html> <head> <!-- head stuff here --> </head> <body> <form name="theform" action="showname.html" method="get"> <input type="text" name="name"><br> <input type="submit" value="Show"> </form </body> </html>
The above is a simple page that allows a user to enter their name.
2. How do I retrieve the values from the URL? Here is showname.html.
<html> <head> <!-- head stuff --> <script type="text/javascript"> <!-- hide from old browsers
function getValue(varname) { // First, we load the URL into a variable var url = window.location.href;
// Next, split the url by the ? var qparts = url.split("?");
// Check that there is a querystring, return "" if not if (qparts.length == 0) { return ""; }
// Then find the querystring, everything after the ? var query = qparts[1];
// Split the query string into variables (separates by &s) var vars = query.split("&");
// Initialize the value with "" as default var value = "";
// Iterate through vars, checking each one for varname for (i=0;i<vars.length;i++) { // Split the variable by =, which splits name and value var parts = vars[i].split("="); // Check if the correct variable if (parts[0] == varname) { // Load value into variable value = parts[1];
// End the loop break; } } // Convert escape code value = unescape(value);
// Convert "+"s to " "s value.replace(/\+/g," ");
// Return the value return value; }
// end hide --> </script> </head> <body> <h1>Hello, <script type="text/javascript"> <!-- hide var name = getValue("name"); document.write(name); // end hide --> </script> </h1> </body> </html>
|
#278882 Author: mariya Member Level: Silver Member Rank: 0 Date: 08/Aug/2008 Rating:  Points: 3 |
hi, refer this code Response.Redirect("Webform2.aspx?Name=" + this.txtName.Text + "&LastName=" + this.txtLastName.Text);
this.txtBox1.Text = Request.QueryString["Name"]; this.txtBox2.Text = Request.QueryString["LastName"];
|
#278920 Author: D.Jeya kumar(JK) Member Level: Gold Member Rank: 12 Date: 08/Aug/2008 Rating:  Points: 4 |
Hi,
in first page we need to add the query string in the url where we need to post to the next page like this.
Resposeredirect("nextpage.aspx?name=jk&id=10")
in next page we can get ths values like this
dim strname as string =Request.Querystring("name") dim strid as string =Request.Querystring("id")
Regards JK
Thanks & Regards D.Jeya Kumar(JK)
|
#278937 Author: Geetha Member Level: Gold Member Rank: 402 Date: 08/Aug/2008 Rating:  Points: 4 |
To Pass values from one web form to another web form named as Webform2.aspx :
Response.Redirect("Webform2.aspx?Name=" + this.txtName.Text + "&PhoneNo=" + this.txtPhoneNo.Text);
Getting the values from the Query String in Webform2.aspx :
this.Name.Text = Request.QueryString["Name"]; this.PhoneNo.Text = Request.QueryString["PhoneNo"];
|
#311485 Author: sravan Member Level: Bronze Member Rank: 0 Date: 29/Oct/2008 Rating:  Points: 5 |
Query string : It will arrange data with in HTTP header by appending to the Url in the form of query string, the data will be visible to the user, it doest provide security for the sensitive data and transmission will be faster.
LOGIN.HTML <HTML> <BODY> <FORM METHOD="POST" ACTION =<"LOGIN.ASP"> USERNAME:<INPUT NAME="T1"> <BR> PASSWORD:<INPUT TYPE="PASSWORD" NAME="T2"><BR> </FORM> </BODY> </HTML>
lOGIN.ASP <% UNAME=REQUEST.FORM ("T1") RESPONSE.WRITE("<H2> WELCOME <BR> TO <BR> &"UNAME &"</H2>")%>
|