i am trying to access a query string value from .cs page to aspx page but cann't bcz i am retrieving it within Page_load function , so its been local to this event and cannot be accessed outside so what to do ?

code:

protected void Page_Load(object sender, EventArgs e)
    {

        Page.DataBind();

        String employerEmail = Request.QueryString["employerEmail"];
    }

and then after retrieving query string value i want to integrate it into this hyperlink , see BOLDED part, email, here i want to put querystring value

<asp:HyperLink ID="homeBtnImage" runat="server" ImageUrl="~/btnPayPal.gif"
          NavigateUrl= "https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_xclick&business=smile2_1355775057_biz@yahoo.com&item_name=MemberShip&amount=20¤cy=USD&return=http://127.0.0.1:57135/Online%20Recruitment%20System-Final/paymentSuccessful.aspx?emailAdmin='?' &cancel_return=https://www.google.com/" >PayPal</asp:HyperLink> 

A better approach may be to access the NavigateUrl property in the code behind and append tbe query string value there. For example..

homeBtnImage.NavigateUrl = "somehost.domain.com/page.aspx?q=" & employerEmail

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.