Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > passing a token from pageA.aspx to pageB.aspx

Reply
Thread Tools

passing a token from pageA.aspx to pageB.aspx

 
 
Jay
Guest
Posts: n/a
 
      10-10-2006
I am trying to get pageA.aspx gridView to pass a key (say deptID) to
pageB.aspx which will use the value passed as a filter in it's own griView
query.
On pageA gridView I have a hyperlinkField with navigateURL property =
~/pageB.aspx?deptID={0} and it is bound to deptID (which is another column in
the grid). Also, the hyperlinkField it has its dataTextFormatString =
~/pageB.aspx?deptID={0}. PageB datasource has a where clause, where deptID =
{0}.
At runtime, the hyperlink appears to populate correctly with values such as
pageB.aspx?deptID=100, etc., byt when I click on it, pageB appears with the
token still set to deptID={0}.
I am new to webforms, can someone please help? Why doen't the
hyperLinkField pass the deptID value in the url token?
Thanks,
Jay
 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      10-10-2006
"Jay" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am trying to get pageA.aspx gridView to pass a key (say deptID) to
> pageB.aspx which will use the value passed as a filter in it's own griView
> query.
> On pageA gridView I have a hyperlinkField with navigateURL property =
> ~/pageB.aspx?deptID={0} and it is bound to deptID (which is another column
> in
> the grid). Also, the hyperlinkField it has its dataTextFormatString =
> ~/pageB.aspx?deptID={0}. PageB datasource has a where clause, where
> deptID =
> {0}.
> At runtime, the hyperlink appears to populate correctly with values such
> as
> pageB.aspx?deptID=100, etc., byt when I click on it, pageB appears with
> the
> token still set to deptID={0}.
> I am new to webforms, can someone please help? Why doen't the
> hyperLinkField pass the deptID value in the url token?


Apparently, you have two different "run" times here. One where the hyperlink
is properly filled in, and one where it goes to the wrong place.

Perhaps you're looking on the server at the hyperlink control when you see
the correct value? Well, the client has an HTML anchor (<a>) element
instead. You should try to find the <a> on the cliekt-side page using View
Source or the IE Developer Toolbar, and see what the href attribute is set
to. I bet it's set to deptID={0}.

Then, all you'll have to do is figure out why that is. In particular, I'd be
interested to know which property you're looking at on the server where you
saw deptID=100.

John


 
Reply With Quote
 
 
 
 
Jay
Guest
Posts: n/a
 
      10-10-2006
John, you were corect, when I looked in the html source, it had deptID={0}
for each row in the gridView. But I had set the hyperLink's dataTextfield =
deptID which is another column in the gridView. Shouldn't this bring in the
department IDs?
--
Jay


"John Saunders" wrote:

> "Jay" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >I am trying to get pageA.aspx gridView to pass a key (say deptID) to
> > pageB.aspx which will use the value passed as a filter in it's own griView
> > query.
> > On pageA gridView I have a hyperlinkField with navigateURL property =
> > ~/pageB.aspx?deptID={0} and it is bound to deptID (which is another column
> > in
> > the grid). Also, the hyperlinkField it has its dataTextFormatString =
> > ~/pageB.aspx?deptID={0}. PageB datasource has a where clause, where
> > deptID =
> > {0}.
> > At runtime, the hyperlink appears to populate correctly with values such
> > as
> > pageB.aspx?deptID=100, etc., byt when I click on it, pageB appears with
> > the
> > token still set to deptID={0}.
> > I am new to webforms, can someone please help? Why doen't the
> > hyperLinkField pass the deptID value in the url token?

>
> Apparently, you have two different "run" times here. One where the hyperlink
> is properly filled in, and one where it goes to the wrong place.
>
> Perhaps you're looking on the server at the hyperlink control when you see
> the correct value? Well, the client has an HTML anchor (<a>) element
> instead. You should try to find the <a> on the cliekt-side page using View
> Source or the IE Developer Toolbar, and see what the href attribute is set
> to. I bet it's set to deptID={0}.
>
> Then, all you'll have to do is figure out why that is. In particular, I'd be
> interested to know which property you're looking at on the server where you
> saw deptID=100.
>
> John
>
>
>

 
Reply With Quote
 
John Saunders
Guest
Posts: n/a
 
      10-11-2006
"Jay" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> John, you were corect, when I looked in the html source, it had deptID={0}
> for each row in the gridView. But I had set the hyperLink's dataTextfield
> =
> deptID which is another column in the gridView. Shouldn't this bring in
> the
> department IDs?


I don't know how this works with gridView controls, but that won't work with
a DataGrid. How is your data binding set up? Is deptID in the data source?

John


 
Reply With Quote
 
Jay
Guest
Posts: n/a
 
      10-11-2006
For data binding setup, I have deptID in the dataSource for the grid. I
click on the dataTextField property for the grid hyperlink, then select
deptID. I even tried a deptID2 to be sure, but the {0} never gets the data.
How is it that the {0} is supposed to get the values from the dataSource?
Also, if there is another way to do this (thru the desiger), I would be
happy to change to your suggestion.
Thanks
--
Jay


"John Saunders" wrote:

> "Jay" <(E-Mail Removed)> wrote in message
> news(E-Mail Removed)...
> > John, you were corect, when I looked in the html source, it had deptID={0}
> > for each row in the gridView. But I had set the hyperLink's dataTextfield
> > =
> > deptID which is another column in the gridView. Shouldn't this bring in
> > the
> > department IDs?

>
> I don't know how this works with gridView controls, but that won't work with
> a DataGrid. How is your data binding set up? Is deptID in the data source?
>
> John
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
This is an unexpected token. The expected token is 'NAME' =?Utf-8?B?Y2FzaGRlc2ttYWM=?= ASP .Net 2 07-13-2007 11:38 AM
Token passing between servers (basic question) ASF ASP .Net 1 05-16-2007 02:32 AM
Token pasting (## operator) - Add whitespace to a token Wessi C Programming 3 08-11-2005 01:02 PM
"token" "token sequence" "scalar variable" "vector" ?? G Fernandes C Programming 1 02-18-2005 05:32 AM
preprocessor, token concatenation, no valid preprocessor token Cronus C++ 1 07-14-2004 11:10 PM



Advertisments