I am starting to learn ASP.NET with C # as a programming language.
I am currently working with HTTPSERVERUTILITY.
I created a web form called Default.aspx and Default2.aspx:
I wrote the following encoding:
Default.aspx:
In the view of the source
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
</div>
</form>
In the Code-behind file:
protected void Button1_Click (object sender, EventArgs e) {
Server.Transfer("Default2.aspx ? name =roseline & password = pass@123");
}
Coding for Default2.aspx:
In the source window:
In the Code-Behind file:
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;
}
When I execute the above application, I get no errors.
When I click the Button1 button in Default.aspx, it shows me Default2.aspx, but when I click on the button, I don't get the value in the TextBox, the text fields are empty without any values.
Can someone tell me what is wrong with my encoding? Why doesn't it display values in TextBoxes?
, !
!