| | |
request.form is not working in asp.net
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
Here's an example. Lets say you have page1.aspx with a textbox control. You want a user to click a next button, transfering to page2.aspx and writting the text out on that page.
The code for button click on page1.aspx
The page_load for the page2.aspx:
-sypher
The code for button click on page1.aspx
ASP.NET Syntax (Toggle Plain Text)
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click Dim context As HttpContext = HttpContext.Current context.Items.Add("strFirstName", TextBox1.Text) Server.Transfer("page2.aspx", True) End Sub
The page_load for the page2.aspx:
ASP.NET Syntax (Toggle Plain Text)
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here Dim context As HttpContext = HttpContext.Current Response.Write("Your First Name is: " & context.Items("strFirstName")) End Sub
-sypher
•
•
Join Date: May 2006
Posts: 2
Reputation:
Solved Threads: 0
I am having the same problem with a slight difference. I hope someone can help.
In my aspx page I have the following:
A you can see I am building <input> dynamically. Let’s say that the above loops 20 times, each with a different name for the dynamic <input>. How can I transfer these 20 values?
I have the following control in the body of the page.
Which calls
I guess I don’t understand how to transfer the form input that has a dynamic name.
-nbp
In my aspx page I have the following:
ASP.NET Syntax (Toggle Plain Text)
<script> sub blah() For intloop = 0 To (intFieldCount - 1) Dim oCell As New TableCell() strDateLink = "<input name='" & strInputName & "' type='text' value='" & dtClosureDate.ToLongDateString & "' size='33' rows='1' class='ltk' style='border:none' />" oCell.Text = strDateLink oRow.Cells.Add(oCell) Next end sub </script>
I have the following control in the body of the page.
ASP.NET Syntax (Toggle Plain Text)
<asp:Button id="btnPreCloseSumbit" OnClick="TransferFormValues" Text="Submit " runat="server"/>
ASP.NET Syntax (Toggle Plain Text)
Sub TransferFormValues(Source As Object, E As EventArgs) Dim context As HttpContext = HttpContext.Current context.Items.Add("strFirstName", TextBox1.Text) Server.Transfer("body_date_closures_test_output.aspx", True) End Sub
ASP.NET Syntax (Toggle Plain Text)
Sub Page_Load(Source As Object, E As EventArgs) response.Write("hello<br><br>") Dim context As HttpContext = HttpContext.Current Response.Write(context.Items("strFirstName")) response.Write("<br><br>...") End Sub
![]() |
Similar Threads
- Seeking Experienced ASP .NET Developer (Software Development Job Offers)
- Is there Win32 method in asp.net for......... (ASP.NET)
- how can I copy asp.net project from one system and work on it in a different system (ASP.NET)
- Asp.Net and Web Services on Linux (ASP.NET)
- ASP.Net Directory Problems (ASP.NET)
- Error creating new ASP.Net project (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: Computer Registration for Public Wireless Network
- Next Thread: how to use a javascript menu in asp.net
| Thread Tools | Search this Thread |
.net 2.0 activexcontrol advice ajax alltypeofvideos appliances application asp asp.net bc30451 beginner bottomasp.net box browser button c# cac checkbox click commonfunctions confirmationcodegeneration css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock development dgv dialog dropdownlist dynamically edit expose feedback fileuploader fill flash form formatdecimal forms formview gridview gudi iframe iis javascript listbox login microsoft mono mouse mssql multistepregistration news numerical objects opera panelmasterpagebuttoncontrols parent radio redirect registration relationaldatabases reportemail rotatepage save schoolproject search security select sessionvariables silverlight smartcard smoobjects software sql-server sqlserver2005 suse textbox tracking treeview unauthorized validatedate validation vb.net video videos virtualdirectory vista visualstudio web webapplications webdevelopemnt webprogramming webservice xsl youareanotmemberofthedebuggerusers





