1

I have following code:

<asp:Button ID="InsertButton" runat="server" CausesValidation="True" 
                                    CommandName="Insert" Text="Add Form" 
             PostBackUrl="~/APPLICATION/FormView.aspx?postquestion="/>   

I using FormView Control.

I need to add Request.QueryString["postquestion"] variable into "FormView.aspx?postquestion=" for PostBackUrl.

I found following code on net, however it's not working:

PostBackUrl='<%# ="~/APPLICATION/FormView.aspx?postquestion=" + Request.QueryString  ["postquestion"].ToString() %>'

Thanks for help!

1
  • When you say "it's not working", what is happening? Are there any errors? Commented May 1, 2012 at 15:11

1 Answer 1

2

Try assigning the PostBackUrl like this instead:

<asp:Button ID="InsertButton" runat="server" 
    CausesValidation="True" 
    CommandName="Insert" 
    Text="Add Form"          
    PostBackUrl='<%# string.Format("~/APPLICATION/FormView.aspx?postquestion={0}", Request.QueryString["postquestion"]) %>' />
Sign up to request clarification or add additional context in comments.

1 Comment

@user1202420: No problem! Don't forget to mark the answer if you're satisfied :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.