server.Transfer with query string
<p>I am beginner learning ASP.NET with C# as the programming language.</p>

<p>Currently I am working with HTTPSERVERUTILITY.</p>

<p>I have created a web form named as Default.aspx and Default2.aspx:</p>

<p>I have written the following coding :</p>

<p>Default.aspx:</p>

<p>In source view</p>

<p>
    
    </p>

<pre><code>    &lt;asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" /&gt;

&lt;/div&gt;
&lt;/form&gt;
</code></pre>

<p></p>

<p>In Code-behind file:</p>

<p>protected void Button1_Click(object sender, EventArgs e)
    {</p>

<pre><code>    Server.Transfer("Default2.aspx ? name =roseline &amp; password = pass@123");
}
</code></pre>

<p>Coding for Default2.aspx:</p>

<p>In Source View:</p>

<p>
    
    
        
        <br />
        <br />
        
        <br />
        <br />
    
        <br />
    
    
</p>

<p>In Code-Behind File:</p>

<pre><code>public string n, p;
protected void Page_Load(object sender, EventArgs e)
{
    n = Request.QueryString["name"];
    p = Request.QueryString["password"];

}
protected void Button1_Click(object sender, EventArgs e)
{
    TextBox1.Text = n;
    TextBox2.Text = p;
}
</code></pre>

<p>When I execute the above application I am not getting any error.</p>

<p>When I click on the Button1 in Default.aspx it shows me the Default2.aspx, but when I click on the button I am not getting the values in the TextBox, the TextBoxes are empty without any values.</p>

<p>Can anyone tell me what is wrong with my coding? Why it is not displaying the values in the TextBoxes?</p>

<p>Please help me out!</p>

<p>Thanks in advance!</p>
