For Programmers: Free Programming Magazines  


Home > Archive > ASP > July 2004 > Querystring size









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Querystring size
zino

2004-07-23, 3:55 pm

Hi,
I'm passing large amount of data from an asp.net page to iframe page using querystring.
the iframe is an asp.net page too, and is redirected from the main page to run a code based on the querystring value

on the asp.net page (main page):
<iframe name="myIframe">
.... ..... ....
<img onclick="javascript:myIframe.location.replace('iFramePage.aspx?textValue='+myform.myText.value)" >

<input type=text name="myText">

it seems like when the amount of data is exceeding 2000 character the browser is hanging for ever and no data is send from main page to the Iframe,
is there a limit for the url parameter size, or am I doing something wrong ??

thank you for help


Bob Barrows [MVP]

2004-07-23, 3:55 pm

zino wrote:
> Hi,
> I'm passing large amount of data from an asp.net page to iframe page


There was no way for you to know it, but this is a classic asp newsgroup.
While you may be lucky enough to find a dotnet-savvy person here who can
answer your question, you can eliminate the luck factor by posting your
question to a group where those dotnet-savvy people hang out. I suggest
microsoft.public.dotnet.framework.aspnet.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Jacob Munk-Stander

2004-07-23, 3:55 pm

Hi,
when passing large amounts of data you should POST your data instead of
using the queystring. You could make a form with a target to the iframe as:

<form method="post" action="iFramePage.aspx" target="nameofiframe">
<input type=text name="myText">
</form>

and you could just submit the form onclick of an img-tag (or use the <input
type="image"> ).

You could also have hidden field's that you fill out in the submit handler
if you need some additional data posted with.

--
Yours sincerely,
Jacob Munk-Stander | http://jacob.munk-stander.dk


"zino" <zino@newsgroups.nospam> wrote in message
news:2A0A67CB-E9C1-47CA-9E1C-235B1A8AD25D@microsoft.com...
> Hi,
> I'm passing large amount of data from an asp.net page to iframe page using

querystring.
> the iframe is an asp.net page too, and is redirected from the main page to

run a code based on the querystring value
>
> on the asp.net page (main page):
> <iframe name="myIframe">
> ... ..... ....
> <img

onclick="java script:myIframe.location.replace('iFramePage.aspx?textValue='+m
yform.myText.value)" >
>
> <input type=text name="myText">
>
> it seems like when the amount of data is exceeding 2000 character the

browser is hanging for ever and no data is send from main page to the
Iframe,
> is there a limit for the url parameter size, or am I doing something wrong

??
>
> thank you for help
>
>



Steven Cheng[MSFT]

2004-07-24, 3:55 am

Hi Zino,

As for the querystirng's length, there is no such limitation in the W3C's
http specification but the IE browser has the limitiation on querystring
which is about 2k. Also, it is not recommed that we store large amount of
data in querystring, the recommend size is below 500.

In addition, I think Jacob' suggestion that use post method and store the
data in form field instead is considerable. You can have a try to see
whether it helps.

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

zino

2004-07-27, 3:55 pm

I used what jacob suggest, plus, something else I forgot to mention :
when the main page post the iframe to itself , I don't want the main page to be refreshed, only the iframe is supposed to be posted back with its url parameter and its hidden field populated from the main page.
(I need the iframe which is not visible to the user, to save some text field value from the main page when the user click on a image without having the main page refreshed so the user can keep clicking and saving this text field many time)



that's what I have currently:

****** main page (mainPage.aspx): ***********
<iframe name='myFrame' src='aspNetFrame.aspx' style='display:none'>
<input type='text' name='mainText'>
<input type='image' onclick='iframeSubmit(mainText.value);'>

<script>
function iframeSubmit(v){
var f=frames('myFrame').document.getElementById('frameForm');
f.journal.value=v;
f.action='aspNetFrame.aspx?id=123';
f.submit();
}
</script>
********* end main page ***************



********** iframe page *****************
aspNetFrame.aspx structure:
<form name ='frameForm'>
<input type='text' name='frameText'>
************ end iframe **************

now, when the user click the image , the 'iframeSubmit' function on the main page pouplate the hidden field in the iframe and set the url parameter. and everything works fine but the problem is that the main page (mainPage.aspx) is posted back too and th
at's what I don't want it to happen, only the iframe need to be submited not the main page.

what am I doing wrong ?
Steven Cheng[MSFT]

2004-07-28, 3:55 pm

Hi Zino,

Thanks for your followup. As for the container page post back problem. I
think this is because of the <input type="image" > element you used.
the <input type="submit" > and <input type="image" >(image button) both
will submit the page when user click them. So we can use either of the
following means to avoid this:
1. provide a "onclick" handler for the <input type="Image" > 's onclick
event and prevent the form be submited. For example
<input type="image" onclick="myFunction();return false;" />

2. Use other element (such as <img > ) instead of the <input type="image" >
element.

Please have a check to see whether this is actual cause. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

zino

2004-07-28, 3:55 pm

thank you for your help
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com