Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / October 2006

Tip: Looking for answers? Try searching our database.

passing a token from pageA.aspx to pageB.aspx

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jay - 10 Oct 2006 19:34 GMT
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
John Saunders - 10 Oct 2006 19:47 GMT
>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
[quoted text clipped - 13 lines]
> 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
Jay - 10 Oct 2006 21:01 GMT
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?
Signature

Jay

> >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
[quoted text clipped - 28 lines]
>
> John
John Saunders - 11 Oct 2006 01:10 GMT
> 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
Jay - 11 Oct 2006 16:14 GMT
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
Signature

Jay

> > 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
[quoted text clipped - 7 lines]
>
> John

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.