Results 1 to 5 of 5

Thread: How to send data from one ASP.NET page to another

  1. #1
    Join Date
    Feb 2010
    Posts
    546

    question How to send data from one ASP.NET page to another

    Hi all,

    I am working as a developer in one company and need information about how to send data from one ASP.NET page to another. Since we cannot use ASP.NET Web Controls (System.Web.UI.WebControls) in such a scenario which only allow posting back of data to the same page. Please suggest. Thanks in advance.

  2. #2
    Join Date
    Jan 2008
    Posts
    1,521

    Re: How to send data from one ASP.NET page to another

    You can use Property Procedure and Context to transfer web form data to another page Read the program given below:

    Code:
    <%@ Page Language="VB" ClassName="SenderClass123" %>
    
    <script runat="server">
    	' Readonly property for name
    	Public ReadOnly Property Name() As String
    		Get
    			Return USerName123.Text
    		End Get
    	End Property
    
    	'Readonly Property for phone
    	Public ReadOnly Property Phone() As String
    		Get
    			Return UserPhone123.Text
    		End Get
    	End Property
    
    	'Event to transfer page control to Result.aspx
    	Sub Page_Transfer(sender As Object, e As EventArgs)
    		Server.Transfer("Result123.aspx")
    	End sub
    </script>

  3. #3
    Join Date
    Feb 2008
    Posts
    1,852

    How to send data from one ASP.NET page to another

    You can also use this method that uses Context object to retrieve the data. It's simple and straight forward, you don't need to create property procedures at all.

    Code:
    <!-- UserForm000.aspx -->
    <%@ Page Language="VB" %>
    <script runat="server">
    	'Event to transfer page control to Result123.aspx
    	Sub Page_Transfer (sender123 as Object, e as EventArgs)
    		'Storing in Context
    		Context.Items("UseNam") = UserNam.text
    		Context.Items("UsePhon") = UserPhon.text
    
    		Server.Transfer("Result123.aspx")
    	End sub
    </script>

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    Re: How to send data from one ASP.NET page to another

    You need to add another code to above procesure.
    Code:
    <html>
    <head>
    </head>
    <body>
    	<form runat="server">
    		User Name: 
    		<asp:TextBox ID="UseNam" runat="server" />
    		Phone: 
    		<asp:TextBox ID="UsePhon" runat="server" /><br>
    
    		<asp:Button Text="Submit" OnClick="Page_Transfer"
    			runat="server" />
    	</form>
    </body>
    </html>

  5. #5
    Join Date
    Oct 2005
    Posts
    2,393

    How to send data from one ASP.NET page to another

    In . net, The CompareValidator and RangeValidator both compare values to literals or extra user-entered data. The two controls inescapably hold some common functionality and therefore are resultant from the BaseCompareValidator class. The BaseCompareValidator just offers us one property in addition to those offered by the BaseValidator class. Its type class permits strings of exact formats to be compared exactly. Check that and reply.

Similar Threads

  1. cannot send a page by email link in Firefox 6
    By veeru s in forum Technology & Internet
    Replies: 6
    Last Post: 20-08-2011, 11:14 PM
  2. IE9 beta: How to send page via email?
    By Iason in forum Technology & Internet
    Replies: 4
    Last Post: 15-04-2011, 02:17 AM
  3. Replies: 4
    Last Post: 27-11-2010, 10:42 PM
  4. When you send a print job it prints a blank page
    By Laalamani in forum Hardware Peripherals
    Replies: 3
    Last Post: 17-06-2010, 04:14 PM
  5. How to send web page in outlook express?
    By Yudhajit in forum Windows Software
    Replies: 8
    Last Post: 27-07-2009, 12:34 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,632,615.04222 seconds with 17 queries