Link to home
Start Free TrialLog in
Avatar of Meps
MepsFlag for United States of America

asked on

How do I add a value to URL?

This has to be simple, but I can't get it to work.

I have a page that I need to add the startDate and endDate text fields to the URL when the submit button is pressed.

Basicly:
...\mypage.aspx
After:
...\mypage.aspx?startDate=3/1/2009&endDate=3/31/2009

Without a redirect, I need it done via postback.

I want the submit button to postback to the page, and put the values in the URL.

Any ideas?
Avatar of GiftsonDJohn
GiftsonDJohn
Flag of India image

QueryString is a readonly property collection. If you want to do it without postback then you have to use

Server.Transfer("mypage.aspx?startDate=3/1/2009&endDate=3/31/2009");

in your code to have the form value persistent along with the query string during button click.
Avatar of Meps

ASKER

That's the problem, this is part of a big form.

If I do any sort of transfer or redirect, it will erase all the values in the form.

Which is why I just wanted it to postback.
ASKER CERTIFIED SOLUTION
Avatar of Meps
Meps
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial