0

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> 
2
Contributors
1
Reply
3
Views
4 Years
Discussion Span
Last Post by JorgeM
1

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.