ASP.NET C# - POST Method - Pass information from a page to another

preview_player
Показать описание
How to pass data between pages using the POST Method
Visual Studio 2015 using ASP.NET C# and Web Forms
Рекомендации по теме
Комментарии
Автор

Thank you for this. It was very helpful to me. I was racking my brain trying to figure out hoe to do a POST in VS2015 and didn't realise how simple it was until I saw your video. Thanks a million!

rkcsp
Автор

Clear and Quick at the same time! Thank You!

sridharramachandran
Автор

very helpfull. thank you a lot.keep going

stefanitotokocopullo
Автор

Great video... the postBackUrl parameter also works with urls that arenot the our project right. a link?

andregomezmercado
Автор

Hello!, it was a really helpfull video, thanks a lot. Is it too much if you tell us how can we do to open a new tab insted of redirect "index.aspx" to "secondPage.aspx"?... Thanks again!.

Dashius
Автор

at 3:59 when i enter that it gives an error message "non invocable member HttpRequest.Form can't be used as a method"...any suggestions?

nikhilksingh
Автор

how to pass radio button, check list and dropdown list controls with this Method can u will help me with the code. I had tried a Lot for it but I can't get the right way to do it.

mayurkadam
Автор

protected void Page_Load(object sender, EventArgs e)
{
string Name = Request.Form["txtName"];
string Age = Request.Form["txtAge"];
string Email = Request.Form["txtEmail"];
string MobileNumber =
bool Gender =bool.Parse( Request.Form["RadioButton"]);
string City =
string Experience =
string ProblemResponse =

lblName.Text = Name;
lblAge.Text = Age;
lblEmail.Text = Email;
lblMobileNumber.Text = MobileNumber;
if (Gender == true)
{
lblGender.Text = Convert.ToString(
}
else if (Gender == true)
{

}
lblCity.Text = City;
lblExperience.Text = Experience;
lblProbResponse.Text = ProblemResponse;

}
This Code I have done on page load of Second Page.aspx & on First Page I had given "postbackUrl" to the buttton where it wiil be directed to second page. this is normal feed back form I'm creating but in gender it takes error. I also tried with session, Jquery but it doesn't give me perfect output.
I want to accomplish that when the Information is Given In one Should Be display on another Form on Label control.
And plz If u make the Video on It, also show me How to display the image on the control when we upload the file in upload control. as it is also getting problem .

protected void btnUpload_Click(object sender, EventArgs e)
{
btnVerification.Visible = true;

if (FileUpload1.HasFile)
{
string fileExtension =

if (fileExtension.ToLower() != ".jpg" && fileExtension.ToLower() != ".png" && fileExtension.ToLower() != ".jpeg")
{
lblMessage.Text = "Only Files with .jpg, .png, .jpeg Extension are allowed";
lblMessage.ForeColor =
}
else
{
int fileSize =
if (fileSize > 2097152)
{
lblMessage.Text = "Maximum file size (2MB) Exceeded";
lblMessage.ForeColor =
}
else
{
+ FileUpload1.FileName));
lblMessage.Text = "File Uploaded";
lblMessage.ForeColor =
}
if (FileUpload1.HasFile)
{
Image1.ImageUrl = "~/Uploads/" + Image1;
}
else
{
lblMessage.Text = "No Image Uploaded";
lblMessage.ForeColor =
}
}
}
else
{
lblMessage.Text = "Please Select a File to upload";
lblMessage.ForeColor =
}
}
this code is for upload control which i have done in it. where after file upload i want to display image but it doesn't show it to me.
so it will be better for me if u make a video.

mayurkadam