Serdar Demirkol
asked on
ASP.NET System.Windows.Forms.MessageBox
Hi,
Is there any downsides/problems adding a reference to System.Windows.Forms and using MessageBox on an ASP.NET form?
Many Thanks,
Is there any downsides/problems adding a reference to System.Windows.Forms and using MessageBox on an ASP.NET form?
Many Thanks,
I don't think it will work. MessageBox is for windows forms and not for web forms
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Take a look into the step by step guide on sendign an alert message from code behind.
http://madskristensen.net/post/JavaScript-AlertShow(e2809dmessagee2809d)-from-ASPNET-code-behind.aspx
Windows controls are not supported in ASP.Net
but you can try the below links for the simulation if needed
http://stackoverflow.com/questions/4779576/how-to-display-windows-form-messagebox-in-asp-net-web-application
http://www.c-sharpcorner.com/uploadfile/mahesh/webmsgbox09082006110929am/webmsgbox.aspx
http://madskristensen.net/post/JavaScript-AlertShow(e2809dmessagee2809d)-from-ASPNET-code-behind.aspx
Windows controls are not supported in ASP.Net
but you can try the below links for the simulation if needed
http://stackoverflow.com/questions/4779576/how-to-display-windows-form-messagebox-in-asp-net-web-application
http://www.c-sharpcorner.com/uploadfile/mahesh/webmsgbox09082006110929am/webmsgbox.aspx
you just can't. even if you try on your development PC and it appears to work, don't forget that when it will run on the IIS server, that code which is in the code behind and thus will show ... on the server!
ASKER
The reason I want to use Wndows.MessageBox (as it does work); it is easy to take the client response and all happenning on client side.
Does anyone know any better way to take client response other than js alert and confirm as you cannot custimize these two.
Thanks,
Does anyone know any better way to take client response other than js alert and confirm as you cannot custimize these two.
Thanks,
in the web world, alert is the way to go!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
santhimurthyd:
Any ideas of picking the client response by server dinamically?
Thanks,
Any ideas of picking the client response by server dinamically?
Thanks,
If you wish to trigger any event on Server side based on User input, that can be achieved by below stesp
i) Create an asp button
<asp:Button ID="Button1" runat="server" Text="Button" Style="display:none" OnClick="Button1_Click" />
ii) Create an event in the code behind
protected void Button1_Click(object sender, EventArgs e)
{
//Your logical code you wish to do
}
iii) In the javascript
if(confirm("Are you wish to do"))
{
document.getElementById("< %=Button1. ClientID %>").click();
}
check it out, whether it meets your requirment
i) Create an asp button
<asp:Button ID="Button1" runat="server" Text="Button" Style="display:none" OnClick="Button1_Click" />
ii) Create an event in the code behind
protected void Button1_Click(object sender, EventArgs e)
{
//Your logical code you wish to do
}
iii) In the javascript
if(confirm("Are you wish to do"))
{
document.getElementById("<
}
check it out, whether it meets your requirment
ASKER
I have also found below link very useful. Many Thanks
http://www.4guysfromrolla.com/articles/021104-1.aspx
http://www.4guysfromrolla.com/articles/021104-1.aspx
ASKER
I've requested that this question be closed as follows:
Accepted answer: 250 points for santhimurthyd's comment http:/Q_27480134.html#37243395
Assisted answer: 250 points for santhimurthyd's comment http:/Q_27480134.html#37243502
Assisted answer: 0 points for serdardmrk's comment http:/Q_27480134.html#37244698
for the following reason:
The link I have provided is exactly what I was looking for so everyone has similar issues would find it as the solution.
Accepted answer: 250 points for santhimurthyd's comment http:/Q_27480134.html#37243395
Assisted answer: 250 points for santhimurthyd's comment http:/Q_27480134.html#37243502
Assisted answer: 0 points for serdardmrk's comment http:/Q_27480134.html#37244698
for the following reason:
The link I have provided is exactly what I was looking for so everyone has similar issues would find it as the solution.
I posted same link in my first post, did you read that comment ???
Thanks serdardmrk for accepting the information and for your points.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ajaysharmaapjs:
Sorry (blaming the busy work), this must be where I have found it. I'll correct the points.
Sorry (blaming the busy work), this must be where I have found it. I'll correct the points.