开发者

Programmatically setting Absolute URL inside image controls for .NET Facebook Application

开发者 https://www.devze.com 2022-12-23 14:07 出处:网络
The goal is to allow a function to be called from within an ASPX imagebutton control that is used as part of a form. The need for an absolute URL is that Facebook Canvas applications require them. So

The goal is to allow a function to be called from within an ASPX imagebutton control that is used as part of a form. The need for an absolute URL is that Facebook Canvas applications require them. So the rendered control should look something like

<input type="image" src="http://myURL.com/images/submit.gif" />

The ASPX markup might be something like <asp:imagebutton runat="server" imageurl="<%= MyAbsoluteURLFunction("images/submit.gif)" %>" />

My sample syntax is obviously incorrect, which is why I'm here. The reason I want to use an ImageButton is because it will h开发者_Python百科ave events attached to it.


instead of pointing to a method in your markup, why don't you set the absolute URL from your code? if you have a single image control it can be done in page_init/load, and if you're dealing with rows of image controls, say in a Repeater control, you can handle the OnRowDataBound event and set the properties.

0

精彩评论

暂无评论...
验证码 换一张
取 消