473,756 Members | 1,808 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing null values in a Querystring

Hi Group,
I'm not sure if there's a limit to the amount of parameters you can pass
between pages.
I'm trying to pass 9 as follows:

strRedirect = "PlacementHisto ry.aspx" & _
"?hlscaseno =" & Me.txtHLSCaseNo .Text.ToString & _
"&SeqNo=" & Me.txtseqno.Tex t.ToString & _
"&type=" & Me.txtType.Text .ToString & _
"&regno=" & Me.txtRegNo.Tex t.ToString & _
"&allocode= " & Me.txtAllocCode .Text.ToString & _
"&hlsstatus =" & Me.txtHLSStatus .Text.ToString & _
"&accomno=" & Me.txtaccomno.T ext.ToString & _
"&roomno=" & Me.txtroomno.Te xt.ToString & _
"&letter=" & Me.txtletter.Te xt.ToString & _
"&startdate =" & Me.txtstartedda te.Text.ToStrin g & _
"&name=" & Me.txtName.Text .ToString & _
"&propid=" & Me.txtpropid.Te xt.ToString
Server.Transfer (strRedirect)
However, I receive the following error:
Invalid path for child request
'PlacementHisto ry.aspx?hlscase no=22238&SeqNo= 1&type=hlshotel &regno=0&alloco de=&hlsstatus=C LOS&accomno=2&r oomno=2&letter=
&startdate=0 1/07/2005 09:11:31&name=U NKNOWN WILKINSON&propi d= '. A virtual
path is expected.
TIA
Jun 27 '08 #1
1 1985
axapta wrote:
Hi Group,
I'm not sure if there's a limit to the amount of parameters you can pass
between pages.
I'm trying to pass 9 as follows:

strRedirect = "PlacementHisto ry.aspx" & _
"?hlscaseno =" & Me.txtHLSCaseNo .Text.ToString & _
"&SeqNo=" & Me.txtseqno.Tex t.ToString & _
"&type=" & Me.txtType.Text .ToString & _
"&regno=" & Me.txtRegNo.Tex t.ToString & _
"&allocode= " & Me.txtAllocCode .Text.ToString & _
"&hlsstatus =" & Me.txtHLSStatus .Text.ToString & _
"&accomno=" & Me.txtaccomno.T ext.ToString & _
"&roomno=" & Me.txtroomno.Te xt.ToString & _
"&letter=" & Me.txtletter.Te xt.ToString & _
"&startdate =" & Me.txtstartedda te.Text.ToStrin g & _
"&name=" & Me.txtName.Text .ToString & _
"&propid=" & Me.txtpropid.Te xt.ToString
Server.Transfer (strRedirect)
However, I receive the following error:
Invalid path for child request
'PlacementHisto ry.aspx?hlscase no=22238&SeqNo= 1&type=hlshotel &regno=0&alloco de=&hlsstatus=C LOS&accomno=2&r oomno=2&letter=
&startdate=0 1/07/2005 09:11:31&name=U NKNOWN WILKINSON&propi d= '. A
virtual path is expected.
TIA
The date and name values contains characters that are invalid in an url,
so you have to url encode the values:

"&startdate =" & Server.UrlEncod e(Me.txtstarted date.Text.ToStr ing) & _
"&name=" & Server.UrlEncod e(Me.txtName.Te xt.ToString) & _

Actually, you should url encode any value that possibly may contain
characters that are not completely safe.
Also, I think that you have to specify that the current QuesryString and
Form collections should be cleared to specify a new query string:

Server.Transfer (strRedirect, false)
The limit to what you can put in an url, is in the length that the
browser can handle. The buffer used for the url is usually something
like 2kB or 4kB. If you keep it below a thousand characters, you will be
safe.

However, when you are using Server.Transfer , the url doesn't make a
round trip to the browser, so you could probably put a bit more in the
query string before you reach any limit. You should probably try to keep
it reasonably small anyhow.

--
Göran Andersson
_____
http://www.guffa.com
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4992
by: Fredrik/Sweden | last post by:
Hi folks ! got this problem... i have a table 'Accounts' in my database, which contains a bunch of users. From the main menu i choose "edit user" and all users in the db are presented in a table. The first column 'Pnr' is a unique ID for each user that i made appear as a link. clicking on one userID should present a form where the picked users userdata is already filled in so i can easily edit it and then move on to submit the form to...
3
3460
by: Kim Lots | last post by:
Hi all I'm trying to pass two variables, but what is wrong with my code? -------- <form name="uno" action="validate.asp?Num=<%=Request.Querystring("Num") %>" method="post"> <textarea name="komm" cols="90" rows="4" id="komm"></textarea>
1
3617
by: Consuelo Guenther | last post by:
Hello, I am having problems with passing variables between pages. I have the following: First asp page has the function: ----------------------------------------------------------------------- <script language="JavaScript"> function addProcess(addPName,addSProcess,addPIndex) { var addProcessWindow = window.open('second.asp','mywindow','width=400,height=200');
3
1510
by: Ben R. | last post by:
I've got an asp.net application with a page that collects user info via forms and I'd like to have those values then passed to a 2nd page for a continuation which makes use of the entered values from the previous page. One way that I could think of would be to have the submit button's event handler call response.redirect with a querystring attached on based on values that I could attach on. First question: Could I do the same thing but...
3
10837
by: Joe Bloggs | last post by:
Does anyone know if its possible to pass parameters or the values of Request.QueryString from a web page to a custom control class? I'm using a C# Web Application. For Example I have Web Page1 which has to parameters passed to it from another Web page Parameter # 1 dbid and Parameter # 2 reportid. I know that I can access the values of the parameters from the code behind .aspx.cs using Request.QueryString so
7
43276
by: Anne | last post by:
hie there, i want to be able to pass multiple parameters to another page. currently, i am able to do so, but somehow i feel it is not the correct way to do it. below is part of what i have so far. 'first page Private Sub btnOK_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click Response.Redirect("InputValues.aspx?Requestor=" &
1
1678
by: Russell | last post by:
Hi there, I'm currently creating a .NET Web Application and I have a question about passing values from one screen to another. I previously used Session variables in the code to store these values, however I can no longer use this method because of my current website "Cloaking" the URL. (When site is cloked, the session variables don't seem to work with frames) Anyway, I was wondering if anyone could offer an alternative, I have tried...
1
1019
by: - Steve - | last post by:
I can't find the answer to this because I don't know what it's called. I want to e-mail my users a link that is customized to them. For example I want them to click on the link and have the E-mail Textbox already filled out with their e-mail address. So I believe I want to send them a URL that looks something like http://site.com/page.aspx?Email=user1@domain.com. How do I grab that e-mail address in my ASP.NET page though?
1
4996
by: Paul D. Fox | last post by:
I'm trying to launch a Child Window from a hyperlink on a Datagrid and have it recieve multiple values from the Parent Window. Upon recieving the values in the Child Window, I need to access them in the code-behind so I can render a datagrid in the Child. I've tried just doing another Postback in the child's onLoad event but I get a Javascript error. Is there another way to do this? <%@ Page Language="vb" AutoEventWireup="false"...
3
1544
by: Tor Inge Rislaa | last post by:
Passing and using parameters How to get hold of the parameter value provided by the URL? When I open a web form with a DataSource I often include a parameter in the URL as below: myNewPage.aspx?myParam = 10
0
9275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10034
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9872
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9713
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.