[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

how to execute a sub module in the same asp.net page even after post back using pop up dialog

Posted on 2006-05-31
8
Medium Priority
?
252 Views
Last Modified: 2008-02-01
hey guys

i've this problem. i'm using javascript to create a pop up box in asp.net 1.1.
the code is as follow:

<input type="submit" runat="server" name="ConfirmButton1" value="Purchasse" id="ConfirmButton1" onclick="return confirm (&quot;Do you want to continue?&quot;);" />

when the user clicks on the button, a pop up window is created. when the user clicks on "ok", i need to execute a Sub method in my asp.net codes. how am i able to do that? pardon me for the lack of using asp.net terms coz i'm still new to it.

currently the code now is posting everything back to the same original page. and i cant do anything. please help

regards
0
Comment
Question by:leon24
8 Comments
 

Author Comment

by:leon24
ID: 16797533
oh and i need it to post it back to the same page because the page has a drop down list which posts back values everytime a user selects a new index.
0
 

Author Comment

by:leon24
ID: 16797616
i am trying to perform this

Sub LinkButton1_Click(sender As Object, e As EventArgs)

MyDeleteMethod(Request.form("item"))
Response.redirect("http://www.yahoo.com")

End Sub



after i click on the button.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16797812
Have you heard anything about AJAX?

Bob
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:leon24
ID: 16797827
no dude..

how can that help?
0
 
LVL 5

Accepted Solution

by:
vinodhsomasekharan earned 600 total points
ID: 16797834
Hai ,

Do u need the form to execute the fucntion Sub LinkButton1_Click(sender As Object, e As EventArgs) ??

then if the

if so...

<script language="javascript">
          function callPostBack()
            {
               if(confirm (&quot;Do you want to continue?&quot;))
               {    
                  document.getElementById("LinkButton1").click();                        
               }
            }
</script>

call the function callPostBack() in the onClick() event of the ConfirmButton1 button..

regards
Vinodh



0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16798361
Ajax lets you register a method in a class that you can call through Javascript.  It is a fairly large topic, but an enjoyable one for me.

We use AjaxPro here:

http://www.ajaxpro.info/?old=ajaxpro&ref=http%3a%2f%2fwww.google.com%2fsearch%3fnum%3d100%26hl%3den%26lr%3dlang_en%26newwindow%3d1%26q%3dajaxpro

But, there are other implementations from Micro$oft and others.

Bob
0
 
LVL 8

Assisted Solution

by:thrill_house
thrill_house earned 600 total points
ID: 16798723
You should just be able to use a regular asp.net button.  To perform what you want here.
In the pageload, add this

Button1.Attributes.Add("onclick", "return confirm (&quot;Do you want to continue?&quot;)")

This will give you the confirmation box, and if they select OK, it will cause a postback and do the onclick event in the code behind associated with the button.  This should be a LOT easier than implementing an AJAX solution.
0
 

Author Comment

by:leon24
ID: 16832065
Yeap thanks a lot guys. :)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month17 days, 21 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question