R
RN1
An ASPX page, named LinkButton.aspx, has a single LinkButton & nothing
else. The code is very simple:
<form runat="server">
<asp:LinkButton ID="lnk" PostBackUrl="Page1.aspx" Text="CLICK"
runat="server"/>
</form>
When I run the above code in my local; (Intranet) IIS server, then
when the LinkButton is clicked, the user is taken to Page1.aspx but
when I uploaded the above ASPX file to a remote server & ran the page,
clicking the LinkButton doesn't take the user to Page1.aspx. Rather,
the user is brought back to LinkButton.aspx.
Why so? If I am not mistaken, PostBackUrl means posting a page to
itself (unlike the NavigateUrl property of the HyperLink control which
takes the user to a different page); so why is the LinkButton behaving
differently when the ASPX page is run in my local server & when the
same ASPX page is run in a remote server?
Also when I right-click the link & then click "Properties" in my local
server, the URL is
javascript:WebForm_DoPostBackWithOptions(new
%20WebForm_PostBackOptions("lnk",%20"",%20false,%20"",%20"Page1.aspx",
%20false,%20true))
but the URL of the link in the remote server turns out to be
javascript:__doPostBack('lnk','')
Why?
Thanks,
Ron
else. The code is very simple:
<form runat="server">
<asp:LinkButton ID="lnk" PostBackUrl="Page1.aspx" Text="CLICK"
runat="server"/>
</form>
When I run the above code in my local; (Intranet) IIS server, then
when the LinkButton is clicked, the user is taken to Page1.aspx but
when I uploaded the above ASPX file to a remote server & ran the page,
clicking the LinkButton doesn't take the user to Page1.aspx. Rather,
the user is brought back to LinkButton.aspx.
Why so? If I am not mistaken, PostBackUrl means posting a page to
itself (unlike the NavigateUrl property of the HyperLink control which
takes the user to a different page); so why is the LinkButton behaving
differently when the ASPX page is run in my local server & when the
same ASPX page is run in a remote server?
Also when I right-click the link & then click "Properties" in my local
server, the URL is
javascript:WebForm_DoPostBackWithOptions(new
%20WebForm_PostBackOptions("lnk",%20"",%20false,%20"",%20"Page1.aspx",
%20false,%20true))
but the URL of the link in the remote server turns out to be
javascript:__doPostBack('lnk','')
Why?
Thanks,
Ron