Click to See Complete Forum and Search --> : Use Argument: WAY BASIC
stonkers
03-13-2006, 08:05 PM
It's been years since I've written any serious html (this is actually aspx, but same concept). I'm trying to receive an argument in the url. So, I call the page with http://myPage.aspx?myID=1
On the receiving end (i.e. inside myPage.aspx), I need to use the argument inside a set of double quotes (in a select statement getting data).
Could someone help me out please?
Thanks Much,
Eric
Kravvitz
03-13-2006, 08:16 PM
That's an ASP question, not an HTML question. This is the wrong forum.
Edit: This thread has been moved to the ASP forum, so now it's the right forum.
pcthug
03-13-2006, 08:19 PM
see: http://www.webdeveloper.com/forum/forumdisplay.php?forumid=9
Kravvitz
03-13-2006, 08:28 PM
If that's directed at me, then when I first viewed this thread it was via the HTML forum.
If you go here soon, you will see that this thread is listed as "moved". (http://www.webdeveloper.com/forum/forumdisplay.php?f=2)
stonkers
03-13-2006, 08:48 PM
OK, well, since I'm in the right forum now, I'll post some code. Here's the section in the from page (note that I'm in a cell of a calendar in the codebehind):
while (dbReader.Read())
{
e.Cell.Text = "<br><font size = 1px>myLink<a href=myDisplay.aspx?myVar="" + myVar + "" target="_blank"></a href></font>";
}
Then in the aspx page I'm calling:
<asp:AccessDataSource id="AccessDataSource" runat="server" DataFile="~/myDB.mdb"
SelectCommand = "select myColumn from t_myTable where eventID=<THISisWHEREiNEEDmyARGUMENT>" />
Request.Querystring("myID")
stonkers
03-13-2006, 09:06 PM
Yeah, kind of got that. In the called page in the code behind, I do:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
eventID.Text = Server.HtmlEncode(Request.QueryString["myVar"]);
}
}
But on the aspx page in the middle of an "asp:" tag, how do I access myVar?
SelectCommand = "select eventDate, eventTime, eventTitle, eventDesc from t_events where eventID="AccessMyVarSomehow" />
I hate to tell you this, but you're in the wrong forum :p
This is the classic ASP forum, not the .NET forum.
stonkers
03-13-2006, 09:26 PM
Dude, I SUCK! Can someone move this please? Thanks - Eric