scooter1977
asked on
Passing a variable from a hyperlink
I have a list of static HTML that contains a list of users. What I need to do is hyperlink each name and pass a string to a new page that will display user details. On the Hyperlinks I have set a datanavigation url that has the query string /details.aspx?cn=tom but on the details page I'm not sure how to get that string.
I know I need to access request.querystring but what is the easiest way to do that without having to put in a static entry for each user. Can I just somehow access the variable part of the DataNavigationURL - (ie - tom)
BTW - I am using vb.net and asp 2.0
I know I need to access request.querystring but what is the easiest way to do that without having to put in a static entry for each user. Can I just somehow access the variable part of the DataNavigationURL - (ie - tom)
BTW - I am using vb.net and asp 2.0
If you can store that usernames into database than
1) create aspx with user list in datagrid.
2) Make their names as hyperlink
3) On selected index change event of gridview take the clicked button's text property and add it to query string parameters and than redirect to that page.
1) create aspx with user list in datagrid.
2) Make their names as hyperlink
3) On selected index change event of gridview take the clicked button's text property and add it to query string parameters and than redirect to that page.
ASKER
A list of users that is made of of static HTML like so:
<asp:hyperLink ID="HyperLink1" runat="server" NavigateUrl="~/details.asp x?cn=usern ame">Tom Smith</asp:HyperLink>
Title <br />
Department<br />
Additional Info<br />
Phone #<br />
<a href="mailto:Tom@domain.co m">Email Tom </a>
<asp:hyperLink ID="HyperLink1" runat="server" NavigateUrl="~/details.asp
Title <br />
Department<br />
Additional Info<br />
Phone #<br />
<a href="mailto:Tom@domain.co
How are you generating this HTML text?
Bob
Bob
ASKER
it's just static HTML, it's not being generated from anywhere - I just need to know how to get the username from the NavigateUrl="~/details.asp x?cn=usern ame (which I set manually - it's not dynamic) into the details page with a request.querystring or whatever will work
Normally I'd set the Request.quesrystring ("the field I want") but since there is no dynamic field for the username I don't know how to do it.
Normally I'd set the Request.quesrystring ("the field I want") but since there is no dynamic field for the username I don't know how to do it.
ASKER
For example on Joe I have NavigateUrl="~/details.asp x?cn=joe
on Jack I have NavigateUrl="~/details.asp x?cn=jack
on Jill I have NavigateUrl="~/details.asp x?cn=Jill
Does that make sense?
on Jack I have NavigateUrl="~/details.asp
on Jill I have NavigateUrl="~/details.asp
Does that make sense?
If you aren't generated this, then why don't you just hard code the values?
Bob
Bob
ASKER
That's what I'm asking how to do ...... How do I get Joe, Jack, Jill, ect into my details page.....
On my details page I have a query that pulls info from a database based on cn=UserName
Example code please. I'm not a .net coder so you're gonna have to help me out a little here
On my details page I have a query that pulls info from a database based on cn=UserName
Example code please. I'm not a .net coder so you're gonna have to help me out a little here
On every name links navigation url put like this.
for x
Details.aspx?user=x;
for y
Details.aspx?user=y;
Extract these values on the next page
for x
Details.aspx?user=x;
for y
Details.aspx?user=y;
Extract these values on the next page
ASKER
ok......... so again.....how do I extract them on the next page. I already have the values hard coded as I specified in my previous post
details.aspx?cn=joe
details.aspx?cn=jack
details.aspx?cn=Jill
details.aspx?cn=joe
details.aspx?cn=jack
details.aspx?cn=Jill
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I need to get them into the next page.
Dim cn As String = Request.QueryString("cn")
Produces: The (cn=) search filter is invalid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: The (cn=) search filter is invalid.
Dim cn As String = Request.QueryString("cn")
Produces: The (cn=) search filter is invalid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: The (cn=) search filter is invalid.
If you consider as i said than
string user = Request.QueryString("user" );
string user = Request.QueryString("user"
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok - thank you chinu - that's the part I was missing is that I had to do a request.querystring on each page.
Wait.
What you mean each page ? Each separate page for each user details ?
Is that what you doing ?
What you mean each page ? Each separate page for each user details ?
Is that what you doing ?
Bob