Answered by:
Having problem with PostBackUrl in a GridView, I need help

Question
-
User426001450 posted
I do have the following ItemTemplate in a GridView:
<ItemTemplate> <asp:ImageButton ID="AdBoxImageButton" runat="server" Width="" PostBackUrl='<%# Convert.ToString(Eval("NavigateUrl")) %>' ImageUrl='<%# Convert.ToString(Eval("ImageUrl")) %>' /> </ItemTemplate>
The PostBackUrl works fine when the ‘NavigateUrl’ data that I’m getting from the database have a format like: https://www.youtube.com/, however when the address is more specific like: https://www.youtube.com/watch?v=A-XlyB_QQYs , the browser does not display anything, just a blank page. I copied the same address that the browser is displaying to another window, and it displays the right video. I don’t get it, what is the problem?
Another thing that I did was to be sure that I’m passing a string, so, instead of just: PostBackUrl='<%# Convert.ToString(Eval("NavigateUrl")) %>'
I changed to this: PostBackUrl='<%# Convert.ToString(Eval("NavigateUrl").ToString) %>'
But is not working either. Could anyone help me here? Thanks
Wednesday, May 18, 2016 3:09 PM
Answers
-
User-1672470423 posted
I don't know why you are not getting error in chrome console, when you click on it.
I hope you are checking console after clicking on it.
Generally when using youtube url, embed url is used when accessing in other applications.
Hope this helps.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, May 18, 2016 8:11 PM
All replies
-
User-1672470423 posted
Did you check error in chrome developer tools console ? There might be error not allowing the content tot be displayed.
Can you check below in postback url for same video
https://www.youtube.com/embed/A-XlyB_QQYs
Is this working ?
Wednesday, May 18, 2016 6:55 PM -
User426001450 posted
I opened the developer console and it is completely blank, nothing there. I do not think that there is any problem with the content since the same link opens fine from another location on the Website. This is weird, any other idea? Thanks
Wednesday, May 18, 2016 7:22 PM -
User-1672470423 posted
Did you try with the URL I provided ?
Wednesday, May 18, 2016 7:28 PM -
User426001450 posted
Hmm, interesting, yes, the url that you provided works. What seen to be the problem here?
Wednesday, May 18, 2016 8:03 PM -
User-1672470423 posted
I don't know why you are not getting error in chrome console, when you click on it.
I hope you are checking console after clicking on it.
Generally when using youtube url, embed url is used when accessing in other applications.
Hope this helps.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, May 18, 2016 8:11 PM