473,405 Members | 2,261 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,405 software developers and data experts.

LinkButton click event not firing

Mel
I have a website that allows the user to generate a new quote. When
they are finished creating the quote, it brings them to the final page
(called the Goodbye.aspx page) which just states the quote has been
submitted and an email will arrive to them shortly.

I added a "Home" link button on this page which will return them to
the website's home page. I want to clear out 10 session variables
(contact name, ship to address, city, state, zip, etc.) when they
click the Home button so it's ready for a new quote, however the
LinkButton_click event is never fired. How do I clear the session
variables from this Goodbye page?

Jun 11 '07 #1
6 16792
On Jun 11, 10:35 pm, Mel <MLights...@gmail.comwrote:
I have a website that allows the user to generate a new quote. When
they are finished creating the quote, it brings them to the final page
(called the Goodbye.aspx page) which just states the quote has been
submitted and an email will arrive to them shortly.

I added a "Home" link button on this page which will return them to
the website's home page. I want to clear out 10 session variables
(contact name, ship to address, city, state, zip, etc.) when they
click the Home button so it's ready for a new quote, however the
LinkButton_click event is never fired. How do I clear the session
variables from this Goodbye page?
How does your button look like?

Should be similar to this

<asp:LinkButton ID="..." Text="Home" runat="server"
OnClick="LinkButton_click"></asp:LinkButton>

and the event

protected void LinkButton_click(object sender, EventArgs e)
{
....
}

to ensure that it's working, add a debug info

Response.Write("Hello...");

Jun 11 '07 #2
Mel
On Jun 11, 4:15 pm, Alexey Smirnov <alexey.smir...@gmail.comwrote:
On Jun 11, 10:35 pm, Mel <MLights...@gmail.comwrote:
I have a website that allows the user to generate a new quote. When
they are finished creating the quote, it brings them to the final page
(called the Goodbye.aspx page) which just states the quote has been
submitted and an email will arrive to them shortly.
I added a "Home" link button on this page which will return them to
the website's home page. I want to clear out 10 session variables
(contact name, ship to address, city, state, zip, etc.) when they
click the Home button so it's ready for a new quote, however the
LinkButton_click event is never fired. How do I clear the session
variables from this Goodbye page?

How does your button look like?

Should be similar to this

<asp:LinkButton ID="..." Text="Home" runat="server"
OnClick="LinkButton_click"></asp:LinkButton>

and the event

protected void LinkButton_click(object sender, EventArgs e)
{
...

}

to ensure that it's working, add a debug info

