Last post Nov 02, 2005 10:13 PM by GrantGauld
Nov 02, 2005 03:40 PM|GrantGauld|LINK
Please help I have two files viewrota.aspx and displayrota.aspx
When the user selects a date on a calendar it stores the date in a string called wc, which is then used to build a query string and redirect the webpage to displayrota.aspx as far as I can see this works fine.
wc &= calendar1.SelectedDates(i).ToShortDateString()
As String =
"?Week=" & _
Response.Redirect("displayrota.aspx" & strQueryStr)
At a later point,I am going to want to use the value passed as variable, however just now all I want to do is simply assign the value to a label however the following code fails to display the date however I can write it to the page using Response.Write
to prove that it is picking up the query string correctly. I must be doing something really silly as I have seen so many examples on the net but cant get mine to work.
Sub Page_Load(ByVal Sender
ByVal E As EventArgs)
Label1.Text = Request.QueryString("Week")
Label = <asp:Label
Response.Write = <% Response.Write(Request.QueryString("Week").ToString)%>
Response.Write = 27/10/2005
Thanks in advance
Nov 02, 2005 05:02 PM|bmains|LINK
When it works, you have a .ToString() method call; add that to the one above. What I always do instead is use Request.QueryString.Get("Week"), which works.
Nov 02, 2005 05:11 PM|GrantGauld|LINK
Thanks for your reply however both suggestions fail to work
Nov 02, 2005 06:16 PM|ivandon|LINK
Nov 02, 2005 06:29 PM|GrantGauld|LINK
Nov 02, 2005 06:47 PM|bmains|LINK
Nov 02, 2005 06:48 PM|ivandon|LINK
You can use the same response.write directly in the page_load. I would prefer to use trace.write..
In addition, I would move page_load to the back page and use debugger. It is still possible to write aspx pages the same way as we use to write asp but...
Nov 02, 2005 06:59 PM|Chriskoi|LINK
Label.Text = Request.Params["Week"];
This should work.
Nov 02, 2005 07:01 PM|GrantGauld|LINK
Nov 02, 2005 08:30 PM|bmains|LINK
Nov 02, 2005 10:13 PM|GrantGauld|LINK