codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  I am having trouble withResponse.Redirect asp.net vb  lowest69 at 04:35 on Thursday, December 02, 2004
 


Here is my code i am using to try to understand how to pass parm to other asp.net pages.
I can pass them into a page but iam unable to use the Response.Redirect correctly.






<%@ Page Language="VB" Debug="true" %>
<script runat="server">

Sub Page_Load(Sender as Object, e as EventArgs)

if not request.querystring("inputtext") = nothing then

lblMsg.Text = "You entered: " & request.querystring("inputtext")

else

lblMsg.Text = "Nothing Input"

end if

if not request.querystring("inputtext2") = nothing then

lblMsg2.Text = "You entered: " & request.querystring("inputtext2")

else

lblMsg2.Text = "Nothing Input"

end if

End Sub



Sub btnOnClick(Sender as Object, e as EventArgs)

Response.Redirect("/forum/passpram2_inputtext_.html" & tbInput.Text,"inputtext2=" & tbInput2.Text )

End Sub

</script>
<html>
<head>
</head>
<body>
<form runat="server">
<p>
<asp:Label id="lblMsg" runat="server"></asp:Label>
<br />
<asp:textbox id="tbInput" runat="server"></asp:textbox>
</p>
<p>
<asp:Label id="lblMsg2" runat="server">lblMsg2</asp:Label>
</p>
<p>
<asp:TextBox id="tbInput2" runat="server"></asp:TextBox>
</p>
<p>
<br />
<asp:button id="Button1" onclick="btnOnClick" runat="server" text="Submit"></asp:button>
</p>
</form>
</body>
</html>
---------------------------------------------------------------------------------------------
Response.Redirect("/forum/passpram2_inputtext_.html" & tbInput.Text,"inputtext2=" & tbInput2.Text )
here is a test using the adress bar to work.
http://localhost:8080/passpram2.aspx?inputtext=text1 &inputtext2=text2
The parms pass. The redirect
Is my format in error? Any help would be welcome.


  Re: I am having trouble withResponse.Redirect asp.net vb  Jeff Anderson at 14:52 on Monday, December 06, 2004
 

Here's how I think it should look:

Response.Redirect("/forum/passpram2_inputtext_.html" & tbInput.Text & "&inputtext2=" & tbInput2.Text )


  Re: I am having trouble withResponse.Redirect asp.net vb  tgreer at 15:52 on Monday, December 06, 2004
 

Exactly: QueryString key-value pairs are separated from the URL by a question mark, and from each other by an ampersand. When your code is interpreted, it should result in a URL that looks like:

http://www.myDomain.com?key1=value1&key2=value2


As an alternative, you can pass all of your ASP.NET webform data via POST rather than GET, to a second ASP.NET webform, by using the more powerful "Server.Transfer()" method.









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Cadenas.CoCreate.FTI.IMSI.CADCAM.DELCAM.GMI.PLAXIS
•  Cadenas.CoCreate.FTI.IMSI.CADCAM.DELCAM.GMI.PLAXIS
•  Schlumberger.PTC.Siemens.EDS.CATIA.CIMATRON.AUTODESK
•  PDMS.Plate.UGS.CYME.FLOMERICS.Tanner.LINUX.MAC.UNIX
•  Tanner.CrossLight.Elite.Software.Geocentrix.FLOW.3D.PTC.
•  ITTVIS.ENVI.Leica.Erdas.LEAP.SOFTWARE.MapInfo.Nobeltec.
•  Re: Cracked software ftp download 2013
•  Re: Crack Engineering Software
•  Full engineering software


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2013