updating query string on client

  • Thread starter Thread starter Dennis
  • Start date Start date
D

Dennis

I'm sure there is an easy way to do what I want but I'm failing to find
it...


I have a single web page with links back to itself with set query
strings...


href="?data=x"
href="?data=y"
href="?data=z"


This works fine...

The problem is that now I need to update/add to the query string based on
selection of radio buttons on the page. Since the href above drives
"page_load" all values are set to default...

Is there a way to append to the href with more data on the client side?
such as add a variable that is updated on the page based on the radio
button selected? Then passed when they select the link? I'm sure this is
something easy but what i have tried has failed...

Thank you
 
Here is one way:

<html>
....
<script>
function addQS()
{
var qs;
// Construct the query string based on radio buttons and assign in to qs
window.location.href = <current page> + "?" + qs;
}
</script>
<body onunload="addQS();">
....

I'm sure there is an easy way to do what I want but I'm failing to find
it...


I have a single web page with links back to itself with set query
strings...


href="?data=x"
href="?data=y"
href="?data=z"


This works fine...

The problem is that now I need to update/add to the query string based on
selection of radio buttons on the page. Since the href above drives
"page_load" all values are set to default...

Is there a way to append to the href with more data on the client side?
such as add a variable that is updated on the page based on the radio
button selected? Then passed when they select the link? I'm sure this is
something easy but what i have tried has failed...

Thank you
 
Not sure what you want to see...most of the code is creating data for
Gridview that displays upons selection of one of the links...


This is the basics:


Partial Class Default2
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Dim theData As String

theData = Request.QueryString("data")
If Not theData = Nothing Then
 
Thank you

I just have a question about the <current page> part...

Is this a variable? ie. i code "<current page>" in the code...

Or are you saying to value this with the current page?

If this is a variable that i can use....will this have the HREF from the
link they have selected and then append the data i code to it?

The problem is that they click on one of several links (there actually
50 of these - so 50 values of x.

<current page>?data=x

I need to then add item to the querystring

<current page>?data=x,moredata=y

and moredata is based on the radio button...

I want to avoid putting this all in script if I can...

Thanks

I hope this makes sense and I haven't confused the issue...
 
<currrent page> I meant as a placeholder for the current page's name.

Thank you

I just have a question about the <current page> part...

Is this a variable? ie. i code "<current page>" in the code...

Or are you saying to value this with the current page?

If this is a variable that i can use....will this have the HREF from the
link they have selected and then append the data i code to it?

The problem is that they click on one of several links (there actually
50 of these - so 50 values of x.

<current page>?data=x

I need to then add item to the querystring

<current page>?data=x,moredata=y

and moredata is based on the radio button...

I want to avoid putting this all in script if I can...

Thanks

I hope this makes sense and I haven't confused the issue...
 
Back
Top