Response.Write("Hello...");
It currently looks like this. I posted the click event code too (but
it's not firing). Did I mention that I am a new user? So I hope it's
something easy.
'file: BMQQuoteGoodBye.aspx
<asp:LinkButton ID="lbutHome" runat="server" PostBackUrl="~/
FSMPTechHome.aspx"
Style="z-index: 104; left: 36px; position: absolute; top:
95px">Home</asp:LinkButton>

'file: BMQQuoteGoodBye.aspx.vb
Protected Sub lbutHome_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles lbutHome.Click
Session("OrdNum") = Nothing
Session("ProjName") = Nothing
Session("ShipAddr1") = Nothing
Session("ShipAddr2") = Nothing
Session("ShipCity") = Nothing
Session("ShipSt") = Nothing
Session("Customer") = Nothing
Session("CusContact") = Nothing
Session("CusPhone") = Nothing
Session("ShipZip") = Nothing
Session("PriceAdj") = Nothing
End Sub

Jun 11 '07 #3
On Jun 11, 11:24 pm, Mel <MLights...@gmail.comwrote:
On Jun 11, 4:15 pm, Alexey Smirnov <alexey.smir...@gmail.comwrote:


On Jun 11, 10:35 pm, Mel <MLights...@gmail.comwrote:
I have a website that allows the user to generate a new quote. When
they are finished creating the quote, it brings them to the final page
(called the Goodbye.aspx page) which just states the quote has been
submitted and an email will arrive to them shortly.
I added a "Home" link button on this page which will return them to
the website's home page. I want to clear out 10 session variables
(contact name, ship to address, city, state, zip, etc.) when they
click the Home button so it's ready for a new quote, however the
LinkButton_click event is never fired. How do I clear the session
variables from this Goodbye page?
How does your button look like?
Should be similar to this
<asp:LinkButton ID="..." Text="Home" runat="server"
OnClick="LinkButton_click"></asp:LinkButton>
and the event
protected void LinkButton_click(object sender, EventArgs e)
{
...
}
to ensure that it's working, add a debug info
Response.Write("Hello...");

It currently looks like this. I posted the click event code too (but
it's not firing). Did I mention that I am a new user? So I hope it's
something easy.

'file: BMQQuoteGoodBye.aspx
<asp:LinkButton ID="lbutHome" runat="server" PostBackUrl="~/
FSMPTechHome.aspx"
Style="z-index: 104; left: 36px; position: absolute; top:
95px">Home</asp:LinkButton>

'file: BMQQuoteGoodBye.aspx.vb
Protected Sub lbutHome_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles lbutHome.Click
Session("OrdNum") = Nothing
Session("ProjName") = Nothing
Session("ShipAddr1") = Nothing
Session("ShipAddr2") = Nothing
Session("ShipCity") = Nothing
Session("ShipSt") = Nothing
Session("Customer") = Nothing
Session("CusContact") = Nothing
Session("CusPhone") = Nothing
Session("ShipZip") = Nothing
Session("PriceAdj") = Nothing
End Sub- Hide quoted text -

- Show quoted text -
Mel,

when you set the PostBackUrl, you post the page directly to
FSMPTechHome.aspx

Try to remove PostBackUrl="~/FSMPTechHome.aspx" and add to the end of
lbutHome_Click() function the following line

Response.Redirect("~/FSMPTechHome.aspx")

Hope it helps

Jun 11 '07 #4
Mel
On Jun 11, 4:31 pm, Alexey Smirnov <alexey.smir...@gmail.comwrote:
On Jun 11, 11:24 pm, Mel <MLights...@gmail.comwrote:


On Jun 11, 4:15 pm, Alexey Smirnov <alexey.smir...@gmail.comwrote:
On Jun 11, 10:35 pm, Mel <MLights...@gmail.comwrote:
I have a website that allows the user to generate a new quote. When
they are finished creating the quote, it brings them to the final page
(called the Goodbye.aspx page) which just states the quote has been
submitted and an email will arrive to them shortly.
I added a "Home" link button on this page which will return them to
the website's home page. I want to clear out 10 session variables
(contact name, ship to address, city, state, zip, etc.) when they
click the Home button so it's ready for a new quote, however the
LinkButton_click event is never fired. How do I clear the session
variables from this Goodbye page?
How does your button look like?
Should be similar to this
<asp:LinkButton ID="..." Text="Home" runat="server"
OnClick="LinkButton_click"></asp:LinkButton>
and the event
protected void LinkButton_click(object sender, EventArgs e)
{
...
}
to ensure that it's working, add a debug info
Response.Write("Hello...");
It currently looks like this. I posted the click event code too (but
it's not firing). Did I mention that I am a new user? So I hope it's
something easy.
'file: BMQQuoteGoodBye.aspx
<asp:LinkButton ID="lbutHome" runat="server" PostBackUrl="~/
FSMPTechHome.aspx"
Style="z-index: 104; left: 36px; position: absolute; top:
95px">Home</asp:LinkButton>
'file: BMQQuoteGoodBye.aspx.vb
Protected Sub lbutHome_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles lbutHome.Click
Session("OrdNum") = Nothing
Session("ProjName") = Nothing
Session("ShipAddr1") = Nothing
Session("ShipAddr2") = Nothing
Session("ShipCity") = Nothing
Session("ShipSt") = Nothing
Session("Customer") = Nothing
Session("CusContact") = Nothing
Session("CusPhone") = Nothing
Session("ShipZip") = Nothing
Session("PriceAdj") = Nothing
End Sub- Hide quoted text -
- Show quoted text -

Mel,

when you set the PostBackUrl, you post the page directly to
FSMPTechHome.aspx

Try to remove PostBackUrl="~/FSMPTechHome.aspx" and add to the end of
lbutHome_Click() function the following line

Response.Redirect("~/FSMPTechHome.aspx")

Hope it helps- Hide quoted text -

- Show quoted text -
Okay thanks. Like this? Sorry to be a pain but I have never used
the redirect method before.

Protected Sub lbutHome_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles lbutHome.Click
Response.Redirect("~/FSMPTechHome.aspx")

End Sub

Jun 12 '07 #5
On Jun 12, 2:30 pm, Mel <MLights...@gmail.comwrote:
On Jun 11, 4:31 pm, Alexey Smirnov <alexey.smir...@gmail.comwrote:


On Jun 11, 11:24 pm, Mel <MLights...@gmail.comwrote:
On Jun 11, 4:15 pm, Alexey Smirnov <alexey.smir...@gmail.comwrote:
On Jun 11, 10:35 pm, Mel <MLights...@gmail.comwrote:
I have a website that allows the user to generate a new quote. When
they are finished creating the quote, it brings them to the final page
(called the Goodbye.aspx page) which just states the quote has been
submitted and an email will arrive to them shortly.
I added a "Home" link button on this page which will return them to
the website's home page. I want to clear out 10 session variables
(contact name, ship to address, city, state, zip, etc.) when they
click the Home button so it's ready for a new quote, however the
LinkButton_click event is never fired. How do I clear the session
variables from this Goodbye page?
How does your button look like?
Should be similar to this
<asp:LinkButton ID="..." Text="Home" runat="server"
OnClick="LinkButton_click"></asp:LinkButton>
and the event
protected void LinkButton_click(object sender, EventArgs e)
{
...
}
to ensure that it's working, add a debug info
Response.Write("Hello...");
It currently looks like this. I posted the click event code too (but
it's not firing). Did I mention that I am a new user? So I hope it's
something easy.
'file: BMQQuoteGoodBye.aspx
<asp:LinkButton ID="lbutHome" runat="server" PostBackUrl="~/
FSMPTechHome.aspx"
Style="z-index: 104; left: 36px; position: absolute; top:
95px">Home</asp:LinkButton>
'file: BMQQuoteGoodBye.aspx.vb
Protected Sub lbutHome_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles lbutHome.Click
Session("OrdNum") = Nothing
Session("ProjName") = Nothing
Session("ShipAddr1") = Nothing
Session("ShipAddr2") = Nothing
Session("ShipCity") = Nothing
Session("ShipSt") = Nothing
Session("Customer") = Nothing
Session("CusContact") = Nothing
Session("CusPhone") = Nothing
Session("ShipZip") = Nothing
Session("PriceAdj") = Nothing
End Sub- Hide quoted text -
- Show quoted text -
Mel,
when you set the PostBackUrl, you post the page directly to
FSMPTechHome.aspx
Try to remove PostBackUrl="~/FSMPTechHome.aspx" and add to the end of
lbutHome_Click() function the following line
Response.Redirect("~/FSMPTechHome.aspx")
Hope it helps- Hide quoted text -
- Show quoted text -

Okay thanks. Like this? Sorry to be a pain but I have never used
the redirect method before.

Protected Sub lbutHome_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles lbutHome.Click
Response.Redirect("~/FSMPTechHome.aspx")

End Sub- Hide quoted text -

Yes, it's correct:

HOW TO: Use Response.Redirect in ASP.NET with Visual Basic .NET
http://support.microsoft.com/kb/312063

Jun 12 '07 #6
Mel
On Jun 12, 7:56 am, Alexey Smirnov <alexey.smir...@gmail.comwrote:
On Jun 12, 2:30 pm, Mel <MLights...@gmail.comwrote:


On Jun 11, 4:31 pm, Alexey Smirnov <alexey.smir...@gmail.comwrote:
On Jun 11, 11:24 pm, Mel <MLights...@gmail.comwrote:
On Jun 11, 4:15 pm, Alexey Smirnov <alexey.smir...@gmail.comwrote:
On Jun 11, 10:35 pm, Mel <MLights...@gmail.comwrote:
I have a website that allows the user to generate a new quote. When
they are finished creating the quote, it brings them to the final page
(called the Goodbye.aspx page) which just states the quote has been
submitted and an email will arrive to them shortly.
I added a "Home" link button on this page which will return them to
the website's home page. I want to clear out 10 session variables
(contact name, ship to address, city, state, zip, etc.) when they
click the Home button so it's ready for a new quote, however the
LinkButton_click event is never fired. How do I clear the session
variables from this Goodbye page?
How does your button look like?
Should be similar to this
<asp:LinkButton ID="..." Text="Home" runat="server"
OnClick="LinkButton_click"></asp:LinkButton>
and the event
protected void LinkButton_click(object sender, EventArgs e)
{
...
}
to ensure that it's working, add a debug info
Response.Write("Hello...");
It currently looks like this. I posted the click event code too (but
it's not firing). Did I mention that I am a new user? So I hope it's
something easy.
'file: BMQQuoteGoodBye.aspx
<asp:LinkButton ID="lbutHome" runat="server" PostBackUrl="~/
FSMPTechHome.aspx"
Style="z-index: 104; left: 36px; position: absolute; top:
95px">Home</asp:LinkButton>
'file: BMQQuoteGoodBye.aspx.vb
Protected Sub lbutHome_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles lbutHome.Click
Session("OrdNum") = Nothing
Session("ProjName") = Nothing
Session("ShipAddr1") = Nothing
Session("ShipAddr2") = Nothing
Session("ShipCity") = Nothing
Session("ShipSt") = Nothing
Session("Customer") = Nothing
Session("CusContact") = Nothing
Session("CusPhone") = Nothing
Session("ShipZip") = Nothing
Session("PriceAdj") = Nothing
End Sub- Hide quoted text -
- Show quoted text -
Mel,
when you set the PostBackUrl, you post the page directly to
FSMPTechHome.aspx
Try to remove PostBackUrl="~/FSMPTechHome.aspx" and add to the end of
lbutHome_Click() function the following line
Response.Redirect("~/FSMPTechHome.aspx")
Hope it helps- Hide quoted text -
- Show quoted text -
Okay thanks. Like this? Sorry to be a pain but I have never used
the redirect method before.
Protected Sub lbutHome_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles lbutHome.Click
Response.Redirect("~/FSMPTechHome.aspx")
End Sub- Hide quoted text -

Yes, it's correct:

HOW TO: Use Response.Redirect in ASP.NET with Visual Basic .NEThttp://support.microsoft.com/kb/312063- Hide quoted text -

- Show quoted text -
Thanks for your help, it works like a charm. I posted the code below
in case someone else can benefit from it. Apparently clicking the
Home link button calls the Page_Load event where I happened to be
writing the quote record to the database so I had to enclose the
Page_Load code with an IF statement "If Not IsPostBack Then" to ensure
the database is only written once. Yep, that redirect method will be
my new "favorite" friend. Oh just imagine the possiblities!

Protected Sub lbutHome_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles lbutHome.Click
'Clear session variables before returning to the HOME page.
Session("OrdNum") = Nothing
Session("ProjName") = Nothing
Session("ShipAddr1") = Nothing
Session("ShipAddr2") = Nothing
Session("ShipCity") = Nothing
Session("ShipSt") = Nothing
Session("Customer") = Nothing
Session("CusContact") = Nothing
Session("CusPhone") = Nothing
Session("ShipZip") = Nothing
Session("PriceAdj") = Nothing
Response.Redirect("~/FSMPTechHome.aspx")
End Sub

Jun 12 '07 #7

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

Similar topics

1
by: Assaf Weinberg | last post by:
Using ASP.NET web form with VB.NET I have a page with a calendar control that onSelectionChanged builds a table control showing the events scheduled for the selected calendar days. One of the...
0
by: Pat Sagaser via .NET 247 | last post by:
I'm trying to add LinkButtons to a Repeater control using adynamic template. The docs state that you should be able tobubble the click event to the containing Repeater. There areplenty of examples in...
2
by: Grant | last post by:
Below is the code I am using to build the table using system.web.ui.webcontrols.table. I am building a collection of link buttons inside each cell. How do I know when the user clicks on the link...
0
by: Demetri | last post by:
I have created a web control that can be rendered as either a linkbutton or a button. It is a ConfirmButton control that allows a developer to force a user to confirm if they intended to click it...
1
by: bradw2k | last post by:
I have one frame that needs to cause a button click event on another frame. I was trying to do this by putting a display:none LinkButton on the target frame, and having a javascript on that page...
2
by: Chu | last post by:
Thanks everyone for taking a moment to read this. I've got a page where I use a LinkButton and I wire up a dynamic event to the button. When the user clicks the button, the event is fired as...
6
by: Class | last post by:
Hi all, I create a gridview dynamicly because I don't know the columns in advance. I use the Templatefield to create a linkbutton. Everything fine..I have the postbackurl and it works. But now...
1
by: Jack | last post by:
Hi, I am new to .NET and need help with adding click event on LinkButton programatically. Please see the code below. I would like to add a click event on LinkButton returned from "Function...
1
by: netman38 | last post by:
Hi, I couldnt find a solution to my problem. I created linkbutton dynamically and also add an eventhandler dynamically. However when i click the button an empty page is reloaded. My guess is, my...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.