Click here to Skip to main content
16,017,100 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi guys

i want to redirect my page to another page and send query string with PostBackURL but it doesn't work plz help :)

C#
<asp:ImageButton ID="ImageButton2" PostBackUrl='Mng.aspx?fileOutIdBook=<%#Eval("fileOuId") %>>&module=DeletFile' runat="server"/>


i get something like below in my address bar ->


http://localhost:9965/liberary/Mng/Mng.aspx?fileOutIdBook=%3C%#Eval%28%22fileOuId%22%29%20%%3E%3E&module=DeletFile

i expected to see this


http://localhost:9965/liberary/Mng/Mng.aspx?fileOutIdBook=201&module=DeletFile

201 bounded by Eval()
Posted
Updated 6-May-14 21:46pm
v3
Comments
Kornfeld Eliyahu Peter 7-May-14 3:43am    
What you get is what you wrote! What the expected result?
farham_heidari 7-May-14 3:55am    
i update my question and add my expectation

try with

HTML
PostBackUrl='<%# String.Format("~/Mng.aspx?fileOutIdBook={0}&module=DeletFile", Eval("fileOuId")) %>'
 
Share this answer
 
Comments
farham_heidari 7-May-14 4:23am    
tnx boys
pls try this one....

PostBackUrl='Mng.aspx?fileOutIdBook='<%#Eval("fileOuId") %>'&module=DeletFile'
 
Share this answer
 
Comments
farham_heidari 7-May-14 3:58am    
The server tag is not well formed.
[no name] 7-May-14 4:04am    
use "Mng.aspx?fileOutIdBook='<%#Eval("fileOuId") %>'&module=DeletFile"
Sanket Saxena 7-May-14 4:06am    
wrong this will always throw server tag is not well formed. Cant use like this.
It seems you got a syntax error. All inline expressions must have a whitesapce between opening and the actual content:
ASP.NET
<asp:imagebutton id="ImageButton2" postbackurl="Mng.aspx?fileOutIdBook=<%#[here must have a whitespace]Eval("fileOuId") %>>&module=DeletFile" runat="server" xmlns:asp="#unknown" />

For some reference reading: http://support.microsoft.com/kb/976112[^]
 
Share this answer
 
v2
Do one thing, replace your PostBackUrl bythe below one:

HTML
PostBackUrl='<%#"Mng.aspx?fileOutIdBook="+ Eval("fileOuId") %>&module=DeletFile'


OR try

HTML
PostBackUrl='<%#"Mng.aspx?fileOutIdBook="+ Eval("fileOuId")+&module=DeletFile %>'
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900