473,396 Members | 1,987 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.

LinkButton and PopUps

I have an interesting problem.

I have a link button on a webpage with VB as code behind.

When the user clicks on the link button I have to
1. Save the record
2. Popup a window for the user to add some extra information

Can I do both the jobs on LinkButton Click event? If I can then How???

Thanks in advance...
Jun 19 '06 #1
3 1215
Hi Guru,

How about injecting some client-side script to open the secondary window?
You can do that during the click of the link button.

Here's the idea in the code below.

Let us know if this helps?

Ken
Microsoft MVP [ASP.NET]

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
Label1.Text = "Save to database here"
ClientScript.RegisterStartupScript(Me.GetType, "pop",
"window.open('popwin.aspx')", True)
End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:linkbutton id="LinkButton1" runat="server"
onclick="LinkButton1_Click">LinkButton</asp:linkbutton><br />
<br />
<asp:label id="Label1" runat="server" text="Label"></asp:label><br
/>
<br />
</form>
</body>
</html>
"Guru" <Gu**@discussions.microsoft.com> wrote in message
news:A9**********************************@microsof t.com...
I have an interesting problem.

I have a link button on a webpage with VB as code behind.

When the user clicks on the link button I have to
1. Save the record
2. Popup a window for the user to add some extra information

Can I do both the jobs on LinkButton Click event? If I can then How???

Thanks in advance...

Jun 19 '06 #2
Guru,

Why would you use the clasic way with a popup window and not an approach by
a panel for this?
The last is very easy to handle in aspnet bot 1.x and 2.0.

Cor

"Guru" <Gu**@discussions.microsoft.com> schreef in bericht
news:A9**********************************@microsof t.com...
I have an interesting problem.

I have a link button on a webpage with VB as code behind.

When the user clicks on the link button I have to
1. Save the record
2. Popup a window for the user to add some extra information

Can I do both the jobs on LinkButton Click event? If I can then How???

Thanks in advance...

Jun 19 '06 #3
The program already has heaps of panels. It is already getting very hard to
align and display data properly on the webpage.

Ken's code worked. So atleast in that area it is working fine.

Thanks.

"Cor Ligthert [MVP]" wrote:
Guru,

Why would you use the clasic way with a popup window and not an approach by
a panel for this?
The last is very easy to handle in aspnet bot 1.x and 2.0.

Cor

"Guru" <Gu**@discussions.microsoft.com> schreef in bericht
news:A9**********************************@microsof t.com...
I have an interesting problem.

I have a link button on a webpage with VB as code behind.

When the user clicks on the link button I have to
1. Save the record
2. Popup a window for the user to add some extra information

Can I do both the jobs on LinkButton Click event? If I can then How???

Thanks in advance...


Jun 19 '06 #4

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

Similar topics

3
by: Art | last post by:
NEWBIE ALERT! Esteemed List Participants and Lurkers: (System: P-II 350, 192 meg, Win98 SE, Python 2.2.3, wxPythonWIN32-2.4.1.2-Py22.exe) I'm having a lot of fun getting started with Python...
52
by: Harlan Messinger | last post by:
Can you help me figure out what to do about popups? Sometimes we develop web applications where popups make very good sense for precisely the same reasons they make sense in traditional...
2
by: Tom Szabo | last post by:
Hi, >>IE in Windows XP Service Pack 2 has a popup blocker that blocks unsolicited >>popups >>IE (other than Windows XP Service Pack 2) also has many add-ons (Google toolbar, >>Yahoo! toolbar,...
5
by: Fresh Air Rider | last post by:
Hello Could anyone please explain how I can pass more than one arguement/parameter value to a function using <asp:linkbutton> or is this a major shortfall of the language ? Consider the...
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...
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...
1
by: YotamElal | last post by:
Hello, I have a popup problem. When a popup is opened, I want all other popups to close immediatly. (except for its self and it's child popups) Here is my code: code: <!DOCTYPE HTML PUBLIC...
1
by: Moe Sisko | last post by:
Using : ASP.NET 2.0, IE 7. This is a strange problem with popups not working in IE to remote sites, even though popups are allowed in IE. To reproduce, create web site with two pages,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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.