Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
C#
String tempStr1 = "";
String.Format("{1} ", "", Request["Name"]);
   Display.Text = tempStr1;


Thanks a lot.
Posted
Updated 12-Feb-12 23:39pm
v3
Comments
Varun Sareen 13-Feb-12 4:56am    
Are you using this code? If yes then what you want to achieve with this. Please be more clear.

C#
// create a temporary string containing no characters
String tempStr1 = "";
// format a string containing the contents of a field called Name,
// but don't save the new string anywhere
String.Format("{1} ", "", Request["Name"]);
// set the text content of variable Display to the string tempStr1
// which is nothing
   Display.Text = tempStr1;
 
Share this answer
 
That code would display nothing in the Display control.

If you change it as follows you will get the "Name" from your request in the "Display" control-

C#
String tempStr1 = "";
tempStr1 = String.Format("Hi {0}!", Request["Name"]);
   Display.Text = tempStr1;


Using the abouve code, if Request["Name"] is "noname89757" then "Display" control would display "Hi noname89757!"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900