Thursday, 4 September 2014

HOW TO USE QUERY STRING IN SHAREPOINT PAGES BY USING C#

How To pass values from one page to other page in sharepoint..(two different webparts present in two different pages)programmatically with c#.....

Normally, to pass or transfer the data from one page to other page we use the familiar concept called (QueryString).....

Using of query string is described bellow.....

In first webpart or in page one, where we get the value: 

Here we have to write the redirected page url and passed value as the following 

               this.page.response.redirect("url?value="+value);
example:
          this.page.respose.redirect("vm:5555/_layouts/pages/login.aspx?username="+gowtham);

Then in second page, we have to write as follow: 

                                page_Load()
                                           {
                                        String user = this.page.request.QueryString["username"];
                                           }
now we can use that particular value of user in the second page.
if you want to validate that particular value across page you have to use the "ViewState".....

all the best happy coding 

24 comments:

  1. thanks a lot ...it helped me so much.. thank u gowtham sir.!

    ReplyDelete
  2. D93A3E1948KennedyF8609659DB11 October 2024 at 18:34

    FEC1C4F968
    telegram sanal show

    ReplyDelete