Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Request.Form doesn't work in asp.net like in classic

Status
Not open for further replies.

dpdoug

Programmer
Nov 27, 2002
455
US
In classic Asp you could get the contents from a text box called txtCustomer in the page that is called, with Request.Form("txtCustomer").

Why can't this be done in ASP.NET(?):

Code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

      Response.Write(Request.Form("txtCustomer"))

End Sub
 
In ASP.Net u can access the text box as well as other controls just by taking there name(not by request.form etc).


Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Response.Write(txtCustomer.Value)

End Sub


Rakhi
 
You're right. But I think you misunderstood me. I want to get the value of the text box from the page that called this one, like you could do in classic asp.

The code you showed me gets the value of the text box in it's own page. Request.Form("txtCustomer") would get the value of that text box in the calling page, in classic asp.

Thanks anyway, Rakhi.
 
Look at Server.Transfer
thread855-865969
 
yeah.i misunderstood the things.. well u can easily do redirection to other page also.for that u need to set the following things:
on the page write the following javascript code and attach it with the button click on which u want to redirect the page:

function redirect()
{
document.frmIssueSearch.action='IssueList.aspx'; document.frmIssueSearch.__EVENTARGUMENT.disabled = true;
document.frmIssueSearch.__EVENTTARGET.disabled = true;
document.frmIssueSearch.__VIEWSTATE.disabled = true;
return true;
}

now on the page where u want to retrieve the values from the page submitted, get the values from request.form.



Rakhi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top