Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi,
 
I have aspx page in my project. In this page i have a linkbutton, When i click this linkbutton i want to redirect to same page with differnt text in this linkbutton. Also i want to change the address of thr url depends upon the text in the linkbutton. But the page same for all action I just want to change the text for the link button and address in the url.
 
Thanks,
Velkumar
Posted 15-May-12 20:24pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

As far as change in URL is concern if you use some tricks like Server.Transfer or Response.Redirect, it may help you. If you want proper mapping url then its an advance concept like URL Rewriting, where you can actually rename Url at run time.
 
Linkbutton rename you can handle it by using
if (Page.IsPostBack)
       {
           ;
       }
  Permalink  
v2
Comments
Velkumar Kannan at 16-May-12 2:03am
   
Could you post some examples?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

To show different URLs in the browser you can use the concept of URL rewriting. To change the label you can handle it programmetically.
 

UPDATE:
[SM]: Read here: URL Rewriting with ASP.NET[^]
MSDN: URL Rewriting[^]
  Permalink  
v2
Comments
Velkumar Kannan at 16-May-12 2:02am
   
Could you post some examples?
Sandeep Mewara at 16-May-12 2:31am
   
Answer updated with URL.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

  Permalink  

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



Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 16 May 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100