Click here to Skip to main content
15,881,861 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when I login then label1 shows a referral link like this
Referral Link >> http://my-site-url/login/signup.aspx?uid=NM100129

when I give this link to someone that person go directly to the registration page and user id textbox is autofill with uid no which is mentioned in to the link.

What I have tried:

I have tried request.querystring but it did not work and I can't understand how can I use this.
Posted
Updated 17-Mar-20 1:22am
v2
Comments
F-ES Sitecore 17-Mar-20 6:55am    
Request.QueryString is the right code to use, if it isn't working for you then post the code you've tried.
Member 14743579 17-Mar-20 9:20am    
when page is load
string var = "http://localhost:6794/mypageurl.com/Login/Signup.aspx?userid=" + ltrRegid.Text;
label1.Text = var;
above code shows the link on label on same page but how can i show this link on other page by using request.querystring please help me if you have an idea about this..
F-ES Sitecore 17-Mar-20 10:18am    
string var = "http://localhost:6794/mypageurl.com/Login/Signup.aspx?userid=" + Request.QueryString["userid"];
label1.Text = var;

You might want to load it into an intermediary variable first and check it is in a valid format before using it.
Member 14743579 17-Mar-20 14:47pm    
but the problem is i want to show this link or url on another page. how can i show this url on my another page as a referral link like..
suppose i have 3 pages webpage1, webpage2 and webpage3, i want to try to create a url of 2webpage in 1webpage after that this url shows on a 3webpage using request.querystring and important thing is write the above command in 1webpage.

page name webform3
referral like: shows url here
Richard Deeming 17-Mar-20 7:16am    
I have removed the actual URL of your site since it wasn't required for your question, and it made the question look like spam.

1 solution

Quote:
user id textbox is autofill
That is because the application knows the relation between this UUID and the user who generated this link.
Quote:
i have tried request.querystring
Yes, that is the approach to capture any query string parameters passed to the URL. In this case, uid.
Quote:
but it didnot work and i can't understand how can i use this.
This is because perhaps the database does not contain any reference to this value. Note that this value is specific to the application that generated the UUID.

Secondly, a TextBox is only going to show a user id entered if your application adds the value to it. TextBox does not know the relation between the UUID and the user profile.

Here is a workflow for this:

  • Capture the UUID from the query string.
  • Query the database to find if a referral code with this UUID exists.
  • If it does, then get the user id and input that in the TextBox.
  • If it does not, then show the error message stating this code is invalid.

As you might guess, you need to create a database table for this record. This can be a starter schema for the table:

ReferralCodeId | Referee | CreatedOn
1234           | 4321    | January 20, 2020
Then you can create a separate table that contains the records of the consumption of this code. But you get the idea.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900