|
Hi
Replace this in your code and try it is working fine...
Button1.Attributes.Add("onClick", "javascript:if(confirm('Check text')){alert('ok')}else{alert('Cancel')}");
Regards,
Sandeep Kumar.V
|
|
|
|
|
hai sandeep,
Your code is sufficeient to display and confirm something,but how to check if it si ok or cancel.
i want to again display some msg on OK click,and same for cancel,or sometimes i want to redirect some other page( when it is confirm msgbox only),Please dont get irritate and tell me .i have tried.but it is not giving anything.
thanks once again
Regards
shakeena
kissy
|
|
|
|
|
Hi Kissy,
Button1.Attributes.Add("onClick", "javascript:if(confirm('Check text')){alert('ok')}else{alert('Cancel')}");
In the above code i placed confim dialog box in if condition it means whenever you click on Ok it returns true so it executes the code after the if condition statemts.
if the user clicks on cancel button it execute the statements followed by else statement.
so in that way whatever you want you can place your code in that if condition followed statements.
In the above Code if the user clicks on OK it display an alert dialog box saying OK simillarly if he clicks on Cancel u will get a alert dialog box saying Cancel.
Regards,
Sandeep Kumar.V
|
|
|
|
|
if ur using asp.net2.0 using c#
include the header file
using System.Windows.Forms;
now u can show the megs using theis code
DialogResult msgrslt = MessageBox.Show("Do You Want To Save The ata", "SAVE", MessageBoxButtons.YesNo);
if (msgrslt == DialogResult.Yes)
{
//code for save
}
![Rose | [Rose]](https://codeproject.global.ssl.fastly.net/script/Forums/Images/rose.gif)
|
|
|
|
|
You should reply to the original post instead of replying to my post.
However, this is the ASP.NET forum. You can't use the message box from Windows.Forms in an ASP.NET application.
---
single minded; short sighted; long gone;
|
|
|
|
|
in asp.net the header file s tere try...im using it
|
|
|
|
|
No, it doesn't work. The message box is shown on the server, not on the client computer. While you are testing the application using your own computer as server, you will see the message box. When you deploy the application to a web server, there is no user interface for the process running the application, so the message box have nowhere to go.
---
single minded; short sighted; long gone;
|
|
|
|
|
we are using the tool visual studio 2005 webdeveloper express edition,
are you sure it doesnt work in server,because i have no way to test it right now.
-- modified at 4:51 Wednesday 9th May, 2007
|
|
|
|
|
regimol wrote: v r r u bz hav rgt nw.
Plese try to write proper english. It's just a few more keystrokes, and it makes the message so much easier to read.
regimol wrote: r u sure it doesnt work in server
Absolutely.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi to all, I want to know how to encript and decript my connectionstring inside the web.config file
Mkanhha
|
|
|
|
|
refer to the System.Security.Cryptography namespace
<< >>
|
|
|
|
|
Thanks for your replay. If you have some examples, Please Post it
Mkanchha
|
|
|
|
|
|
Thanks for your Reply. But I am Not Getting my answer from that URL. If you have another examples or code please paste it
Mkanchha
|
|
|
|
|
what do you expect? that article show you how to encrypt and decrypt..right?
<< >>
|
|
|
|
|
I want the Encript and Decript my connectionString inside the WEB.CONFIG file
Mkanchha
|
|
|
|
|
okie..from that article..do you know how to encrypt a string?
<< >>
|
|
|
|
|
Where I can find ODBC Driver 3.5 for Ingres 3.0
Please Help
Thank you
|
|
|
|
|
|
Hi,
I have some webpages for a small project. I have login page also. after logout, when I click on Back button It takes me to previously visited page. but then it should ask to login...
How can WE do to ask the credentials when we click BACK button, after logging out?
thanks in advance...
shah_tech
|
|
|
|
|
Maybe you can redirect them to the login page after loggin out.
if they push the back button now they wil be redirected again to the login
Stef
|
|
|
|
|
yeah,
thanks for ur rply...
I'm redirecting to login page only after logging out, but there after, if i click on BACK button, it takes me to previously visited page which is not desirable.
thanks in advance.
|
|
|
|
|
if you use the session,after check logout,you should remove the session,and you should check the session in the loginpage.
my english is very bad!
|
|
|
|
|
thanks suyuan,
i'm using Sessions in my application. for logout, i'm using Hyperlink ( navigateUrl as Login.aspx. then where can i remove the session? I checked as removing session in page_load of Login.aspx, but it's not working.
|
|
|
|
|
to shah_tech:
you can use a page(loginout.aspx) for clear session,after,let the page redirect to the login.aspx
loginout.aspx'code like this:
private void Page_Load(Object sender,EventArgs e)
{
if(!Page.IsPostBack)
{
Session.Clear();
Response.Write("");
}
}
I hope this can help you!
my english is very bad!
|
|
|
|