Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

QueryString Not Accesible from the Server (Please Respond)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pbd22 - 13 Mar 2008 20:13 GMT
Hi.

I have HTML on my form that was constructed on the server.
The "browser" is a PopUp that was previously fired from another page.
This popup is a standard browser pop-up,
nothing fancy or unique.

There are two forms inside the pop-up:

They both have javascript buttons on them that submit the form. The
submit constructs a querystring that gets sent to the server. When i
look at it on the server, Length is always 0.

What am i doing wrong?

I have tried this using an input button with type=submit also and i
still get length = 0.

One of the two forms is as such:

<form action='view_webinar_free.aspx' name='view_webinar_free'
id='view_webinar_free'><div class='formButtons'><a
href='javascript:submitviewer();' class='textBtnRed
formBtn'><span>View Webinar</span></a></div></form>

Bot forms and enclosing HTML is below:

<div class="mod1Col">
                <div class="shbox">

                    <div class="sh1">
                        <div class="sh2">
                            <div class="box">
                                <!-- BEGIN HEADER -->
                                <div class="modHeader deepPurpleBG">
                                    <h2>View webinar</h2>
                                </div>
                                <!-- END HEADER -->

                                <!-- BEGIN MODULE CONTENT-->
                                <div class="modBody modHeight160">
                                    <div class="modCopy">
                                    <p>Click on the button below to access the webinar.</p><form
action='view_webinar_free.aspx' name='view_webinar_free'
id='view_webinar_free'><div class='formButtons'><a
href='javascript:submitviewer();' class='textBtnRed
formBtn'><span>View Webinar</span></a></div></form>
                                    </div>
                                </div>
                                <!-- END MODULE CONTENT-->
                            </div>
                        </div>
                    </div>
                </div>

                <div class="shbox">

                    <div class="sh1">
                        <div class="sh2">
                            <div class="box">
                                <!-- BEGIN HEADER -->
                                <div class="modHeader deepPurpleBG">
                                    <h2>Login to the presenter</h2>
                                </div>
                                <!-- END HEADER -->

                                <!-- BEGIN MODULE CONTENT-->
                                <div class="modBody modHeight360">
                                    <div class="modCopy">
                                    <p>Click on the button below to access the presentation
interface.</p><br /><form action='presenter_interface.aspx'
name='presenter_interface?music=love&travel=love&sports=love'
id='presenter_interface' ><ul><li><label>Email:</label><input
type='text' class='input_small' id='oEmail' /></
li><li><label>Password:</label><input type='password'
class='input_small' id='oPass' /></li></ul><div class='formButtons'><a
href='javascript:submitpresenter();' class='textBtnRed
formBtn'><span>Login</span></a></div></form>
                                    </div>
                                </div>
                                <!-- END MODULE CONTENT-->
                            </div>
                        </div>
                    </div>
                </div>

            </div>
bruce barker - 13 Mar 2008 21:11 GMT
you don't show the javascript that actually submits, but the form action
(postback url) doesn't have any query string arguments.

-- bruce (sqlwork.com)

> Hi.
>
[quoted text clipped - 83 lines]
>
>             </div>
pbd22 - 13 Mar 2008 22:05 GMT
Thanks for the reply bruce,

Even if I put querystring arguments there, it doesn't do anything.
For example, if the HTML looks like this, it doesn't help:

<form action='view_webinar_free.aspx?one=hello&two=hello&three=hello'
name='view_webinar_free'
id='view_webinar_free'><div class='formButtons'><a
href='javascript:submitviewer();' class='textBtnRed
formBtn'><span>View Webinar</span></a></div></form>
Jeff Dillon - 13 Mar 2008 22:45 GMT
Forms POST, not GET. Querystrings are from GET.

> Thanks for the reply bruce,
>
[quoted text clipped - 6 lines]
> href='javascript:submitviewer();' class='textBtnRed
> formBtn'><span>View Webinar</span></a></div></form>
pbd22 - 14 Mar 2008 00:15 GMT
Jeff,

I am not sure what you are trying to illustrate with the link you
provided but i get a 404 error when i
try to click on it.

Thanks,
Peter
Jeff Dillon - 14 Mar 2008 00:33 GMT
I did not provide a link. Form POSTs do not send a query string. Look up
POST versus GET
Peter Bromberg [C# MVP] - 14 Mar 2008 01:13 GMT
If i make a form post and there are items on the querystring, are you saying
that they won't be there if I parse the querystring? I think not. A url is a
url. If it has items on the querystring, they are available to the developer
regardless of what the HTTP verb is. With a POST you would also have a
NameValueCollection of post name / value pairs, but that doesn't mean the
querystring isn't there.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net

> Forms POST, not GET. Querystrings are from GET.
>
[quoted text clipped - 8 lines]
> > href='javascript:submitviewer();' class='textBtnRed
> > formBtn'><span>View Webinar</span></a></div></form>
pbd22 - 14 Mar 2008 02:11 GMT
the problem was that i omitted the method= in my form tag.
now that i see what you were say jeff, yes, i have to agree
with peter - you most certainly "can" get the querystring
logic with a get and post.

regardless, thanks to all for the perspectives.
Jeff Dillon - 14 Mar 2008 18:53 GMT
I didn't say that, or perhaps I mispoke. I assumed the OP was looking for
POST'd data in the query string, which is incorrect

Jeff

> If i make a form post and there are items on the querystring, are you
> saying
[quoted text clipped - 22 lines]
>> > href='javascript:submitviewer();' class='textBtnRed
>> > formBtn'><span>View Webinar</span></a></div></form>

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.