473,396 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Simple LinkButton

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,%2 0"",%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

Nov 7 '07 #1
4 3293
RN1
On Nov 7, 5:17 pm, RN1 <r...@rediffmail.comwrote:
An ASPX page, namedLinkButton.aspx, has a singleLinkButton& nothing
else. The code is verysimple:

<form runat="server">
<asp:LinkButtonID="lnk" PostBackUrl="Page1.aspx" Text="CLICK"
runat="server"/>
</form>

When I run the above code in my local; (Intranet) IIS server, then
when theLinkButtonis clicked, the user is taken to Page1.aspx but
when I uploaded the above ASPX file to a remote server & ran the page,
clicking theLinkButtondoesn't take the user to Page1.aspx. Rather,
the user is brought back toLinkButton.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 theLinkButtonbehaving
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,%2 0"",%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
Can someone please clear my doubts?

Thanks,

Ron

Nov 9 '07 #2
Can someone please clear my doubts?

I dislike anything in .net that uses javascript postback links. They're not
accessible and tend to hide the logic.

Now, maybe that's unfair, but when I need to make public-facing websites, I
tend to avoid them.

So, anyhow, it appears that the source code on your local machine just isn't
the same as what's on your server. Are you SURE the files are the same?

-Darrel
Nov 9 '07 #3
RN1
On Nov 9, 8:43 pm, "darrel" <notr...@nowhere.comwrote:
Can someone please clear my doubts?

I dislike anything in .net that uses javascript postback links. They're not
accessible and tend to hide the logic.

Now, maybe that's unfair, but when I need to make public-facing websites, I
tend to avoid them.

So, anyhow, it appears that the source code on your local machine just isn't
the same as what's on your server. Are you SURE the files are the same?

-Darrel
>>Are you SURE the files are the same?
Yes Darrel I am more than 100% sure that the files on my Intranet &
remote server are the same. It was I only who created & uploaded the
ASPX file.
Nov 22 '07 #4
Where is Page1 on the server ?

Have you tried

PostBackUrl="~/Page1.aspx"
-----Original Message-----
From: RN1 [mailto:rn**@rediffmail.com]
Posted At: Wednesday, 7 November 2007 10:18 PM
Posted To: microsoft.public.dotnet.framework.aspnet
Conversation: Simple LinkButton
Subject: Simple LinkButton

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,%2 0"",%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
Nov 22 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: ItNerd | last post by:
Someone PLEASE HELP ME!!!!! All I want to do is a simple postback and grab the value from a textbox on clicking a linkbutton like below, but the value is not writing to the screen. I am...
2
by: News | last post by:
Hi, I need help with datalist and linkbutton. I need a LinkButton to display in datalist if datafield "is_measure_customchecklist" in a db table set to true. Here is the code (in parts): ...
0
by: Solomon Shaffer | last post by:
This is very interesting - and odd. I have a number of LinkButtons that are created in a custom data grid that I created. The purpose of the LinkButtons is to provide alphabetical filtering...
13
by: rn5a | last post by:
In a shopping cart app, suppose a user has placed 5 orders, I want to show him 5 LinkButtons (one for each order) so that when he clicks the first LinkButton, he would be shown the details of his...
3
by: rn5a | last post by:
Consider the following code which creates LinkButtons dynamically: For i = 1 to 5 lnkBut = New LinkButton lnkBut.ID = "lnkBut" & i lnkBut.Text = i.ToString & " " lnkBut.CommandName = i...
0
by: OceanBreeze | last post by:
I have added a LinkButton to a table cell programmatically inside the Page_Load method. I also added a custom event to that link button. The same custom event is valid for all the link buttons. The...
3
by: =?Utf-8?B?SmFrb2IgTGl0aG5lcg==?= | last post by:
I have two sets of search criteria on my page. They are placed inside two DIV tags made visible/hidden by a client script. In each DIV tag I have a LinkButton that performs the search from each...
0
by: HillBilly | last post by:
MasterPages again. Three LinkButtons are being used as styled tabs in the content page that will load a different ListView when a tab is selected: TabA, TabB or TabC. The LinkButtons are declared...
5
by: Peter Larsen [CPH] | last post by:
Hi, The following sample shows a LinkButton in the HeaderTemplate of a Repeater control. The problem is that i'm not able to access the linkbutton in code (in the cs file) as long as the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.